public function update() { $id = $_POST[tpl_category::category() . '_' . tpl_category::id() . '_update']; $id_student = $_POST[tpl_models::models() . '_' . tpl_models::id_student() . '_update']; $id_companies = $_POST[tpl_models::models() . '_' . tpl_models::id_companies() . '_update']; $id_department = $_POST[tpl_models::models() . '_' . tpl_models::id_department() . '_update']; $id_section = $_POST[tpl_models::models() . '_' . tpl_models::id_section() . '_update']; $id_supervisor = $_POST[tpl_models::models() . '_' . tpl_models::id_supervisor() . '_update']; $db = new data_base(tpl_models::models(), array(tpl_models::id_student() => $id_student, tpl_models::id_companies() => $id_companies, tpl_models::id_department() => $id_department, tpl_models::id_section() => $id_section, tpl_models::id_supervisor() => $id_supervisor, tpl_models::date_in() => date_time::Date_time_24()), array(tpl_models::id() => $id)); $results = $db->change(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Update ' . $id_student)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not Update ' . $id_student . ', please try again')); } }