Commit 4c96ff66 by Tobin

changes in admin

parent ea081d7b
...@@ -31,7 +31,8 @@ class Booking_model extends CI_Model { ...@@ -31,7 +31,8 @@ class Booking_model extends CI_Model {
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id) INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId) LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id) LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
WHERE $cond"; WHERE $cond
GROUP BY booking_id ORDER BY booking_id DESC";
$bookingData = $this->db->query($sql); $bookingData = $this->db->query($sql);
if($bookingData->num_rows() <= 0){ if($bookingData->num_rows() <= 0){
......
...@@ -13,7 +13,8 @@ class Customer_model extends CI_Model { ...@@ -13,7 +13,8 @@ class Customer_model extends CI_Model {
USR.status,CUST.profile_city AS city USR.status,CUST.profile_city AS city
FROM customer AS CUST FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id) INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE $cond"; WHERE $cond
GROUP BY CUST.customer_id ORDER BY CUST.customer_id DESC";
if(!empty($provider_id)){ if(!empty($provider_id)){
$sql = "SELECT CUST.customer_id,CUST.name,CUST.email,CUST.phone,CUST.email,CUST.gender, $sql = "SELECT CUST.customer_id,CUST.name,CUST.email,CUST.phone,CUST.email,CUST.gender,
...@@ -23,7 +24,8 @@ class Customer_model extends CI_Model { ...@@ -23,7 +24,8 @@ class Customer_model extends CI_Model {
INNER JOIN users AS USR ON (USR.id=CUST.customer_id) 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 booking AS BOK ON (BOK.customer_id=CUST.customer_id)
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_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' GROUP BY CUST.customer_id"; WHERE $cond AND EVT.provider_id='$provider_id' AND BOK.status!='4'
GROUP BY CUST.customer_id ORDER BY CUST.customer_id DESC";
} }
$customerData = $this->db->query($sql); $customerData = $this->db->query($sql);
......
...@@ -10,17 +10,13 @@ class Provider_model extends CI_Model { ...@@ -10,17 +10,13 @@ class Provider_model extends CI_Model {
return 0; return 0;
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE user_type IN('2','4') AND status!='2' AND username='".$provider_data['username']."'"); WHERE status!='2' AND username='".$provider_data['username']."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4; if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM provider AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.provider_id)
WHERE USR.user_type='2' AND USR.status!='2' AND PRV.email='".$provider_data['email']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2;
$phoneChk = $this->db->query("SELECT * FROM provider AS PRV $phoneChk = $this->db->query("SELECT * FROM provider AS PRV
INNER JOIN users AS USR ON (USR.id=PRV.provider_id) INNER JOIN users AS USR ON (USR.id=PRV.provider_id)
WHERE USR.user_type='2' AND USR.status!='2' AND PRV.phone='".$provider_data['phone']."'"); WHERE USR.user_type='2' AND USR.status!='2' AND
PRV.phone='".$provider_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3; if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3;
$status = $this->db->insert('users', $status = $this->db->insert('users',
......
...@@ -21,8 +21,7 @@ class Staff_model extends CI_Model { ...@@ -21,8 +21,7 @@ class Staff_model extends CI_Model {
return 0; return 0;
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND WHERE status!='2' AND username='".$staff_data['username']."'");
user_type IN (2,4,5)");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2; if(!empty($userNameChk) && $userNameChk->num_rows() > 0) return 2;
$status = $this->db->insert('users', $status = $this->db->insert('users',
...@@ -39,7 +38,7 @@ class Staff_model extends CI_Model { ...@@ -39,7 +38,7 @@ class Staff_model extends CI_Model {
return 0; return 0;
$userNameChk = $this->db->query("SELECT * FROM users $userNameChk = $this->db->query("SELECT * FROM users
WHERE status!='2' AND username='".$staff_data['username']."' AND WHERE status!='2' AND username='".$staff_data['username']."' AND
user_type IN (4,5) AND id!='".$staff_id."'"); id!='".$staff_id."'");
if(!empty($userNameChk) && $userNameChk->num_rows() > 0) { return 2; } if(!empty($userNameChk) && $userNameChk->num_rows() > 0) { return 2; }
if(!isset($staff_data['profile_image']) || empty($staff_data['profile_image'])){ if(!isset($staff_data['profile_image']) || empty($staff_data['profile_image'])){
......
...@@ -39,12 +39,11 @@ ...@@ -39,12 +39,11 @@
<thead> <thead>
<tr> <tr>
<th class="hidden">ID</th> <th class="hidden">ID</th>
<th width="80px;">Organizer</th> <th width="100px;">Organizer</th>
<th width="80px;">User Name</th> <th width="120px;">Email (User Name)</th>
<th width="80px;">Email_id</th> <th width="100px;">Phone</th>
<th width="70px;">Phone</th> <th width="80px;">Status</th>
<th width="60px;">Status</th> <th width="300px;">Action</th>
<th width="600px;">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -55,7 +54,6 @@ ...@@ -55,7 +54,6 @@
<th class="hidden"><?= $provider->provider_id ?></th> <th class="hidden"><?= $provider->provider_id ?></th>
<th class="center"><?= $provider->name ?></th> <th class="center"><?= $provider->name ?></th>
<th class="center"><?= $provider->username ?></th> <th class="center"><?= $provider->username ?></th>
<th class="center"><?= $provider->email ?></th>
<th class="center"><?= $provider->phone ?></th> <th class="center"><?= $provider->phone ?></th>
<th class="center" id="statusFlag_<?= $provider->provider_id ?>"> <th class="center" id="statusFlag_<?= $provider->provider_id ?>">
<?= ($provider->status == 1)?'Active':'De-activate' ?> <?= ($provider->status == 1)?'Active':'De-activate' ?>
......
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