Commit e680e527 by Tobin

dc

parent 3b036b3c
...@@ -125,9 +125,9 @@ ...@@ -125,9 +125,9 @@
return $savePath; return $savePath;
} }
function BayanPayPayment(){ // function BayanPayPayment(){
include 'BayanPayPaymentLibrary.php'; // include 'BayanPayPaymentLibrary.php';
} // }
function getCurrency($userId=''){ function getCurrency($userId=''){
$CI = & get_instance(); $CI = & get_instance();
......
...@@ -557,30 +557,30 @@ class Api_model extends CI_Model { ...@@ -557,30 +557,30 @@ class Api_model extends CI_Model {
$imgExt = strtolower($imgNameArr[1]); $imgExt = strtolower($imgNameArr[1]);
if($imgExt=='png' || $imgExt=='jpeg' || $imgExt == 'jpg' || $imgExt == 'gif'){ if($imgExt=='png' || $imgExt=='jpeg' || $imgExt == 'jpg' || $imgExt == 'gif'){
$imgPath = 'assets/uploads/user/CUST_'.$user_id.'.png'; $imgPath = 'assets/uploads/user/CUST_'.$user_id.'.'.$imgExt;
$imgQRPath = 'assets/uploads/user/CUST_QR_'.$user_id.'.png'; // $imgQRPath = 'assets/uploads/user/CUST_QR_'.$user_id.'.png';
$bagImagePath = 'assets/uploads/user/bitmoji_back.png'; // $bagImagePath = 'assets/uploads/user/bitmoji_back.png';
move_uploaded_file($data['file']["tmp_name"],"./".$imgPath); move_uploaded_file($data['file']["tmp_name"],"./".$imgPath);
$imgSrc = imagecreatefrompng($imgPath); // $imgSrc = imagecreatefrompng($imgPath);
$bagSrc = imagecreatefrompng($bagImagePath); // $bagSrc = imagecreatefrompng($bagImagePath);
$bagW = imagesx($bagSrc)/3; // $bagW = imagesx($bagSrc)/3;
$bagH = imagesy($bagSrc)/3; // $bagH = imagesy($bagSrc)/3;
$imgW = imagesx($imgSrc); // $imgW = imagesx($imgSrc);
$imgH = imagesy($imgSrc); // $imgH = imagesy($imgSrc);
$scale = $imgW/$bagW; // $scale = $imgW/$bagW;
$iWidth = $bagW; // $iWidth = $bagW;
$iHeight = $imgH/$scale; // $iHeight = $imgH/$scale;
imagecopyresampled($bagSrc,$imgSrc,$iWidth,$bagH,0,0,$iWidth,$iHeight,$imgW,$imgH); // imagecopyresampled($bagSrc,$imgSrc,$iWidth,$bagH,0,0,$iWidth,$iHeight,$imgW,$imgH);
imagepng($bagSrc,$imgPath); // imagepng($bagSrc,$imgPath);
imagealphablending($imgPath, false); // imagealphablending($imgPath, false);
imagesavealpha($imgPath, true); // imagesavealpha($imgPath, true);
genQRcode(encode_param($user_id),$imgQRPath,$imgPath); // genQRcode(encode_param($user_id),$imgQRPath,$imgPath);
$post_data['profile_image'] = $imgPath; $post_data['profile_image'] = $imgPath;
$post_data['profile_image_qr'] = $imgQRPath; $post_data['profile_image_qr'] = '';//$imgQRPath;
$state=$this->db->where('customer_id',$user_id)->update('customer',$post_data); $state=$this->db->where('customer_id',$user_id)->update('customer',$post_data);
if($state){ if($state){
...@@ -1339,8 +1339,11 @@ class Api_model extends CI_Model { ...@@ -1339,8 +1339,11 @@ class Api_model extends CI_Model {
return $this->db->get()->row(); return $this->db->get()->row();
} }
function update_payment($response,$transactionid,$last_id,$status){ function update_payment($response='',$transactionid='',$last_id,$status){
try{ try{
if(empty($last_id)){
return;
}
$this->db->update('transaction', $this->db->update('transaction',
array('transaction_id'=>$transactionid, array('transaction_id'=>$transactionid,
'transaction_response'=>json_encode($response), 'transaction_response'=>json_encode($response),
......
...@@ -967,23 +967,21 @@ class Webservice_model extends CI_Model { ...@@ -967,23 +967,21 @@ class Webservice_model extends CI_Model {
$this->db->from('users'); $this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.id');
$num = $this->db->get()->num_rows(); $num = $this->db->get()->num_rows();
if($num > 0) if($num > 0) {
{
$res = array('status'=>0,'message'=>'Email address already exist','code'=>'ER32'); $res = array('status'=>0,'message'=>'Email address already exist','code'=>'ER32');
return $res; return $res;
} }
} }
if(isset($data['file'])){ if(isset($data['file'])){
$img=$data['file']['name']; $imgName = $data['file']['name'];
$expbanner = explode('.',$img); $imgNameArr = explode('.',$imgName);
$img_ext = strtolower($expbanner[1]); $imgExt = strtolower($imgNameArr[1]);
$rand = rand(10000,99999);
$encname = time().$rand; if($imgExt=='png' || $imgExt=='jpeg' || $imgExt == 'jpg' || $imgExt == 'gif'){
if($img_ext=='png' || $img_ext=='jpeg' || $img_ext == 'jpg' || $img_ext == 'gif'){ $imgPath = 'assets/uploads/user/CUST_'.$user_id.'.'.$imgExt;
$bannername = $encname.'.'.$img_ext; move_uploaded_file($data['file']["tmp_name"],"./".$imgPath);
$imagePath="./assets/uploads/".$bannername; $post_data['profile_image'] = $imgPath;
$post_data['profile_image'] = "assets/uploads/".$bannername;
move_uploaded_file($data['file']["tmp_name"],$imagePath);
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data); $state = $this->db->where('customer_id',$user_id)->update('customer',$post_data);
if($state){ if($state){
$img_error = 1; $img_error = 1;
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<body> <body>
<center><h1 style="margin-top: 20%">Please do not refresh this page...</h1></center> <center><h1 style="margin-top: 20%">Please do not refresh this page...</h1></center>
<form action="<?= $requestUrl ?>" method="post" id="BayanPay_online_payment"> <form action="<?= $rUrl ?>" method="post" id="BayanPay_online_payment">
<input type="hidden" name="MerchantID" value="<?php echo $merchantId; ?>"> <input type="hidden" name="MerchantID" value="<?php echo $mId; ?>">
<input type="hidden" name="CollaboratorID" value="<?php echo $collaboratorId; ?>"> <input type="hidden" name="CollaboratorID" value="<?php echo $colabId; ?>">
<input type="hidden" name="requestParameter" value="<?= $requestParameter ?>"> <input type="hidden" name="requestParameter" value="<?= $requestParam ?>">
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) { document.addEventListener("DOMContentLoaded", function(event) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment