Viewing file: planEditMissionFaculty.php (18.26 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | ";
echo " กรุณาทำการ Login ก่อน ";
echo "";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../includes/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "project_type_tb";
$myTable3 = "project_plan";
$myTable4 = "project_mission";
$myTable2PK = "Orderlist";
$myTable2PK = "ProjectId";
/** Table --> projectstdplan_tb */
$query = " SELECT * FROM $myTable4 WHERE Budget_Year='$Budget_Year' ";
$result11 = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result11);
$query = " SELECT * FROM $myTable4 WHERE Budget_Year='$Budget_Year' ";
$result = $dbObj->execQuery($query);
$rs01 = $dbObj->fetchArray($result);
$query = " SELECT * FROM $myTable2 WHERE Budget_Year='$Budget_Year' AND subId ='$subId' and Faculty_code='$Faculty_code' ORDER BY Orderlist ASC ";
$result3 = $dbObj->execQuery($query);
$rs3 = $dbObj->fetchArray($result3);
$num3 = $dbObj->_numrows;
//echo $num01;
/** Paging */
$page = $_GET['page'];
if( $page == "" ) { $page = 1; }
/** จำนวนข้อมูล ต่อ 1 หน้า */
$perpage = $_REQUEST['perpage'];
if( $perpage == "" ) { $perpage = 20; }
/** Botton Name Action */
$action = $_REQUEST['action'];
$id = $_REQUEST['id'];
if( isset($action) && !empty($action) ) {
switch($action) {
case "Delete" :
$num = count($id);
for( $i=0; $i<$num; $i++ ) {
$qrySel = " SELECT * FROM $myTable2 WHERE $myTable2PK='$id[$i]' ";
$resultSel = $dbObj->execQuery($qrySel);
$rsSel = $dbObj->fetchObject($resultSel);
$Training_code = $rsSel->Training_code;
$qryDel = " DELETE FROM $myTable2 WHERE $myTable2PK='$id[$i]' ";
$resultDel = $dbObj->runQuery($qryDel);
$dbObj->freeresult($resultDel);
if( $resultSel ) {
//--- tech_spec_tb
$qryDel4 = " DELETE FROM project_plan WHERE ProjectId='$id[$i]' ";
$resultDel4 = $dbObj->runQuery($qryDel4);
$dbObj->freeresult($resultDel4);
} # if
}
break;
} # switch
} # if
/* Parameters **/
$params = "Budget_Year=$Budget_Year&subId=$subId&Faculty_code=$Faculty_code";
} # else
?>
ข้อมูลแผนดำเนินงานและรายงาน : ข้อมูลแผนดำเนินการ - รายละเอียดแผนดำเนินการ
|
execQuery($query);
$numrows = $dbObj->_numrows;
//echo $numrows;
/** Paging */
$display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page'];
$start = ( ($display * $limit) - $limit );
/** Paging */
if( isset($_GET['OrderBy']) ) {
$query = " SELECT * FROM $myTable2
WHERE Budget_Year='$Budget_Year' AND subId='$subId' and Faculty_code='$Faculty_code' ORDER BY $OrderBy $ASCDESC ";
}
elseif( !isset($_GET['OrderBy']) ) {
$query = " SELECT * FROM $myTable2
WHERE Budget_Year='$Budget_Year' AND subId='$subId' and Faculty_code='$Faculty_code' ORDER BY $myTable2PK ASC ";
}
$query .= " LIMIT $start, $limit ";
$result = $dbObj->execQuery($query);
?>
|
freeresult($result01);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?> |