public function run($username, $password) { global $session; $userReg = Clientuser::authenticate($username, $password); if ($userReg) { $session->Clientlogin($userReg); return true; } else { return false; } }
public function getData() { global $database; $depts = Department::find_all(); $role = Roles::find_all(); $country = Country::find_all(); $vendors = Vendor::find_all(); $countAcc = count(Cproduct::find_by_client($_SESSION["client_ident"])); $schedule = Cproduct::getNextSchedule($_SESSION["client_ident"]); $OnSchedule = Schedule::find_by_sql("SELECT * FROM schedule WHERE client_id='" . $_SESSION['client_ident'] . "' AND maint_type !='Activation' AND (status='Open' OR status='In Progress') ORDER BY id DESC LIMIT 10"); $OnScheduleAct = Schedule::find_by_sql("SELECT * FROM schedule WHERE client_id='" . $_SESSION['client_ident'] . "' AND maint_type='Activation' AND (status='Open' OR status='In Progress') ORDER BY id DESC LIMIT 10"); $countTicketOpen = count(Ticket::find_by_sql("SELECT * FROM support_ticket WHERE client_id ='" . $_SESSION['client_ident'] . "' AND status ='Open'")); $countTicketClose = count(Ticket::find_by_sql("SELECT * FROM support_ticket WHERE client_id ='" . $_SESSION['client_ident'] . "' AND status ='Closed'")); $countTicketPending = count(Ticket::find_by_sql("SELECT * FROM support_ticket WHERE client_id ='" . $_SESSION['client_ident'] . "' AND (status ='Admin Reply' OR status='Customer Reply')")); $countTic = count(Ticket::find_by_client($_SESSION['client_ident'])); $countuser = count(Clientuser::find_by_client($_SESSION['client_ident'])); $zone = Zone::find_by_sql("SELECT * FROM zone"); $startups = array("cschedule" => $OnSchedule, "departs" => $depts, "country" => $country, "zone" => $zone, "vendors" => $vendors, "role" => $role, "countProd" => $countAcc, "countTick" => $countTic, "Schel" => $schedule, "SchelAct" => $OnScheduleAct, "CountPending" => $countTicketPending, "CountOpent" => $countTicketOpen, "CountClosed" => $countTicketClose, "CountUsers" => $countuser); return $startups; }
echo $uri->link("supportticket/index"); ?> " class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a> </div> </div><!-- ./col --> <?php global $session; $user = Client::find_by_id($_SESSION['client_ident']); if ($_SESSION['user_role'] == "admin") { echo "<div class='col-lg-2 col-xs-6'>\n <!-- small box -->\n <div class='small-box bg-teal'>\n <div class='inner'>\n <h3>{$this->usercount} </h3>\n <p>Users</p>\n </div>\n <div class='icon'>\n <i class='ion ion-person-add'></i>\n </div>\n <a href='"; echo $_SESSION['user_role'] === 'admin' ? $uri->link("users/index") : "javascript:void(0)"; echo "' class='small-box-footer'>More info <i class='fa fa-arrow-circle-right'></i></a>\n\n </div>\n </div>"; } elseif (strtolower($_SESSION['user_role']) == "standard user" || strtolower($_SESSION['user_role']) == "standard") { $me = Clientuser::find_by_id($_SESSION['user_ident']); } ?> </div><!-- /.row --> <div class="row"> <div class="col-lg-6"> <div class="box box-info"> <div class="box-header with-border"> <h3 class="box-title">Terminals On Service Schedules</h3> <div class="box-tools pull-right"> <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button> <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> </div>
public function delete($id) { $newuser = Clientuser::find_by_id($id); if ($newuser->delete()) { return true; } }