public function scanTask($serv, $task_id, $from_id, $data) { global $admin_id; $task_list = get_url('list', $admin_id); foreach ($task_list as $_task_id => $_task_info) { if (!empty($_task_info['stop'])) { //进库 Service::getInstance()->scanResult($_task_id, $_task_info['url']); } } }
<?php include 'class/includes.php'; $view = new Savant3(); $service = Service::getInstance(); $view->setPath('template', array(TPL_PATH)); if (isset($_POST['search_term']) && chkid($_POST['city_id'])) { //TODO avoid search if term is empty(?) $search_term = htmlentities(text_only(trim($_POST['search_term'])), ENT_QUOTES, CONF_ENC); if ($search_term == LANG_SEARCH_TEXT) { $search_term = ''; } else { //TODO check for other criteria and if none dispaly message - no search term } $view->search_term = $search_term; $search_term = mb_strtoupper($search_term, CONF_ENC); $city_id = $_POST['city_id']; if (chkid($_POST['cat_id'])) { $cat_id = $_POST['cat_id']; $field_list = $service->get_searchable_field_list($cat_id); if (count($field_list) > 0) { foreach ($field_list as $key => $value) { switch ($value['type']) { case TYPE_NUMBER: if (isset($_POST[$value['name'] . TYPE_NUMBER_FROM]) && ctype_digit($_POST[$value['name'] . TYPE_NUMBER_FROM]) && $_POST[$value['name'] . TYPE_NUMBER_FROM] >= 0) { $field_list[$key]['from'] = text_only($_POST[$value['name'] . TYPE_NUMBER_FROM]); } if (isset($_POST[$value['name'] . TYPE_NUMBER_TO]) && ctype_digit($_POST[$value['name'] . TYPE_NUMBER_TO]) && $_POST[$value['name'] . TYPE_NUMBER_TO] >= 0) { $field_list[$key]['to'] = text_only($_POST[$value['name'] . TYPE_NUMBER_TO]); } break;
public function TerminateOverdueOrders() { $setting = Settings::getInstance(); $service = Service::getInstance(); $time = Time::getInstance(); $retarray = array(); $days = $time->UtoM(time()); $this->raw = $this->db->fetch_all_array('SELECT * FROM `Order` WHERE `status` = "Suspended" AND `nextdue` < "' . $days . '" AND `cycle` > 0'); for ($i = 0; $i < count($this->raw); $i++) { if ($time->diff_dates($days, $this->raw[$i]['nextdue'], 'D') > 14) { if ($service->Terminate($this->raw[$i]['id'])) { $retarray[$this->raw[$i]['id']] = "1"; } else { $retarray[$this->raw[$i]['id']] = "0"; } } } return $retarray; }
function do_crea_respuesta_cerrada() { $user = Session::get_user(); if ($user != null && $user->getVerified()) { $service = Service::getInstance(); return json_encode($service->do_crea_respuesta_cerrada($this)); } else { header("Location: ?ID=login"); exit(0); } }