Created
September 29, 2016 21:19
-
-
Save nested/357813557b01c7c695c010775d8b927f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function UpdateBankProfile($modal, $RtTruckOwnerBankAccountDetailsTruckLevel, $rtTrucks, $truck_owner_status) | |
{ | |
// $this->passErrorToView($truck_owner_status); | |
$truck_registration_number = $this->ifValueGiven($this->input->post('truck_registration_number')); | |
if ($truck_owner_status == 1) { | |
$pan_number = $this->ifValueGiven($this->input->post('pan_number')); | |
$bank_account_name = $this->ifValueGiven($this->input->post('bank_account_name')); | |
$bank_account_number = $this->ifNumValueGiven($this->input->post('bank_account_number')); | |
$bank_account_number_repeat = $this->ifNumValueGiven($this->input->post('bank_account_number_repeat')); | |
if ($bank_account_number != $bank_account_number_repeat) { | |
$error = "bank account Number won't Match with the repeatAccountNumber"; | |
$this->passErrorToView($error); | |
} | |
// $this->passErrorToView('Ban account validation passed'); | |
if ($this->ifValueGiven($this->input->post('ifsc_code_status')) == "yes" ){ | |
$ifsc_code = $this->ifValueGiven($this->input->post('ifsc_code')); | |
} | |
else { | |
$ifsc_code = "None"; | |
} | |
$bank_name = $this->ifValueGiven($this->input->post('bank_name')); | |
// $this->passErrorToView($bank_name); | |
$bank_city = $this->ifValueGiven($this->input->post('bank_city')); | |
$bank_location = $this->ifValueGiven($this->input->post('bank_location')); | |
$bank_account_type = $this->ifValueGiven($this->input->post('bank_account_type')); | |
$bank_state = $this->ifValueGiven($this->input->post('bank_state')); | |
if ($this->ifFileGiven('bank_cheque_copy')) { | |
$bank_cheque_copy = $this->doUpload('bank_cheque_copy', $rtTrucks->getRtCustomer()->getRtCustomerId(), $truck_registration_number); | |
} | |
else { | |
$bank_cheque_copy = 'NA'; | |
} | |
if ($this->ifFileGiven($this->input->post('pan_copy'))) { | |
$pan_copy = $this->doUpload('pan_copy', $rtTrucks->getRtCustomer()->getRtCustomerId(), $truck_registration_number); | |
} | |
else { | |
$pan_copy = 'NA'; | |
} | |
} | |
else { | |
$pan_number="None"; | |
$pan_copy = "None"; | |
$bank_account_name = "None"; | |
$bank_account_number = "0"; | |
$bank_account_number_repeat = "0"; | |
$ifsc_code = "None"; | |
$bank_name = "None"; | |
$bank_city = "None"; | |
$bank_location = "None"; | |
$bank_account_type = "None"; | |
$bank_state = "None"; | |
$bank_cheque_copy = "None"; | |
} | |
if (!$modal) { | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setTruckRegistrationNumber($rtTrucks); | |
} | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setPanNumber($pan_number); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setPanCopyPath($pan_copy); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setCustomerAccName($bank_account_name); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setCustomerAccNumber($bank_account_number); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setIfscCode($ifsc_code); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setBankName($bank_name); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setCity($bank_city); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setBranch($bank_location); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setState($bank_state); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setChequeCopyPath($bank_cheque_copy); | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setAdvancePaymentApprovalStatus("No"); //it has to come from the Form | |
$RtTruckOwnerBankAccountDetailsTruckLevel->setCountry("India"); | |
try { | |
$this->doctrine->em->persist($RtTruckOwnerBankAccountDetailsTruckLevel); | |
$this->doctrine->em->flush(); | |
} catch (Exception $e) { | |
$error = 'ERROR :'.$e->getMessage( ) . ' FILE: ' . __FILE__ . ' LINE :' . __LINE__; | |
$this->passErrorToView($error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment