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');
$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)
if ($updatedDetails)
if ($updatedDetails['status'])
{
$updatedDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit

View File

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