php
define('IN_SITE', true);
require(dirname(__FILE__) . '/includes/init.
php');
if(trim($_GET['ac']) == 'del') {
deletetable('bug', "id='$_GET[bug_id]'");
goto($_SESSION['
php_self']);
}
$_SESSION['
php_self'] = geturl();
//echo $_SESSION['
php_self'];
$pro_id = empty($_GET['pro_id'])?'':intval($_GET['pro_id']);
$bug_id = empty($_GET['bug_id'])?'':intval($_GET['bug_id']);
$types = set_supetype($_SESSION['supe_type']);
$sql = "SELECT * FROM ".tname('project')." WHERE `father` = '$pro_id'";
$pro_list = $db->getAll($sql);
$sql = "SELECT pro_name, father, pro_id FROM ".tname('project')." WHERE `pro_id` = '$pro_id'";
$pro_info = $db->getRow($sql);
if(!($_SESSION['supe_username'] and (($_SESSION['supe_project']!=$pro_info['pro_id'] ? $_SESSION['supe_project']==$pro_info['father'] : 1) or $_SESSION['supe_type']==-1))) {
goto("login.
php?pro_id=$pro_id");
}
$sql = "SELECT pro_name FROM ".tname('project')." WHERE `pro_id` = '$pro_id'";
$pro_name = $db->getOne($sql);
if($bug_id) {
$sql = "select * from ".tname('bug')." where id='$bug_id'";
$bug = $db->getRow($sql);
}
if($_POST['submit']) {
if($_POST['bug_id']) {
if($_POST['pro_id']) {
$pro_id = $_POST['pro_id'];
}
$sqlarr = array(
'pro_id' => $pro_id,
'title' => $_POST['title'],
'quick' => $_POST['quick'],
'bug' => $_POST['bug']
);
updatetable('bug', $sqlarr, "id='$_POST[bug_id]'");
} else {
if($_POST['pro_id']) {
$pro_id = $_POST['pro_id'];
}
$sqlarr = array(
'pro_id' => $pro_id,
'name' => $_SESSION['supe_username'],
'title' => $_POST['title'],
'quick' => $_POST['quick'],
'bug' => $_POST['bug'],
'dateline' => NOW
);
inserttable('bug', $sqlarr);
}
goto("bug_list.
php?pro_id=$pro_id");
}
?>
=$_CFG['site_name']?>
1