Commit a579a245 by Tobin

daily commit

parent f4ee07e0
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
function genQRcode($data){ function genQRcode($data){
include 'qr_code/autoload.php'; include 'qr_code/autoload.php';
$logo = 'assets/images/asset_logo.png'; $logo = 'assets/images/qr-cod-icon.png';
$QR = imagecreatefrompng('https://chart.googleapis.com/chart?cht=qr&chld=H|1&chs=500x500&chl='.urlencode($data)); $QR = imagecreatefrompng('https://chart.googleapis.com/chart?cht=qr&chld=H|1&chs=500x500&chl='.urlencode($data));
$logo = imagecreatefromstring(file_get_contents($logo)); $logo = imagecreatefromstring(file_get_contents($logo));
...@@ -125,4 +125,24 @@ ...@@ -125,4 +125,24 @@
include 'BayanPayPaymentLibrary.php'; include 'BayanPayPaymentLibrary.php';
} }
// function resizeImage($file=array()){
// if(empty($file) || ($size = $file['size']/1024) < 100 ||
// empty($info = getimagesize($file['tmp_name'])) || $info['mime'] == 'image/gif'){
// return false;
// }
// $resize = 100 - ((100/$size)*100);
// pre($resize);
// if ($info['mime'] == 'image/jpeg') {
// $fname = 'assets/uploads/services/img_upload_'.time().'.jpg';
// $image = imagecreatefromjpeg($file['tmp_name']);
// imagejpeg($image,$fname,$resize);
// }
// else if ($info['mime'] == 'image/png') {
// $fname = 'assets/uploads/services/img_upload_'.time().'.png';
// $image = imagecreatefromjpeg($file['tmp_name']);
// imagepng($image,$fname,$resize);
// }
// return $fname;
// }
?> ?>
\ No newline at end of file
...@@ -34,7 +34,10 @@ class Api_model extends CI_Model { ...@@ -34,7 +34,10 @@ class Api_model extends CI_Model {
function register($data) { function register($data) {
try{ try{
$res_count = $this->db->where('email',$data['email_id'])->or_where('phone',$data['phone'])->get('customer')->row(); $email = $data['email_id'];
$phone = $data['phone'];
$res_count = $this->db->query("SELECT * FROM customer INNER JOIN `users` ON users.id = customer.customer_id AND users.user_type = 3 WHERE users.status AND (customer.email = '$email' OR customer.phone = '$phone')")->row();
//$res_count = $this->db->where('email',$data['email_id'])->where()->or_where('phone',$data['phone'])->get('customer')->row();
if(count($res_count) > 0) { if(count($res_count) > 0) {
if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){ if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12'); $res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12');
...@@ -58,7 +61,8 @@ class Api_model extends CI_Model { ...@@ -58,7 +61,8 @@ class Api_model extends CI_Model {
$customer_data = array( $customer_data = array(
'customer_id'=>$id, 'customer_id'=>$id,
'phone'=>$data['phone'], 'phone'=>$data['phone'],
'email'=>$data['email_id'] 'email'=>$data['email_id'],
'name'=>$data['name']
); );
$this->db->insert('customer', $customer_data); $this->db->insert('customer', $customer_data);
......
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