Viewing file: ProplanStrateg.php (9.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;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable = "prostrategymap_tb";
$myTable1 = "projstrategy_tb";
$myTable2 ="projectstra_type_tb";
$myTable3 ="proplanstrateg_tb" ;
$myTable2PK = "StaplanId";
$myOrderBy = "Noplan";
/** Paging */
$page = $_GET['page'];
if( $page == "" ) { $page = 1; }
/** จำนวนข้อมูล ต่อ 1 หน้า */
$perpage = $_REQUEST['perpage'];
if( $perpage == "" ) { $perpage = 50; }
/** Botton Name Action */
$action = $_REQUEST['action'];
$id = $_REQUEST['id'];
if( isset($action) && !empty($action) ) {
switch($action) {
case "Update" :
$num = count($id);
//for( $i=0; $i<$num; $i++ ) {
//$query2 = " SELECT StratempId , StaplanId ,Budget_Year FROM $myTable3 WHERE StaplanId='$StaplanId' ";
// $result2 = mysql_query($query2);
$query3 = " SELECT * FROM projectstra_type_tb WHERE ProstrId='$ProstrId' ";
$result3 = mysql_query($query3);
$rows = mysql_num_rows($result3);
$data = mysql_fetch_array($result3);
if($rows) $queryUp = "UPDATE projectstra_type_tb SET StratempId='$StratempId' , proId='$proId' ,ProjectId='$ProjectId' , StaplanId='$StaplanId', AcademicYear='$AcademicYear' , Budget_Year='$Budget_Year' WHERE ProstrId = '$data[ProstrId]' " ;
else $queryUp = " INSERT INTO projectstra_type_tb ( StratempId , proId, ProjectId, StaplanId, AcademicYear, Budget_Year )
VALUES( '$StratempId' , '$proId' , '$ProjectId' , '$StaplanId', '$AcademicYear' , '$Budget_Year' ) ";
mysql_query($queryUp);
$query = " UPDATE project_type_tb SET StaplanId='$StaplanId' WHERE ProjectId ='$ProjectId' and proId='$proId' ";
mysql_query($query);
echo "";
echo "";
echo "";
exit();
//}
break;
} # switch
} # if
} # else
?>
ข้อมูลทั่วไปบุคลากร - ข้อมูลการแผนดำเนินการ - แผนดำเนินการรายปี
execQuery($query);
$numrows = $dbObj->_numrows;
/** Paging */
$display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page'];
$start = ( ($display * $limit) - $limit );
/** Paging */
if( isset($_GET['OrderBy']) ) {
$query = " SELECT * FROM $myTable3 WHERE StratempId ='$StratempId' ORDER BY $OrderBy $ASCDESC ";
}
elseif( !isset($_GET['OrderBy']) ) {
$query = " SELECT * FROM $myTable3 WHERE StratempId ='$StratempId' ORDER BY $myTable2PK ASC ";
}
$query .= " LIMIT $start, $limit ";
$result = $dbObj->execQuery($query);
?>
|
freeresult($result1);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?> |