} if (empty($clientid)) { $valid = false; } /* if (empty($interviewer)) { $valid = false; } */ if (empty($date)) { $valid = false; } // update data if ($valid) { $sql = "interviewUpdate"; $sqlValuesForUpdate = array($traineeid, $assistedby, $clientid, $interviewer, $time, $status, $updatedDate, $description, $date, $id); GlobalCrud::update($sql, $sqlValuesForUpdate); header("Location:../?content=22"); } } else { $sql = "interviewSelectById"; $sqlValues = array($id); $data = GlobalCrud::selectById($sql, $sqlValues); $traineeid = $data['trainee_id']; $assistedby = $data['assisted_by']; $clientid = $data['client_id']; $interviewer = $data['interviewer']; $time = $data['time']; $status = $data['status']; //$created_date = $data['created_date']; //$updated_date = $data['updated_date']; $description = $data['description'];
} $sqlContactInsert = "contactInsert"; $sqlContactUpdate = "contactUpdate"; for ($i = 0; $i < count($_POST['poc']); $i++) { $contactId = $_POST['contactId'][$i]; $poc = $_POST['poc'][$i]; $email = $_POST['email'][$i]; $phone = $_POST['phone'][$i]; $designation = $_POST['designation'][$i]; $clientid = $id; if ($contactId == 0) { $sqlValues = array($clientid, $poc, $email, $phone, $createdDate, $description, $designation); GlobalCrud::setData($sqlContactInsert, $sqlValues); } elseif ($contactId != 0) { $sqlValuesContactUpdate = array($clientid, $poc, $email, $phone, $updatedDate, $description, $designation, $contactId); GlobalCrud::update($sqlContactUpdate, $sqlValuesContactUpdate); } } header("Location:../?content=7"); } } else { $sql = "clientSelectById"; $sqlValues = array($id); $data = GlobalCrud::selectById($sql, $sqlValues); $name = $data['name']; $address = $data['address']; $description = $data['description']; $sqlContact = "contactSelectById"; $sqlValuesContact = array($id); $dataContact = GlobalCrud::getAllRecordsBasedOnId($sqlContact, $sqlValuesContact); }