Ejemplo n.º 1
0
 public function index()
 {
     // set rules
     $this->_set_page_rule('R');
     // set template content
     $this->smarty->assign("template_content", "member/pending/index.html");
     // list waiting
     $rs_id = $this->m_member->get_list_pending_task_waiting(array($this->com_user['role_id'], $this->com_user['airlines_id']));
     foreach ($rs_id as $value) {
         // get detail rute
         $rs_rute = $this->m_member->get_data_rute_by_id(array($value['data_id']));
         $total_rute = COUNT($rs_rute);
         $list_rute = "";
         $x = 1;
         foreach ($rs_rute as $rute) {
             $x++;
             $list_rute .= $rute['airport_iata_cd'];
             if ($x <= $total_rute) {
                 $list_rute .= "-";
             }
         }
         $data[] = array("data_id" => $value['data_id'], "document_no" => $value['document_no'], "data_type" => $value['data_type'], "data_flight" => $value['data_flight'], "date_start" => $value['date_start'], "date_end" => $value['date_end'], "rute_all" => $list_rute, "services_nm" => $value['services_nm'], "task_nm" => $value['task_nm'], "selisih_hari" => $value['selisih_hari'], "selisih_waktu" => $value['selisih_waktu'], "group_link" => $value['group_link']);
     }
     $this->smarty->assign("rs_id", $rs_id);
     // $this->smarty->assign("rs_id", $rs_id);
     $this->smarty->assign("total", count($rs_id));
     // notification
     $this->tnotification->display_notification();
     $this->tnotification->display_last_field();
     // output
     parent::display();
 }
Ejemplo n.º 2
0
 public function index()
 {
     // 取商铺幻灯片
     $where = array('type' => 'SHOP');
     $scroll_shop = M('scroll')->where($where)->order('sort')->select();
     while (COUNT($scroll_shop) < 12) {
         $scroll_shop = array_merge($scroll_shop, $scroll_shop);
     }
     $this->scroll_shop = $scroll_shop;
     // 取首页幻灯片
     $where = array('type' => 'INDEX');
     $this->scroll_index = M('scroll')->where($where)->order('sort')->select();
     // 男士服装封面图片
     $data = M('picture')->where(array('type' => 'MANCLOTH'))->find();
     $this->man_cloth_picture = $data['pic_adr'];
     // 女士服装封面图片
     $data = M('picture')->where(array('type' => 'WOMANCLOTH'))->find();
     $this->woman_cloth_picture = $data['pic_adr'];
     // 鞋类封面图片
     $data = M('picture')->where(array('type' => 'SHOE'))->find();
     $this->shoe_picture = $data['pic_adr'];
     // 取QQ
     $where = array('type' => 'QQ');
     $this->QQ = M('webinfo')->where($where)->find();
     $this->display();
 }
