UPDATE CHILDS WHILE ONLINE SUCCESS
This commit is contained in:
parent
df7113c5f0
commit
f2da709982
@ -49,7 +49,7 @@ else if(ENVIRONMENT == 'production')
|
||||
$config['txn_initiate_url'] = 'https://www.iobnet.co.in/iobpay/apitxninit.do';
|
||||
$config['txn_status_url'] = 'https://www.iobnet.co.in/iobpay/iobpayRESTService/apitxnstatusservice/gettxnstatus/';
|
||||
$config['merchant_reply_url'] = 'https://contribute.tnschools.gov.in/csrb/api/receiveIOBPAYResponse';
|
||||
$config['referer_url'] = 'https://testapp.iobnet.org';
|
||||
$config['referer_url'] = 'https://www.iobnet.co.in';
|
||||
|
||||
$config['success_url'] = 'https://contribute.tnschools.gov.in/csr/#/payment-status/success';
|
||||
$config['failure_url'] = 'https://contribute.tnschools.gov.in/csr/#/payment-status/failure';
|
||||
|
||||
@ -180,9 +180,12 @@ class iobpay extends REST_Controller
|
||||
{
|
||||
if($txnstatus=="SUCCESS")
|
||||
{
|
||||
$temp_array['msg'] = 'Txn Sucessfull!';
|
||||
$temp_array['msg'] = 'Txn Successfull!';
|
||||
// update FUNS_RECEIVED status against contribute id
|
||||
$updated = $this->user_management_model->updateRecords(array('status' => 'FUNDS_RECEIVED'),CSR_CONTRIBUTION_DETAILS,array('cont_id' => $contribution_id[0]['con_id']));
|
||||
$updated = $this->user_management_model->updateRecords(array('status' => 'FUNDS_RECEIVED'),CSR_CONTRIBUTIONS,array('id' => $contribution_id[0]['con_id']));
|
||||
|
||||
//update child
|
||||
$updated = $this->user_management_model->updateRecords(array('status' => 'FUNDS_RECEIVED'),CSR_CONTRIBUTION_DETAILS,array('cont_id' => $contribution_id[0]['con_id']));
|
||||
|
||||
header('Location: '.$this->config->item('success_url'));
|
||||
exit;
|
||||
@ -241,7 +244,8 @@ class iobpay extends REST_Controller
|
||||
|
||||
if($flag == 'STATUS_CHECK')
|
||||
{
|
||||
$txn_details = $this->user_management_model->selectCustomRecords(array('trackid','token','amount'),array('merchant_txn_id' => $merchant_txn_id),CSR_TXN_DETAILS);
|
||||
$txn_details = $this->user_management_model->selectCustomRecords(array('trackid','token','amount','con_id'),array('merchant_txn_id' => $merchant_txn_id),CSR_TXN_DETAILS);
|
||||
|
||||
}
|
||||
else if($flag == 'PDF')
|
||||
{
|
||||
@ -264,6 +268,7 @@ class iobpay extends REST_Controller
|
||||
$totalamt = $txn_details[ (count($txn_details) - 1) ]['amount'];
|
||||
$tokenid = $txn_details[ (count($txn_details) - 1) ]['token'];
|
||||
$trackid = $txn_details[ (count($txn_details) - 1) ]['trackid'];
|
||||
$con_id = $txn_details[ (count($txn_details) - 1) ]['con_id'];
|
||||
|
||||
$txn_staus = IOBPAY_UTILITY::checkTxnStatus($this->config->item('txn_status_url'),$merchant_id,$merchant_sub_id,$action,$feetype,$totalamt,$tokenid,$trackid,$sign_key,$encryption_key,$encryption_iv);
|
||||
|
||||
@ -285,6 +290,15 @@ class iobpay extends REST_Controller
|
||||
$merchanttxnid = $txn_staus->merchanttxnid;
|
||||
|
||||
$updated = $this->user_management_model->updateRecords(array('trackid' => $trackid,'txnstatus' => $txnstatus),CSR_TXN_DETAILS,array('merchant_txn_id' => $merchanttxnid));
|
||||
if($txnstatus == 'SUCCESS')
|
||||
{
|
||||
|
||||
//update parent
|
||||
$updated = $this->user_management_model->updateRecords(array('status' => 'FUNDS_RECEIVED'),CSR_CONTRIBUTIONS,array('id' => $con_id));
|
||||
//update child
|
||||
$updated = $this->user_management_model->updateRecords(array('status' => 'FUNDS_RECEIVED'),CSR_CONTRIBUTION_DETAILS,array('cont_id' => $con_id));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$result_array = array('ref_id' => $trackid,'txnstatus' => $txnstatus,'amt' => $txn_staus->totalamt,'merchanttxnid' => $merchanttxnid);
|
||||
|
||||
@ -163,8 +163,9 @@ class school_requirement_model extends Custom_Model {
|
||||
// echo $no_of_schools_posted;
|
||||
// echo $total_amount_required;
|
||||
|
||||
$query = "SELECT count(distinct user_id) as supporters,sum(amount) as contributed_amount,(SELECT count(distinct school_id) FROM ".CSR_SCHOOL_REQUIREMENTS.") as no_of_schools_posted,(SELECT sum((qty * CSR_MATERIAL_MASTER.cost_per_unit)) as required_amount FROM ".CSR_SCHOOL_REQUIREMENTS." as CSR_SCHOOL_REQUIREMENTS LEFT JOIN ".CSR_MATERIAL_MASTER." as CSR_MATERIAL_MASTER on CSR_SCHOOL_REQUIREMENTS.mat_id = CSR_MATERIAL_MASTER.id) as total_amount_required FROM ".CSR_CONTRIBUTIONS."";
|
||||
$query = "SELECT count(distinct user_id) as supporters,ifnull(sum(amount),0) as contributed_amount,(SELECT count(distinct school_id) FROM ".CSR_SCHOOL_REQUIREMENTS.") as no_of_schools_posted,(SELECT sum((qty * CSR_MATERIAL_MASTER.cost_per_unit)) as required_amount FROM ".CSR_SCHOOL_REQUIREMENTS." as CSR_SCHOOL_REQUIREMENTS LEFT JOIN ".CSR_MATERIAL_MASTER." as CSR_MATERIAL_MASTER on CSR_SCHOOL_REQUIREMENTS.mat_id = CSR_MATERIAL_MASTER.id WHERE CSR_SCHOOL_REQUIREMENTS.isactive = 1) as total_amount_required FROM ".CSR_CONTRIBUTIONS." as CSR_CONTRIBUTIONS WHERE CSR_CONTRIBUTIONS.status= 'FUNDS_RECEIVED'OR CSR_CONTRIBUTIONS.status= 'MAT_RECEIVED'";
|
||||
return $this->db->query($query)->result_array()[0];
|
||||
print_r($this->db->last_query());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class user_management_model extends Custom_Model {
|
||||
|
||||
//$contributions = $this->user_management_model->selectCustomRecords(array('id', 'user_id', 'cont_type', 'cont_towards', 'amount', 'payment_mode', 'payment_ref','gen_dev_fund_remarks', 'mat_delivery_point', 'mat_delivery_date','DATE_FORMAT(timestamp,"%d-%m-%Y %h:%i %p") as contribute_date'),array('user_id' => $userid),CSR_CONTRIBUTIONS);
|
||||
|
||||
$this->db->SELECT('CSR_CONTRIBUTIONS.id, CSR_CONTRIBUTIONS.user_id, CSR_CONTRIBUTIONS.cont_type, CSR_CONTRIBUTIONS.cont_towards, CSR_CONTRIBUTIONS.amount, CSR_CONTRIBUTIONS.amount, CSR_CONTRIBUTIONS.payment_mode,CSR_CONTRIBUTIONS.payment_ref,CSR_CONTRIBUTIONS.gen_dev_fund_remarks,CSR_CONTRIBUTIONS.mat_delivery_point,CSR_CONTRIBUTIONS.mat_delivery_date,DATE_FORMAT(convert_tz(CSR_CONTRIBUTIONS.timestamp,"+00:00","+05:30"),"%d-%m-%Y %h:%i %p") as contribute_date,CSR_TXN_DETAILS.merchant_txn_id,CSR_TXN_DETAILS.txnstatus,concat(DATE_FORMAT(convert_tz(CSR_CONTRIBUTIONS.timestamp,"+00:00","+05:30"),"%Y%m%d"),CSR_TXN_DETAILS.merchant_txn_id) as ref_id,CSR_TXN_DETAILS.trackid');
|
||||
$this->db->SELECT('CSR_CONTRIBUTIONS.id, CSR_CONTRIBUTIONS.user_id, CSR_CONTRIBUTIONS.cont_type, CSR_CONTRIBUTIONS.cont_towards, CSR_CONTRIBUTIONS.amount, CSR_CONTRIBUTIONS.amount, CSR_CONTRIBUTIONS.payment_mode,CSR_CONTRIBUTIONS.payment_ref,CSR_CONTRIBUTIONS.gen_dev_fund_remarks,CSR_CONTRIBUTIONS.mat_delivery_point,CSR_CONTRIBUTIONS.mat_delivery_date,DATE_FORMAT(convert_tz(CSR_CONTRIBUTIONS.timestamp,"+00:00","+05:30"),"%d-%m-%Y %h:%i %p") as contribute_date,CSR_TXN_DETAILS.merchant_txn_id,CSR_TXN_DETAILS.txnstatus,concat(DATE_FORMAT(convert_tz(CSR_CONTRIBUTIONS.timestamp,"+00:00","+05:30"),"%Y%m%d"),CSR_TXN_DETAILS.merchant_txn_id) as ref_id,CSR_TXN_DETAILS.trackid,CSR_CONTRIBUTIONS.payment_type,CSR_CONTRIBUTIONS.payment_date,CSR_CONTRIBUTIONS.bank_branch,CSR_CONTRIBUTIONS.mode_of_deposit,CSR_CONTRIBUTIONS.cheque_drop_address');
|
||||
$this->db->FROM(CSR_CONTRIBUTIONS.' as CSR_CONTRIBUTIONS');
|
||||
$this->db->JOIN(CSR_TXN_DETAILS.' as CSR_TXN_DETAILS','CSR_CONTRIBUTIONS.id = CSR_TXN_DETAILS.con_id','LEFT');
|
||||
$this->db->WHERE('CSR_CONTRIBUTIONS.user_id',$userid);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user