Viewing file: showSendDocToPs.php (18.16 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html>
<head>
<script language="javascript" src="../source/calendarDateInput.js"></script>
<script language="javascript">
function select_checkAll(){
if(document.getElementById("checkAll").checked==true){
iselect=document.getElementById("iselect").value;
for(i=1;i<=iselect;i++){
if(document.getElementById("mydept").value==i){
document.getElementById("select1["+i+"]").checked = false;
}else{
document.getElementById("select1["+i+"]").checked = true;
}
}
iselect2=document.getElementById("iselect2").value;
for(i=1;i<=iselect2;i++){
if(document.getElementById("mydept2").value==i){
document.getElementById("select2["+i+"]").checked = false;
}else{
document.getElementById("select2["+i+"]").checked = true;
}
}
iselect3=document.getElementById("iselect3").value;
for(i=1;i<=iselect3;i++){
if(document.getElementById("mydept3").value==i){
document.getElementById("select3["+i+"]").checked = false;
}else{
document.getElementById("select3["+i+"]").checked = true;
}
}
iselect4=document.getElementById("iselect4").value;
for(i=1;i<=iselect4;i++){
if(document.getElementById("mydept4").value==i){
document.getElementById("select4["+i+"]").checked = false;
}else{
document.getElementById("select4["+i+"]").checked = true;
}
}
iselect5=document.getElementById("iselect5").value;
for(i=1;i<=iselect5;i++){
if(document.getElementById("mydept5").value==i){
document.getElementById("select5["+i+"]").checked = false;
}else{
document.getElementById("select5["+i+"]").checked = true;
}
}
}else{
iselect=document.getElementById("iselect").value;
for(i=1;i<=iselect;i++){
document.getElementById("select1["+i+"]").checked = false;
}
iselect2=document.getElementById("iselect2").value;
for(i=1;i<=iselect2;i++){
document.getElementById("select2["+i+"]").checked = false;
}
iselect3=document.getElementById("iselect3").value;
for(i=1;i<=iselect3;i++){
document.getElementById("select3["+i+"]").checked = false;
}
iselect4=document.getElementById("iselect4").value;
for(i=1;i<=iselect4;i++){
document.getElementById("select4["+i+"]").checked = false;
}
iselect5=document.getElementById("iselect5").value;
for(i=1;i<=iselect5;i++){
document.getElementById("select5["+i+"]").checked = false;
}
}
return true;
}
function select_checkAll2(){
if(document.getElementById("checkAll").checked==true){
iselect=document.getElementById("iselect").value;
for(i=1;i<=iselect;i++){
if(document.getElementById("mydept").value==i){
document.getElementById("select1["+i+"]").checked = false;
}else{
if(document.getElementById("select1["+i+"]").value==""){
document.getElementById("select1["+i+"]").checked = false;
}else{
document.getElementById("select1["+i+"]").checked = true;
}
}
}
}else{
iselect=document.getElementById("iselect").value;
for(i=1;i<=iselect;i++){
document.getElementById("select1["+i+"]").checked = false;
}
}
return true;
}
function select_checkAllPs(){
if(document.getElementById("checkAllPs").checked==true){
iselectps=document.getElementById("iselectps").value;
for(i=1;i<=iselectps;i++){
document.getElementById("selectPs["+i+"]").checked = true;
}
}else{
iselectps=document.getElementById("iselectps").value;
for(i=1;i<=iselectps;i++){
document.getElementById("selectPs["+i+"]").checked = false;
}
}
}
function select_checkAllPs(){
if(document.getElementById("checkAllPs").checked==true){
iselectps=document.getElementById("iselectps").value;
for(i=1;i<=iselectps;i++){
document.getElementById("selectPs["+i+"]").checked = true;
}
}else{
iselectps=document.getElementById("iselectps").value;
for(i=1;i<=iselectps;i++){
document.getElementById("selectPs["+i+"]").checked = false;
}
}
}
</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%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_2"]; ?>" height=22>
<td align="left" colspan="3"> เลือกผู้รับหนังสือ</td>
</tr>
<tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_16"]; ?>">
<td height="22" valign="bottom" colspan="2"> <strong>ส่งให้หน่วยงานย่อย [สารบรรณย่อย]</strong></td>
<td width="7%" align="right"></td>
</tr>
<tr height=22 width="100%" align="center">
<td align="center" colspan="3">
<div style="overflow: auto; height: 120px; width: 100%;">
<? $resultsendall=SearchSendAll($oDlc->DlpID); ?>
<table bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_17"]; ?>" width="94%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr bgcolor="#F2F2F2"><td>
<input name="checkAll" id="checkAll" type="checkbox" value="1" <? if($checkAll=="1"){ echo "checked";}?> <? if(($resultsendall!="All" && $oSys->sendAllDeptUp!="Y") || ($resultsendall=="All" && $oSys->sendAllDeptDown!="Y")){ echo "onClick=\"return select_checkAll();\""; }else{ echo "onClick=\"return select_checkAll2();\""; } ?>>
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>">
ส่งให้สารบรรณของทุกหน่วยงานย่อย</font><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>" size="2">(ยกเว้นหน่วยงานย่อยของตนเอง)</font></td></tr>
<?
if(($resultsendall!="All" && $oSys->sendAllDeptUp!="Y") || ($resultsendall=="All" && $oSys->sendAllDeptDown!="Y")){
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$oDPt->SearchByShowselectdoc($oDlc->deptId);
$oDPt->GetRecord();
if($oDPt->deptParentId==0){
$oDPt2->RSmenuByDeptParent2($oDPt->deptParentId);
$iselect=1;
while($oDPt2->GetRecord()){
$pssend=ShowSendtoPs2($oDPt2->deptId);
if($pssend!=''){ ?>
<tr><td>
<input name="deptPs[<? echo $oDPt2->deptId; ?>]" id="select1[<? echo $iselect;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($deptPss[$oDPt2->deptId]!=$deptPs[$oDPt2->deptId]){ echo "checked";}?>>
<? if($oDlc->deptId==$oDPt2->deptId){ $mydept=$iselect; }?>
<?
$nextpssend=searchnextpssend($pssend,$oDPt2->deptId); if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
$oDlc4->SearchByKey($pssend); $oDlc4->GetRecord();
$oPS2->SearchByKey($oDlc4->personId); $oPS2->GetRecord();
echo "$oDPt2->deptName";
?>
<input name="deptPssend[<? echo $oDPt2->deptId; ?>]" type="hidden" value="<? echo $oDlc4->personId; ?>">
<?
//------my child-------
if($DlcdeptId==$oDPt2->deptId){
$oDPt3->RSmenuByDeptParent2($oDPt2->deptId);
$iselect2=1;
while($oDPt3->GetRecord()){
$pssend=ShowSendtoPs2($oDPt3->deptId);
if($pssend!=''){
?>
<tr><td>
<input name="deptPs[<? echo $oDPt3->deptId; ?>]" id="select2[<? echo $iselect2;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($deptPss[$oDPt3->deptId]!=$deptPs[$oDPt3->deptId]){ echo "checked";}?>>
<? if($oDlc->deptId==$oDPt3->deptId){ $mydept2=$iselect2; }?>
<? $nextpssend=searchnextpssend($pssend,$oDPt3->deptId);
if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0 ){
?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
$oDlc5->SearchByKey($pssend); $oDlc5->GetRecord();
$oPS2->SearchByKey($oDlc5->personId); $oPS2->GetRecord();
echo " <b>$oDPt3->deptName</b>";
// [".GetPrefix($oPS2->prefixId).$oPS2->fName." ".$oPS2->lName."]"; //echo "deptPs=".$pssend." deptPssend=".$oDlc4->personId;?>
<input name="deptPssend[<? echo $oDPt3->deptId; ?>]" type="hidden" value="<? echo $oDlc5->personId; ?>">
</td></tr>
<? $iselect2++; } } }
$iselect++;
} //if*/
} //while
}else{ //-----------have deptparent
$oDPt2->SearchByKey($oDPt->deptParentId);
$oDPt2->GetRecord();
$pssend=ShowSendtoPs2($oDPt2->deptId);
$iselect3=1;
if($pssend!=''){
?>
<tr><td>
<input name="deptPs[<? echo $oDPt2->deptId; ?>]" id="select3[<? echo $iselect3;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($deptPss[$oDPt2->deptId]!=$deptPs[$oDPt2->deptId]){ echo "checked";}?>>
<? if($oDlc->deptId==$oDPt2->deptId){ $mydept3=$iselect3; }?>
<? $nextpssend=searchnextpssend($pssend,$oDPt2->deptId); if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0 ){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
$oDlc4->SearchByKey($pssend); $oDlc4->GetRecord();
$oPS2->SearchByKey($oDlc4->personId); $oPS2->GetRecord();
echo "$oDPt2->deptName";
// [".GetPrefix($oPS2->prefixId).$oPS2->fName." ".$oPS2->lName."]"; //echo "deptPs=".$pssend." deptPssend=".$oDlc4->personId; ?>
<input name="deptPssend[<? echo $oDPt2->deptId; ?>]" type="hidden" value="<? echo $oDlc4->personId; ?>">
</td></tr>
<? $iselect3++;}
$oDPt3->RSmenuByDeptParent2($oDPt2->deptId);
$iselect4=1;
while($oDPt3->GetRecord()){
$pssend=ShowSendtoPs2($oDPt3->deptId);
if($pssend!=''){
?>
<tr><td>
<input name="deptPs[<? echo $oDPt3->deptId; ?>]" id="select4[<? echo $iselect4;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($deptPss[$oDPt3->deptId]!=$deptPs[$oDPt3->deptId]){ echo "checked";}?>>
<? if($oDlc->deptId==$oDPt3->deptId){ $mydept4=$iselect4; }?>
<? $nextpssend=searchnextpssend($pssend,$oDPt3->deptId); if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0 ){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
$oDlc4->SearchByKey($pssend); $oDlc4->GetRecord();
$oPS2->SearchByKey($oDlc4->personId); $oPS2->GetRecord();
echo " <b>$oDPt3->deptName</b>";
// [".GetPrefix($oPS2->prefixId).$oPS2->fName." ".$oPS2->lName."]"; //echo "deptPs=".$pssend." deptPssend=".$oDlc4->personId;?>
<input name="deptPssend[<? echo $oDPt3->deptId; ?>]" type="hidden" value="<? echo $oDlc4->personId; ?>">
</td></tr>
<?
if($oDPt3->deptId==$oDPt->deptId){
$oDPt4->RSmenuByDeptParent2($oDPt3->deptId);
$iselect5=1;
while($oDPt4->GetRecord()){
$pssend=ShowSendtoPs2($oDPt4->deptId);
if($pssend!=''){
?>
<tr><td>
<input name="deptPs[<? echo $oDPt4->deptId; ?>]" id="select5[<? echo $iselect5;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($deptPss[$oDPt4->deptId]!=$deptPs[$oDPt4->deptId]){ echo "checked";}?>>
<? if($oDlc->deptId==$oDPt4->deptId){ $mydept5=$iselect5; }?>
<? $nextpssend=searchnextpssend($pssend,$oDPt4->deptId); if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0 ){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
$oDlc4->SearchByKey($pssend); $oDlc4->GetRecord();
$oPS2->SearchByKey($oDlc4->personId); $oPS2->GetRecord();
echo " $oDPt4->deptName";
// [".GetPrefix($oPS2->prefixId).$oPS2->fName." ".$oPS2->lName."]"; //echo "deptPs=".$pssend." deptPssend=".$oDlc4->personId; ?>
<input name="deptPssend[<? echo $oDPt4->deptId; ?>]" type="hidden" value="<? echo $oDlc4->personId; ?>">
</td></tr>
<?
$iselect5++; }
}
}
$iselect4++; }
}
}
?>
<input name="iselect" type="hidden" id="iselect" value="<? echo $iselect-1; ?>">
<input name="iselect2" type="hidden" id="iselect2" value="<? echo $iselect2-1; ?>">
<input name="iselect3" type="hidden" id="iselect3" value="<? echo $iselect3-1; ?>">
<input name="iselect4" type="hidden" id="iselect4" value="<? echo $iselect4-1; ?>">
<input name="iselect5" type="hidden" id="iselect5" value="<? echo $iselect5-1; ?>">
<input name="mydept" type="hidden" id="mydept" value="<? echo $mydept; ?>">
<input name="mydept2" type="hidden" id="mydept2" value="<? echo $mydept2; ?>">
<input name="mydept3" type="hidden" id="mydept3" value="<? echo $mydept3; ?>">
<input name="mydept4" type="hidden" id="mydept4" value="<? echo $mydept4; ?>">
<input name="mydept5" type="hidden" id="mydept5" value="<? echo $mydept5; ?>">
<?
}else{ //send all
$oDPt->RSMainDepartment(); //deptParentId=0
$iselect=1;
while($oDPt->GetRecord()){
$pssend=ShowSendtoPs2($oDPt->deptId);
?>
<tr><td>
<input name="deptPs[<? echo $oDPt->deptId; ?>]" id="select1[<? echo $iselect;?>]" type="checkbox" value="<? echo $pssend; ?>" <? if($pssend==''){ echo 'disabled'; }?>>
<? if($oDlc->deptId==$oDPt->deptId){ $mydept=$iselect; }?>
<? $nextpssend=searchnextpssend($pssend,$oDPt->deptId); if($oRs9->searchHaveSendDocToPs($pssend,$nextpssend,$searchDoc) > 0 ){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<?
echo $oDPt->deptName;
?>
</td></tr>
<?
$oDPt2->RSmenuByDeptParent2($oDPt->deptId);
while($oDPt2->GetRecord()){
//echo '<br> '.$oDPt2->deptName.'<br>';
$iselect++;
showDeptForSend($oDPt2->deptId,$iselect,$oDlc->deptId,$searchDoc);
//$iselect++;
}
$iselect++;
}
?>
<input name="iselect" type="hidden" id="iselect" value="<? echo $iselect-1; ?>">
<input name="mydept" type="hidden" id="mydept" value="<? echo $mydept; ?>">
<input name="maindept" type="hidden" value="1">
<?
} //case send all
?>
</table>
<? //--/////////////////////////////////////////////////////////////////////////////////////////////// ?>
</div>
</td>
</tr>
<tr height=22>
<td height=22 bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_16"]; ?>" colspan="3"> <strong>ส่งให้บุคลากรที่อยู่ในหน่วยงานของท่านเป็นหลัก</strong></td>
</tr>
<tr><td colspan="3">
<div style="overflow: auto; height: 120px; width: 100%;">
<table bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_17"]; ?>" width="94%" border=0>
<tr bgcolor="#F2F2F2"><td colspan="2">
<input name="checkAllPs" id="checkAllPs" type="checkbox" value="1" <? if($checkAllPs=="1"){ echo "checked";}?> onClick="return select_checkAllPs();">
<font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>">
ส่งให้ทุกคนในหน่วยงานย่อย</font></td></tr>
<input name="deptId" type="hidden" value="<? echo $DlcdeptId; ?>">
<input name="mainPs" type="hidden" value="0" id="mainPs0" onClick="radioSelectType('0')">
<? $oPS2->SearchByDeptIdadminId($DlcdeptId);
$iselectps=1;
while($oPS2->GetRecord()){
?>
<tr>
<td width="10%" valign="top">
<input name="mainPs" type="radio" value="<? echo $oPS2->personId; ?>" id="mainPs<? echo $oPS2->personId; ?>" onClick="radioSelectType('<? echo $oPS2->personId; ?>')" <? if($mainPsselect==$oPS2->personId){ echo "checked"; ?><? }?>></td>
<td width="90%" valign="top"><input name="Ps[<? echo $oPS2->personId; ?>]" type="checkbox" id="selectPs[<? echo $iselectps;?>]" value="1" <? if(($Pss[$oPS2->personId]!=$Ps[$oPS2->personId]) || ($mainPsselect==$oPS2->personId) ){ echo "checked";}?>>
<? $oRs10->searchHaveSendDocps($oPS2->personId,$searchDoc); if($oRs10->GetRecord()==1){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<? echo GetPrefix($oPS2->prefixId).$oPS2->fName." ".$oPS2->lName; ?></td>
</tr>
<? $iselectps++; } ?>
<input name="iselectps" type="hidden" id="iselectps" value="<? echo $iselectps-1; ?>">
</table>
</div>
</td></tr>
<? //////////////////////////////////////////////////////////////////////////////////////////////// ?>
<? $oPSd->SearchBydeptId($DlcdeptId);
$countPSd=$oPSd->NumRow();
if($countPSd!="" && $countPSd!="0"){
?>
<tr height=22>
<td height=22 bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_16"]; ?>" colspan="3"> <strong>ส่งให้บุคลากรที่อยู่ในหน่วยงานของท่านเป็นงานรอง</strong></td>
</tr>
<tr><td colspan="3">
<div style="overflow: auto; height: 120px; width: 100%;">
<table bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_17"]; ?>" width="94%" >
<?
while($oPSd->GetRecord()){
$oPS->SearchByKey($oPSd->personId);
$oPS->GetRecord();
?>
<tr>
<td width="10%" valign="top">
<input name="mainPs" type="radio" value="<? echo $oPSd->personId; ?>" id="mainPs<? echo $oPSd->personId; ?>" onClick="radioSelectType('<? echo $oPSd->personId; ?>')" <? if($mainPsselect==$oPSd->personId){ echo "checked"; ?><? }?>>
</td>
<td valign="top">
<? //echo "[".$oPSd->personId."]"; ?><input name="Ps[<? echo $oPSd->personId; ?>]" type="checkbox" value="1" <? if(($Pss[$oPSd->personId]!=$Ps[$oPSd->personId]) || ($mainPsselect==$oPSd->personId) ){ echo "checked";}?>>
<? $oRs10->searchHaveSendDocps($oPSd->personId,$searchDoc); if($oRs10->GetRecord()==1){?><img src="../picture/yes.gif" border="0" alt="หมายถึงหน่วยงานย่อยหรือบุคลากรผู้นั้น เคยได้รับหนังสือนี้แล้ว"> <? } ?>
<? echo GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName; ?></td>
</tr>
<? } ?>
</table>
</div>
</td></tr><? } ?>
</table>
</body>
</html>
|