Ejemplo n.º 3
0
 public function indexAction()
 {
     $loansearch = new Loandisbursmentg_Form_Search();
     $this->view->form = $loansearch;
     $this->view->transactiontype = 'Loan transaction';
     if ($this->_request->isPost() && $this->_request->getPost('Search')) {
         $formData = $this->_request->getPost();
         if ($this->_request->isPost()) {
             $formData = $this->_request->getPost();
             if ($loansearch->isValid($formData)) {
                 $search = $this->view->loanModel->searchaccounts($this->_request->getParam('accNum'));
                 if (!$search) {
                     echo "Enter a valid Number";
                 } else {
                     if (COUNT($search) == '1') {
                         foreach ($search as $account) {
                             $accountnumber = $account->number;
                         }
                         $this->_redirect("/loandisbursmentg/index/disbursment/accNum/" . base64_encode($accountnumber));
                     } else {
                         $this->view->accounts = $search;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 public function postBuscardni()
 {
     if (Request::ajax()) {
         $dni = Input::get('dni');
         $ficha = Input::get('ficha');
         $aData = Reniec::getPersona($dni);
         $aParametro['data'] = $aData;
         $aParametro['rst'] = 1;
         $aParametro['msj'] = "";
         if (COUNT($aData) == 0) {
             $ef = EscalafonFichas::getEFIdporFicha($ficha);
             $efr = EscalafonFichas::getEFRIdporFicha($ficha);
             $ficham = new Ficha();
             if (count($ef) > 0) {
                 $ficham['escalafon_ficha_id'] = $ef[0]->id;
                 if (count($efr) > 0) {
                     $ficham['escalafon_ficha_recepcion_id'] = $efr[0]->id;
                 }
             }
             $ficham['ficha'] = $ficha;
             $ficham['estado_ficha'] = 3;
             $ficham['usuario_created_at'] = Auth::user()->id;
             $ficham->save();
             $aParametro['rst'] = 2;
             $aParametro['msj'] = "No Existe persona con el dni:" . $dni . " Será contabilizada como firma inválida";
         }
         $vef = Ficha::getValidarEstadoFicha($ficha);
         $aParametro['estado'] = $vef;
         return Response::json($aParametro);
     }
 }
Ejemplo n.º 5
0
 public static function DataTable($db_name, $array_data)
 {
     $list = "<a href='?T=" . $_GET["T"] . "&amp;REQ=DEL_TABLE'>- DELETE TABLE " . strtoupper($_GET["T"]) . "</a><br>";
     $list .= "<a href='?T=" . $_GET["T"] . "&amp;REQ=ADD_ENTITIES'>- ADD ENTITIES TO " . strtoupper($_GET["T"]) . "</a><br>";
     $list .= "<table>";
     //open table
     $i = 0;
     //iteraction counter
     $a = 0;
     //get table name
     foreach ($array_data[0] as $key => $value) {
         if ($i % 2 == 0) {
             $list .= "<th>" . $key . "</th>";
             $titre[$a] = $key;
             $a++;
         }
         $i++;
     }
     //get table data
     foreach ($array_data as $k => $DATA) {
         $list .= "<tr>";
         //open row
         for ($i = 0; $i < COUNT($DATA) / 2; $i++) {
             $list .= "<td>" . $DATA[$i] . "</td>";
         }
         $list .= "<td><a href='?ID=" . $DATA[0] . "&amp;PRIMARY=" . $titre[0] . "&amp;T=" . $_GET["T"] . "&amp;REQ=UPDATE_DATA'><img src='./Fichiers/images/modifier.png'></a></td>";
         $list .= "<td><a href='?ID=" . $DATA[0] . "&amp;PRIMARY=" . $titre[0] . "&amp;T=" . $_GET["T"] . "&amp;REQ=DEL_DATA'><img src='./Fichiers/images/supprimer.png'></a></td>";
         $list .= "</tr>";
         // close row
     }
     $list .= "</table>";
     //close table
     return $list;
 }
Ejemplo n.º 6
0
 public function search_func()
 {
     $make = $this->input->post("chosen_make_box");
     echo json_encode($make);
     die;
     $make = "";
     $year = "";
     $price = "";
     if (isset($_POST['chosen_make_box'])) {
         $make = $_POST['chosen_make_box'];
     }
     if ($_POST['chosen_year_box']) {
         $year = $_POST['chosen_year_box'];
     }
     if ($_POST['chosen_price_tag']) {
         $price = $_POST['chosen_price_tag'];
     }
     echo "<pre>";
     print_r($_POST);
     die;
     $data["result"] = $this->home_m->search_func($make, $year, $price);
     $data['rows'] = COUNT($this->home_m->search_func($make, $year, $price));
     $data['page_rows'] = 12;
     $data['last'] = ceil($data['rows'] / $data['page_rows']);
     $data['pagenum'] = 1;
     //first page of gallery
     print_r($data["result"]);
     die;
     $data['content_view'] = "index/search_v";
     $data['menu'] = "home";
     $this->load->view('template/layout', $data);
     // echo json_encode($result);
 }
Ejemplo n.º 7
0
 public function index()
 {
     // set page rules
     $this->_set_page_rule("R");
     // set template content
     $this->smarty->assign("template_content", "member/registration_non/list.html");
     // list opened form
     $rs_id = $this->m_registration->get_list_registration_open(array('bukan niaga', $this->com_user['airlines_id']));
     $data = array();
     foreach ($rs_id as $value) {
         // get detail rute
         $rs_rute = $this->m_registration->get_data_rute_by_id(array($value['data_id']));
         $total_rute = COUNT($rs_rute);
         $list_rute = "";
         $x = 1;
         foreach ($rs_rute as $rute) {
             $x++;
             $list_rute .= $rute['airport_iata_cd'];
             if ($x <= $total_rute) {
                 $list_rute .= "-";
             }
         }
         $data[] = array("data_id" => $value['data_id'], "published_no" => $value['published_no'], "data_type" => $value['data_type'], "data_flight" => $value['data_flight'], "date_start" => $value['date_start'], "date_end" => $value['date_end'], "rute_all" => $list_rute, "services_nm" => $value['services_nm'], "flight_no" => $value['flight_no'], "selisih_hari" => $value['selisih_hari'], "selisih_waktu" => $value['selisih_waktu']);
     }
     $this->smarty->assign("rs_id", $rs_id);
     $this->smarty->assign("total", count($rs_id));
     // notification
     $this->tnotification->display_notification();
     $this->tnotification->display_last_field();
     // output
     parent::display();
 }
 public function index()
 {
     // 基础信息
     $phone = M('webinfo')->where(array('type' => C('电话')))->field('content')->find();
     $middle = explode(' ', $phone['content']);
     $this->phone = $middle['0'];
     $banquan = M('webinfo')->where(array('type' => C('版权')))->field('content')->find();
     $this->banquan = $banquan['content'];
     // 明星师资
     $teacher = M('teacher')->order('sort')->field('controller,created_time,sort', ture)->select();
     for ($i = 0; $i < COUNT($teacher); $i++) {
         $teacher[$i]['content'] = mb_substr($teacher[$i]['content'], 0, 78, 'utf-8');
         $teacher[$i]['content'] = $teacher[$i]['content'] . "...";
     }
     $this->teacher = $teacher;
     // 历届成绩
     $achievement = M('achievement')->order('sort')->field('controller,created_time,sort', ture)->select();
     // 遍历取录入情况
     for ($i = 0; $i < COUNT($achievement); $i++) {
         $str = "";
         $data = M('achievement_status')->where(array('achievement_id' => $achievement[$i]['id']))->field('achievement_id', ture)->select();
         for ($j = 0; $j < COUNT($data); $j++) {
             $str = $str . $data[$j]['school'] . $data[$j]['number'] . '人;';
         }
         $achievement[$i]['status'] = $str;
     }
     $this->achievement = $achievement;
     // 1977作品
     $this->works = M('picture')->where(array('type' => C('作品展示')))->field('controller,created_time,type', ture)->find();
     // 教学环境
     $this->environment = M('picture')->where(array('type' => C('教学环境')))->field('controller,created_time,type', ture)->find();
     $this->display();
 }
 public static function track($file, $rs = '')
 {
     $db = Database::getDatabase();
     if (SITE_CONFIG_STATS_ONLY_COUNT_UNIQUE == 'yes') {
         // check whether the user has already visited today
         $sql = "SELECT * FROM stats WHERE ip = " . $db->quote(self::getIP()) . " AND page_title = " . $file->id . " AND DATE(dt) = " . $db->quote(date('Y-m-d'));
         $row = $db->getRows($sql);
         if (COUNT($row)) {
             return false;
         }
     }
     $file->updateVisitors();
     $dt = date("Y-m-d H:i:s");
     $referer = getenv('HTTP_REFERER');
     $referer_is_local = self::refererIsLocal($referer);
     $url = full_url();
     $img_search = '';
     $ip = self::getIP();
     $info = self::browserInfo();
     $browser_family = $info['browser'];
     $browser_version = $info['version'];
     $os = $info['platform'];
     $os_version = '';
     $user_agent = $info['useragent'];
     $country = self::getCountry($ip);
     $base_url = self::getBaseUrl($referer);
     $sql = "INSERT INTO stats (dt, referer, referer_is_local, url, page_title, country, img_search, browser_family, browser_version, os, os_version, ip, user_agent, base_url)\n                    VALUES (:dt, :referer, :referer_is_local, :url, :page_title, :country, :img_search, :browser_family, :browser_version, :os, :os_version, :ip, :user_agent, :base_url)";
     $vals = array('dt' => $dt, 'referer_is_local' => $referer_is_local, 'referer' => $referer, 'url' => $url, 'page_title' => $file->id, 'country' => $country, 'img_search' => $img_search, 'ip' => $ip, 'browser_family' => $browser_family, 'browser_version' => $browser_version, 'os_version' => $os_version, 'os' => $os, 'user_agent' => $user_agent, 'base_url' => $base_url);
     $db->query($sql, $vals);
     return true;
 }
Ejemplo n.º 10
0
 public function getQuestionsFromBD()
 {
     $str = "";
     $str .= "<center>";
     $str .= "<table border = '1' id='hor-minimalist-b'><thead><tr><th scope='col'>Libelle</th><th scope='col'>Type</th><th scope='col'>Actions</th></tr></thead>";
     $str .= "<tbody>";
     for ($i = 0; $i < COUNT($this->mesQuestions); $i++) {
         $str .= "<tr id = 'ligne'>";
         $str .= "<td>" . $this->mesQuestions[$i]->getLibelle() . "</td>";
         if ($this->mesQuestions[$i]->getType() == 0) {
             $str .= "<td>OUVERTE</td>";
         } else {
             if ($this->mesQuestions[$i]->getType() == 1) {
                 $str .= "<td>FERMEE</td>";
             } else {
                 $str .= "<td>NUMERIQUE</td>";
             }
         }
         $str .= "<td><input type='button' id = 'suppr' value='SUPPRIMER' name='supprimer' onclick ='supprimerQuestion(" . $i . ");'/></td>";
         $str .= "</tr>";
     }
     $str .= "</tbody>";
     $str .= "</table>";
     $str .= "</center>";
     return $str;
 }
 public function getProduction($type)
 {
     $classify_id = $_GET['classify'];
     if ($classify_id == "" || $classify_id == 0 || $classify_id == null || $classify_id == 'all') {
         // 条件
         $where = array('type' => $type);
     } else {
         // 条件
         $where = array('type' => $type, 'classify_id' => $classify_id);
     }
     // 获得当前页数
     $pageNumber = $_GET['p'];
     if ($pageNumber == "") {
         $pageNumber = 0;
     }
     // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取
     $production = M('production')->where($where)->order('sort')->page($pageNumber, C('分页'))->select();
     // 查询满足要求的总记录数
     $count = M('production')->where($where)->count();
     for ($i = 0; $i < COUNT($production); $i++) {
         $rebate = $production[$i]['rebate'];
         $production[$i]['deduction'] = $rebate / 100 * $production[$i]['price_now'];
     }
     $perPage = $count / C('分页');
     // 数据映射
     $this->production = $production;
     $this->count = $count;
     $this->perPage = $perPage;
     $this->classify_id = $classify_id;
 }
Ejemplo n.º 12
0
function count_objects($value)
{
    $cart = explode(',', $value);
    if (is_null($value)) {
        return '0';
    }
    return COUNT($cart);
}
Ejemplo n.º 13
0
	/**
	 * Loads the entire menu table into memory.
	 *
	 * @return array
	 */
	public function load()
	{
		// Initialise variables.
		$db		= JFactory::getDbo();
		$app	= JApplication::getInstance('site');
		$query	= $db->getQuery(true);

		$query->select('m.id, m.menutype, m.title, m.alias, m.note, m.path AS route, m.link, m.type, m.level, m.language');
		$query->select('m.browserNav, m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id');
		$query->select('e.element as component');
		$query->from('#__menu AS m');
		$query->leftJoin('#__extensions AS e ON m.component_id = e.extension_id');
		$query->where('m.published = 1');
		$query->where('m.parent_id > 0');
		$query->where('m.client_id = 0');
		$query->order('m.lft');
		
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OSE Added - OSE and Open Source Excellence is the registered trade mark of the Open Source Excellence PTE LTD.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		$where = null;
		if (file_exists(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'init.php') && file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ose_cpu'.DS.'define.php') && !file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_osemsc'.DS.'installer.dummy.ini'))
		{
			require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'init.php');
		
			$content_ids = oseRegistry::call('content')->getRestrictedContent('joomla','menu');
		
			$where = (COUNT($content_ids) > 0)?$query->where(' m.id NOT IN ('.implode(',',$content_ids).')'):null;
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// OSE Added - OSE and Open Source Excellence is the registered trade mark of the Open Source Excellence PTE LTD.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		// Set the query
		$db->setQuery($query);
		if (!($this->_items = $db->loadObjectList('id'))) {
			JError::raiseWarning(500, JText::sprintf('JERROR_LOADING_MENUS', $db->getErrorMsg()));
			return false;
		}

		foreach($this->_items as &$item) {
			// Get parent information.
			$parent_tree = array();
			if (isset($this->_items[$item->parent_id])) {
				$parent_tree  = $this->_items[$item->parent_id]->tree;
			}

			// Create tree.
			$parent_tree[] = $item->id;
			$item->tree = $parent_tree;

			// Create the query array.
			$url = str_replace('index.php?', '', $item->link);
			$url = str_replace('&amp;', '&', $url);

			parse_str($url, $item->query);
		}
	}
Ejemplo n.º 14
0
 function bin2text($bin_str)
 {
     $text_str = '';
     $chars = EXPLODE("\n", CHUNK_SPLIT(STR_REPLACE("\n", '', $bin_str), 8));
     $_I = COUNT($chars);
     for ($i = 0; $i < $_I; $text_str .= CHR(BINDEC($chars[$i])), $i) {
     }
     return $text_str;
 }
 /**
  * check user facebook in db
  */
 public function checkUserFacebook($iFacebookUserId)
 {
     $iCount = (int) $this->database()->select(COUNT('*'))->from($this->_sTable)->where('fb_user_id = \'' . $this->database()->escape($iFacebookUserId) . '\'')->execute('getField');
     if ($iCount > 0) {
         return true;
     } else {
         return false;
     }
 }
 function __construct($options = null)
 {
     // get accepted file types
     $acceptedFileTypes = getAcceptedFileTypes();
     $this->options = array('script_url' => $_SERVER['PHP_SELF'], 'upload_dir' => _CONFIG_FILE_STORAGE_PATH, 'upload_url' => dirname($_SERVER['PHP_SELF']) . '/files/', 'param_name' => 'files', 'delete_hash' => '', 'max_file_size' => $this->get_max_upload_size(), 'min_file_size' => 1, 'accept_file_types' => COUNT($acceptedFileTypes) ? '/(\\.|\\/)(' . str_replace(".", "", implode("|", $acceptedFileTypes)) . ')$/i' : '/.+$/i', 'max_number_of_files' => null, 'discard_aborted_uploads' => true, 'image_versions' => array('thumbnail' => array('upload_dir' => dirname(__FILE__) . '/thumbnails/', 'upload_url' => dirname($_SERVER['PHP_SELF']) . '/thumbnails/', 'max_width' => 80, 'max_height' => 80)));
     if ($options) {
         $this->options = array_replace_recursive($this->options, $options);
     }
 }
Ejemplo n.º 17
0
 public function getShopScroll()
 {
     // 取商铺幻灯片
     $where = array('type' => 'SHOP');
     $scroll_shop = M('scroll')->where($where)->order('sort')->select();
     while (COUNT($scroll_shop) < 16) {
         $scroll_shop = array_merge($scroll_shop, $scroll_shop);
     }
     $this->scroll_shop = $scroll_shop;
 }
 public function alter_admission_handle()
 {
     $content = $_POST['content'];
     $data = M('admission')->select();
     for ($i = 0; $i < COUNT($content); $i++) {
         $data[$i] = array('id' => $data[$i]['id'], 'content' => $content[$i], 'controller' => $_SESSION['loginname'], 'created_time' => Date('Y-m-d H:i:s'));
         M('admission')->data($data[$i])->save();
     }
     $this->success('修改成功');
 }
 public function edit($id)
 {
     $sql = \DB::select("select s.id,s.consecutive, s.label, s.level, w.watersource_name as name, s.created_at from sampling s\n        inner join watersource w on w.id = s.watersource_id\n        inner join concession_watersource cw on cw.watersource_id = w.id\n        inner join concession c on c.id = cw.concession_id\n        inner join entity e on e.id = c.agent_id \n        where s.analysis_id = " . $id);
     if (COUNT($sql) < 0) {
         $sql = \DB::select("select s.id, s.consecutive, s.label, s.level, ss.name, s.created_at from sampling s\n             inner join sampling_site ss on ss.id = s.sampling_site_id\n             inner join entity e on e.id = ss.agent_id\n             where s.analysis_id = " . $id);
     }
     $view = Auth::user()->getView();
     $analysis = Analysis::findOrFail($id);
     $entities = Entity::getEntities();
     return view('analysis.edit', compact('view', 'analysis', 'entities', 'sql'));
 }
 static function updateAllLanguageContent($languageId)
 {
     $db = Database::getDatabase();
     /* make sure we have all content records populated */
     $getMissingRows = $db->getRows("SELECT id, languageKey, defaultContent FROM language_key WHERE id NOT IN (SELECT languageKeyId FROM language_content WHERE languageId = " . (int) $languageId . ")");
     if (COUNT($getMissingRows)) {
         foreach ($getMissingRows as $getMissingRow) {
             $dbInsert = new DBObject("language_content", array("languageKeyId", "languageId", "content"));
             $dbInsert->languageKeyId = $getMissingRow['id'];
             $dbInsert->languageId = (int) $languageId;
             $dbInsert->content = $getMissingRow['defaultContent'];
             $dbInsert->insert();
         }
     }
 }
Ejemplo n.º 21
0
 /**
  * Used to fill the array with existing cache items
  *
  * @return void
  */
 private function initCache()
 {
     // Init the cacheitems
     $files = glob($this->path . '/*.val');
     $expirations = glob($this->path . '/*.meta');
     sort($files);
     sort($expirations);
     $count = COUNT($files);
     for ($i = 0; $i < $count; $i++) {
         $key = basename($files[$i]);
         $key = preg_replace('/\\.[^.\\s]{3,4}$/', '', $key);
         $expiration = unserialize(file_get_contents($expirations[$i]));
         $this->cacheItems[] = new \Anax\Cache\CCacheFile($key, null, $expiration);
     }
 }
Ejemplo n.º 22
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new PendidikanM();
     $nourut = COUNT(PendidikanM::model()->findAll()) + 1;
     $model->pendidikan_urutan = $nourut;
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['PendidikanM'])) {
         $model->attributes = $_POST['PendidikanM'];
         if ($model->save()) {
             $this->redirect(array('admin', 'id' => $model->pendidikan_id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Ejemplo n.º 23
0
 public function get_td_innerText(&$tr)
 {
     $cells = array();
     if (IS_ARRAY($tr)) {
         for ($i = 0, $n = COUNT($tr); $i < $n; $i++) {
             $td = $this->get_htmltag_innerText($tr[$i], 'td');
             for ($j = 0, $m = COUNT($td); $j < $m; $j++) {
                 $cells[$i][$j] = $td[$j];
             }
         }
         //end for
         return $cells;
     } else {
         return false;
     }
 }
Ejemplo n.º 24
0
 protected function getData()
 {
     $this->_logger->log(__METHOD__ . ' $this->start_time: ' . print_r($this->start_time, 1));
     $this->_logger->log(__METHOD__ . ' $this->end_time: ' . print_r($this->end_time, 1));
     $result = ListenerLog::model()->getAllDataInType($this->station_type, $this->start_time, $this->end_time);
     $this->_logger->log(__METHOD__ . ' $result COUNT: ' . print_r(COUNT($result), 1));
     if (!is_null($result)) {
         //            $this->schedule_type_report->updateLastReportedMessageData($result[0]->created);
         $this->data = $result;
         return true;
     } else {
         $this->data = array();
         //            $this->schedule_type_report->updateLastReportedMessageData($this->end_time);
         return false;
     }
 }
Ejemplo n.º 25
0
 protected function structuredMatches($matches)
 {
     $structuredMatches = [];
     foreach ($matches as $match) {
         $month = date("n", strtotime($match["created_at"]));
         $structuredMatches[$this->months[strval($month)]][] = $match["created_at"];
     }
     $matches = [];
     $totalCount = 0;
     foreach ($structuredMatches as $key => $structuredMatch) {
         $matches[$key] = COUNT($structuredMatch);
         $totalCount += $matches[$key];
     }
     $matches["Totalt"] = $totalCount;
     return $matches;
 }
Ejemplo n.º 26
0
 protected function index()
 {
     $this->language->load('module/shopbycolor');
     $this->data['heading_title'] = $this->language->get('heading_title');
     // definice barev (background, name, search) pro product/search
     $this->data['colors'] = array(array('#ffffff', 'Bílá', 'bíl'), array('#ffff00', 'Žlutá', 'žlut'), array('#fb940b', 'Oranžová', 'oranž'), array('#cc0000', 'Červená', 'červ'), array('#ff98bf', 'Růžová', 'růžo'), array('#762ca7', 'Fialová', 'fial'), array('#0000ff', 'Modrá', 'modr'), array('#03c0c6', 'Tyrkysová', 'tyrky'), array('#00cc00', 'Zelená', 'zelen'), array('#999999', 'Šedá', 'šed'), array('#885418', 'Hnědá', 'hněd'), array('#000000', 'Černá', 'čern'), array('#ffd700', 'Zlatá', 'zlat'), array('#dddddd', 'Stříbrná', 'stříb'));
     // URL s parametry
     $url = "";
     // zobrazeni produktu pouze v aktualni kategorii (cislo vybrane kategorie)
     if (!isset($_REQUEST['category_id'])) {
         //zjisti cisla kategorii z cesty (path)
         if (isset($this->request->get['path'])) {
             $parts = explode('_', (string) $this->request->get['path']);
         } else {
             $parts = array();
         }
         $parts_end = COUNT($parts) - 1;
         // posledni kategorie ve strukture
         // uloz aktualni kategorii
         if (isset($parts[0])) {
             $this->data['category_id'] = $parts[$parts_end];
             $category_id = $parts[$parts_end];
         } else {
             $this->data['category_id'] = 0;
             $category_id = 0;
         }
     } else {
         // aktualni kategorie
         $category_id = $_REQUEST['category_id'];
     }
     // link pro navigaci (path) + aktualni kategorii (category_id)
     if (isset($_REQUEST['path'])) {
         // je otevrena nejaka kategorie = cesta
         $url .= "&path=" . $_REQUEST['path'];
     }
     // aktualni kategorie v hierarchii
     if ($category_id) {
         $url .= "&category_id=" . $category_id;
     }
     $this->data['link_cat'] = $url;
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/shopbycolor.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/module/shopbycolor.tpl';
     } else {
         $this->template = 'default/template/module/shopbycolor.tpl';
     }
     $this->render();
 }
 public function index()
 {
     // 基础信息
     $phone = M('webinfo')->where(array('type' => C('电话')))->field('content')->find();
     $this->phone = $phone['content'];
     // 读取文章
     $data = M('consult')->order('id desc')->field('content,controller', true)->select();
     // 取年月日舍去时间
     for ($i = 0; $i < COUNT($data); $i++) {
         $middle = explode(' ', $data[$i]['created_time']);
         $data[$i]['created_time'] = $middle['0'];
     }
     // 数据映射
     $this->consult = $data;
     // 模板显示
     $this->display();
 }
 public function alter_contact_handle()
 {
     // 获取参数
     $content = $_POST['content'];
     // 读取数据
     $data = M('contact')->select();
     // 遍历数据
     for ($i = 0; $i < COUNT($content); $i++) {
         // 构造数据
         $data[$i] = array('id' => $data[$i]['id'], 'content' => $content[$i], 'controller' => $_SESSION['loginname'], 'created_time' => Date('Y-m-d H:i:s'));
         // 数据更新
         if (!M('contact')->data($data[$i])->save()) {
             echo 'contact表更新数据错误';
             die;
         }
     }
     $this->success('修改成功');
 }
Ejemplo n.º 29
0
 private function _loopSearch(array $table, string $method, string $requestUri) : MatchInterface
 {
     if (COUNT($table) > 0) {
         if (!reset($table) instanceof \Hx\Route\InfoInterface) {
             throw new \Hx\Route\RouteException("Mapper table's element is not type of \\Hx\\Route\\InfoInterface");
         } else {
             if ($this->_isMatch(reset($table), $method, $requestUri)) {
                 preg_match('*^' . reset($table)->getUri() . '$*', $requestUri, $args);
                 return new \Hx\Route\Match(reset($table), $this->shiftArray($args));
             } else {
                 array_shift($table);
                 return $this->_loopSearch($table, $method, $requestUri);
             }
         }
     } else {
         throw new \Hx\Route\RouteException("No matching candidate for method <{$method}>, uri <{$requestUri}>");
     }
 }
Ejemplo n.º 30
0
 public function entry()
 {
     $today = date("d F Y");
     $dates = parent::dates();
     $months = parent::months();
     $years = parent::years_from();
     $id = Auth::user()->emp_id();
     //R-Open
     $rOpen1 = COUNT(DB::table('admin_trackings')->where('completion_status', 'R-Open')->where('initial_risk', 'H-High Risk')->get());
     $rOpen2 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'R-Open')->where('initial_risk', '=', 'M-Medium Risk')->get());
     $rOpen3 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'R-Open')->where('initial_risk', '=', 'L-Low Risk')->get());
     $rOpen4 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'R-Open')->where('initial_risk', '=', 'N-No Risk')->get());
     //A-All Ready In Progress
     $aAll1 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'A-All Ready In Progress')->where('initial_risk', '=', 'H-High Risk')->get());
     $aAll2 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'A-All Ready In Progress')->where('initial_risk', '=', 'M-Medium Risk')->get());
     $aAll3 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'A-All Ready In Progress')->where('initial_risk', '=', 'L-Low Risk')->get());
     $aAll4 = COUNT(DB::table('admin_trackings')->where('completion_status', '=', 'A-All Ready In Progress')->where('initial_risk', '=', 'N-No Risk')->get());
     return View::make('adminTracking/entry')->with('PageName', 'Admin Tracking Entry')->with('dates', $dates)->with('toDay', $today)->with('months', $months)->with('year', $years)->with('personnel', parent::getPersonnelInfo())->with('OH', $rOpen1)->with('OM', $rOpen2)->with('OL', $rOpen3)->with('ON', $rOpen4)->with('AH', $aAll1)->with('AM', $aAll2)->with('AL', $aAll3)->with('AN', $aAll4);
 }