Files
WrenchBoradWeb/www/application/models/Recipient_model.php
T
2019-05-31 11:26:35 -04:00

64 lines
1.9 KiB
PHP

<?php
class Recipient_model extends CI_Model {
var $optCons = '';
var $currentStyle = 'form-control select';
function __construct() {
}
public function verifyNewRecipientInfo($data, $member_id) {
$out = array();
$error_state = false;
$out['error'] = '';
if ($data['country'] == '' || $data['firstname'] == '' || $data['lastname'] == '' || $data['state'] == '' || $data['city'] == '') {
$out['error'] .="All feilds required<br>";
$error_state = true;
}
if ($error_state == false) {
if ($data['account_no'] == '' || $data['account_no_repeat'] == '') {
$out['error'] .="Invalid Account Number<br>";
$error_state = true;
} else {
if ($data['account_no'] != $data['account_no_repeat']) {
$out['error'] .="Account numbers did not match<br>";
$error_state = true;
}
}
if ($data['banks'] == '') {
$out['error'] .="Select Bank Name<br>";
$error_state = true;
}
if (trim($data['account_type']) == '') {
$out['error'] .="Select Account Type<br>";
$error_state = true;
}
}
$out['error_state'] = $error_state;
// print_r($data);
return $out;
}
}
/*
* $data['country_combo'] = $this->combo_model->getCountryCombo('country', $data['country']);
$data['bank_combo'] = $this->combo_model->getBankCombo('banks', $data['banks']);
$data['account_type'] = $this->combo_model->getAccountTypeCombo('account_type', $data['account_type']);
* $data['firstname'] = $data['lastname'] = $data['account_no'] = $data['account_no_repeat'] = '';
$data['state'] = $data['city'] = '';
*/