Viewing file: deptpop3.php (5.83 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("../../class/clsConnection.php");
include_once("../../class/clsDB.php");
include_once "../global.php";
include_once "../link/function.php";
include_once "../class/clsDepartment.php";
include_once "../class/clsdepttype.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDp = new Department($oC);
$oDp1 = new Department($oC);
$oDpT = new Department($oC);
$oDp2 = new Department($oC);
$oDp3 = new Department($oC);
$oDp4 = new Department($oC);
$oDp5 = new Department($oC);
$oDp6 = new Department($oC);
$oDp7 = new Department($oC);
$oDp8 = new Department($oC);
$oDpt= new Departmenttype($oC);
$maxdate = $oDp5->MaxDate();
?>
<script language="JavaScript1.2">
function checkFormat(){
document.ps.xv.value = 0;
if(document.ps.deptName.value==""){
alert("กรุณากรอกชื่อส่วนราชการภายใน!");
document.ps.xv.value = 1;
return false;
}
if(document.ps.depttypeId.value==""){
alert("กรุณากรอกประเภทส่วนราชการภายใน!");
document.ps.xv.value = 1;
return false;
}
}
</script>
<?
if($method=="edit" && $xv != 1){
$oC->BeginTrans();
$oDp->SearchByKey($deptId);
$oDp->GetRecord();
$oDp->Edit();
$oDp->deptName=$deptName;
$oDp->deptDesc=$deptDesc;
$oDp->depttypeId=$depttypeId;
$oDp->Save();
$oC->CommitTrans();
?>
<script language="javascript1.2">
window.opener.location.href="deptstructureedit.php?deptDate=<?php echo $oDp->deptDate;?>";
window.close();
</script>
<?php
}
?>
<html>
<head>
<title>แก้ไขส่วนราชการภายใน</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<style>
<!--
A:link {text-decoration: none }
A:visited {text-decoration: none}
A:hover {text-decoration: none; font-weight: underline}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<form name="ps" action="<?php echo $PHP_SELF;?>" method="post" >
<table width="550" border="0" cellspacing="1" cellpadding="1" align="center"><?php echo $startyear;?>
<tr >
<td align="center" colspan="4" height="22"><font size="3" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>"><b>แก้ไขส่วนราชการภายใน</b></font></td>
</tr>
<tr>
<td colspan="4" height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>"> </font></td>
</tr>
<?
$oDp->SearchByKey($deptId);
$oDp->GetRecord();
?>
<tr height="22" >
<td align="left" width="221" ><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ชื่อส่วนราชการภายใน</b></font></td>
<td align="left" width="4"> </td>
<td align="left" width="315"><input type="text" name="deptName" size="40" value="<? echo $oDp->deptName; ?>" onKeyPress="if(event.keyCode==39){ alert('ระบบไม่สามารถบันทึกตัวอักษรนี้ได้!!'); return false;}">
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
</tr>
<? if($maxdate!='0000-00-00' && $maxdate!=""){ ?>
<tr height="22" bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_4'];?>">
<td align="left"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ส่วนราชการภายใน<br>(โครงสร้างเพื่อการส่งหนังสือในระบบสารบรรณเก่า)</b></font></td>
<td align="left" > </td>
<td align="left">
<?
$oDp4->SearchByKey($oDp->deptRef);
if($oDp4->GetRecord()==1){
echo ' '.$oDp4->deptName;
}else{
echo ' -';
}
?>
</td>
</tr>
<? } ?>
<tr height="22" >
<td align="left"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>ประเภทของส่วนราชการภายใน</b></font></td>
<td align="left" > </td>
<td align="left">
<select name="depttypeId" >
<?
$oDpt->RSDepartmenttype();
while($oDpt->GetRecord()){
?>
<option value="<? echo $oDpt->depttypeId; ?>" <? if($oDpt->depttypeId == $oDp->depttypeId){ echo "selected"; }?>><? echo $oDpt->depttypeName; ?>
<? }?>
</select>
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td>
</tr>
<tr height="22" bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_4'];?>">
<td align="left" width="221" ><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b>รายละเอียด</b></font></td>
<td align="left" width="4"> </td>
<td align="left" width="315"><input type="text" name="deptDesc" size="40" value="<? if($oDp->deptDesc!=""){ echo $oDp->deptDesc; } ?>" onKeyPress="if(event.keyCode==39){ alert('ระบบไม่สามารถบันทึกตัวอักษรนี้ได้!!'); return false;}">
</td>
</tr>
<tr height="22">
<td align="left" width="221" colspan="4" height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b> </b></font></td>
</tr>
<tr height="40">
<td colspan="4" align="center" bgcolor="#FFFFFF"><input type="submit" name="edit" value="แก้ไข" onClick="return checkFormat()">
<input type="reset" name="clear" value="เคลียร์ข้อมูล">
<input type="hidden" name="method" value="edit">
<input type="hidden" name="deptDate" value="<? echo $deptDate; ?>">
</td>
</tr>
<input type="hidden" name="deptId" value="<?php echo $deptId;?>">
<br>
</table>
<table width="550" border="0" cellspacing="0" cellpadding="1" align="center" >
<tr>
<td align="center" colspan="4" bgcolor="#FFFFFF" height="22"><a href="#" onClick="window.close()"><font size="1" face="Microsoft Sans Serif">[ปิดหน้าต่าง]</font></a></td>
</tr>
</table>
</form>
</body>
</html>
<?php
//$oDpt->Close();
//$oDp->Close();
$oC->Disconnect();
?>
|