本文整理汇总了PHP中FSS_Helper::DateValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP FSS_Helper::DateValidate方法的具体用法?PHP FSS_Helper::DateValidate怎么用?PHP FSS_Helper::DateValidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSS_Helper
的用法示例。
在下文中一共展示了FSS_Helper::DateValidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTicketsBySearch
//.........这里部分代码省略.........
$allopen = FSS_Ticket_Helper::GetStatusIDs("is_closed");
// remove the archived tickets from the list to deal with
$def_archive = FSS_Ticket_Helper::GetStatusID('def_archive');
foreach ($allopen as $offset => $value) {
if ($value == $def_archive) {
unset($allopen[$offset]);
}
}
// tickets that are closed
$wherebits[] = " t.ticket_status_id IN ( " . implode(", ", $allopen) . ") /* all closed */";
} elseif ($status == 'all') {
// need all tickets that arent archived
$allopen = FSS_Ticket_Helper::GetStatusIDs("def_archive", true);
$wherebits[] = " t.ticket_status_id IN ( " . implode(", ", $allopen) . " ) /* all (not archived) */ ";
} elseif ($status == 'archived') {
// need all tickets that arent archived
$allopen = FSS_Ticket_Helper::GetStatusIDs("def_archive");
$wherebits[] = " t.ticket_status_id IN ( " . implode(", ", $allopen) . " ) /* archived */ ";
} else {
$wherebits[] = " t.ticket_status_id = " . (int) FSSJ3Helper::getEscaped($db, $status) . " /* specified status */";
}
}
$product = FSS_Input::getInt('product', '');
if ($product) {
$wherebits[] = " t.prod_id = '" . FSSJ3Helper::getEscaped($db, $product) . "' /* Product */";
}
$department = FSS_Input::getInt('department', '');
if ($department) {
$wherebits[] = " t.ticket_dept_id = '" . FSSJ3Helper::getEscaped($db, $department) . "' /* Department */ ";
}
$cat = FSS_Input::getInt('cat', '');
if ($cat) {
$wherebits[] = " t.ticket_cat_id = '" . FSSJ3Helper::getEscaped($db, $cat) . "' /* Category */";
}
$pri = FSS_Input::getInt('priority', '');
if ($pri) {
$wherebits[] = " t.ticket_pri_id = '" . FSSJ3Helper::getEscaped($db, $pri) . "' /* Priority */";
}
$group = FSS_Input::getInt('group', '');
if ($group > 0) {
$wherebits[] = " t.user_id IN (SELECT user_id FROM #__fss_ticket_group_members WHERE group_id = '" . FSSJ3Helper::getEscaped($db, $group) . "' GROUP BY user_id) /* Ticket Group */";
}
$date_from = FSS_Helper::DateValidate(FSS_Input::getString('date_from', ''));
$date_to = FSS_Helper::DateValidate(FSS_Input::getString('date_to', ''));
if ($date_from) {
$wherebits[] = " t.lastupdate > DATE_SUB('" . FSSJ3Helper::getEscaped($db, $date_from) . "',INTERVAL 1 DAY) /* Date From */";
}
if ($date_to) {
$wherebits[] = " t.opened < DATE_ADD('" . FSSJ3Helper::getEscaped($db, $date_to) . "',INTERVAL 1 DAY) /* Date To */";
}
$this->searchFields($wherebits, "advancedsearch");
if (count($wherebits) == 0) {
$wherebits[] = "1 /* Catch All */";
}
$query .= "\n WHERE " . implode("\n AND ", $wherebits);
} else {
$query .= " WHERE 1 /* Catch All */";
}
}
$query .= "\n AND " . $this->getTagFilter() . " /* Tag Filter */";
$query .= "\n AND " . SupportUsers::getAdminWhere() . " /* getAdminWhere */";
$query .= "\n AND " . SupportSource::admin_show_sql() . " /* admin_show_sql */";
$order = array();
if (SupportUsers::getSetting("group_products")) {
$order[] = "prod.ordering";
}
if (SupportUsers::getSetting("group_departments")) {
$order[] = "dept.title";
}
if (SupportUsers::getSetting("group_cats")) {
$order[] = "cat.title";
}
if (SupportUsers::getSetting("group_pri")) {
$order[] = "pri.ordering DESC";
}
if (SupportUsers::getSetting("group_group")) {
$order[] = "case when grp.groupname is null then 1 else 0 end";
$order[] = "grp.groupname";
}
$ordering = JFactory::getApplication()->getUserStateFromRequest("fss_admin.ordering", "ordering", "");
if ($ordering) {
$order = array();
$ordering = str_replace(".asc", " ASC", $ordering);
$ordering = str_replace(".desc", " DESC", $ordering);
$order[] = $ordering;
} else {
$order[] = "lastupdate DESC";
}
$query .= "\n ORDER BY " . implode(", ", $order);
$session = JFactory::getSession();
$session->set("last_admin_query", (string) $query);
$session->set("last_admin_list", $_SERVER['REQUEST_URI']);
$session->set("last_admin_post", $_POST);
//echo "<br>".str_replace("\n", "<br>", $query)."<br>";
$db->setQuery($query);
$db->query();
$this->ticket_count = $db->getNumRows();
$db->setQuery($query, $this->limitstart, $this->limit);
$this->LoadFromRows($db->loadObjectList());
}