!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/mistk/eoffice/admin/   drwxr-xr-x
Free 50.91 GB of 127.8 GB (39.84%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     mobliedetail.php (63.33 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
$fn 
= (! isset($_REQUEST['fn'])? "" $_REQUEST['fn']);

if(
$fn=='loginmoblie'){ 
include_once(
"../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../class/clsUmuser.php";

$Username = (! isset($_REQUEST['Username'])? "" $_REQUEST['Username']);
$Password = (! isset($_REQUEST['Password'])? "" $_REQUEST['Password']);
//====== Test Case For Apple ===================
if($Username == "demosaraban" && $Password == "DEMOSARABAN"){
    
$Username "namphon";
    
$Password "57namphon7";
}
//==============================================
$oUm = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_UMS'], $GLOBALS['DBUSER_UMS'], $GLOBALS['DBPASS_UMS']);
$oUus = new umuser($oUm);

        
$oUus->SearchByLoginMoblie($Username$Password);
        if (
$oUus->GetRecord()) {
            echo 
$oUus->UsPsCode;
        }else{
            echo 
0;
        }
}else if(
$fn=='user_detail'){
include_once(
"../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../class/clsPerson.php";
include_once 
"../class/clsPersonPE.php";

$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);

$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oCc = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EPERSON'], $GLOBALS['DBUSER_EPERSON'], $GLOBALS['DBPASS_EPERSON']);

$oPSp = new PersonPE($oCc);
$oPS = new person($oC);

        
$oPS->SearchByPersonIdNamefNamePrefix($personId);
        if (
$oPS->GetRecord()) {
            
$prefixName=$oPSp->SearchPrefixName($oPS->prefixId);
            echo 
iconv('TIS-620''UTF-8',$prefixName).','.iconv('TIS-620''UTF-8',$oPS->fName).','.iconv('TIS-620''UTF-8',$oPS->lName);
        }


}else if(
$fn=='detail_work_moblie'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"../class/clsUmuser.php";    
    include_once 
"../class/clsUmUserGroup.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../link/keyThai.php";
    include_once 
"../class/clsDocForSign.php";
    include_once 
"../class/clsSendReceive.php";
    
    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);    
    
    
$oUs = new umuser($oC);
    
$oUg = new umusergroup($oC);
    
$oRs = new DocReceiveSend($oC);
    
$oRs2 = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc2 = new Documents($oC);
    
$oDoc3 = new Documents($oC);
    
$oDP = new Department($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp2 = new docLinePosition($oC);
    
$oDlp3 = new docLinePosition($oC);
    
$oDlp4 = new docLinePosition($oC);
    
$oDlc = new docLineConfig($oC);
    
$oDlc1 = new docLineConfig($oC);
    
$oDlc2 = new docLineConfig($oC);
    
$oDlc3 = new docLineConfig($oC);
    
$oDlc4 = new docLineConfig($oC);
    
$oDlc5 = new docLineConfig($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$Maxgroup=$oDP->SearchMaxDocGroup();
    
$oDfs = new DocForSign($oC);
    
$oTsr = new sendreceive($oC);

    
$oUs->SearchUsIDByUsPsCode($personId,$GLOBALS['DBNAME_UMS']);
    
$oUs->GetRecord();   //---find  -> $oUs->UsID;

    
$list='<?xml version="1.0" encoding="UTF-8" ?><work>';
    
$oUg->RSgroupByUgUsIDMobile($oUs->UsID,$GLOBALS['DBNAME_UMS'],'UgGpID');
    while(
$oUg->GetRecord()){  
            
//------------------------------staff sarabun----------------------------------------------------------------
            
            
if($oUg->UgGpID==SearchGroupSarabunStaff()){             
                
$oDlp->SearchByGpID(SearchGroupSarabunStaff());
                while(
$oDlp->GetRecord()){
                        
$oDlc->SearchByPsPositionDlpIDActiveYUnion($personId,$oDlp->DlpID,$Maxgroup);
                        while(
$oDlc->GetRecord()){  
                                    
$list.="<workgroup>";
                                    
$oDP->SearchByKey($oDlc->deptId);
                                    
$oDP->GetRecord(); 
            
                                    if(
$oDlp->DlpPID!="0"){ 
                                        
$DlcPS2=$oDlc3->SearchDlc2($oDlc->DlcSeq,$oDlp->DlpPID,$oDlc->deptId);
                                     }else{
                                        
$DlcPS2=$oDlc3->SearchDlc2($oDlc->DlcSeq,$oDlp->DlpPID,$oDlc->deptId);
                                    }
                                    
$list.="<positionname>".iconv('TIS-620''UTF-8',$oDlp->DlpName)."(".iconv('TIS-620''UTF-8',$oDP->deptName).")</positionname>";
                                    
$list.="<dlcid> ".$oDlc->DlcID." </dlcid>";
                                    
$list.="<mainworklist>";
                                    
                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>receivedoc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือเข้า/ลงรับ</worklisttypename>";
                                    
$i=0;
                                    
$i=$oDoc->SearchCountDocIDByDlcIDDocGroupPSDlcID2DsID0DrsSendDate($oDlc->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sendBack_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือแจ้งการส่งผิด</worklisttypename>";
                                    
$j=0;
                                    
$j=$oRs->SearchCountDrsIDByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($oDlc->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$j."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";
                                    
                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>send_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือลงนามแล้วรอส่ง</worklisttypename>";
                                    
$k=0;
                                    
$k=$oDoc3->SearchCountDocIDByDlcIDDocGroupPSDlcID2DsID3DrsSendDateDrsSEndnotY2($oDlc->DlcID,$Maxgroup,$DlcPS2,$oDlc->DlcID);
                                    
$list.="<worklistamount>".$k."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>statusDocforSign</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือเสนอลงนามแล้วรอรับหนังสือ</worklisttypename>";
                                    
$m=0;
                                    
$m=$oDfs->SearchDlcIDstatusNoGetNumCaseSign($oDlc->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$m."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>statusDocforSignEdit</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือเสนอลงนาม(ยังไม่ลงนาม)มีการแจ้งแก้ไข</worklisttypename>";
                                    
$p=0;
                                    
$p=$oDfs->SearchDlcIDstatusNoGetNumCaseEdit($oDlc->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$p."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";
                                    
                                                                    
                                    if(
SearchSendAll_receive($oDlc->DlpID)=="All"){
                                    
//----------------------------------
                                            
$list.="<worklist>";
                                            
$list.="<worklisttype>receiveEdoc</worklisttype>";
                                            
$list.="<worklisttypename>รายการหนังสือเข้าอิเล็กทรอนิกส์</worklisttypename>";
                                            
$n=0;    
                                            
$n$oTsr->SearchCountBytsr_status(r1);
                                            
$list.="<worklistamount>".$n."</worklistamount>";
                                            
$list.="<worklistunit>ฉบับ</worklistunit>";
                                            
$list.="</worklist>";
                                    }
                                    
$list.="</mainworklist>";
                                    
$list.="</workgroup>";
                        }
                }                
            } 
//--umusergroup

            //------------------------------head sarabun----------------------------------------------------------------
            
if($oUg->UgGpID==SearchGroupSarabunHead()){
                
$oDlp2->SearchByGpID(SearchGroupSarabunHead());
                while(
$oDlp2->GetRecord()){
                        
$group2=0;
                        
$oDlc2->SearchByPsPositionDlpIDActiveY($personId,$oDlp2->DlpID,$Maxgroup);
                        while(
$oDlc2->GetRecord()){
                                    
$list.="<workgroup>";
                                    
$oDP->SearchByKey($oDlc2->deptId);
                                    
$oDP->GetRecord(); 
                                    
                                    if(
$oDlp2->DlpPID!="0"){ 
                                            
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp2->DlpPID,$oDlc2->deptId);
                                    }else{
                                            
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp2->DlpPID,$oDlc2->deptId);
                                    }

                                    
$list.="<positionname>".iconv('TIS-620''UTF-8',$oDlp2->DlpName)."(".iconv('TIS-620''UTF-8',$oDP->deptName).")</positionname>";
                                    
$list.="<dlcid> ".$oDlc2->DlcID." </dlcid>";
                                    
$list.="<mainworklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sign_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือที่ยังไม่ได้ลงนาม</worklisttypename>";
                                    
$i=0;
                                    
$i $oDoc->SearchCountDocIDByDocGroupDsID2DocIDDlcIDDrsReceiveDlcID2Status2($Maxgroup,$oDlc2->DlcID,$DlcPS2);
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sendBack_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือแจ้งการส่งผิด</worklisttypename>";
                                    
$j=0;
                                    
$j $oRs->SearchCountDrsIDByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($oDlc2->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$j."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>send_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือลงนามแล้วรอส่ง</worklisttypename>";
                                    
$k=0;    
                                    if(
$oDlp2->DlpPID=="0"){  $a=2$b=1;   }else{  $a=3$b=2;  }
                                    
$DlcSeq=$oDlc2->DlcSeq-$a;   
                                    
$DlcSeq2=$oDlc2->DlcSeq-$b
                                    
$oDlc4->SearchByNextDlcID($DlcSeq,$oDlc2->docGroup,$oDlc2->deptId); $oDlc4->GetRecord();   $DLCID2=$oDlc4->DlcID;
                                    
$oDlc5->SearchByNextDlcID($DlcSeq2,$oDlc2->docGroup,$oDlc2->deptId); $oDlc5->GetRecord();  $DlcPS22=$oDlc5->DlcID;
                                    
$k $oDoc3->SearchCountSendDocFirstPage($DLCID2,$Maxgroup,$DlcPS22);
                                    
$list.="<worklistamount>".$k."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
$list.="</mainworklist>";
                                    
$list.="</workgroup>";
                        }
                }
            } 
//--umusergroup
            
            //------------------------------head in dept----------------------------------------------------------------
            
if($oUg->UgGpID==SearchGroupHeadDept()){
                
$oDlp3->SearchByGpID(SearchGroupHeadDept());
                while(
$oDlp3->GetRecord()){
                        
$group3=0;
                        
$oDlc2->SearchByPsPositionDlpIDActiveY($personId,$oDlp3->DlpID,$Maxgroup);
                        while(
$oDlc2->GetRecord()){
                                    
$list.="<workgroup>";
                                    
$oDP->SearchByKey($oDlc2->deptId);
                                    
$oDP->GetRecord(); 
                                    
                                    if(
$oDlp3->DlpPID!="0"){ 
                                            
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp3->DlpPID,$oDlc2->deptId);
                                    }else{
                                            
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp3->DlpPID,$oDlc2->deptId);
                                    }    

                                    
$list.="<positionname>".iconv('TIS-620''UTF-8',$oDlp3->DlpName)."(".iconv('TIS-620''UTF-8',$oDP->deptName).")</positionname>";
                                    
$list.="<dlcid> ".$oDlc2->DlcID." </dlcid>";
                                    
$list.="<mainworklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sign_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือที่ยังไม่ได้ลงนาม</worklisttypename>";
                                    
$i=0;
                                    
$i =$oDoc->SearchCountDocIDByDocGroupDsID2DocIDDlcIDDrsReceiveDlcID2Status2($Maxgroup,$oDlc2->DlcID,$DlcPS2);
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sendBack_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือแจ้งการส่งผิด</worklisttypename>";
                                    
$j=0;
                                    
$j =$oRs->SearchCountDrsIDByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($oDlc2->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$j."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>send_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือลงนามแล้วรอส่ง</worklisttypename>";
                                    
$k=0;    
                                    
$DlcSeq=$oDlc2->DlcSeq-$a;   
                                    
$DlcSeq2=$oDlc2->DlcSeq-$b
                                    
$oDlc4->SearchByNextDlcID($DlcSeq,$oDlc2->docGroup,$oDlc2->deptId); $oDlc4->GetRecord();   $DLCID2=$oDlc4->DlcID;
                                    
$oDlc5->SearchByNextDlcID($DlcSeq2,$oDlc2->docGroup,$oDlc2->deptId); $oDlc5->GetRecord();  $DlcPS22=$oDlc5->DlcID;
                                    
$k $oDoc3->SearchCountSendDocFirstPage($DLCID2,$Maxgroup,$DlcPS22);
                                    
$list.="<worklistamount>".$k."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";
                                    
$list.="</mainworklist>";
                                    
$list.="</workgroup>";

                        }
                }

            } 
//--umusergroup
            
            //------------------------------header----------------------------------------------------------------
            
if($oUg->UgGpID==SearchGroupBoss()){  
                
$oDlp4->SearchByGpID(SearchGroupBoss());
                while(
$oDlp4->GetRecord()){ 
                        
$group4=0
                        
$oDlc2->SearchByPsPositionDlpIDActiveY($personId,$oDlp4->DlpID,$Maxgroup);
                        while(
$oDlc2->GetRecord()){
                                    
$list.="<workgroup>";                    

                                    
$oDP->SearchByKey($oDlc2->deptId);
                                    
$oDP->GetRecord(); 

                                            if(
$oDlp4->DlpPID!="0"){ 
                                                
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp4->DlpPID,$oDlc2->deptId);
                                            }else{
                                                
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp4->DlpPID,$oDlc2->deptId);
                                            }

                                    
$list.="<positionname>".iconv('TIS-620''UTF-8',$oDlp4->DlpName)."(".iconv('TIS-620''UTF-8',$oDP->deptName).")</positionname>";
                                    
$list.="<dlcid> ".$oDlc2->DlcID." </dlcid>";
                                    
$list.="<mainworklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sign_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือที่ยังไม่ได้ลงนาม</worklisttypename>";
                                    
$i=0;
                                    
$i =$oDoc->SearchCountDocIDByDocGroupDsID2DocIDDlcIDDrsReceiveDlcID2Status2($Maxgroup,$oDlc2->DlcID,$DlcPS2);
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sendBack_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือแจ้งการส่งผิด</worklisttypename>";
                                    
$j=0;
                                    
$j =$oRs->SearchCountDrsIDByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($oDlc2->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$j."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>send_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือลงนามแล้วรอส่ง</worklisttypename>";
                                    
$k=0;    
                                    
$DlcSeq=$oDlc2->DlcSeq-$a;   
                                    
$DlcSeq2=$oDlc2->DlcSeq-$b
                                    
$oDlc4->SearchByNextDlcID($DlcSeq,$oDlc2->docGroup,$oDlc2->deptId); $oDlc4->GetRecord();   $DLCID2=$oDlc4->DlcID;
                                    
$oDlc5->SearchByNextDlcID($DlcSeq2,$oDlc2->docGroup,$oDlc2->deptId); $oDlc5->GetRecord();  $DlcPS22=$oDlc5->DlcID;
                                    
$k $oDoc3->SearchCountSendDocFirstPage($DLCID2,$Maxgroup,$DlcPS22);
                                    
$list.="<worklistamount>".$k."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";
                                    
$list.="</mainworklist>";
                                    
$list.="</workgroup>";

                        }
                }
            } 
//--umusergroup
            
                //------------------------------head----------------------------------------------------------------
            
if($oUg->UgGpID==SearchGroupBossSecond()){
                
$oDlp3->SearchByGpID(SearchGroupBossSecond());
                while(
$oDlp3->GetRecord()){ 
                        
$group5=0;
                        
$oDlc2->SearchByPsPositionDlpIDActiveY($personId,$oDlp3->DlpID,$Maxgroup);
                        while(
$oDlc2->GetRecord()){
                                    
$list.="<workgroup>";        

                                    
$oDP->SearchByKey($oDlc2->deptId);
                                    
$oDP->GetRecord(); 
                                    

                                            if(
$oDlp3->DlpPID!="0"){ 
                                                
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp3->DlpPID,$oDlc2->deptId);
                                            }else{
                                                
$DlcPS2=$oDlc3->SearchDlc2($oDlc2->DlcSeq,$oDlp3->DlpPID,$oDlc2->deptId);
                                            }

                                    
$list.="<positionname>".iconv('TIS-620''UTF-8',$oDlp3->DlpName)."(".iconv('TIS-620''UTF-8',$oDP->deptName).")</positionname>";
                                    
$list.="<dlcid> ".$oDlc2->DlcID." </dlcid>";
                                    
$list.="<mainworklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sign_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือที่ยังไม่ได้ลงนาม</worklisttypename>";
                                    
$i=0;

                                        if(
$oDlp3->DlpPID!="0"){ 
                                            
$i$oDoc->SearchCountDocIDByDocGroupDsID2DocIDDlcIDDrsReceiveDlcID2StatusR($Maxgroup,$oDlc2->DlcID,$DlcPS2);
                                        }else{  
                                            
$i$oDoc->SearchCountDocIDByDocGroupDsID2DocIDDlcIDDrsReceiveDlcID2Status2($Maxgroup,$oDlc2->DlcID,$DlcPS2);
                                        }    
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>sendBack_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือแจ้งการส่งผิด</worklisttypename>";
                                    
$j=0;
                                    
$j =$oRs->SearchCountDrsIDByDlcIDDocGroupDrsSendBackDrsSendBackDlcID($oDlc2->DlcID,$Maxgroup,$DlcPS2);
                                    
$list.="<worklistamount>".$j."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>send_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือลงนามแล้วรอส่ง</worklisttypename>";
                                    
$k=0;    
                                    
$DlcSeq=$oDlc2->DlcSeq-$a;   
                                    
$DlcSeq2=$oDlc2->DlcSeq-$b
                                    
$oDlc4->SearchByNextDlcID($DlcSeq,$oDlc2->docGroup,$oDlc2->deptId); $oDlc4->GetRecord();   $DLCID2=$oDlc4->DlcID;
                                    
$oDlc5->SearchByNextDlcID($DlcSeq2,$oDlc2->docGroup,$oDlc2->deptId); $oDlc5->GetRecord();  $DlcPS22=$oDlc5->DlcID;
                                    
$k $oDoc3->SearchCountSendDocFirstPage($DLCID2,$Maxgroup,$DlcPS22);
                                    
$list.="<worklistamount>".$k."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                                    
$list.="</mainworklist>";
                                    
$list.="</workgroup>";

                        }
                }

            } 
//--umusergroup

            //-------------------------------person----------------------------------------------------------------------
            
if($oUg->UgGpID==SearchGroupUsers()){
                    
$list.="<workgroup>";    
                    
$list.="<positionname>ผู้ใช้ทั่วไป</positionname>";
                    
$list.="<dlcid> ".'0'." </dlcid>";
                    
$list.="<mainworklist>";
                    
$i=0;
                    
$i $oRs2->SearchCountBypersonIdDocGroupDsID0($personId,$Maxgroup); 
                                    
//----------------------------------
                                    
$list.="<worklist>";
                                    
$list.="<worklisttype>entry_doc</worklisttype>";
                                    
$list.="<worklisttypename>รายการหนังสือเข้าที่ยังไม่ได้เปิดอ่าน</worklisttypename>";
                                    
$list.="<worklistamount>".$i."</worklistamount>";
                                    
$list.="<worklistunit>ฉบับ</worklistunit>";
                                    
$list.="</worklist>";

                    
$list.="</mainworklist>";
                    
$list.="</workgroup>";
            } 

    } 
//end while umusergroup
    
$list.='</work>';
    echo 
$list;

}else if(
$fn=='receivedoc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);
    
    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"../class/clsDepartment.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"funct.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
    
$oDP = new Department($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlc3 = new DocLineConfig($oC);
    
$oDlc4 = new DocLineConfig($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDoc = new Documents($oC);
    
$oDoc5 = new Documents($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();
        
$deptcenter=checkSarabunMain($oDlc->DlpID);  //$deptcenter=1
        
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);

                    if(
$oDlp1->GsarabunHead=="Y" || $oDlp1->GheadDept=="Y" || $oDlp1->Gboss=="Y" || $oDlp1->Gboss2=="Y"){ 
                            
$DlcSeq=$oDlc->DlcSeq-$a;   
                            
$DlcSeq2=$oDlc->DlcSeq-$b
                            
$oDlc3->SearchByNextDlcID($DlcSeq,$oDlc->docGroup,$oDlc->deptId); $oDlc3->GetRecord();   $searchDLCID=$oDlc3->DlcID;
                            
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $searchDlcPS2=$oDlc4->DlcID;    
                    }else{
                        
$searchDLCID=$dlcid;
                        
$searchDlcPS2=$DlcPS2;
                    }
            
                        
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';
                        
$oDoc->SearchDetailReceiveMoblie($searchDLCID,$MaxDocGroup,$searchDlcPS2);
                        while(
$oDoc->GetRecord()){ 
                            
$DocFrom='';
                            
$DocSubject='';
                            
//echo $oDoc->DocID.'<br>';
                            
$list.='<booklist>';
                            
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oDoc->DocNo).'</DocNo>';
                            
$list.='<DocDate>'.iconv('TIS-620''UTF-8',abbreDateMoblie($oDoc->DocDate)).'</DocDate>';


                            if(
$oDoc->DtID=="1" || $oDoc->DtID=="2" || $oDoc->DtID=="14"){
                                                
$DocFrom=$oDoc->DocFrom."<br>";
                            }else{
                                        if(
$oDoc->DocPID=="0"){
                                                
$oDlc2->SearchByKey($oDoc->DlcID); $oDlc2->GetRecord();
                                                
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                        }else{
                                                
$oDoc5->SearchByKey($oDoc->DocPID); $oDoc5->GetRecord();
                                                
$oDlc2->SearchByKey($oDoc5->DlcID); $oDlc2->GetRecord();
                                                
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                        }
                                                
$DocFrom=$oDoc->DocFrom."(".$oDlp->DlpName.")";
                            }    
                            
$list.='<deptName>'.iconv('TIS-620''UTF-8',$oDoc->DocFrom).'</deptName>';
                            if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                            
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                            
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oDoc->DrsReceiveDate)).'</DrsReceiveDate>';

                            
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                            
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                            
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';
                            
$list.='<DrsID>'.iconv('TIS-620''UTF-8',$oDoc->DrsID).'</DrsID>';                            
                            
$list.='</booklist>';
                        }
                        
$list.='</book>';

    echo 
$list;
}else if(
$fn=='entry_doc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc4 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';
                   
$oRs->SearchBypersonIdDrsDeleteMoblie($personId);                 
                  while(
$oRs->GetRecord()){ 
                        
$oDoc->SearchByKey($oRs->DocID); $oDoc->GetRecord();
                        
$list.='<booklist>';
                        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oDoc->DocNo).'</DocNo>';

                          if(
$oDoc->DtID=="1" || $oDoc->DtID=="2" || $oDoc->DtID=="14"){
                                            
$list.='<deptName>'.iconv('TIS-620''UTF-8',$oDoc->DocFrom).'</deptName>';
                          }else{
                                if(
$oDoc->DocPID=="0"){
                                        
$oDlc2->SearchByKey($oDoc->DlcID); $oDlc2->GetRecord();
                                        
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                        
$DocFrom=$oDoc->DocFrom."(".$oDlp->DlpName.")";
                                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$DocFrom).'</deptName>';
                                }else{
                                        
$oDoc4->SearchByKey($oDoc->DocPID); $oDoc4->GetRecord();
                                        
$oDlc2->SearchByKey($oDoc4->DlcID); $oDlc2->GetRecord();
                                        
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                        
$DocFrom=$oDoc->DocFrom."(".$oDlp->DlpName.")";
                                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$DocFrom).'</deptName>';
                                }
                            }

                        
                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oRs->DrsReceiveDate)).'</DrsReceiveDate>';
                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';
                        
