Пример #1
0
	public function save()
	 {
	 	$ship = Shipments::get_shipment();
		$ship = new Shipments();
		$ship -> vaccine_id = $this -> input -> post("combo2");
		$ship -> task_id = $this -> input -> post("combo1");
		$test_initiate_date=strtotime($this -> input -> post("start_date"));
		$ship -> Initiate_date = date('Y-m-d',$test_initiate_date);
		$test_start_date=strtotime($this -> input -> post("receive_date"));
		$ship -> receive_date = date('Y-m-d',$test_start_date);
		$test_end_date=strtotime($this -> input -> post("end_date"));
		$ship -> end_date = date('Y-m-d',$test_end_date);
		$ship -> Initiator_name = $this -> input -> post("name");
		$ship -> save();
 		$this->index() ;
	}	
Пример #2
0
 public function save()
 {
     $ship = Shipments::get_shipment();
     $ship = new Shipments();
     //picks values eneterd in the add_task_view
     //picks the vaccines_id and the task_id and populates the task and vaccine name drop down
     $ship->vaccine_id = $this->input->post("combo2");
     $ship->task_id = $this->input->post("combo1");
     //formatting the dates from the date picker
     //Initiate Date
     $test_initiate_date = strtotime($this->input->post("start_date"));
     $ship->Initiate_date = date('Y-m-d', $test_initiate_date);
     //Receive Date
     $test_start_date = strtotime($this->input->post("start_date"));
     $test_start_date = strtotime("+7 day", $test_start_date);
     $ship->expected_end_date = date('Y-m-d', $test_start_date);
     //End Date
     $test_end_date = strtotime($this->input->post("end_date"));
     $ship->end_date = date('Y-m-d', $test_end_date);
     //Initiator Name
     $ship->Initiator_name = $this->input->post("name");
     $ship->save();
     $this->index();
 }