Commit ea081d7b by Tobin

staff customer and provider usertype check

parent e97971e1
......@@ -767,6 +767,7 @@ class Api extends CI_Controller {
!isset($reqData['auth_token']) || empty($reqData['auth_token'])){
redirect($redUrl.'failure');
}
$reqData['cardNumber'] = str_replace(' ', '', $reqData['cardNumber']);
$payData = array('auth_token'=>$reqData['auth_token'],'amount'=>'1','booking_id'=>'ADD_CARD');
$res = $this->Api_model->payNow($payData);
......
......@@ -23,7 +23,7 @@ class Customer_model extends CI_Model {
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
INNER JOIN booking AS BOK ON (BOK.customer_id=CUST.customer_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
WHERE $cond AND EVT.provider_id='$provider_id' AND BOK.status!='4'";
WHERE $cond AND EVT.provider_id='$provider_id' AND BOK.status!='4' GROUP BY CUST.customer_id";
}
$customerData = $this->db->query($sql);
......
......@@ -10,7 +10,7 @@ class Provider_model extends CI_Model {
return 0;
$userNameChk = $this->db->query("SELECT * FROM users
WHERE user_type='2' AND status!='2' AND username='".$provider_data['username']."'");
WHERE user_type IN('2','4') AND status!='2' AND username='".$provider_data['username']."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM provider AS PRV
......
......@@ -22,7 +22,7 @@ class Staff_model extends CI_Model {
$userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type IN (4,5)");
user_type IN (2,4,5)");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2;
$status = $this->db->insert('users',
......
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