$list.='<DrsID>'.iconv('TIS-620''UTF-8',$oRs->DrsID).'</DrsID>';                            
                        
$list.='</booklist>';
                        
                }
                
$list.='</book>';
    echo 
$list;    
}else if(
$fn=='sign_doc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc4 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDP = new Department($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();


                if(
$oDlp1->DlpPID!="0"){   
                                
$DlcPS2=$dlcid;
                                
$buddy=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                                
$oDoc->SearchDetailSignMoblie($MaxDocGroup,$dlcid,$DlcPS2,$buddy);
                }else{
                                
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                                
$oDoc->SearchDetailSignMoblie2($MaxDocGroup,$dlcid,$DlcPS2);
                }

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oDoc->GetRecord()){ 
                        
$list.='<booklist>';
                        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oDoc->DocNo).'</DocNo>';
                        
$list.='<DocDate>'.iconv('TIS-620''UTF-8',abbreDateMoblie($oDoc->DocDate)).'</DocDate>';


                            if(
$oDoc->DtID=="1" || $oDoc->DtID=="2" || $oDoc->DtID=="14"){
                                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$oDoc->DocFrom).'</deptName>';
                            }else{
                                if(
$oDoc->DocPID=="0"){
                                        
$oDlc2->SearchByKey($oDoc->DlcID); $oDlc2->GetRecord();
                                        
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();                        
                                }else{
                                        
$oD_DlcID=$oDoc4->SearchDlcID($oDoc->DocPID); 
                                        
$oDlc2->SearchByKey($oD_DlcID); $oDlc2->GetRecord();
                                        
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                    
                                }        
                                        
$DocFrom=$oDoc->DocFrom."(".$oDlp->DlpName.")";
                                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$DocFrom).'</deptName>';
                            }

                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';
                        
