Viewing file: deptpop1.php (3.98 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/clsTable.php"; include_once "../class/clsDepartment.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDp2 = new Department($oC); $oDp = new Department($oC);
?> <script language="JavaScript1.2"> function checkFormat(){ var xv = 0; if(document.ps.deptName.value==""){ alert("กรุณากรอกชื่อหน่วยงานภายใน!"); xv = 1; return false; } } </script> <? //echo ">>".$startyear; if($method=="add" && $xv != 1){
//$oC->BeginTrans(); $oDp->AddNew(); $oDp->deptId=$oDp->GetNextCode(); $oDp->deptName=$deptName; $oDp->deptDesc=$deptDesc; $oDp->deptCode=$deptCode; $oDp->deptParent=0; $oDp->deptYear=(date(Y)+543); $oDp->deptDate=getNowDateTh(); $oDp->deptRef=0; $oDp->pbriId=0; $oDp->deptIsCenter=""; $oDp->receiveIn="Y"; $oDp->receiveOut=""; $oDp->sendIn="Y"; $oDp->sendOut="Y"; $oDp->deptNo=""; $oDp->docGroup=""; $maxnext=$oDp->SearchMaxDocGroup(); $oDp->docGroup=($maxnext); $oDp->deptParentId=$deptParentId; $oDp->deptLevel=$deptLevel; $oDp->deptgroup = $dg; $oDp->Save(); ?> <script language="javascript1.2"> window.opener.location.href="addWorkGroup2.php"; 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="100%" border="0" cellspacing="1" cellpadding="1" align="center"> <tr > <td align="center" colspan="4" height="22"><br><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> <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"><input type="text" name="deptName" id="deptName" size="40" value="<? echo $deptName; ?>"> <font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></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"><input type="text" name="deptDesc" id="deptDesc" size="40" value="<? echo $deptDesc; ?>"> </td> </tr> <tr> <td align="left" colspan="4" height="22"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><b> </b></font></td> </tr> <tr> <td colspan="4" align="center" bgcolor="#FFFFFF"><input type="submit" name="add" value="บันทึก" onClick="return checkFormat()"> <input type="reset" name="clear" value="เคลียร์ข้อมูล"> <input type="hidden" name="method" id="method" value="add"> </td> </tr> <input type="hidden" name="deptParentId" id="deptParentId" value="<?php echo $deptParentId;?>"> <input type="hidden" name="deptLevel" id="deptLevel" value="<?php echo $deptLevel;?>"> <input type="hidden" name="startyear" id="startyear" value="<?php echo $startyear;?>"> <input type="hidden" name="endyear" id="endyear" value="<?php echo $endyear;?>"> <input type="hidden" name="dg" id="dg" value="<?php echo $dg;?>"> <tr><td colspan="4" align="center"><a href="#" onClick="window.close()"><font size="1" face="Microsoft Sans Serif">[ปิดหน้าต่าง]</font></a></td></tr> </table> </form> </body> </html>
|