本文整理汇总了PHP中Schedule::find_by_sql方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::find_by_sql方法的具体用法?PHP Schedule::find_by_sql怎么用?PHP Schedule::find_by_sql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::find_by_sql方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
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;
}
示例2: getTaskBySql
public function getTaskBySql()
{
return Schedule::find_by_sql();
}
示例3: index
public function index()
{
@$this->loadModel("Dashboard");
global $session;
$dashData = array();
$dashData = $this->model->getDashboardStat();
$this->view->oticketcount = $dashData['otcount'];
$this->view->aticketcount = $dashData['atcount'];
$this->view->oschedule = $dashData['oschedule'];
$this->view->oworksheet = $dashData['oworksheet'];
$this->view->clients = $dashData['clients'];
$this->view->pendings = $dashData['openPend'];
$this->view->cproducts = $dashData['cproducts'];
$lastmonth = (int) date("n") - 1;
$curmonth = date("n");
$this->view->monthreport = $this->model->getMonthlyReportFinance(" Month(datecreated) ='" . $curmonth . "' AND Year(datecreated)='" . date("Y") . "'");
$this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(" Month(datecreated) ='" . $lastmonth . "' AND Year(datecreated)='" . date("Y") . "'");
$this->view->thisquarter = $this->model->getThisQuaterReportFinance(" Quarter(datecreated) ='" . self::date_quarter() . "' AND Year(datecreated)='" . date("Y") . "'");
global $session;
if ($session->empright == "Super Admin") {
$this->view->render("dashboard/index");
} elseif ($session->empright == "Customer Support Services" || $session->empright == "Customer Support Service") {
$this->view->render("support/index");
} elseif ($session->empright == "Customer Support Engineer" || $session->empright == "Customer Service Engineer") {
@$this->loadModel("Itdepartment");
global $session;
$datan = "";
$uri = new Url("");
//$empworkdata = $this->model->getWorkSheetEmployee($id,"");
$ptasks = Worksheet::find_by_sql("SELECT * FROM work_sheet_form WHERE cse_emp_id =" . $_SESSION['emp_ident']);
// print_r($ptasks);
//$empworkdata['worksheet'];
$x = 1;
$datan .= "<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>";
if ($ptasks) {
foreach ($ptasks as $task) {
$datan .= "<tr><td>{$x}</td><td>{$task->prod_id}</td><td>{$task->status} </td><td>{$task->cse_emp_id}</td><td>{$task->problem}</td><td>{$task->sheet_date}</td><td><a href='" . $uri->link("itdepartment/worksheetdetail/" . $task->id . "") . "'>View Detail</a></td><td></td></tr>";
$x++;
}
} else {
$datan .= "<tr><td colspan='8'></td></tr>";
}
$datan .= "</tbody></table>";
$mysched = "<div id='transalert'>";
$mysched .= isset($_SESSION['message']) && !empty($_SESSION['message']) ? $_SESSION['message'] : "";
$mysched .= "</div>";
$psched = Schedule::find_by_sql("SELECT * FROM schedule WHERE status !='Closed' AND emp_id =" . $_SESSION['emp_ident'] . " ORDER BY id DESC");
//print_r($psched);
//$empworkdata['worksheet'];
$x = 1;
$mysched .= "<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>";
if ($psched) {
foreach ($psched as $task) {
$mysched .= "<tr><td>{$x}</td><td>{$task->prod_name}</td><td>{$task->issue} </td>";
$machine = Cproduct::find_by_id($task->prod_id);
$mysched .= "<td>{$machine->install_address} {$machine->install_city}</td><td>{$task->maint_type}</td><td>{$task->s_date}</td><td>";
if ($task->status == "Open") {
$mysched .= "<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>";
}
if ($task->status == "In Progress") {
$mysched .= "<a href='" . $uri->link("itdepartment/worksheetupdateEmp/" . $task->id . "") . "'>Get Work Sheet</a>";
}
$mysched .= "\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>×</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>";
$x++;
}
} else {
$mysched .= "<tr><td colspan='8'>There is no task currently</td></tr>";
}
$mysched .= "</tbody></table>";
$this->view->oldtask = $datan;
$this->view->schedule = $mysched;
$this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);
$this->view->render("itdepartment/staffaccount");
} else {
$this->view->render("login/index", true);
}
}
示例4: doAcceptTask
public function doAcceptTask($id = "")
{
@$this->loadModel("Itdepartment");
global $session;
$uri = new Url("");
if ($this->model->acceptTask() === 1) {
$_SESSION['message'] = "<div data-alert class='alert-box success'>Record Saved<a href='#' class='close'>×</a></div>";
$mysched = "<div id='transalert'>";
$mysched .= isset($_SESSION['message']) && !empty($_SESSION['message']) ? $_SESSION['message'] : "";
$mysched .= "</div>";
$psched = Schedule::find_by_sql("SELECT * FROM schedule WHERE status !='Closed' AND emp_id =" . $_SESSION['emp_ident'] . " ORDER BY id DESC");
//print_r($psched);
//$empworkdata['worksheet'];
$x = 1;
$mysched .= "<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>";
if ($psched) {
foreach ($psched as $task) {
$mysched .= "<tr><td>{$x}</td><td>{$task->prod_name}</td><td>{$task->issue} </td>";
$machine = Cproduct::find_by_id($task->prod_id);
$mysched .= "<td>{$machine->install_address} {$machine->install_city}</td><td>{$task->maint_type}</td><td>{$task->s_date}</td><td>";
if ($task->status == "Open") {
$mysched .= "<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>";
}
if ($task->status == "In Progress") {
$mysched .= "<a href='" . $uri->link("itdepartment/worksheetupdateEmp/" . $task->id . "") . "'>Get Work Sheet</a>";
}
$mysched .= "\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>×</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>";
$x++;
}
} else {
$mysched .= "<tr><td colspan='8'>There is no task currently</td></tr>";
}
$mysched .= "</tbody></table>";
echo $mysched;
} elseif ($this->model->acceptTask() === 2) {
echo "<div data-alert class='alert-box alert'>Record not saved<a href='#' class='close'>×</a></div>";
}
}