Viewing file: printRepHisFollowDocAllDeptex.php (9.04 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
set_time_limit(0);
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="printRepHisFollowDocAllDeptex.xls"');
include_once("../../class/clsConnection.php");
include_once("../../class/clsDB.php");
include_once "../global.php";
include_once "../link/function.php";
include_once "../link/functionshow.php";
include_once "../class/clsDocType.php";
include_once "../class/clsDocuments.php";
include_once "funct.php";
include_once "../class/clsDepartment.php";
include_once "../class/clsDocLineConfig.php";
include_once "../class/clsDocLinePosition.php";
include_once "../class/clsDocReceiveSend.php";
include_once "../class/clsPerson.php";
include_once "../link/keyThai.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDt = new doctype($oC);
$oDoc = new Documents($oC); //
$oDoc2 = new Documents($oC); //
$oDP = new Department($oC);
$oDP1 = new Department($oC);
$oDlc = new DocLineConfig($oC);
$oDlc1 = new DocLineConfig($oC);
$oDlc2 = new DocLineConfig($oC);
$oDlc3 = new DocLineConfig($oC);
$oDlc4 = new DocLineConfig($oC);
$oDlp = new docLinePosition($oC);
$oDlp1 = new docLinePosition($oC);
$oRs = new DocReceiveSend($oC);
$oRs1 = new DocReceiveSend($oC);
$oPS = new person($oC);
$MaxDocGroup=$oDP->SearchMaxDocGroup();
?>
<html>
<head>
<script language="javascript" src="../source/calendarDateInput.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
</head>
<body>
<table width="978" align="center">
<tr><td >
<form name="ff" method="post" action="printRepHisFollowDocAllDeptex.php">
<table width="99%" align="center">
<tr>
<td height="22" colspan="8"><font face="MS Sans Serif, Tahoma, sans-serif"><strong><? echo "-".$dlcid; ?>รายงานการติดตามหนังสือราชการ
<? $oDP1->SearchByKey($selectPositionDeptID); $oDP1->GetRecord(); echo "หน่วยงาน :: ".$oDP1->deptName; ?>
</strong></font></td>
</tr>
<tr>
<td width="93%" height="20" colspan="8"><font face="MS Sans Serif, Tahoma, sans-serif"><strong><? echo $GLOBALS["COLLEGENAME"]; ?>
<? if(th2a($yearDoc) == 0){
echo "วันที่ดำเนินการส่งหนังสือตั้งแต่วันที่ "; list($day1,$month1,$year1) = split('/',$start); $s=($year1+543)."-".$month1."-".$day1; echo abbreDate2($s,'/');
echo " ถึง "; list($day2,$month2,$year2) = split('/',$end); $e=($year2+543)."-".$month2."-".$day2; echo abbreDate2($e,'/');
}else{
echo "วันที่ดำเนินการส่งหนังสือประจำปี ".a2th($yearDoc);
}
?>
</strong></font></td>
</tr>
<tr>
<td height="24" colspan="8"></td>
</tr>
<tr align="center">
<td align="center" colspan="2">
<table width="100%" 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="6%" align="center"><strong>ที่</strong></td><td width="27%" align="center"><strong>ที่หนังสือ เรื่อง</strong></td><td width="10%" align="center"><strong>ว/ด/ป ที่<br>สั่งการ</strong></td><td width="11%" align="center"><strong>ว/ด/ป ที่<br>กำหนดเสร็จ</strong></td><td width="17%" align="center"><strong>ผู้รับผิดชอบหลัก</strong></td><td width="10%" align="center"><strong>ว/ด/ป ที่<br>รับทราบ</strong></td><td width="10%" align="center"><strong>หมายเหตุ</strong></td></tr>
<?
if(th2a($yearDoc) == 0){
list($dd, $mm, $yy) = split('[/]',$start);
$startT=($yy+543)."-".$mm."-".$dd;
list($dd, $mm, $yy) = split('[/]',$end);
$endT=($yy+543)."-".$mm."-".$dd;
}else{
$yy = th2a($yearDoc);
$startT = $yy."-01-01";
$endT = $yy."-12-31";
}
$oDP->SearchByKey($selectPositionDeptID); $oDP->GetRecord();
//if($seeDept!="1"){
$oDoc->SearchByDrsSendDateDocTypeNoDocSubjectDocNoDeptIdfDeleteDocGroupDsID32($startT,$endT,th2a($DocTypeNoStart),th2a($DocTypeNoEnd),th2a($DocSubject),th2a($DocNo),$selectPositionDeptID,$oDP->docGroup);
/*
}else{
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord();
$oDlc1->SearchByDocGroupDlpIDdeptId($oDlc->DlpID,$oDP->docGroup,$oDP->deptId);
$oDlc1->GetRecord();
$DLCIDshow=$oDlc1->DlcID;
$oDlp1->SearchByKey($oDlc1->DlpID); $oDlp1->GetRecord();
if($oDlp1->DlpPID!="0"){
$DlcPS2=$DLCIDshow;
}else{
$DlcPS2=$oDlc2->SearchDlc2($oDlc1->DlcSeq,$oDlp1->DlpPID,$oDlc1->deptId);
}
// echo $DLCIDshow."-".$DlcPS2;
if($GroupID=="110" || $GroupID=="111" || $GroupID=="112" || $GroupID=="115"){ //head
$oDlp->SearchByKey($oDlc1->DlpID); $oDlp->GetRecord();
$DlcSeq=$oDlc->DlcSeq;
$DlcSeq2=$oDlc->DlcSeq+1;
$oDlc3->SearchByNextDlcID($DlcSeq,$oDlc1->docGroup,$oDlc1->deptId); $oDlc3->GetRecord(); $DLCIDshow2=$oDlc3->DlcID;
if($oDlp->DlpPID=="0"){
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc1->docGroup,$oDlc1->deptId); $oDlc4->GetRecord(); $DlcPS22=$oDlc4->DlcID;
}else{
$DlcPS22=$DLCIDshow2;
}
//echo "==".$DLCIDshow2."-".$DlcPS22;
if($GroupID=="112"){
$oDoc->SearchByDrsSendDateDocTypeNoDocSubjectDocNoDeptIdfDeleteDlcIDDlcID2DocGroupDsID3DrsSendSeeAll2($startT,$endT,th2a($DocTypeNoStart),th2a($DocTypeNoEnd),th2a($DocSubject),th2a($DocNo),$selectPositionDeptID,$DLCIDshow2,$oDP->docGroup,$DlcPS22);
}else{
$oDoc->SearchByDrsSendDateDocTypeNoDocSubjectDocNoDeptIdfDeleteDlcIDDlcID2DocGroupDsID3DrsSend2($startT,$endT,th2a($DocTypeNoStart),th2a($DocTypeNoEnd),th2a($DocSubject),th2a($DocNo),$selectPositionDeptID,$DLCIDshow2,$oDP->docGroup,$DlcPS22);
}
}else{
$oDoc->SearchByDrsSendDateDocTypeNoDocSubjectDocNoDeptIdfDeleteDlcIDDlcID2DocGroupDsID32($startT,$endT,th2a($DocTypeNoStart),th2a($DocTypeNoEnd),th2a($DocSubject),th2a($DocNo),$deptId,$DLCIDshow,$oDP->docGroup,$DlcPS2);
}
}
*/
while($oDoc->GetRecord()){
//$oDlc1->SearchByKey($oDoc->DlcIDRS); $oDlc1->GetRecord();
//echo "DlcID=".$oDoc->DlcID." Doc-deptId=".$oDlc1->deptId." deptId=".$deptId."<br>";
//if($oDlc1->deptId==$selectPositionDeptID){
$nomainps='0';
if(($i%2) == 0)
echo "<tr bgcolor=\"#FFFFFF\" height=22 >";
else
echo "<tr bgcolor=\"".$GLOBALS["COLOR_BG_TD_17"]."\">";
$oRs->SearchByDrsFromDrsIDDrsMainPs($oDoc->DrsID);
if($oRs->GetRecord()==1){
$oPS->SearchByKey($oRs->personId); $oPS->GetRecord();
$showname=GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName;
}else{
$showname="<div align=\"center\">-</div>";
$nomainps=1;
}
?>
<td width="6%" align="center"> <? echo a2th($oDoc->DocTypeNo); ?> </td>
<td width="27%"> <? echo $oDoc->DocNo; ?><? echo "<br> ".$oDoc->DocSubject; ?></a></td>
<td width="10%" align="center"><? if($oDoc->DrsSendDate!="0000-00-00 00:00:00"){ list($DocD,$DocT) = split(' ',$oDoc->DrsSendDate); echo " ".abbreDate2($DocD,'/')."<br>".a2th($DocT);} ?></td>
<td width="11%" align="center"><? if($oDoc->DrsDocDueDate!="0000-00-00"){ echo " ".abbreDate2($oDoc->DrsDocDueDate,'/'); }else{ echo "-"; } ?></td>
<td width="17%"><? echo $showname; ?></td>
<td width="10%" align="center"><? if($nomainps==1){ echo "-"; }else{ if($oRs->DsID=='7'){ echo "แจ้งการส่งผิด<br>"; } if($oRs->DrsDocReceiveDate!="0000-00-00 00:00:00"){ list($DocD2,$DocT2) = split(' ',$oRs->DrsDocReceiveDate); echo " ".abbreDate2($DocD2,'/')."<br>".a2th($DocT2);}}?></td>
<td width="10%"> </td></tr>
<? $i++; }
// }?>
</table>
</td></tr>
</table>
<input type="hidden" name="DocSubject" value="<? echo $DocSubject; ?>" >
<input type="hidden" name="DocNo" value="<? echo $DocNo; ?>" >
<input type="hidden" name="start" value="<? echo $start; ?>" >
<input type="hidden" name="end" value="<? echo $end; ?>" >
<input type="hidden" name="yearDoc" value="<? echo $yearDoc; ?>" >
<input type="hidden" name="DocTypeNoStart" value="<? echo $DocTypeNoStart; ?>" >
<input type="hidden" name="DocTypeNoEnd" value="<? echo $DocTypeNoEnd; ?>" >
<input type="hidden" name="selectPositionDeptID" value="<? echo $selectPositionDeptID; ?>" >
<input type="hidden" name="dlcid" value="<? echo $dlcid; ?>" >
<input type="hidden" name="print" value="พิมพ์" >
</form>
</td>
</tr>
</table>
</body>
</html>
<script>
function printDetailFollowDocDept(p,q){
FileName = "printRepFollowDocDeptDetail.php?DocID="+p+"&DrsID="+q;
var w=600;
var h=600;
strOption = "scrollbars=yes,left=300,top=100,width=" + w + ",height=" + h;
window.open(FileName,"",strOption);
}
function showDocex(){
document.ff.submit();
}
</script>
|