enrolment receive changes

This commit is contained in:
gandhimathi 2018-08-29 18:36:57 +05:30
parent 3761f070e5
commit faab41e795
2 changed files with 18 additions and 28 deletions

View File

@ -47,7 +47,7 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller {
$enrolmentDetails = $this->post('details'); $enrolmentDetails = $this->post('details');
$localDetails = $this->post('localDetails'); $localDetails = $this->post('localDetails');
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL) $updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL)
if ($updatedDetails) if ($updatedDetails['status'])
{ {
$updatedDetails['status'] = REST_Controller::HTTP_OK; $updatedDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit

View File

@ -219,7 +219,7 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
else{ else{
$insert['ApprovedDate'] = ""; $insert['ApprovedDate'] = "";
} }
$get_data[$k]=array( $get_data[count($get_data)]=array(
'FormID' => $insert['FormID'], 'FormID' => $insert['FormID'],
'EnrolmentNo' => $insert['EnrolmentNo'], 'EnrolmentNo' => $insert['EnrolmentNo'],
'RollNo' => $insert['RollNo'], 'RollNo' => $insert['RollNo'],
@ -265,41 +265,31 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model {
} }
// check form id exit in table for insert / update // check form id exit in table for insert / update
$formIDData = $this->db->select('FormID')->get(ENROLMENTRECEIVEDFROMUNIV)->result_array(); $formIDData = $this->db->select('FormID')->order_by('SubmitID','ASC')->get(ENROLMENTRECEIVEDFROMUNIV)->result_array();
$form_ids=array(); $form_ids=array();
$insertForms=array(); $insertForms=array();
$updateForms=array();
foreach($formIDData as $fkey => $fvalue): foreach($formIDData as $fkey => $fvalue):
$matchedKey=array_search($fvalue['FormID'], array_column($get_data, 'FormID'));
$form_ids[$fkey]=$fvalue['FormID']; if(count($matchedKey)>0){
$updateForms[count($updateForms)]=$get_data[$matchedKey];
if(array_search($fvalue['FormID'], array_column($get_data, 'FormID'))) { // $form_ids[]=$fvalue['FormID'];
$matchedKey=array_search($fvalue['FormID'], array_column($get_data, 'FormID')); array_splice($get_data,$matchedKey,1);
print_r($get_data[9]);die();
// $insertForms[count($insertForms)]=$get_data[$matchedKey];
} }
else{
echo "NOOOOOOOOOOO";
}
endforeach; endforeach;
print_r($form_ids);
die();
if(count($get_data)>0){
// $this->db->insert_batch(ENROLMENTRECEIVEDFROMUNIV, $get_data); $this->db->insert_batch(ENROLMENTRECEIVEDFROMUNIV, $get_data);
// if ($this->db->affected_rows() > 0) { }
// // outgoingSMS data were successfully inserted /* if(count($updateForms)>0){
// return TRUE; //$this->db->where_in('FormID',$form_ids);
// } else { $this->db->update_batch(ENROLMENTRECEIVEDFROMUNIV, $updateForms,'FormID');
// log_message('error', $this->campaign_id.' :: Could not insert sms into database'); }*/
// log_message('error', $this->ci->db->_error_message()); $finalArray['status']=true;
// return FALSE; // sms was not inserted correctly
// }
$finalArray['details']=$errorArray; $finalArray['details']=$errorArray;
print_r($finalArray);die(); return $finalArray;
return false;
} }
public function updateEnrolmentDetails1($enrolment=null,$local=null) public function updateEnrolmentDetails1($enrolment=null,$local=null)