staff=$staff->getUserByIdList($_COOKIE["staff"]); self::$NEW= $this->getReceiptCount(); self::$NEW2= $this->getExeCount(); include './protected/controller/ReceiptController.php'; ReceiptController::$NEW=self::$NEW; ReceiptController::$NEW2=self::$NEW2; return "/"; } } Doo::loadCore ( 'uri/DooUriRouter' ); $router = new DooUriRouter (); $routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER ); if($routeRs['1']!="login"){ header ( 'Content-Type:text/html;charset=utf-8' ); @header ( "Location: /login" ); } } public function myList(){ $data ['memu'] = 'holiday'; $data ['holidaymenu'] = 'mylist'; $data ['staff'] = $this->staff; $this->render ( "/holiday-myList", $data ); } private function getReceiptCount(){ $status=2; $year=date('Y'); Doo::loadModel('receipt'); $receipt=new receipt(); $dateCondition=" and Year(date) =".$year; $approvalCondition=' and nowStaff like "%'.$this->staff[0]['sid'].'%" '; $receiptList=$receipt->find(array('where'=>' status='.$status.$dateCondition.$approvalCondition,'desc'=>'rid','asArray'=>true)); return count($receiptList); } private function getExeCount(){ Doo::loadModel('receipt'); $receipt=new receipt(); $receiptList=$receipt->find(array('where'=>'(executeCopy like \'%["'.$this->staff[0]['sid'].'%\' and executeStaff NOT LIKE \'%'.$this->staff[0]['sid'].'%\' ) and (status=1 or status=6)','desc'=>'rid','asArray'=>true)); return count($receiptList); } } ?>