/** * Check Whether the user is logged in * * Create a admin URL based on the admin folder path mentioned in config file. Segments can be passed via the * first parameter either as a string or an array. * * @access public * @param string * @return string */ function admin_client_action($data) { $r_data['result'] = false; $action = $data['action']; $client_id = $data['client_id']; $table = 'pl_user'; $condition = array('user_id' => $client_id); $CI =& get_instance(); //For Client account approve if ($action == 'admin_client_approve') { $data_val = array('acc_active' => 1); $result = $CI->user_model->updateData($table, $data_val, $condition); if ($result != 0) { $r_data['result'] = true; } } if ($action == 'admin_client_disapprove') { $data_val = array('acc_active' => 0); $result = $CI->user_model->updateData($table, $data_val, $condition); if ($result != 0) { $r_data['result'] = true; } } $r_data['total_clients'] = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'is_active' => 1)); $r_data['total_pending_clients'] = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'acc_active' => 0, 'is_active' => 1)); $r_data['total_approved_clients'] = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'acc_active' => 1, 'is_active' => 1)); echo json_encode($r_data); }
<?php $client_list = getAllClients(); $total_clients = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'is_active' => 1)); $total_pending_clients = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'acc_active' => 0, 'is_active' => 1)); $total_approved_clients = totalCount($table = 'pl_user', $condition = array('role_id' => 2, 'acc_active' => 1, 'is_active' => 1)); ?> <div class="container-fluid" style="margin-top:20px;"> <div class="row"> <div class="col-lg-4 col-md-4"> <section class="panel panel-box"> <div class="panel-left panel-item bg-info"> <i class="fa fa-users text-huge"></i> </div> <div class="panel-right panel-item bg-reverse"> <p class="size-h1 clients_count"><?php echo $total_clients; ?> </p> <p class="text-muted">Clients</p> </div> </section> </div> <div class="col-lg-4 col-md-4"> <section class="panel panel-box"> <div class="panel-left panel-item bg-success"> <i class="fa fa-check text-huge"></i> </div> <div class="panel-right panel-item bg-reverse"> <p class="size-h1 approved_clients_count"><?php
$countAlertSMSQuery = mysqli_query($dbConnect, $countAlertSMSsql . " '{$newSDate}' AND '{$newEDate}'"); $countAlertSMSresult1 = mysqli_fetch_array($countAlertSMSQuery); echo "<td align='right'>{$countAlertSMSresult1[$countAlertSMSresult]}</td>"; echo "</tr>"; $alertSMSsql1 = "SELECT DISTINCT main_indicator FROM m_lib_alert_indicators"; $alertSMSname = "main_indicator"; $alertSMSsql2 = "SELECT count(sms_id) FROM m_lib_sms_alert WHERE sms_code LIKE "; $alertSMSsql3 = "date_format(alert_date, '%Y/%m/%d')"; $alertSMS = "count(sms_id)"; distributionSMStotal($s, $e, $alertSMSsql1, $alertSMSname, $alertSMSname, $alertSMSsql2, $alertSMSsql3, $alertSMS); //SMS STATUS echo "<tr id='end' class='header'>"; echo "<td><ul type='none' style='margin-left:-15px'><li><span style='padding-right:9px;'>-</span>Distribution Per Sending Status</li></ul></td>"; $countStatusSMSsql = "SELECT count(DISTINCT sms_id) FROM m_lib_sms_alert " . "WHERE date_format(alert_date, '%Y/%m/%d') BETWEEN "; $countStatusSMSresult = "count(DISTINCT sms_id)"; totalCount($s, $e, $countStatusSMSsql, $countStatusSMSresult); //Grand Total $countStatusSMSQuery = mysqli_query($dbConnect, $countStatusSMSsql . " '{$newSDate}' AND '{$newEDate}'"); $countStatusSMSresult1 = mysqli_fetch_array($countStatusSMSQuery); echo "<td align='right'>{$countStatusSMSresult1[$countStatusSMSresult]}</td>"; echo "</tr>"; $statusSMSsql1 = "SELECT DISTINCT sms_status FROM m_lib_sms_alert"; $statusSMSname = "sms_status"; $statusSMSsql2 = "SELECT count(sms_status) FROM m_lib_sms_alert WHERE sms_status = "; $statusSMSsql3 = "date_format(alert_date, '%Y/%m/%d')"; $statusSMS = "count(sms_status)"; distributionTotal($s, $e, $statusSMSsql1, $statusSMSname, $statusSMSname, $statusSMSsql2, $statusSMSsql3, $statusSMS); //End of Table echo "</table>"; echo "</div>"; }