$list.='<DrsID>'.iconv('TIS-620''UTF-8',$oDoc->DrsID).'</DrsID>';                            
                        
$list.='</booklist>';
                        
                }
                
$list.='</book>';
    echo 
$list;    
}else if(
$fn=='sendBack_doc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"../class/clsPerson.php";
    include_once 
"getPrefix.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oRs4 = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc6 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDP = new Department($oC);
    
$oPS = new person($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();


                if(
$oDlp1->DlpPID!="0"){ 
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                 }else{
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                }

                
$oRs->SearchDetailSendBackDocMoblie($dlcid,$MaxDocGroup,$DlcPS2);

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oRs->GetRecord()){ 
                        
$oDoc6->SearchDocID($oRs->DocID);
                        
$oDoc6->GetRecord();
                        if(
$oDoc6->DocPID=="0" || $oDoc6->DocPID==""){  $searchDoc=$oDoc6->DocID; }else{ $searchDoc=$oDoc6->DocPID; }
                                            
                        
$oDoc->SearchByKey($searchDoc);
                        
$oDoc->GetRecord();
                        
$oRs4->SearchByDocIDDsID3($searchDoc);
                        
$oRs4->GetRecord();

                        
$list.='<booklist>';
                        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oDoc->DocNo).'</DocNo>';
                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';

                        if(
$oRs->DlcID==0){    
                                            
$oPS->SearchByKey($oRs->personId); $oPS->GetRecord();  
                                            
$sendername=GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName
                                            
$list.='<personSendBack>'.iconv('TIS-620''UTF-8',$sendername).'</personSendBack>';
                                            
$list.='<DrsSendBack>'.iconv('TIS-620''UTF-8',$oRs->DrsSendBack).'</DrsSendBack>';
                                            
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oRs->DrsReceiveDate)).'</DrsReceiveDate>';                                    
                        }else{
                                        
$oDlc2->SearchByKey($oRs->DlcID); $oDlc2->GetRecord(); 
                                        
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                                        
$oPS->SearchByKey($oRs->DrsPsIDCreate); $oPS->GetRecord();  
                                        
$sendername=GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName."(".$oDlp->DlpName.")"
                                        
$list.='<personSendBack>'.iconv('TIS-620''UTF-8',$sendername).'</personSendBack>';
                                        
$list.='<DrsSendBack>'.iconv('TIS-620''UTF-8',$oRs->DrsSendBack).'</DrsSendBack>';
                                        
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oRs->DrsReceiveDate)).'</DrsReceiveDate>';
                        }

                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';
                        
