Viewing file: addDocCommentSign.php (8.87 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once "template.php"; include_once "../class/clsDocCommentSign.php"; include_once "../link/function.php"; include_once "funct.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDcs = new doccommentsign($oC); $oDcs2 = new doccommentsign($oC); $oDcs1 = new doccommentsign($oC); $obj = new doccommentsign($oC); $obj2 = new doccommentsign($oC);
$Topp=$oDcs2->GetMinOrderS(); $Bottomp=$oDcs2->GetMaxOrderS(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <link href="../source/style.css" rel="stylesheet" type="text/css"> </head> <body> <br> <table width=703 align="center"> <tr><td height="150"> <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="?mm=1">จัดการข้อมูลพื้นฐานในงานสารบรรณ</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle">ข้อความบันทึกต่อเนื่อง (ลงนาม)</font></legend> <br> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#DADADA" style="border-collapse:collapse"> <tr> <td height="25" colspan="3" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_2"];?>"><strong><? if($edDocComment==1){ echo "แก้ไข"; }?>ข้อความบันทึกต่อเนื่อง (ลงนาม) <br></strong></font></td> </tr> </table> <table width="75%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#DADADA" style="border-collapse:collapse"> <form name="aa" METHOD="POST" action="<?php echo $PHP_SELF;?>"> <? if($edDocComment==1){ $oDcs1->SearchByKey($dCsID); $oDcs1->GetRecord(); } ?> <tr> <td width="33%" height="22" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <strong>ข้อความบันทึกต่อเนื่อง</strong></td> <td width="0%" align="center"><strong>:</strong></td><td width="72%"><input name="commentS" type="text" size="50" maxlength="255" value="<? if($edDocComment==1){ echo $oDcs1->commentS; } ?>"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">*</font></td> </tr> <? if($edDocComment==1){ ?> <tr> <td width="33%" height="22" > <strong>การใช้งาน</strong></td> <td width="0%" align="center"><strong>:</strong></td><td width="72%"><input type="checkbox" name="commentUse" value="Y" <? if($oDcs1->commentUse=='Y'){ echo "checked";} ?>></td> </tr> <? }?> <tr><td height="22" colspan="3" align="center"><br> <? if($edDocComment==1){ ?> <input type="submit" name="editDocComment" value="แก้ไข" onclick="return checkFormatedit();"> <input type="hidden" name="dCsID" value="<? echo $dCsID;?>"> <? }else{ ?><input type="submit" name="addDocComment" value="บันทึก" onclick="return checkFormat();"> <? } ?> <? if($edDocComment==1){ ?> <input type="button" name="cEdit" value="ยกเลิก" onclick="cancleEdit();"> <? } ?> <input type="hidden" name="method"> <input type="hidden" name="MaxRow" value="<? echo ($Bottomp+1); ?>"> </td></tr></form> </table> <form name="bb" METHOD="POST" action="<?php echo $PHP_SELF;?>"> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0"> </table><a name="b"></a> <table width="88%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse"> <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <td width="7%" align="center" height="22"><strong>ลำดับ</strong></td> <td width="73%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_4"]; ?>"><strong>ข้อความบันทึกต่อเนื่อง (ลงนาม) </strong></font></td> <td width="5%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_4"]; ?>"><strong>แก้ไข</strong></font></td> <td width="5%" align="center"><font color="<?php echo $GLOBALS["COLOR_FONT_4"]; ?>"><strong>ใช้งาน</strong></font></td> <td width="8%" colspan="2" align="center"><font size="2"> </font></td> </tr> <? $i=0; $oDcs->RSdoccommentsignAll(); while($oDcs->GetRecord()){ if(($i%2) == 0) echo "<tr bgcolor=\"#FFFFFF\" height=22 >"; else echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_16"]."\" height=22 align=\"left\">"; ?> <td align="center" height="22" ><? echo ($i+1); ?></td><td> <? echo $oDcs->commentS;?></td> <td align="center"><img src="../picture/textedit3.gif" alt="แก้ไข" border="0" align="absmiddle" onclick="goEdit('<? echo $oDcs->dCsID; ?>');" style="cursor:pointer;"> </td> <td align="center"><? if($oDcs->commentUse=='Y'){ ?><img src="../picture/apply.gif" border="0" align="absmiddle"><? }?></td> <td width="4%" align="center" valign="middle"> <? if($Topp!=$oDcs->orderS){ ?><a href="addDocCommentSign.php?method=changeSeq&typeb=Top&dCsID=<? echo $oDcs->dCsID; ?>&orderS=<? echo $oDcs->orderS; ?>"> <img src="../picture/up.gif" alt="เลื่อนขึ้น" border="0" style="cursor:pointer;"></a><? }else{ echo " "; } ?> </td> <td width="4%" align="center" valign="middle"> <? if($Bottomp!=$oDcs->orderS){ ?><a href="addDocCommentSign.php?method=changeSeq&typeb=Bottom&dCsID=<? echo $oDcs->dCsID; ?>&orderS=<? echo $oDcs->orderS; ?>"> <img src="../picture/down.gif" alt="เลื่อนลง"border="0" style="cursor:pointer;"></a><? }else{ echo " "; } ?> </td> </tr> <? $i++; } if($i==0){ ?> <tr><td colspan="6" align="center"><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>">** ไม่ปรากฏรายการในฐานข้อมูล **</font></td></tr> <? }?> <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_4"]; ?>"><td colspan="6" align="right" height="22"> <table border="0" width="100%"><tr> <td width="72%"> </td> <td width="28%" align="right">รวม <strong><?php echo $i;?></strong> รายการ</td> </tr></table> </td></tr> </table> <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse"> </table><br><input type="hidden" name="dCsID"><input type="hidden" name="edDocComment"><input type="hidden" name="delDocComment"> <input type="hidden" name="method"> <input type="hidden" name="page_id" value="<? echo $page_id; ?>"> </form> </fieldset><br><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><b>หมายเหตุ : </b>* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</font> </td> </tr> </table> </body> </html>
<? ############process################################# if($method=="addDocComment" && $addDocComment=="บันทึก"){ $obj->AddNew(); $obj->dCsID=$obj->GetNextCode(); echo "dCsID=".$obj->dCsID."<br>"; $obj->commentS=$commentS; echo "commentS=".$obj->commentS."<br>"; $obj->orderS=$MaxRow; $obj->commentUse='Y'; $obj->Save(); header("Location: addDoccommentSign.php"); }else if($method=="editDocComment" && $editDocComment=="แก้ไข"){ $obj->SearchByKey($dCsID); $obj->GetRecord(); $obj->Edit(); $obj->dCsID=$dCsID; echo "dCsID=".$obj->dCsID."<br>"; $obj->commentS=$commentS; echo "commentS=".$obj->commentS."<br>"; $obj->commentUse=$commentUse; $obj->Save(); header("Location: addDocCommentSign.php"); }else if($method=="changeSeq"){ if($typeb=="Top"){ $obj->SearchBydCsIDlimitPreSeq($orderS); $obj->GetRecord(); $preseqBox=$obj->orderS;
$obj->Edit(); $obj->dCsID=$obj->dCsID; $obj->orderS=$orderS; $obj->Save(); $obj2->SearchByKey($dCsID); $obj2->GetRecord(); $obj2->Edit(); $obj2->dCsID=$obj2->dCsID; $obj2->orderS=$preseqBox; $obj2->Save();
}else if($typeb=="Bottom"){ $obj->SearchBydCsIDlimitNextSeq($orderS); $obj->GetRecord(); $nextseqBox=$obj->orderS;
$obj->Edit(); $obj->dCsID=$obj->dCsID; $obj->orderS=$orderS; $obj->Save(); $obj2->SearchByKey($dCsID); $obj2->GetRecord(); $obj2->Edit(); $obj2->dCsID=$obj2->dCsID; $obj2->orderS=$nextseqBox; $obj2->Save(); } header("Location: addDocCommentSign.php"); } #################################################### ?> <script language="javascript"> function goEdit(dcsid){ document.bb.dCsID.value=dcsid; document.bb.edDocComment.value=1; document.bb.submit(); } function cancleEdit(){ document.aa.submit(); } function checkFormat(){ if(document.aa.commentS.value == ""){ alert("กรุณากรอกข้อความบันทึกต่อเนื่อง"); document.aa.commentS.focus(); return false; } var agree=confirm("คุณต้องการบันทึกข้อมูลข้อความบันทึกต่อเนื่อง\nแน่นอนใช่หรือไม่ ?"); if (agree){ document.aa.method.value="addDocComment"; return true; }else{ return false ; } }
function checkFormatedit(){ if(document.aa.commentS.value == ""){ alert("กรุณากรอกข้อความบันทึกต่อเนื่อง"); document.aa.commentS.focus(); return false; } var agree=confirm("คุณต้องการแก้ไขข้อมูลข้อความบันทึกต่อเนื่อง\nแน่นอนใช่หรือไม่ ?"); if (agree){ document.aa.method.value="editDocComment"; return true; }else{ return false ; } } </script>
|