Viewing file: EditPlaningList.php (16.39 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")&&session_is_registered("Priority")&&session_is_registered("password") )
{
$Username = $valid_user;
$Password = $password;
include("../include/FunctionDB.php");
include("../include/Function.php");
include("admin_menu.php");
ConnectDB();
$Username = $valid_user;
$sql = "SELECT * FROM personal_tb WHERE Teacher_code='$Teacher_code'";
$res = mysql_query($sql);
$rss = mysql_fetch_array($res);
$sql1 = "SELECT * FROM project_type_tb Where Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ORDER BY Faculty_code,Orderlist_2";
$res1 = mysql_query($sql1);
$rs = mysql_fetch_array($res1);
//$Teacher_code = $rs[Teacher_code];
$strSQL = "SELECT * FROM project_type_tb Where Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ORDER BY Faculty_code,Orderlist_2";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 25;
$result = mysql_query($strSQL);
$Page_start = ($Per_Page*$Page) - $Per_Page;
$Num_Rows = mysql_num_rows($result);
if( $Num_Rows <= $Per_Page)
$Num_Pages = 1;
else if (($Num_Rows % $Per_Page) == 0)
$Num_Pages = ($Num_Rows / $Per_Page);
else
$Num_Pages = ($Num_Rows / $Per_Page) + 1;
$Num_Pages = (int)$Num_Pages;
if (( $Page > $Num_Pages) || ($Page < 0))
echo"Page $Page More than $Num_Pages";
$strSQL .=" LIMIT $Page_start,$Per_Page" ;
$result = mysql_query($strSQL);
$num = mysql_num_rows($result );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link rel="stylesheet" href="../css/cart4.css" type="text/css">
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-size: 14px}
-->
</style>
<table width="807" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="807"><br>
<fieldset>
<legend><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style1"><a href="menu_teacher.php " >หน้าหลัก</a><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="AddPlaning.php?Teacher_code=<? echo $rss[Teacher_code] ?>&Budget_Year=<?php echo $rs[Budget_Year] ?>&Faculty_code=<?php echo $rs[Faculty_code] ?>">เพิ่มข้อมูลแผนดำเนินงานรายปี</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="PlaningByYear.php?Teacher_code=<? echo $rss[Teacher_code]; ?>&Budget_Year=<?php echo $rs[Budget_Year]?>&Faculty_code=<?php echo $rs[Faculty_code] ?> ">ข้อมูลแผนดำเนินงานรายปี</a></span></font></legend>
<label><div align="center">
<form id="form1" name="form1" method="post" action="DelPlaning.php">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:1px solid gray"size="12">
<tr>
<td height="29" background="../Image/barIns2.jpg" bgcolor="#D1E1F0"><div align="center" class="style1"><font face="Tahoma">
<input name="Budget_Year" type="hidden" id="Budget_Year" value="<?=$Budget_Year;?>" />
<input name="Faculty_code" type="hidden" id="Faculty_code" value="<?=$Faculty_code;?>" />
ขณะนี้ อ.<font color="#993333"><strong><? echo $rss['Teacher_name'] ?> <? echo $rss['Teacher_lastname'] ?> </strong></font><span class="style14">รหัสประจำตัว</span> <font color="#993333"><strong><? echo $rss['Teacher_id'] ?></strong></font> กำลังใช้งานระบบ</font></div></td>
</tr>
<tr>
<td height="43" ><table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:0px solid #CCCCFF">
<tr>
<td height="25" bgcolor="#DFDFFF"><div align="center"><span class="style1"><font face="Tahoma"> <strong>ชื่อที่ต้องการค้นหา</strong></font></span> <font size="2" face="Tahoma"> <img src="../picture/search.gif" width="15" height="19" align="absmiddle" border="0" />
<input name="keyword" type="text" style="background-color:#F0FFD2;" value="<? echo"$keyword"; ?>" size="30">
<strong>จาก</strong></font> <font size="2" face="Tahoma">
<select name="fields" style="background-color:#F0FFD2;" >
<option value="<? echo "$fields"; ?>"></option>
<option value="Faculty_code">รหัสหน่วยงาน</option>
<option value="project_name">ชื่อแผนดำเนินการ</option>
<option value="Orderlist_2">ข้อแผนดำเนินการ</option>
<option value="project_plan">ชื่อหัวข้อแผนดำเนินการ</option>
<option value="Percent_ans">หมวดเงิน</option>
<option value="Term">ปีการศึกษา</option>
<option value="Budget_Year">ปี งบประมาณ</option>
</select>
<input type="submit" name="Submit" value="ค้นหา" />
</font></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:0px solid gray">
<tr bgcolor="#ECD9C6" >
<td colspan="7"><div align="center"><font color="#996633" face="Tahoma"><span class="style1"><font color="#FF0000">แก้ไข</font> <font color="#000000">ข้อมูลของแผนดำเนินการ</font></span></font><font size="4" face="Tahoma"><font color="#003399"> <? echo $Budget_Year?></font></font></div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="23" align="center" style="border:1px solid gray"><span class="style1"><font color="#FF0000" face="Tahoma">ลบ</font></span></td>
<td width="36" align="center" style="border:1px solid gray"><span class="style1"><font color="#000000" face="Tahoma">ลำดับ</font></span></td>
<td width="62" align="center" style="border:1px solid gray"><span class="style1"><font face="Tahoma">รหัส</font></span></td>
<td width="479" align="center" style="border:1px solid gray"><span class="style1"><font color="#000066" face="Tahoma">ชื่อหัวข้อของแผนดำเนินการ</font></span></td>
<td width="82" align="center" style="border:1px solid gray"><span class="style1"><font color="#000000" face="Tahoma">ปีงบประมาณ</font></span></td>
<td colspan="2" align="center" style="border:1px solid gray"><span class="style1"><font color="#FF0000" face="Tahoma"><strong>กระทำการ</strong></font></span></td>
</tr>
<?
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bordercolor="#EEEEEE" >
<td align="center" bgcolor="#eeeeee" ><input type="checkbox" name="checkbox[]" value="<? echo $row[Project_code]?>" /></td>
<td align="center" bgcolor="#eeeeee" ><font color="#003366" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bgcolor="#eeeeee" ><div align="center"><font color="#003366" size="2" face="Tahoma">
<?=$row["Orderlist"]?>
</font></div></td>
<td align="center" bgcolor="#eeeeee" ><div align="left"><font color="#990099" size="2" face="Tahoma"> </font>
<div align="left"><font color="#990099" size="2" face="Tahoma"> <a href="PlaningDetail.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font>
<div align="left">
<div align="left">
<div align="center" onclick="MM_openBrWindow('PlaningDetail.php?Project_code=<?=$row["Project_code"]?>','Detail','width=700,height=440')">
<div align="left"><font color="#996600" size="2" face="Tahoma"><a href="#">
<?=$row["Project_plan"]?>
</a></font></div>
</div>
</div>
<font color="#996600" size="2" face="Tahoma"><a href="#" onclick="openNewWindow('TrainingDetail.php?Training_code=<?php echo $row["Training_code"];?>','','scrollbars=No,width=600,height=450')" class="nav"></a> </font></div>
</div>
<font color="#990099" size="2" face="Tahoma"><a href="PlaningDetail.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font><font color="#003366" size="2" face="Tahoma"> </font></div></td>
<td bgcolor="#eeeeee" ><div align="center"><font color="#003366" size="2" face="Tahoma">
<?=$row["Budget_Year"]?>
</font></div></td>
<td width="39" bgcolor="#eeeeee" ><div align="center"><strong><font size="2" face="Tahoma"><a href="FrmEditPlaning.php?Project_code=<? echo $row[Project_code]?>"><img src="../picture/edit.gif" width="15" height="12" border="0" alt="แก้ไข" /></a></font><font color="#003366" size="2" face="Tahoma"></font></strong></div></td>
<td width="42" bgcolor="#eeeeee" ><div align="center"><strong><font size="2" face="Tahoma">
<script language="JavaScript" type="text/javascript">
function Conf<?=$row[Project_code];?>0(object) {
if (confirm("คุณต้องการลบข้อมูล [<?php echo " $row[Project_name] "; ?>] หรือไม่?") == true) {
return true;
}
return false;
}
</script>
<a href="DelPlaning.php?Project_code=<?php echo $row[Project_code]; ?>&Budget_Year=<?php echo $row[Budget_Year];?>&Faculty_code=<?php echo $row[Faculty_code];?>"> <img src="../picture/deletenew.gif" alt=" Delete " width="16" height="19" border="0" onclick="return Conf<?=$row[Project_code];?>0(this)" /></a> </font></strong></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bordercolor="#EEEEEE">
<td align="center" bgcolor="#FFFFFF" ><input type="checkbox" name="checkbox[]" value="<? echo $row[Project_code]?>" /></td>
<td align="center" ><font color="#003366" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#FFFFFF" ><div align="center"><font color="#003366" size="2" face="Tahoma">
<?=$row["Orderlist"]?>
</font></div></td>
<td height="20" align="center" bgcolor="#FFFFFF" ><div align="left"><font color="#990099" size="2" face="Tahoma"> </font>
<div align="left"><font color="#990099" size="2" face="Tahoma"> <a href="PlaningDetail.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font>
<div align="left">
<div align="left">
<div align="center" onclick="MM_openBrWindow('PlaningDetail.php?Project_code=<?=$row["Project_code"]?>','Detail','width=700,height=440')">
<div align="left"><font color="#996600" size="2" face="Tahoma"><a href="#">
<?=$row["Project_plan"]?>
</a></font></div>
</div>
</div>
<font color="#996600" size="2" face="Tahoma"><a href="#" onclick="openNewWindow('TrainingDetail.php?Training_code=<?php echo $row["Training_code"];?>','','scrollbars=No,width=600,height=450')" class="nav"></a> </font></div>
</div>
<font color="#990099" size="2" face="Tahoma"><a href="PlaningDetail.php?Project_code=<?=$row["Project_code"]?>"title="Click to see Detail" class="d"></a></font><font color="#003366" size="2" face="Tahoma"> </font></div></td>
<td bgcolor="#FFFFFF" ><div align="center"><font color="#003366" size="2" face="Tahoma">
<?=$row["Budget_Year"]?>
</font></div></td>
<td bgcolor="#FFFFFF" ><div align="center"><strong><font size="2" face="Tahoma"><a href="FrmEditPlaning.php?Project_code=<? echo $row[Project_code]?>"><img src="../picture/edit.gif" width="15" height="12" border="0" alt="แก้ไข" /></a></font><font color="#003366" size="2" face="Tahoma"></font></strong></div></td>
<td bgcolor="#FFFFFF" ><div align="center"><strong><font size="2" face="Tahoma">
<script language="JavaScript" type="text/javascript">
function Conf<?=$row[Project_code];?>0(object) {
if (confirm("คุณต้องการลบข้อมูล [<?php echo " $row[Project_name] "; ?>] หรือไม่?") == true) {
return true;
}
return false;
}
</script>
<a href="DelPlaning.php?Project_code=<?php echo $row[Project_code]; ?>"> <img src="../picture/deletenew.gif" alt=" Delete " width="16" height="19" border="0" onclick="return Conf<?=$row[Project_code];?>0(this)" /></a></font></strong></div></td>
</tr>
<?
$count=0;
}
$i++;
}
CloseDB();
?>
<tr bgcolor="#CCCCCC">
<td colspan="7" align="center"><input type="submit" name="Submit2" value=" ลบ " /></td>
</tr>
<tr bgcolor="#ECD9C6">
<td colspan="7" align="center"><div align="center"><font color="#003300" size="2" face="Tahoma">ทั้งหมด <? echo $num ?> หัวข้อ </font> </div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td align="right" bordercolor="#CCCCCC" class="Tahoma11"><div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <font color="#FFFFFF"><font color="#FFFFFF" size="3" face="MS Sans Serif"><strong><font color="#0033CC" size="2" face="Tahoma"><?php echo $Num_Pages;?></font></strong></font></font><font color="#0033CC" size="2" face="Tahoma"> </font></strong></font><font color="#000000" size="2" face="Tahoma"><strong> หน้า</strong></font></font> <font color="#FFFFFF"><font color="#0033CC" size="2" face="Tahoma"><strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page&&Budget_Year=$Budget_Year&&Faculty_code=$Faculty_code\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</strong></font></font></div></td>
</tr>
</table> </td>
</tr>
</table>
<p> </p><table width="91%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:1px solid gray"size="12">
</table>
</form>
</div>
</label>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>หมายเหตุ :</b> ใช้เมาส์คลิกที่ชื่อ<br>
</font></td>
</tr>
</table>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../login.php\">\n";
echo"Please Login ";
}
?>
|