$list.='<DrsID>'.iconv('TIS-620''UTF-8',$oRs4->DrsID).'</DrsID>';                            
                        
$list.='</booklist>';
                        
                }
                
$list.='</book>';
    echo 
$list;    
}else if(
$fn=='send_doc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc4 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlc3 = new DocLineConfig($oC);
    
$oDlc4 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDP = new Department($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();

                   if(
$oDlp1->GsarabunHead=="Y" || $oDlp1->GheadDept=="Y" || $oDlp1->Gboss=="Y" || $oDlp1->Gboss2=="Y"){ 
                                if(
$oDlp1->DlpPID=="0"){  $a=2$b=1;   }else{  $a=3$b=2;  }
                                
$DlcSeq=$oDlc->DlcSeq-$a;   
                                
$DlcSeq2=$oDlc->DlcSeq-$b
                                
$oDlc3->SearchByNextDlcID($DlcSeq,$oDlc->docGroup,$oDlc->deptId); $oDlc3->GetRecord();   $DLCID2=$oDlc3->DlcID;
                                
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $DlcPS22=$oDlc4->DlcID;
                                
$oDoc->SearchSendDocMoblie($DLCID2,$MaxDocGroup,$DlcPS22,$dlcid);
                }else{
                                
$oDoc->SearchSendDocMoblie2($dlcid,$MaxDocGroup,$DlcPS2,$dlcid);                                
                }

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oDoc->GetRecord()){ 
                        
$list.='<booklist>';
                        
$list.='<DocTypeNo>'.$oDoc->DocTypeNo.'</DocTypeNo>';
                        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oDoc->DocNo).'</DocNo>';
                        
$list.='<DocDate>'.iconv('TIS-620''UTF-8',abbreDateMoblie($oDoc->DocDate)).'</DocDate>';


                            if(
$oDoc->DocPID=="0"){
                                    
$oDlc2->SearchByKey($oDoc->DlcID); $oDlc2->GetRecord();
                                    
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();                    
                            }else{
                                    
$od_DlcID=$oDoc4->SearchDlcID($oDoc->DocPID); 
                                    
$oDlc2->SearchByKey($od_DlcID); $oDlc2->GetRecord();
                                    
$oDlp->SearchByKey($oDlc2->DlpID);  $oDlp->GetRecord();
                            }        

                        if(
$oDoc->DtID=="1" || $oDoc->DtID=="2" || $oDoc->DtID=="14"){
                                
$DocFrom=$oDoc->DocFrom;
                        }else{  
                                
$DocFrom=$oDoc->DocFrom."(".$oDlp->DlpName.")";
                                
                        }
                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$DocFrom).'</deptName>';
                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';
                        
