Viewing file: addRegisDocAllReg.php (16.43 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once "template.php"; include_once "../class/clsTable.php"; include_once "../class/clsDepartment.php"; include_once "../class/clsPerson.php"; include_once "../link/function.php"; include_once "../link/functionshow.php"; include_once "../class/clsDocLinePosition.php"; include_once "../class/clsDocLineConfig.php"; include_once "../class/clsReceiveSendType.php"; include_once "../class/clsDocType.php"; include_once "../class/clsDocSpeedLevel.php"; include_once "../class/clsDocSecreLevel.php"; include_once "../class/clsDocattatchesTmp.php"; include_once "funct.php"; include_once "../class/clsDocInbox.php"; include_once "../link/keyThai.php"; include_once "../class/clsSysConfig.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDP = new Department($oC); $oDP2 = new Department($oC); $oDP3 = new Department($oC); $oPS = new person($oC); $oDlc = new DocLineConfig($oC); $oDlc2 = new DocLineConfig($oC); $oDlc3 = new DocLineConfig($oC); $oDlp = new docLinePosition($oC); $oDlp2 = new docLinePosition($oC); $oRSt = new receiveSendType($oC); $oDt = new doctype($oC); $oDt2 = new doctype($oC); $oDsl = new DocSpeedLevel($oC); $oDcl = new DocSecretLevel($oC); $oDtmp = new DocattatchesTmp($oC); $oDbx = new DocInbox($oC); $oSys->SearchByKey($free); $oSys->GetRecord();
$MaxDocGroup=$oDP->SearchMaxDocGroup(); $InputThai=$oSys->SearchByInputThai();
if($_SESSION['DLCID'] && $_SESSION['one_position']!="1"){ include_once "selectposition.php"; ?>
<? $oDlc->SearchByKey($_SESSION['DLCID']); $oDlc->GetRecord(); if($_SESSION['DLCIDSECOND']=="Y"){ $oDlc3->SearchByKey($_SESSION['DLCIDSECONDID']); $oDlc3->GetRecord(); $mypersonId=$oDlc3->personId; }else{ $mypersonId=$oDlc->personId; } $oDP->SearchByKey($oDlc->deptId); $oDP->GetRecord(); if($RsID=="" && $oDP->deptIsCenter=="Y" && $oDP->receiveOut=="Y"){ $RsID=1; if($DtID==""){ $DtID=1; } }else if($RsID=="" && $oDP->deptIsCenter=="Y" && $oDP->sendOut=="Y"){ $RsID=2; if($DtID==""){ $DtID=1; } }else if($RsID=="" && $oDP->deptIsCenter=="N" && $oDP->sendIn=="Y" ){ $RsID=4; if($DtID==""){ $DtID=3; } } ?> <html> <head> <script language="javascript" src="../source/calendarDateInput.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <link href="../source/style.css" rel="stylesheet" type="text/css"> </head> <body> <table width="100%" align="center"> <tr><td > <fieldset> <legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="regisDoc.php">Е§·РаєХВ№гЛБи/аК№НЛ№С§КЧН</a> <img src="../picture/ico3.gif" width="10" border="0" align="absmiddle"><a href="addRegisDoc.php?RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>">Е§·РаєХВ№Л№С§КЧН</a> <img src="../picture/ico3.gif" width="10" border="0" align="absmiddle">Е§·РаєХВ№Л№С§КЧНГСєГН§аЎХиВЗЎСє№СЎИЦЎЙТбєєЎЕШиБ </font> </font></legend> <?php if($c!="3" || $success=="1"){ if($c=="1") { echo '<script LANGUAGE="JavaScript"> alert("дїЕм·ХиНСѕвЛЕґБХў№ТґгЛиаЎФ№д» !!") </script>'; } else if($c=="2") { echo '<script LANGUAGE="JavaScript"> alert("дїЕм·ХиНСѕвЛЕґдБигЄи .csv !!") </script>'; } ?> <br> <form name="ff" METHOD="POST" enctype="multipart/form-data" action="processRegisterDoc.php"> <table align="center" width="95%" > <tr> <td align="right"> </td> </tr> <tr> <td width="68%" height="25" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_19"]; ?>"> <font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="3"><strong> Е§·РаєХВ№Л№С§КЧН: </strong></font> <font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong><? echo $oRSt->SearchShowRsName($RsID); ?></strong></font> <font color="<?php echo $GLOBALS["COLOR_FONT_1"]; ?>" size="3"><strong> Є№ФґЛ№С§КЧН: </strong></font> <font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="3"><strong> <? $oDt->SearchByKey($DtID); $oDt->GetRecord(); echo $oDt->DtName; ?>аЎХиВЗЎСє№СЎИЦЎЙТбєєЎЕШиБ </strong></font></td> </tr> </table> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#DADADA" style="border-collapse:collapse"> <tr><td colspan="3" align="center"><? if($oSys->closeSystem=="Y"){ echo "<font color=#FF0000>ГРєєдБиН№ШТµФгЛйЕ§·РаєХВ№гЛБий а№ЧиН§ЁТЎЎУЕС§ЁР»ГСєв¤Г§КГйТ§Л№иЗВ§Т№</font>"; }?></td></tr> <tr> <td> </td> <td> </td> <td align="right"> </td> </tr> <tr > <td width="21%" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <strong><? echo ShowNameDate2($DtID); ?></strong></td> <td width="0%" align="center"><strong>:</strong></td> <td> <? if($DocDate!="" && $DocDate!="0000-00-00"){ ?> <script>DateInput('DocDate', true, 'DD/MM/YYYY','<?php echo $DocDate;?>');</script> <? }else{ ?> <script>DateInput('DocDate', true, 'DD/MM/YYYY','<?php echo getNowDateFw2();?>');</script> <? } ?> </td> </tr> <? //if($DtID!=13){ ?> <tr > <td width="21%" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>" > <strong><? echo ShowNameSubject($DtID); ?></strong></td> <td width="0%" align="center"><strong>:</strong></td> <td ><input name="DocSubject" id="DocSubject" type="text" style="" size="70" maxlength="255" value="<? if($DocSubject!=""){ echo a2th($DocSubject); }?>" onkeypress="return chkNoKey(event)" onKeyUp="CheckInput('<? echo $InputThai; ?>','DocSubject')"></td> </tr> <? //} ?> <? if($DtID==1 || $DtID==2 || $DtID==14 || $DtID==13){?> <tr > <td width="21%" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <strong><? echo ShowNameFrom($DtID); ?></strong></td> <td width="0%" align="center"><strong>:</strong></td> <td ><input name="DocFrom" id="DocFrom" type="text" style="" size="70" maxlength="255" <? if($RsID=="2" || $DtID=="13"){ $checkNameFrom=1; ?>value="<? echo a2th($GLOBALS["COLLEGENAME2"]); ?>" disabled<? }else{ if($DocFrom!=""){ ?> value="<? echo a2th($DocFrom); ?>" <? } } ?> onkeypress="return chkNoKey(event)" onKeyUp="CheckInput('<? echo $InputThai; ?>','DocFrom')"> <? if($RsID=="2" || $DtID=="13"){ ?> <input name="DocFrom" type="hidden" value="<? echo a2th($GLOBALS["COLLEGENAME2"]); ?>"> <? } ?> </td> </tr> <? } ?> <tr > <td width="21%" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <strong>ЛБТВаЛµШ</strong></td> <td width="0%" align="center"><strong>:</strong></td> <td><textarea name="DocShortDesc" id="DocShortDesc" cols="70" rows="4" <? echo showtextarea('DocShortDesc',$InputThai); ?>><? if($DocShortDesc!=""){ echo a2th($DocShortDesc); } ?></textarea></td> </tr> <tr > <td width="21%" height="24"> </td> <td width="0%" align="center"> </td> <? $oDt2->SearchByKey($DtID); $oDt2->GetRecord(); ?> <td ><input name="endDoc" type="checkbox" value="Y" <? if($oDt2->forRegis=="Y" || ($RsID=="2" && ($DtID=="1" || $DtID=="2"))){ echo "checked disabled"; }else{ if($endDoc=="Y"){ echo "checked"; } }?>> <strong>ВШµФЛ№С§КЧН</strong></td> <? if($oDt2->forRegis=="Y" || ($RsID=="2" && ($DtID=="1" || $DtID=="2"))){ ?> <input name="endDoc" type="hidden" value="Y"> <? } ?> </tr> <tr> <td colspan="3"><hr color="#000099"></hr> </td> </tr> <tr> <td colspan="3" height="50"> <font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong> №УаўйТўйНБЩЕ№СЎИЦЎЙТ·ХидґйГСєЎТГГСєГН§<br> - аБЧиН·УЎТГЕ§·РаєХВ№бЕйЗ Л№С§КЧН·Сй§ЛБґЁР¶ЩЎаЎзєНВЩиг№ [ГТВЎТГЛ№С§КЧН·ХиЕ§·РаєХВ№¤ШБбЕйЗ·Сй§ЛБґ] </strong></font></td> </tr> <? if($DtID==13){?> <tr><td colspan="3" align="left"> <strong>µСЗНВиТ§ЎТГЎГНЎбїйБўйНБЩЕ</strong></td></tr> <tr><td colspan="3" align="center"><img src="../picture/importexcelreg.jpg" border="0" ></td></tr> <tr > <td width="21%" height="30" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_1"]; ?>"> <strong>ўйНБЩЕ№СЎИЦЎЙТ</strong></td> <td width="0%" align="center"><strong>:</strong></td> <td > <? if($success!="1"){ ?> <input type="file" name="uploadfile"> <input type="submit" name="send" value="НСѕвЛЕґ" onClick="return showDoc2();"> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"> *** НСѕвЛЕґбїйБўйНБЩЕ (.csv) <br><a href="<? echo $GLOBALS['path_download_uploadfile'];?>templetereg.csv" target="_top">[¤ЕФЎґТЗ№мвЛЕґµСЗНВиТ§бїйБ (.csv)]</a></font> <? }else{ ?> <img src="../picture/search2.jpg" title="¤ЕФЎґЩўйНБЩЕ№СЎИЦЎЙТ·ХидґйГСєЎТГГСєГН§" border="0" style="cursor:pointer;" onClick = "viewps('<? echo $filename;?>')"> ¤ЕФЎґЩўйНБЩЕ№СЎИЦЎЙТ·ХидґйГСєЎТГГСєГН§ЎТГЁєЎТГИЦЎЙТ <? echo a2th($countps); ?> ГТВЎТГ <? } ?> </td> </tr> <? } ?> <tr> <td> </td> </tr> <tr > <td height="24" colspan="3" align="center"> <input type="submit" name="jj" value="Е§·РаєХВ№" onClick="return checkFormat('<? echo $countps; ?>');" <? if($success!="1"){ echo "disabled"; } ?> <? if($oSys->closeSystem=="Y"){ echo "disabled"; }?>> <? if($success=="1"){ ?> <input type="button" name="cancel" value="ВЎаЕФЎ" onClick="location.href = 'addRegisDocAllReg.php?RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>'"> <? } ?> <input type="button" name="cancel" value="ЎЕСєЛ№йТЛЕСЎ" onClick="location.href = 'addRegisDoc.php?RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>'"> <input name="RsID" type="hidden" value="<?php echo $RsID; ?>"> <input name="DtID" type="hidden" value="<?php echo $DtID; ?>"> <input name="DlcID" type="hidden" value="<?php echo $DLCID; ?>"> <input name="personId" type="hidden" value="<?php echo $mypersonId; ?>"> <input name="deptId" type="hidden" value="<?php echo $oDlc->deptId; ?>"> <input name="DocGroup" type="hidden" value="<?php echo $MaxDocGroup; ?>"> <input name="filename" type="hidden" value="<?php echo $filename; ?>"> <input type="hidden" name="countps" id="countps" value="<? echo $countps;?>"> <input type="hidden" name="method" id="method"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </form> <?php }else{ if($success!="1"){ echo '<script LANGUAGE="JavaScript"> alert("дґйГСєдїЕмбЕйЗ ЄЧиН '.$n.' ў№Тґ '.$s.' дєµм")</script>'; ?> <form name="gg" method="post" enctype="multipart/form-data" action="addRegisDocAllReg.php"> <table width="680" border="0" cellspacing="1" cellpadding="1" align="center"> <tr> <td><strong><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">*** ЎГШіТµГЗЁКНєўйНБЩЕЎиН№єС№·ЦЎўйНБЩЕ ***</font></strong></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="6"><b>ўйНБЩЕЁТЎбїйБ <? echo $n; ?></b> <input type="submit" name="send2" value="єС№·ЦЎўйНБЩЕ" onClick="return showDoc3();"> <input type="hidden" name="method" id="method" value="addpersoninregis"> <input type="hidden" name="filename" id="filename" value="<? echo $n;?>"> <input type="hidden" name="RsID" id="RsID" value="<? echo $RsID;?>"> <input type="hidden" name="DtID" id="DtID" value="<? echo $DtID;?>"> <input type="hidden" name="DocDate" id="DocDate" value="<? echo $DocDate;?>"> <input type="hidden" name="DocSubject" id="DocSubject" value="<? echo $DocSubject;?>"> <input type="hidden" name="DocFrom" id="DocFrom" value="<? echo $DocFrom;?>"> <input type="hidden" name="DocShortDesc" id="DocShortDesc" value="<? echo $DocShortDesc;?>"> <input name="DocGroup" type="hidden" value="<?php echo $MaxDocGroup; ?>"> <input type="hidden" name="success" id="success" value="1"> <input name="Button" type="button" value="ВЎаЕФЎ" onClick=" location.href = 'addRegisDocAllReg.php?RsID=<? echo $RsID; ?>&DtID=<? echo $DtID; ?>'"> </td> </tr> </table><br> <table width="55%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="silver"> <tr align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_9"];?>"> <td width="10%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ЕУґСє</b></font></td> <td width="15%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ГЛСК№СЎИЦЎЙТ</b></font></td> <td width="30%" align="center"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_1"];?>"><b>ЄЧиН - №ТБКЎШЕ</b></font></td> </tr> <? $UPath=$GLOBALS['path_upload_uploadfile'].$n; $fp = fopen($UPath, "r"); $i = 0; while(!feof($fp)) { $mark=0; $char = fgets($fp); $stdCode=""; $prefixname=""; $name=""; $surname=""; list($stdCode,$prefixname, $name, $surname) = preg_split('[,]', $char); if($stdCode!=""){ if(($i%2) == 0) echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_5"]."\">"; else echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_11"]."\">"; ?> <td align="center"><? echo ($i+1); ?></td> <td align="center"><? echo $stdCode; ?></td> <td align="left"> <? echo $prefixname.$name.' '.$surname; ?></td> </tr> <? $i++; } } //end while ?> <input type="hidden" name="countps" id="countps" value="<? echo $i;?>"> <? if($i == 0) {?> <tr bgcolor="#FFFFFF"> <td align="center" height="22" colspan="14"><font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2">** дБи»ГТЎЇўйНБЩЕ№СЎИЦЎЙТг№бїйБ <? echo $n; ?> **</font></td> </tr> <?php } ?> </table></form> <? } } ?> </fieldset> <table width="95%" border="0" align="center"> <tr> <td width="76" align="left"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"> <strong>ЛБТВаЛµШ : </strong> </font></td> <td width="618" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">*** НСѕвЛЕґбїйБўйНБЩЕ (.csv) аѕЧиН№УаўйТўйНБЩЕ№СЎИЦЎЙТ·ХидґйГСєЎТГГСєГН§</font></td> </tr> <tr> <td width="76" align="left"> </td> <td width="618" align="left"> <font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2"><img src="../picture/search2.jpg" border="0" > ¤ЕФЎґЩўйНБЩЕ№СЎИЦЎЙТ·ХидґйГСєЎТГГСєГН§</font></td> </tr> </table>
</td> </tr> </table> </body> </html> <? }else{ include_once "unselectposition.php"; } ?> <script language="javascript"> function showDoc2(){ if(document.ff.uploadfile.value==""){ alert("ЎГШіТЎГНЎбїйБўйНБЩЕ !!"); document.ff.uploadfile.focus(); return false; }else{ var agree=confirm("¤ШіµйН§ЎТГНСѕвЛЕґбїйБўйНБЩЕгЄиЛГЧНдБи ?"); if (agree){ document.ff.method.value="upload_filereg"; return true ;}else{return false ;} } } function showDoc3(){ var agree=confirm("¤ШіµйН§ЎТГєС№·ЦЎўйНБЩЕ№СЎИЦЎЙТ·Сй§ЛБґ\nаѕЧиН№Уд»гЄйг№ЎТГЕ§·РаєХВ№Л№С§КЧНГСєГН§гЄиЛГЧНдБи ?"); if (agree){ return true ;}else{return false ;} } function checkFormat(p){ if(document.ff.DocSubject.value==""){ alert("ЎГШіТЎГНЎаГЧиН§ !!"); document.ff.DocSubject.focus(); return false; } var a="¤ШіµйН§ЎТГЕ§·РаєХВ№Л№С§КЧНГСєГН§\nЁУ№З№ "+p+" ГТВЎТГб№и№Н№гЄиЛГЧНдБи ?"; var agree=confirm(a); if (agree){ document.ff.method.value="confirmRegisterDocAllreg"; return true; }else{ return false ; } } function viewps(p){ FileName = "viewPsTablereg.php?filename="+p; var w=400; var h=500; strOption = "scrollbars=yes,left=400,top=100,width=" + w + ",height=" + h; window.open(FileName,"",strOption); } </script>
|