Commit e680e527 by Tobin

dc

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