MaxDate(); $oDr= new deptref($oC); ?> BeginTrans(); if($depttypeId == 1 || $depttypeId == 2 || $depttypeId == 3 || $depttypeId == 4 || $depttypeId == 5 || $depttypeId == 6){ echo " if 1234"; if($depttypeId == 1 || $depttypeId == 2){ echo " if 12"; $oDp2->SearchByName(); if($oDp2->GetRecord() == 1) $oDp->deptgroup = $oDp2->deptId; else $oDp->deptgroup = 1; } if($depttypeId == 3 || $depttypeId == 4) { echo " if 34"; $oDp->deptgroup = $oDp->deptId; } echo "-------".$oDp->deptgroup; $oDp->AddNew(); $oDp->deptId=$oDp->GetNextCode(); $oDp->deptName=$deptName; $oDp->deptDesc=$deptDesc; $oDp->deptCode=$deptCode; $oDp->deptParent=0; $oDp->deptYear=$deptYear; $oDp->deptDate=$deptDate; $oDp->deptRef=0; $oDp->pbriId=$pbriId; $oDp->depttypeId=$depttypeId; $oDp->deptParentId=$deptParentId; $oDp->deptLevel=$deptLevel; $oDp->deptgroup=$oDp->deptgroup; $oDp->Save(); $oDp4->searchdeptDate($maxdate); while($oDp4->GetRecord()){ if($deptmaxdate[$oDp4->deptId]==1){ $oDr->AddNew(); $oDr->drId=$oDr->GetNextCode(); $oDr->deptId=$oDp->deptId; $oDr->deptrefId=$oDp4->deptId; $oDr->Save(); } } }else{ while($count != 'END') { $oDp->SearchByKey($deptParentId); $oDp->GetRecord(); if($oDp->depttypeId == 1 || $oDp->depttypeId == 2 || $oDp->depttypeId == 3 || $oDp->depttypeId == 4){ //echo " else 1234"; if($oDp->depttypeId == 1 || $oDp->depttypeId == 2){//echo " else 12"; $oDp2->SearchByName(); if($oDp2->GetRecord() == 1) $oDp->deptgroup = $oDp2->deptId; else $oDp->deptgroup = 1; }else if($oDp->depttypeId == 3 || $oDp->depttypeId == 4){ //echo " else 34"; $oDp->deptgroup = $oDp->deptId; $count = 'END'; } }else{ $deptParentId = $oDp->deptParentId; $count = 'NO'; } }//while $oDp->AddNew(); $oDp->deptId=$oDp->GetNextCode(); $oDp->deptName=$deptName; $oDp->deptDesc=$deptDesc; $oDp->deptCode=$deptCode; $oDp->deptParent=0; $oDp->deptYear=$deptYear; $oDp->deptDate=$deptDate; $oDp->deptRef=0; $oDp->pbriId=$pbriId; $oDp->depttypeId=$depttypeId; $oDp->deptParentId=$deptParentId; $oDp->deptLevel=$deptLevel; $oDp->deptgroup=$deptG; $oDp->Save(); $oDp4->searchdeptDate($maxdate); while($oDp4->GetRecord()){ if($deptmaxdate[$oDp4->deptId]==1){ $oDr->AddNew(); $oDr->drId=$oDr->GetNextCode(); $oDr->deptId=$oDp->deptId; $oDr->deptrefId=$oDp4->deptId; $oDr->Save(); } } }//else $oDp5->RSdeptSetgroupHeaddeptDate0(); while($oDp5->GetRecord()){ $oDp3->SearchByName(); if($oDp3->GetRecord() == 1) $deptG = $oDp3->deptId; else $deptG = 1; $oDp6->SearchByKey($oDp5->deptId); $oDp6->GetRecord(); $oDp6->Edit(); $oDp6->deptId=$oDp6->deptId; $oDp6->deptName=$oDp6->deptName; $oDp6->deptDesc=$oDp6->deptDesc; $oDp6->deptCode=$oDp6->deptCode; $oDp6->deptParent=$oDp6->deptParent; $oDp6->deptYear=$oDp6->deptYear; $oDp6->deptDate=$oDp6->deptDate; $oDp6->deptRef=$oDp6->deptRef; $oDp6->pbriId=$oDp6->pbriId; $oDp6->depttypeId=$oDp6->depttypeId; $oDp6->deptParentId=$oDp6->deptParentId; $oDp6->deptLevel=$oDp6->deptLevel; $oDp6->deptgroup=$deptG; $oDp6->Save(); } ?> เพิ่มส่วนราชการภายใน

เพิ่มส่วนราชการภายใน
 
ชื่อส่วนราชการภายใน   *
ส่วนราชการภายใน
(โครงสร้างเพื่อการส่งหนังสือในระบบสารบรรณเก่า)
  searchdeptDate($maxdate); while($oDp4->GetRecord()){ ?>  deptName; ?>
ประเภทของส่วนราชการภายใน   *
รายละเอียด  
 
[ปิดหน้าต่าง]