$list.='<DrsID>'.iconv('TIS-620''UTF-8',$oDoc->DrsID).'</DrsID>';                            
                        
$list.='</booklist>';                
                }
                
$list.='</book>';
    echo 
$list;    

}else if(
$fn=='receiveEdoc'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsSendReceive.php";
    include_once 
"../class/clsCollegeDetail.php";
    include_once 
"functforRptEx.php";    

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlc3 = new DocLineConfig($oC);
    
$oDlc4 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oTsr = new sendreceive($oC);
    
$oTsr2 = new sendreceive($oC);
    
$oTsr3 = new sendreceive($oC);
    
$oCd = new collegedetail($oC);
    
$oCd2 = new collegedetail($oC);
    
$oCd3 = new collegedetail($oC);

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();

        if(
SearchSendAll_receive($oDlc->DlpID)=="All"){
                
$oTsr->SearchDocEMoblie(r1);
                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oTsr->GetRecord()){ 
                        
$list.='<booklist>';
                        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',$oTsr->tsr_DocNo).'</DocNo>';
                        
$list.='<DocDate>'.iconv('TIS-620''UTF-8',abbreDateMoblie($oTsr->tsr_DocDate)).'</DocDate>';
                        
$oCd2->SearchByKey($oTsr->tsr_fr_node); $oCd2->GetRecord(); 
                        
$DocSubject=$oTsr->tsr_DocSubject.'('.iconv('UTF-8''TIS-620','จาก').$oCd2->collegeAbbr.')'
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oTsr->tsr_to_node_date)).'</DrsReceiveDate>';
                        
$list.='<RsID>1</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oTsr->tsr_DtID).'</DtID>';        
                        
$list.='<trs_id>'.iconv('TIS-620''UTF-8',$oTsr->tsr_id).'</trs_id>';                                
                        
$list.='</booklist>';                
                }
                
$list.='</book>';
    echo 
