Commit 2f39e1d8 by Tobin

dc

parent 7faace52
......@@ -557,30 +557,21 @@ 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.'.'.$imgExt;
// $imgQRPath = 'assets/uploads/user/CUST_QR_'.$user_id.'.png';
// $bagImagePath = 'assets/uploads/user/bitmoji_back.png';
$imgPath = 'assets/uploads/user/CUST_'.$user_id.'.jpg';
$imgQRPath = 'assets/uploads/user/CUST_QR_'.$user_id.'.jpg';
$imgFramePath = 'assets/images/bitmojiFrame.jpg';
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;
$usrImage = imagecreatefrompng($imgPath);
$imgFrame = imagecreatefromjpeg($imgFramePath);
// 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);
imagecopy($imgFrame,$usrImage,(imagesx($imgFrame)/2)-(imagesx($usrImage)/2),(imagesy($imgFrame)/2)-(imagesy($usrImage)/2),0,0,imagesx($usrImage),imagesy($usrImage));
imagesavealpha($imgFrame, true);
imagepng($imgFrame,$imgPath,0);
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){
......@@ -655,7 +646,9 @@ class Api_model extends CI_Model {
$rs = $this->db->insert('booking', $post_data);
if($rs){
if(!empty($promocodeData)){
$this->db->insert('promocode_used',$promocodeData);
}
$res = array('status'=>1,'data'=>array('user_id'=>$user_id,
'bookingCode'=>$post_data['bookId']));
......
......@@ -1064,7 +1064,9 @@ class Webservice_model extends CI_Model {
$id = $this->db->insert_id();
if($id){
if(!empty($promocodeData)){
$this->db->insert('promocode_used',$promocodeData);
}
$res = array('status'=>1,'data'=>array('bookingCode'=>$post_data['bookId']));
$insertArr = array();
$inStatus = ($post_data['status'] == 1)?'1':'0';
......
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