mercredi 14 janvier 2015

how to ganarate input array in Codeigniter

i have code like this in controller :



$date = $this->input->post('date');
$exca_id = $this->input->post('exca_id');
$status = $this->input->post('id_status');

$data = array(
'date' => $date,
'exca_id' => $exca_id,
'fleet_status' => $fleet,
'id_status' => $status,
);

if ((in_array("id_status", $data)) !== working ) {
$fleet = date('ymd',strtotime(str_replace('-', '/', $date))).$shift.$status;
}
else
{
$fleet = date('ymd',strtotime(str_replace('-', '/', $date))).$shift.$exca_id;
}


i want to save fleet_status when someone input in form input id_status == working, fleet_status save with format ganarate "date('ymd',strtotime(str_replace('-', '/', $date))).$exca_id;" but when someone input in form input id_status !== working, fleet_status save with format ganarate "$fleet = date('ymd',strtotime(str_replace('-', '/', $date))).$status;"


But, when i try this code fleet_status not save anything.


can you help me to solve this probelm?


Aucun commentaire:

Enregistrer un commentaire