$list;    

        }
}else if(
$fn=='statusDocforSign'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"../class/clsDocForSign.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc4 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlc3 = new DocLineConfig($oC);
    
$oDlc4 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDP = new Department($oC);
    
$oDfs = new DocForSign($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();

                if(
$oDlp1->DlpPID!="0"){ 
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                 }else{
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                }

                if(
$oDlp1->GsarabunHead=="Y" || $oDlp1->GheadDept=="Y" || $oDlp1->Gboss=="Y" || $oDlp1->Gboss2=="Y"){ 
                        if(
$oDlp->DlpPID=="0"){  $a=2$b=1;   }else{  $a=3$b=2;  }
                                
$DlcSeq=$oDlc->DlcSeq-$a;   
                                
$DlcSeq2=$oDlc->DlcSeq-$b
                                
$oDlc3->SearchByNextDlcID($DlcSeq,$oDlc->docGroup,$oDlc->deptId); $oDlc3->GetRecord();   $DLCID2=$oDlc3->DlcID;
                            
                                if(
$oDlp->DlpPID=="0"){  
                                    
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $DlcPS22=$oDlc4->DlcID;
                                }else{ 
                                    
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $DlcPS22=$oDlc4->DlcID;
                                }
                                
$oDoc->SearchGetDocForSignDlcIDMoblie($MaxDocGroup,$DLCID2,$DlcPS22);
                }else{
                    
$oDoc->SearchGetDocForSignDlcIDMoblie($MaxDocGroup,$dlcid,$DlcPS2);
                    
                }

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oDoc->GetRecord()){ 
                        
$list.='<booklist>';
                        
$list.='<DocTypeNo>'.$oDoc->DocTypeNo.'</DocTypeNo>';
                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';                    
                        
$list.='</booklist>';                
                }
                
$list.='</book>';
    echo 
$list;    

}else if(
$fn=='statusDocforSignEdit'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$dlcid = (! isset($_REQUEST['dlcid'])? "" $_REQUEST['dlcid']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocLinePosition.php";
    include_once 
"../class/clsDepartment.php";
    include_once 
"../class/clsDocForSign.php";
    include_once 
"../class/clsPerson.php";
    include_once 
"getPrefix.php";
    include_once 
"functforRptEx.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDoc4 = new Documents($oC);
    
$oDlc = new DocLineConfig($oC);
    
$oDlc2 = new DocLineConfig($oC);
    
$oDlc3 = new DocLineConfig($oC);
    
$oDlc4 = new DocLineConfig($oC);
    
$oDlc5 = new DocLineConfig($oC);
    
$oDlp = new docLinePosition($oC);
    
$oDlp1 = new docLinePosition($oC);
    
$oDlp2 = new docLinePosition($oC);
    
$oDP = new Department($oC);
    
$oDP4 = new Department($oC);
    
$oDfs = new DocForSign($oC);
    
$oPS = new person($oC);
    
$MaxDocGroup=$oDP->SearchMaxDocGroup();

        
$oDlc->SearchByKey($dlcid); $oDlc->GetRecord(); 
        
$oDlp1->SearchByKey($oDlc->DlpID);  $oDlp1->GetRecord();

                if(
$oDlp1->DlpPID!="0"){ 
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                 }else{
                    
$DlcPS2=$oDlc2->SearchDlc2($oDlc->DlcSeq,$oDlp1->DlpPID,$oDlc->deptId);
                }

                if(
$oDlp1->GsarabunHead=="Y" || $oDlp1->GheadDept=="Y" || $oDlp1->Gboss=="Y" || $oDlp1->Gboss2=="Y"){ 
                        if(
$oDlp->DlpPID=="0"){  $a=2$b=1;   }else{  $a=3$b=2;  }
                                
$DlcSeq=$oDlc->DlcSeq-$a;   
                                
$DlcSeq2=$oDlc->DlcSeq-$b
                                
$oDlc3->SearchByNextDlcID($DlcSeq,$oDlc->docGroup,$oDlc->deptId); $oDlc3->GetRecord();   $DLCID2=$oDlc3->DlcID;
                            
                                if(
$oDlp->DlpPID=="0"){  
                                    
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $DlcPS22=$oDlc4->DlcID;
                                }else{ 
                                    
$oDlc4->SearchByNextDlcID($DlcSeq2,$oDlc->docGroup,$oDlc->deptId); $oDlc4->GetRecord();  $DlcPS22=$oDlc4->DlcID;
                                }
                                
$oDoc->SearchGetDocForSignDlcIDDocforsignEditMoblie($MaxDocGroup,$DLCID2,$DlcPS22);
                }else{
                    
$oDoc->SearchGetDocForSignDlcIDDocforsignEditMoblie($MaxDocGroup,$dlcid,$DlcPS2);
                    
                }

                
$list='<?xml version="1.0" encoding="UTF-8" ?><book>';    
                  while(
$oDoc->GetRecord()){ 
                        
$list.='<booklist>';
                        
$list.='<DocTypeNo>'.$oDoc->DocTypeNo.'</DocTypeNo>';
                        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
                        
$list.='<docSubject>'.iconv('TIS-620''UTF-8',$DocSubject).'</docSubject>';
                        
$oPS->SearchByKey($oDoc->psComment); $oPS->GetRecord();  
                        
$oDlc5->SearchByKey($oDoc->DlcIDsign);  $oDlc5->GetRecord();    
                        
$oDlp2->SearchByKey($oDlc5->DlpID);  $oDlp2->GetRecord();   
                        
$oDP4->SearchByKey($oDoc->DeptSign);  $oDP4->GetRecord();

                        
$sendername=GetPrefix($oPS->prefixId).$oPS->fName." ".$oPS->lName
                        
$list.='<personSendEdit>'.iconv('TIS-620''UTF-8',$sendername).'('.iconv('TIS-620''UTF-8',$oDlp2->DlpName).')'.'</personSendEdit>';
                        
$list.='<deptName>'.iconv('TIS-620''UTF-8',$oDP4->deptName).'</deptName>';
                        
$list.='<SendEdit>'.iconv('TIS-620''UTF-8',$oDoc->DocEditComment).'</SendEdit>';
                        
$list.='<DrsReceiveDate>'.iconv('TIS-620''UTF-8',abbreDateTimeMoblie($oDoc->DocNoticeDate)).'</DrsReceiveDate>';
                        
$list.='<DocID>'.iconv('TIS-620''UTF-8',$oDoc->DocID).'</DocID>';
                        
$list.='<RsID>'.iconv('TIS-620''UTF-8',$oDoc->RsID).'</RsID>';
                        
$list.='<DtID>'.iconv('TIS-620''UTF-8',$oDoc->DtID).'</DtID>';                    
                        
$list.='</booklist>';                
                }
                
$list.='</book>';
    echo 
$list;    

}else if(
$fn=='workListDetail'){
    
$personId = (! isset($_REQUEST['personId'])? "" $_REQUEST['personId']);
    
$DocID = (! isset($_REQUEST['DocID'])? "" $_REQUEST['DocID']);
    
$RsID = (! isset($_REQUEST['RsID'])? "" $_REQUEST['RsID']);
    
$DtID = (! isset($_REQUEST['DtID'])? "" $_REQUEST['DtID']);
    
$DlcID = (! isset($_REQUEST['DlcID'])? "" $_REQUEST['DlcID']);
    
$DrsID = (! isset($_REQUEST['DrsID'])? "" $_REQUEST['DrsID']);
    
$type = (! isset($_REQUEST['type'])? "" $_REQUEST['type']);

    include_once(
"../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../link/keyThai.php";
    include_once 
"functforRptEx.php";
    include_once 
"../class/clsDocSpeedLevel.php";
    include_once 
"../class/clsDocSecreLevel.php";
    include_once 
"../class/clsDocattatches.php";
    include_once 
"../class/clsSendReceive.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

    
$oRs = new DocReceiveSend($oC);
    
$oDoc = new Documents($oC);
    
$oDsl = new DocSpeedLevel($oC);
    
$oDcl = new DocSecretLevel($oC);
    
$oDatt = new Docattatches($oC);
    
$oDatt2 = new Docattatches($oC);
    
$oTsr = new sendreceive($oC);

    if(
$type!='receiveEdoc'){
    
        if(
$type=='entry_doc'){ // ปรับสถานะว่าเปิดหนังสือแล้ว
            
$oRs->SearchByKey($DrsID); $oRs->GetRecord(); 
            if(
$oRs->DsID=="0"){
                    
UpdatereadDoc($oRs->DrsID,$DocID,"Y");
            }
        }
        
        
$oDoc->SearchByKey($DocID); $oDoc->GetRecord();
        if(
$oDoc->DocDate!="" && $oDoc->DocDate!="0000-00-00"){ 
            
$DocDate=abbreDateMoblie($oDoc->DocDate,'/');
        }
        if(
$oDoc->DtID=="13"){  $DocSubject="ชื่อผู้ได้รับการรับรอง<br>".$oDoc->CertificatePs;  }else{  $DocSubject=$oDoc->DocSubject; } 
        
$oDsl->SearchByKey($oDoc->DslID); $oDsl->GetRecord();  $DslID=$oDsl->DslName;
        
$oDcl->SearchByKey($oDoc->DclID); $oDcl->GetRecord();  $DclID=$oDcl->DclName;
        if(
$oDoc->endDoc=="Y"){  $endDoc="Y";  }else{  $endDoc="";   }


        
$list='<?xml version="1.0" encoding="UTF-8" ?><BookDetail>';    
        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',isset($oDoc->DocNo)?$oDoc->DocNo:"-").'</DocNo>';
        
$list.='<DocDate>'.iconv('TIS-620''UTF-8',isset($DocDate)?$DocDate:"-").'</DocDate>';
        
$list.='<DocSubject>'.iconv('TIS-620''UTF-8',isset($DocSubject)?$DocSubject:"-").'</DocSubject>';
        
$list.='<DocFrom>'.iconv('TIS-620''UTF-8',isset($oDoc->DocFrom)?$oDoc->DocFrom:"-").'</DocFrom>';
        
$list.='<DocTo>'.iconv('TIS-620''UTF-8',isset($oDoc->DocTo)?$oDoc->DocTo:"-").'</DocTo>';
        
$list.='<Docattatches>';    
                            
        if(
$oDoc->DocPID=="0" || $oDoc->DocPID==""){  $searchDoc=$oDoc->DocID; }else{ $searchDoc=$oDoc->DocPID; }   
        
$oDatt->SearchByDocID($searchDoc);
        while(
$oDatt->GetRecord()){  
            
$pathfile="http://".$_SERVER['SERVER_NAME'].'/mispbri/eoffice/documents/'.$oDatt->DaUpFileName;
            
$list.='<docFile><docFilelist>';    
            
$list.='<docFileURL>'.$pathfile.'</docFileURL>';        
            
$list.='<docFileName>'.iconv('TIS-620''UTF-8',$oDatt->DaFileName).'</docFileName>';                    
            
$list.='<docAddNew>N</docAddNew>';                    
            
$list.='</docFilelist></docFile>';    
        } 
        
$oDatt2->SearchByDocIDSended($searchDoc);
        while(
$oDatt2->GetRecord()){  
            
$pathfile2="http://".$_SERVER['SERVER_NAME'].'/mispbri/eoffice/documents/'.$oDatt2->DaUpFileName;
            
$list.='<docFile><docFilelist>';    
            
$list.='<docFileURL>'.$pathfile2.'</docFileURL>';        
            
$list.='<docFileName>'.iconv('TIS-620''UTF-8',$oDatt2->DaFileName).'</docFileName>';                
            
$list.='<docAddNew>Y</docAddNew>';                    
            
$list.='</docFilelist></docFile>';    
        }

        
$list.='</Docattatches>';    


        
$list.='<DocRef>'.iconv('TIS-620''UTF-8',isset($oDoc->DocRef)?$oDoc->DocRef:"-").'</DocRef>';  //อ้างถึง
        
$list.='<DocOther>'.iconv('TIS-620''UTF-8',isset($oDoc->DocOther)?$oDoc->DocOther:"-").'</DocOther>';  //สิ่งที่ส่งมาด้วย
        
$list.='<DocRefAns>'.iconv('TIS-620''UTF-8',isset($oDoc->DocRefAns)?$oDoc->DocRefAns:"-").'</DocRefAns>'//อ้างถึงหนังสือเพื่อตอบกลับ
        
$list.='<DslID>'.iconv('TIS-620''UTF-8',$DslID).'</DslID>'//ชั้นความเร็ว
        
$list.='<DclID>'.iconv('TIS-620''UTF-8',$DclID).'</DclID>'//ชั้นความลับ
        
$list.='<DocDeptOwner>'.iconv('TIS-620''UTF-8',isset($oDoc->DocDeptOwner)?$oDoc->DocDeptOwner:"-").'</DocDeptOwner>'//หน่วยงานเจ้าของเรื่อง
        
$list.='<DocTelOwner>'.iconv('TIS-620''UTF-8',isset($oDoc->DocTelOwner)?$oDoc->DocTelOwner:"-").'</DocTelOwner>'//โทรศัพท์เจ้าของเรื่อง
        
$list.='<DocFaxOwner>'.iconv('TIS-620''UTF-8',isset($oDoc->DocFaxOwner)?$oDoc->DocFaxOwner:"-").'</DocFaxOwner>'//โทรสารเจ้าของเรื่อง
        
$list.='<DocCopySend>'.iconv('TIS-620''UTF-8',isset($oDoc->DocCopySend)?$oDoc->DocCopySend:"-").'</DocCopySend>'//สำเนาส่ง
        
$list.='<DocContactE>'.iconv('TIS-620''UTF-8',isset($oDoc->DocContactE)?$oDoc->DocContactE:"-").'</DocContactE>'//การติดต่อทางอิเล็กทรอนิกส์
        
$list.='<DocShortDesc>'.iconv('TIS-620''UTF-8',isset($oDoc->DocShortDesc)?$oDoc->DocShortDesc:"-").'</DocShortDesc>'//หมายเหตุ
        
$list.='<sendToPs>'.iconv('TIS-620''UTF-8',isset($oDoc->sendToPs)?$oDoc->sendToPs:"-").'</sendToPs>'//ส่งด่วน
        
$list.='<DocSendReal>'.iconv('TIS-620''UTF-8',isset($oDoc->DocSendReal)?$oDoc->DocSendReal:"-").'</DocSendReal>'//ส่งหนังสือตัวจริงตามไปด้วย
        
$list.='<endDoc>'.$endDoc.'</endDoc>'//ยุติหนังสือ
        
$list.='</BookDetail>';
        echo 
$list;    
    
//------------------------------------------------------------------------------------------------------
    
}else{
        
$oTsr->SearchByKey($DocID);
        
$oTsr->GetRecord();

    
        if(
$oTsr->tsr_DocDate!="" && $oTsr->tsr_DocDate!="0000-00-00"){ 
            
$DocDate=abbreDateMoblie($oTsr->tsr_DocDate,'/');
        }
        
$oDsl->SearchByKey($oTsr->tsr_DslID); $oDsl->GetRecord();  $DslID=$oDsl->DslName;
        
$oDcl->SearchByKey($oTsr->tsr_DclID); $oDcl->GetRecord();  $DclID=$oDcl->DclName;
    
        
$list='<?xml version="1.0" encoding="UTF-8" ?><BookDetail>';    
        
$list.='<DocNo>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocNo)?$oTsr->tsr_DocNo:"-").'</DocNo>';
        
$list.='<DocDate>'.iconv('TIS-620''UTF-8',$DocDate).'</DocDate>';    
        
$list.='<DocSubject>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocSubject)?$oTsr->tsr_DocSubject:"-").'</DocSubject>';
        
$list.='<DocFrom>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocFrom)?$oTsr->tsr_DocFrom:"-").'</DocFrom>';
        
$list.='<DocTo>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocTo)?$oTsr->tsr_DocTo:"-").'</DocTo>';
        
$list.='<Docattatches>';    


        
$tsr_docname=$oTsr->tsr_docname;
        
$tsr_statusDocAtt=$oTsr->tsr_statusDocAtt
        
$tsr_doc_url=$oTsr->tsr_doc_url
        
$i=0;
        while(
$tsr_docname!=''){ $i++;
                list(
$downloadfilename,$tsr_docname)=preg_split('[,]',$tsr_docname,2);
                list(
$downloadurl,$tsr_doc_url)=preg_split('[,]',$tsr_doc_url,2);                    
                
$count=strlen($tsr_statusDocAtt);
                if(
$count!=$i){
                        
$statusDoc substr($tsr_statusDocAtt,$i-1,-($count-1-($i-1)));
                }else{
                        
$statusDoc substr($tsr_statusDocAtt,$count-1);
                }        
                

                
$list.='<docFile><docFilelist>';    
                if(
$statusDoc=='Y'){
                            
$file_name basename($downloadurl); 
                            list(
$filename_,$filetype_)=preg_split("/\./",$file_name);
                            
$pathfile=$downloadurl
                            
$list.='<docFileURL>'.$pathfile.'</docFileURL>';        
                            
$list.='<docFileName>'.iconv('TIS-620''UTF-8',$downloadfilename).'</docFileName>';                    
                            
$list.='<docAddNew></docAddNew>';                    
                            
$list.='</docFilelist></docFile>';    
                }else{
                        
//ยังไม่ดาวน์โหลด
                            
$pathfile=''
                            
$list.='<docFileURL>'.$pathfile.'</docFileURL>';        
                            
$list.='<docFileName>'.iconv('TIS-620''UTF-8',$downloadfilename).'(ยังไม่ได้ดาวน์โหลด)'.'</docFileName>';                    
                            
$list.='<docAddNew></docAddNew>';                    
                            
$list.='</docFilelist></docFile>';    
                }

                        
            } 

        
$list.='</Docattatches>';    

        
$list.='<DocRef>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocRef)?$oTsr->tsr_DocRef:"-").'</DocRef>';  //อ้างถึง
        
$list.='<DocOther>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocOther)?$oTsr->tsr_DocOther:"-").'</DocOther>';  //สิ่งที่ส่งมาด้วย
        
$list.='<DslID>'.iconv('TIS-620''UTF-8',$DslID).'</DslID>'//ชั้นความเร็ว
        
$list.='<DclID>'.iconv('TIS-620''UTF-8',$DclID).'</DclID>'//ชั้นความลับ
        
$list.='<DocDeptOwner>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocDeptOwner)?$oTsr->tsr_DocDeptOwner:"-").'</DocDeptOwner>'//หน่วยงานเจ้าของเรื่อง
        
$list.='<DocTelOwner>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocTelOwner)?$oTsr->tsr_DocTelOwner:"-").'</DocTelOwner>'//โทรศัพท์เจ้าของเรื่อง
        
$list.='<DocFaxOwner>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocFaxOwner)?$oTsr->tsr_DocFaxOwner:"-").'</DocFaxOwner>'//โทรสารเจ้าของเรื่อง
        
$list.='<DocCopySend>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocCopySend)?$oTsr->tsr_DocCopySend:"-").'</DocCopySend>'//สำเนาส่ง
        
$list.='<DocContactE>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocContactE)?$oTsr->tsr_DocContactE:"-").'</DocContactE>'//การติดต่อทางอิเล็กทรอนิกส์
        
$list.='<DocShortDesc>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocShortDesc)?$oTsr->tsr_DocShortDesc:"-").'</DocShortDesc>'//หมายเหตุ
        
$list.='<DocSendReal>'.iconv('TIS-620''UTF-8',isset($oTsr->tsr_DocSendReal)?$oTsr->tsr_DocSendReal:"-").'</DocSendReal>'//ส่งหนังสือตัวจริงตามไปด้วย
        
        
$list.='</BookDetail>';
        echo 
$list;    
    }
}else if(
$fn=='readDocEntryDoc'){
    
//echo "readDocEntryDoc";
    
    
include_once("../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../link/keyThai.php";
    include_once 
"functforRptEx.php";
    include_once 
"../class/clsDocReceiveSend.php";

    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
    
    
$oRs = new DocReceiveSend($oC);
    
$oRs1 = new DocReceiveSend($oC);
    
$DrsID = (! isset($_REQUEST['DrsID'])? "" $_REQUEST['DrsID']);
    
$DaSeq = (! isset($_REQUEST['indexBook'])? "" $_REQUEST['indexBook']);
    
    
$oRs->SearchByKey($DrsID);
    
$oRs->GetRecord();
    
$oRs->Edit();
    
$oRs->DsID=5;
    
    
$DrsReadDoc $oRs->DrsReadDoc;
    
//echo "<br>DrsReadDoc = ".$DrsReadDoc;
    //echo "<br>DrsID = ".$DrsID;
    //echo "<br>DaSeq = ".$DaSeq;
    //----update DrsReadDoc
    
if($DaSeq!=0){
        
$count=strlen($DrsReadDoc);
        if(
$count!=$DaSeq){
            
$newDrsReadDoc substr_replace($DrsReadDoc"1"$DaSeq-1,-($count-1-($DaSeq-1)));
        }else{
            
$newDrsReadDoc substr_replace($DrsReadDoc"1"$count-1);
        }
        
$oRs->DrsReadDoc=$newDrsReadDoc
    }
    
//echo "<br>newDrsReadDoc = ".$newDrsReadDoc;
    //-----------------------
    
$oRs->Save();    
    echo 
"Success readDocEntryDoc";
}else if(
$fn=='signDocAction'){ //ลงนาม

    //echo "GET";
    
$personId    =  $_GET['personId'];
    
$DLCID        =  $_GET['DLCID'];
    
$DrsID        =  $_GET['DrsID'];
    
$DocID        =  $_GET['DocID'];
    
$DrsSign    =  $_GET['DrsSign'];

//echo $personId." | ".$DLCID." | ".$DrsID." | ".$DocID." | ".$DrsSign; 
//die;
    
include_once("../../class/clsConnection.php");
    include_once(
"../../class/clsDB.php");
    include_once 
"../global.php";    
    include_once 
"funct.php";
    include_once 
"../link/function.php";
    include_once 
"../link/functionshow.php";
    include_once 
"../class/clsDocLineConfig.php";
    include_once 
"../class/clsDocuments.php";
    include_once 
"../class/clsDocReceiveSend.php";
    include_once 
"../class/clsDocForSign.php";

    
$oDlc = new DocLineConfig($oC);
    
$oDoc = new Documents($oC);
    
$oRs = new DocReceiveSend($oC);
    
$oRs1 = new DocReceiveSend($oC);
    
$oRs2 = new DocReceiveSend($oC);
    
$oRs3 = new DocReceiveSend($oC);
    
$oDfs = new DocForSign($oC);
    
    
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
    
    
//-----------------------------------------------------------
    
$oDoc->SearchByKey($DocID); $oDoc->GetRecord();
    
$oDlc->SearchByKey($DLCID); $oDlc->GetRecord(); 

    
$DlcPs=GetUpPrePsSend($DLCID,$oDlc->deptId); 

    if(
$oDoc->DtID==15){  
        
$DocForSign=1
    }
    
    
$cansend="N"//ไม่ส่งหนังสือเอง
    
$DlcIDlogin $DLCID;
    
$DrsSign str_replace("|"," ",$DrsSign);
    
//$DrsSign = iconv('UTF-8', 'TIS-620',$DrsSign);
    //echo $DrsSign;die;
    //-----------------------------------------------------------
    
$flagCommit true;
    
$oC->BeginTrans();
    
    
$oDoc->SearchByKey($DocID);
    if(
$oDoc->GetRecord()=="1"){
            
$oDoc->Edit();
            
$oDoc->DsID="3";
            
$flagCommit $oDoc->Save();
    }
    
$oRs->SearchByKey($DrsID);
    
$oRs->GetRecord();
    
$oRs->Edit();
    
$oRs->DlcID=$DlcIDlogin;
    
$oRs->DrsReceivePersonId=$personId;
    
$oRs->DrsSendDate=getNowDateTh()." ".date('H:i:s');
    
//echo "DrsSendDate=".$oRs->DrsSendDate;
    
    
if($cansend!="Y"){
        
//$oRs->DrsSendPersonId=$DlcPsId;
        
$oRs->DrsSendPersonId='';
    }else if(
$cansend=="Y"){
        
$oRs->DrsSendPersonId=$personId;
    }
    
    
//echo "DrsSendPersonId=".$oRs->DrsSendPersonId;
    
if($cansend!="Y"){
        
$oRs->DrsSendDlcID=$DlcPs;
    }else if(
$cansend=="Y"){
        
$oRs->DrsSendDlcID=$DlcIDlogin;
    }
    
//echo "DrsSendDlcID=".$oRs->DrsSendDlcID;
    
$oRs->DrsSign=$DrsSign;    
    
$oRs->Save();

    
$oRs2->SearchPreDocSignforDlpID0_Update2($DlcIDlogin,$personId,$oRs->DrsFromDrsID);

    
    
//---------------add DocReceiveSend
    
$oRs1->AddNew();
    
$oRs1->DrsID=$oRs1->GetNextCode();
    
$oRs1->DocID=$DocID;
    if(
$cansend!="Y"){
        
$oRs1->DlcID=$DlcPs;
    }else if(
$cansend=="Y"){
        
$oRs1->DlcID=$DlcIDlogin;
    }
    
$oRs1->DsID=3;
    
$oRs1->PtID=$oRs->PtID;
    
$oRs1->DrsDocTypeNo=$oRs->DrsDocTypeNo;
    
$oRs1->DrsReceiveDate=$oRs->DrsSendDate;
    
//$oRs1->DrsReceivePersonId=$DlcPsId;
    
$oRs1->DrsReceivePersonId='';
    
$oRs1->DrsDocDueDate=$oRs->DrsDocDueDate;
    
$oRs1->DrsDlcIDCreate=$DlcIDlogin;
    
$oRs1->DrsPsIDCreate=$personId;
    
$oRs1->DrsPropose=$oRs->DrsPropose;
    
$oRs1->DrsSign=$DrsSign;
    
$oRs1->DrsFromDrsID=$oRs->DrsID;
    
//echo "DrsFromDrsID=".$oRs1->DrsFromDrsID;
    
$oRs1->DocGroup=$oRs->DocGroup;
    if(
$cansend!="Y"){
        
$oRs1->DrsSend=$oRs1->DrsSend;
    }else if(
$cansend=="Y"){
        
$oRs1->DrsSend="Y";
    }
    
$oRs1->AnID=$oRs->AnID;
    
$oRs1->DrsstartDatePost=$oRs->DrsstartDatePost;
    
$oRs1->DrsendDatePost=$oRs->DrsendDatePost;    
    
$flagCommit $oRs1->Save();
    
    if(
$DocForSign==&& $DocPID!="0"){
        
$oDlc->SearchByKey($DlcIDlogin); $oDlc->GetRecord(); 
        
$oRs2->SearchDeptSendDocforSign($oDoc->DocID);
        
$oRs2->GetRecord();
        
$oRs3->SearchByKey($oRs2->DrsFromDrsID);
        
$oRs3->GetRecord();
        
        
$oDfs->AddNew();
        
$oDfs->dfID=$oDfs->GetNextCode();
        
$oDfs->DocID=$oRs3->DocID;
        
$oDfs->DlcID=$oRs2->DrsDlcIDCreate;
        
$oDfs->DocGroup=$oRs3->DocGroup;
        
$oDfs->DlcIDsign=$DlcIDlogin;
        
$oDfs->DeptSign=$oDlc->deptId;
        
$oDfs->Save();
        
//echo $oRs8->DrsID.'--'.$oRs8->DrsDlcIDCreate.'--'.$oRs8->DrsPsIDCreate.'-'.$oRs8->DrsFromDrsID;        
    
}
            
    if(
$flagCommit)
        
$oC->CommitTrans();
    else
        
$oC->RollbackTrans();
    
    echo 
"Success signDocAction";

}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0363 ]--