Exemple #1
0
 public function getDashboardDetail()
 {
     $userInfo = $this->User_model->getUserDetail($this->userID);
     if ($userInfo->result->user_type == 'operator') {
         $taxis = $this->taxi_model->getAllTaxi($this->userID);
         foreach ($taxis->result as $taxi) {
             $last = $this->roster_model->getLatestEntryForTaxi($taxi->ID);
             if (count($last->result) > 0) {
                 $current_date = strtotime(date("Y-M-d"));
                 for ($i = 0; $i < 366; $i++) {
                     if ($current_date + $i * 86400 > intval(reset($last->result)->paying_date)) {
                         $this->roster_model->addRosterTemplate($this->userID, $taxi->ID, 'Evening', $current_date + $i * 86400);
                         $this->roster_model->addRosterTemplate($this->userID, $taxi->ID, 'Morning', $current_date + $i * 86400);
                     }
                 }
             } else {
                 $current_date = strtotime(date("Y-M-d"));
                 for ($i = 0; $i < 366; $i++) {
                     $this->roster_model->addRosterTemplate($this->userID, $taxi->ID, 'Evening', $current_date + $i * 86400);
                     $this->roster_model->addRosterTemplate($this->userID, $taxi->ID, 'Morning', $current_date + $i * 86400);
                 }
             }
         }
     }
     $args = $this->uri->uri_to_assoc(3);
     $type = "";
     if (count($args) > 0 && $args['type'] != "") {
         $type = $args['type'];
     }
     parent::returnData($this->Dashboard_model->getDashboardDetail($this->userID, $type));
 }
Exemple #2
0
 public function getAllRosterDetailWithDateRange()
 {
     $allTaxi = $this->taxi_model->getAllTaxi($this->userID);
     $start_date = $this->input->get('rosterStart');
     $start_date = !empty($start_date) ? $this->timezone->convertDateToMKTime($start_date) : '';
     $end_date = $this->input->get('rosterEnd');
     $end_date = !empty($end_date) ? $this->timezone->convertDateToMKTime($end_date) : '';
     if (empty($allTaxi)) {
         parent::returnData(array());
     } else {
         parent::returnData($this->Roster_model->getAllRosterWithDateRange($this->userID, $allTaxi, $start_date, $end_date));
     }
 }
 public function getAllDriverAdsDetail()
 {
     parent::returnData($this->generaladsdriverwanted_model->getAllDriverAds($this->userID));
 }
Exemple #4
0
 public function removeTaxi()
 {
     $taxi_id = $this->input->get('taxi_id');
     parent::returnData($this->Taxi_model->removeTaxi($this->userID, $taxi_id));
 }
Exemple #5
0
 public function getAllDriverAdsDetail()
 {
     $userInfo = $this->User_model->getUserDetail($this->userID);
     parent::returnData($this->Driverads_model->getAllDriverAds($this->userID, $userInfo->result->user_type));
 }
Exemple #6
0
 public function getAllAdsDetail()
 {
     parent::returnData($this->Ads_model->getAllAds($this->userID));
 }
Exemple #7
0
 public function getAllJournalDetailWithDateRange()
 {
     parent::returnData($this->Journal_model->getAllJournalWithDateRange($this->userID));
 }