public function generate_log_file_meal($meal_date)
 {
     $this->common->authenticate();
     $message = $this->common->get_message('gen_log_file_meal', array('gen_log_file_success', 'gen_log_file_failure'));
     if (Meals_model::gen_log_file_meal($meal_date)) {
         $data = array('status' => 'success', 'message' => $message['gen_log_file_success']);
     } else {
         $data = array('status' => 'failure', 'message' => $message['gen_log_file_failure']);
     }
     echo json_encode($data);
 }
 public function tracking_meal_log()
 {
     $this->common->authenticate();
     $tables = $this->input->post('tables');
     $meal_date = $this->input->post('lunch_date');
     $note = $this->input->post('note');
     $private_note = $this->input->post('private_note');
     $actual_meals = $this->input->post('actual_meals');
     $shift = $this->input->post('shift');
     $this->validation('tracking');
     if ($this->form_validation->run() == FALSE) {
         $errors = validation_errors();
         $data['status'] = 'failure';
         $data['message'] = $errors;
     } else {
         $this->load->model('meals_model');
         $message = $this->common->get_message('gen_log_file_meal', array('gen_log_file_success', 'gen_log_file_failure'));
         if (Meals_model::update_meal_log($shift, $tables, $meal_date, $note, $private_note, $actual_meals)) {
             $data = array('status' => 'success', 'message' => $message['gen_log_file_success']);
         } else {
             $data = array('status' => 'failure', 'message' => $message['gen_log_file_failure']);
         }
     }
     echo json_encode($data);
 }