本文整理汇总了PHP中l_mysql_query函数的典型用法代码示例。如果您正苦于以下问题:PHP l_mysql_query函数的具体用法?PHP l_mysql_query怎么用?PHP l_mysql_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了l_mysql_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadValue
protected function loadValue()
{
$v9b207167e5381c47682c6b4f58a623fb = array();
$v3aabf39f2d943fa886d86dcbbee4d910 = $this->field_id;
if ($v8d777f385d3dfec8815d20f7496026dc = $this->getPropData()) {
foreach ($v8d777f385d3dfec8815d20f7496026dc['text_val'] as $v3a6d0284e743dc4a9b86f97d6dd1a3bf) {
if (is_null($v3a6d0284e743dc4a9b86f97d6dd1a3bf)) {
continue;
}
if (str_replace(" ", "", trim($v3a6d0284e743dc4a9b86f97d6dd1a3bf)) == "") {
continue;
}
$v9b207167e5381c47682c6b4f58a623fb[] = self::filterOutputString((string) $v3a6d0284e743dc4a9b86f97d6dd1a3bf);
}
return $v9b207167e5381c47682c6b4f58a623fb;
}
$vac5c74b64b4b8352ef2f181affb5ac2a = "SELECT text_val FROM {$this->tableName} WHERE obj_id = '{$this->object_id}' AND field_id = '{$v3aabf39f2d943fa886d86dcbbee4d910}' LIMIT 1";
$result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a, true);
while (list($v3a6d0284e743dc4a9b86f97d6dd1a3bf) = mysql_fetch_row($result)) {
if (is_null($v3a6d0284e743dc4a9b86f97d6dd1a3bf)) {
continue;
}
if (str_replace(" ", "", trim($v3a6d0284e743dc4a9b86f97d6dd1a3bf)) == "") {
continue;
}
$v9b207167e5381c47682c6b4f58a623fb[] = self::filterOutputString((string) $v3a6d0284e743dc4a9b86f97d6dd1a3bf);
}
return $v9b207167e5381c47682c6b4f58a623fb;
}
示例2: save
protected function save()
{
$v67b3dba8bc6778101892eb77249db32e = self::filterInputString($this->host);
$vac5c74b64b4b8352ef2f181affb5ac2a = "UPDATE cms3_domain_mirrows SET host = '{$v67b3dba8bc6778101892eb77249db32e}' WHERE id = '{$this->id}'";
$result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
return true;
}
示例3: get
/**
* Метод получения отчёта
*
* @return array
*/
public function get()
{
$sHostSQL = $this->getHostSQL("p");
l_mysql_query("SET @all = (SELECT COUNT(*) AS `cnt` FROM `cms_stat_paths` `p`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $sHostSQL . ")");
$result['detail'] = $this->simpleQuery("(SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'sites' AS `type`, `d`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_sites` `ss` ON `s`.`concrete_src_id` = `ss`.`id`\r\n INNER JOIN `cms_stat_sources_sites_domains` `d` ON `d`.`id` = `ss`.`domain`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQLd . " AND `s`.`src_type` = 1\r\n GROUP BY `d`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'search' AS `type`, `sse`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_search` `ss` ON `ss`.`id` = `s`.`concrete_src_id`\r\n INNER JOIN `cms_stat_sources_search_engines` `sse` ON `sse`.`id` = `ss`.`engine_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 2\r\n GROUP BY `sse`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'pr' AS `type`, `pr`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_pr` `pr` ON `pr`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 3\r\n GROUP BY `pr`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'ticket' AS `type`, `t`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_ticket` `t` ON `t`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 4\r\n GROUP BY `t`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'coupon' AS `type`, `c`.`descript` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_coupon` `c` ON `c`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 5\r\n GROUP BY `c`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'direct' AS `type`, 'direct' AS `name` FROM `cms_stat_paths` `p`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `p`.`source_id` = 0)\r\n\r\n ORDER BY `cnt` DESC\r\n LIMIT " . $this->offset . ", " . $this->limit);
$result['segments'] = $this->simpleQuery("SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `cnt`, `type` FROM (\r\n (SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'sites' AS `type`, `d`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_sites` `ss` ON `s`.`concrete_src_id` = `ss`.`id`\r\n INNER JOIN `cms_stat_sources_sites_domains` `d` ON `d`.`id` = `ss`.`domain`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 1\r\n GROUP BY `d`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'search' AS `type`, `sse`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_search` `ss` ON `ss`.`id` = `s`.`concrete_src_id`\r\n INNER JOIN `cms_stat_sources_search_engines` `sse` ON `sse`.`id` = `ss`.`engine_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 2\r\n GROUP BY `sse`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'pr' AS `type`, `pr`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_pr` `pr` ON `pr`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 3\r\n GROUP BY `pr`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'ticket' AS `type`, `t`.`name` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_ticket` `t` ON `t`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 4\r\n GROUP BY `t`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'coupon' AS `type`, `c`.`descript` AS `name` FROM `cms_stat_paths` `p`\r\n INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`\r\n INNER JOIN `cms_stat_sources_coupon` `c` ON `c`.`id` = `s`.`concrete_src_id`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `s`.`src_type` = 5\r\n GROUP BY `c`.`id`)\r\n\r\n UNION\r\n (\r\n SELECT COUNT(*) AS `cnt`, COUNT(*) / @all * 100 AS `abs`, 'direct' AS `type`, 'direct' AS `name` FROM `cms_stat_paths` `p`\r\n WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . $this->getUserFilterWhere('p') . " " . $sHostSQL . " AND `p`.`source_id` = 0)\r\n ) `tmp`\r\n GROUP BY `tmp`.`type`\r\n ORDER BY `cnt` DESC\r\n LIMIT " . $this->offset . ", " . $this->limit);
/*
l_mysql_query("DROP TEMPORARY TABLE IF EXISTS `tmp_pages_refuse`");
l_mysql_query("CREATE TEMPORARY TABLE `tmp_pages_refuse` (`path_id` INT, `level` INT, KEY `path_id_level` (`path_id`, `level`)) ENGINE = MEMORY");
l_mysql_query("INSERT INTO `tmp_pages_refuse` SELECT `path_id`, MAX(`number_in_path`) AS `mnum` FROM `cms_stat_hits` `h`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `h`.`path_id`
WHERE `h`.`date` BETWEEN " . $this->getQueryInterval() . " AND `p`.`host_id` = " . $this->host_id . "
GROUP BY `path_id`
HAVING `mnum` = 1");
l_mysql_query("SET @all_refuses = (SELECT COUNT(*) FROM tmp_pages_refuse)");
l_mysql_query("SET @all_visits = (SELECT COUNT(*) FROM `cms_stat_paths` `p`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " AND `p`.`host_id` = " . $this->host_id . " )");
return $this->simpleQuery("SELECT COUNT(DISTINCT(`h`.`path_id`)) AS `refuse`, COUNT(*) AS `entry`, COUNT(DISTINCT(`h`.`path_id`)) / COUNT(*) * 100 AS `refuse_percent`, COUNT(DISTINCT(`h`.`path_id`)) / @all_refuses * 100 AS `all_refuses_percent`, COUNT(DISTINCT(`h`.`path_id`)) / @all_visits * 100 AS `traffic_lost`, `p`.`uri`, `p`.`id` FROM `tmp_pages_refuse` `t`
INNER JOIN `cms_stat_hits` `h` ON `h`.`path_id` = `t`.`path_id` AND `h`.`number_in_path` = `t`.`level`
INNER JOIN `cms_stat_pages` `p` ON `p`.`id` = `h`.`page_id`
INNER JOIN `cms_stat_hits` `h2` ON `h2`.`page_id` = `p`.`id` AND `h2`.`number_in_path` = 1
WHERE `p`.`host_id` = " . $this->host_id . "
GROUP BY `h`.`page_id`
LIMIT 10");
*/
return $result;
}
示例4: saveValue
protected function saveValue()
{
$this->deleteCurrentRows();
if (sizeof($this->value) == 1) {
$v2063c1608d6e0baf80249c42e2be5804 = trim($this->value[0], ",");
$v2063c1608d6e0baf80249c42e2be5804 = preg_replace("/[^A-Za-z0-9А-Яа-яЁё'\\-\$%_,\\s]/u", "", $v2063c1608d6e0baf80249c42e2be5804);
$v2063c1608d6e0baf80249c42e2be5804 = explode(",", $v2063c1608d6e0baf80249c42e2be5804);
} else {
$v2063c1608d6e0baf80249c42e2be5804 = array_map(create_function('$a', " return preg_replace(\"/[^A-Za-z0-9А-Яа-яЁё'\\-\\\$%_,\\s]?/u\", \"\", \$a); "), $this->value);
}
$v2817f701d5e1a1181e657251363295fd = 0;
foreach ($v2063c1608d6e0baf80249c42e2be5804 as $v3a6d0284e743dc4a9b86f97d6dd1a3bf) {
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = trim($v3a6d0284e743dc4a9b86f97d6dd1a3bf);
if (strlen($v3a6d0284e743dc4a9b86f97d6dd1a3bf) == 0) {
continue;
}
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = self::filterInputString($v3a6d0284e743dc4a9b86f97d6dd1a3bf);
$vac5c74b64b4b8352ef2f181affb5ac2a = "INSERT INTO {$this->tableName} (obj_id, field_id, varchar_val) VALUES('{$this->object_id}', '{$this->field_id}', '{$v3a6d0284e743dc4a9b86f97d6dd1a3bf}')";
l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
++$v2817f701d5e1a1181e657251363295fd;
}
if (!$v2817f701d5e1a1181e657251363295fd) {
$this->fillNull();
}
}
示例5: getDetail
private function getDetail()
{
l_mysql_query("DROP TEMPORARY TABLE IF EXISTS `tmp_visit_time`");
l_mysql_query("CREATE TEMPORARY TABLE `tmp_visit_time` (`mins` FLOAT) ENGINE = MEMORY");
l_mysql_query("INSERT INTO `tmp_visit_time` SELECT (UNIX_TIMESTAMP(MAX(`h`.`date`)) - UNIX_TIMESTAMP(MIN(`h`.`date`))) / 60 AS `minutes` FROM `cms_stat_hits` `h`\r\n INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `h`.`path_id`\r\n WHERE `h`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . " \r\n GROUP BY `h`.`path_id`");
return $this->simpleQuery("SELECT COUNT(*) AS `cnt`, IF(`mins` > 10, IF(`mins` > 20, IF(`mins` > 30, IF(`mins` > 40, IF(`mins` > 50, 51, 41), 31), 21), 11), ROUND(`mins`)) `minutes`\r\n FROM `tmp_visit_time`\r\n GROUP BY `minutes` ORDER BY `cnt` DESC");
}
示例6: addField
public function addField($vb068931cc450442b63f5b3d276ea4297, $vd5d3db1765287eef77d7927cc956f50a, $v1e3f04102267eaf5e8d0ca424fd5c561, $ve1c6c9ef2fcbe75f26f815c4ef2e60b4 = true, $v1945c9a2a5e2ba6133f1db6757a35fcb = false, $vd5752333adc3a004f826f2ea2a41273a = false)
{
$this->disableCache();
$vac5c74b64b4b8352ef2f181affb5ac2a = "INSERT INTO cms3_object_fields VALUES()";
l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
return false;
}
$v3aabf39f2d943fa886d86dcbbee4d910 = l_mysql_insert_id();
$v06e3d36fa30cea095545139854ad1fb9 = new umiField($v3aabf39f2d943fa886d86dcbbee4d910);
$v06e3d36fa30cea095545139854ad1fb9->setName($vb068931cc450442b63f5b3d276ea4297);
$v06e3d36fa30cea095545139854ad1fb9->setTitle($vd5d3db1765287eef77d7927cc956f50a);
if (!$v06e3d36fa30cea095545139854ad1fb9->setFieldTypeId($v1e3f04102267eaf5e8d0ca424fd5c561)) {
return false;
}
$v06e3d36fa30cea095545139854ad1fb9->setIsVisible($ve1c6c9ef2fcbe75f26f815c4ef2e60b4);
$v06e3d36fa30cea095545139854ad1fb9->setIsLocked($v1945c9a2a5e2ba6133f1db6757a35fcb);
$v06e3d36fa30cea095545139854ad1fb9->setIsInheritable($vd5752333adc3a004f826f2ea2a41273a);
if (!$v06e3d36fa30cea095545139854ad1fb9->commit()) {
return false;
}
$this->fields[$v3aabf39f2d943fa886d86dcbbee4d910] = $v06e3d36fa30cea095545139854ad1fb9;
return $v3aabf39f2d943fa886d86dcbbee4d910;
}
示例7: saveValue
protected function saveValue()
{
$this->deleteCurrentRows();
if (is_null($this->value)) {
return;
}
$v2817f701d5e1a1181e657251363295fd = 0;
foreach ($this->value as $v3a6d0284e743dc4a9b86f97d6dd1a3bf) {
if (!$v3a6d0284e743dc4a9b86f97d6dd1a3bf) {
continue;
}
if (is_object($v3a6d0284e743dc4a9b86f97d6dd1a3bf)) {
if (!@is_file($v3a6d0284e743dc4a9b86f97d6dd1a3bf->getFilePath())) {
continue;
}
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = l_mysql_real_escape_string($v3a6d0284e743dc4a9b86f97d6dd1a3bf->getFilePath());
} else {
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = l_mysql_real_escape_string($v3a6d0284e743dc4a9b86f97d6dd1a3bf);
}
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = self::unescapeFilePath($v3a6d0284e743dc4a9b86f97d6dd1a3bf);
$vac5c74b64b4b8352ef2f181affb5ac2a = "INSERT INTO {$this->tableName} (obj_id, field_id, text_val) VALUES('{$this->object_id}', '{$this->field_id}', '{$v3a6d0284e743dc4a9b86f97d6dd1a3bf}')";
l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
++$v2817f701d5e1a1181e657251363295fd;
}
if (!$v2817f701d5e1a1181e657251363295fd) {
$this->fillNull();
}
}
示例8: get
public function get()
{
$sQr = "SET @cnt := (SELECT COUNT(*) FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . ")";
l_mysql_query($sQr);
$result = $this->simpleQuery("SELECT COUNT(*) AS `total` FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
INNER JOIN `cms_stat_sources_openstat_source` `s` ON `s`.`id` = `os`.`source_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p'));
$i_total = (int) $result[0]['total'];
$sQr = "SELECT SQL_CALC_FOUND_ROWS COUNT(*) AS `abs`, COUNT(*) / @cnt * 100 AS `rel`, `s`.`name` AS 'name', `s`.`id` AS `source_id` FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
INNER JOIN `cms_stat_sources_openstat_source` `s` ON `s`.`id` = `os`.`source_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . "
GROUP BY `s`.`id`
ORDER BY `abs` DESC
LIMIT " . $this->offset . ", " . $this->limit;
$res = $this->simpleQuery($sQr, true);
return array("all"=>$res['result'], "summ"=>$i_total, "total"=>$res['FOUND_ROWS']);
}
示例9: loadTypes
private function loadTypes()
{
$vb99eb979e6f6efabc396f777b503f7e7 = cacheFrontend::getInstance();
$vda80b9ab86c2d00b85de0cf003cb3e6e = $vb99eb979e6f6efabc396f777b503f7e7->loadData('hierarchy_types');
if (!is_array($vda80b9ab86c2d00b85de0cf003cb3e6e)) {
$vac5c74b64b4b8352ef2f181affb5ac2a = "SELECT `id`, `name`, `title`, `ext` FROM `cms3_hierarchy_types` ORDER BY `name`, `ext`";
$result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
$vda80b9ab86c2d00b85de0cf003cb3e6e = array();
while (list($vb80bb7740288fda1f201890375a60c8f) = $vf1965a857bc285d26fe22023aa5ab50d = mysql_fetch_row($result)) {
$vda80b9ab86c2d00b85de0cf003cb3e6e[$vb80bb7740288fda1f201890375a60c8f] = $vf1965a857bc285d26fe22023aa5ab50d;
}
$vb99eb979e6f6efabc396f777b503f7e7->saveData('hierarchy_types', $vda80b9ab86c2d00b85de0cf003cb3e6e, 3600);
}
foreach ($vda80b9ab86c2d00b85de0cf003cb3e6e as $vb80bb7740288fda1f201890375a60c8f => $vf1965a857bc285d26fe22023aa5ab50d) {
$v599dcce2998a6b40b1e38e8c6006cb0a = $vb99eb979e6f6efabc396f777b503f7e7->load($vb80bb7740288fda1f201890375a60c8f, 'element_type');
if ($v599dcce2998a6b40b1e38e8c6006cb0a instanceof iUmiHierarchyType == false) {
try {
$v599dcce2998a6b40b1e38e8c6006cb0a = new umiHierarchyType($vb80bb7740288fda1f201890375a60c8f, $vf1965a857bc285d26fe22023aa5ab50d);
} catch (privateException $ve1671797c52e15f763380b45e841ec32) {
continue;
}
$vb99eb979e6f6efabc396f777b503f7e7->save($v599dcce2998a6b40b1e38e8c6006cb0a, 'element_type');
}
$this->types[$vb80bb7740288fda1f201890375a60c8f] = $v599dcce2998a6b40b1e38e8c6006cb0a;
}
return true;
}
示例10: getPath
public function getPath()
{
$path = explode('/', $this->params['path']);
$str = '';
foreach ($path as $val) {
$str .= (int)$val . ', ';
}
$str = substr($str, 0, -2);
$qry = "SELECT `id`, `uri` FROM `cms_stat_pages` WHERE `id` IN (" . $str . ")";
$res = l_mysql_query($qry);
$result = array();
while ($row = mysql_fetch_assoc($res)) {
$result[$row['id']] = $row['uri'];
}
reset($path);
$return = array();
foreach ($path as $val) {
if (isset($result[$val])) {
$return[] = $result[$val];
}
}
return $return;
}
示例11: getDynamic
public function getDynamic()
{
l_mysql_query("DROP TEMPORARY TABLE IF EXISTS `tmp_activity`");
l_mysql_query("CREATE TEMPORARY TABLE `tmp_activity` (`days` INT, `" . $this->groupby . "` INT, `year` INT, `date` DATETIME) ENGINE = MEMORY");
l_mysql_query("INSERT INTO `tmp_activity` SELECT FLOOR( ( UNIX_TIMESTAMP(MAX(`date`)) - UNIX_TIMESTAMP(MIN(`date`)) ) / (COUNT(*) - 1) / 3600 / 24 ) AS `days`, DATE_FORMAT(`date`, '%" . $this->groupby_key . "') AS `" . $this->groupby . "`, DATE_FORMAT(`date`, '%Y') AS `year`, `date` FROM `cms_stat_paths`\r\n WHERE `date` BETWEEN '" . $this->formatDate($this->start) . "' AND '" . $this->formatDate($this->finish) . "' " . $this->getHostSQL() . $this->getUserFilterWhere() . "\r\n GROUP BY `user_id`");
return $this->simpleQuery("SELECT AVG(`days`) AS `avg`, `" . $this->groupby . "` AS `period`, UNIX_TIMESTAMP(`date`) AS `ts` FROM `tmp_activity`\r\n GROUP BY `" . $this->groupby . "`, `year` ORDER BY `date`");
}
示例12: saveBranchedTablesRelations
public static function saveBranchedTablesRelations()
{
$v47826cacc65c665212b821e6ff80b9b0 = self::getRelationsFilePath();
$v9b81909fd0da3add2602a8d0ede0e4e7 = umiObjectTypesCollection::getInstance();
self::$branchedObjectTypes = array();
clearstatcache();
if (file_exists($v47826cacc65c665212b821e6ff80b9b0)) {
unlink($v47826cacc65c665212b821e6ff80b9b0);
}
$vac5c74b64b4b8352ef2f181affb5ac2a = "SHOW TABLES LIKE 'cms3_object_content%'";
$result = l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a, true);
if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
}
$v8587774de94e7ee1616350d82cc72317 = array();
while (list($v80071f37861c360a27b7327e132c911a) = mysql_fetch_row($result)) {
if (preg_match("/cms3_object_content_([0-9]+)/", $v80071f37861c360a27b7327e132c911a, $vc68271a63ddbc431c307beb7d2918275)) {
$v8587774de94e7ee1616350d82cc72317[] = (int) $vc68271a63ddbc431c307beb7d2918275[1];
}
}
$vf9ecb86fe4446d46abf44c1f55be3d43 = array();
foreach ($v8587774de94e7ee1616350d82cc72317 as $vacf567c9c3d6cf7c6e2cc0ce108e0631) {
$v0e8133eb006c0f85ed9444ae07a60842 = array_keys($v9b81909fd0da3add2602a8d0ede0e4e7->getTypesByHierarchyTypeId($vacf567c9c3d6cf7c6e2cc0ce108e0631));
if (is_array($v0e8133eb006c0f85ed9444ae07a60842)) {
foreach ($v0e8133eb006c0f85ed9444ae07a60842 as $v6301cee35ea764a1e241978f93f01069) {
$vf9ecb86fe4446d46abf44c1f55be3d43[$v6301cee35ea764a1e241978f93f01069] = $vacf567c9c3d6cf7c6e2cc0ce108e0631;
}
}
}
file_put_contents($v47826cacc65c665212b821e6ff80b9b0, serialize($vf9ecb86fe4446d46abf44c1f55be3d43));
chmod($v47826cacc65c665212b821e6ff80b9b0, 0777);
return self::$branchedObjectTypes = $vf9ecb86fe4446d46abf44c1f55be3d43;
}
示例13: get
public function get()
{
$cond = array();
foreach (array('source_id', 'campaign_id') as $val) {
if ((int)$this->params[$val] > 0) {
$cond[] = '`os`.`' . $val . '` = ' . (int)$this->params[$val];
}
}
$cond_str = '';
if (sizeof($cond)) {
$cond_str = ' AND ' . implode(' AND ', $cond);
}
l_mysql_query("SET @cnt := (SELECT COUNT(*) FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . $cond_str . ")");
$result = $this->simpleQuery("SELECT COUNT(*) AS `abs` FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
INNER JOIN `cms_stat_sources_openstat_service` `s` ON `s`.`id` = `os`.`service_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . $cond_str);
$i_total = (isset($result[0]['total'])) ? (int) $result[0]['total'] : 0;
$res = $this->simpleQuery("SELECT SQL_CALC_FOUND_ROWS COUNT(*) AS `abs`, COUNT(*) / @cnt * 100 AS `rel`, `s`.`name`, `s`.`id` AS 'service_id' FROM `cms_stat_sources_openstat` `os`
INNER JOIN `cms_stat_paths` `p` ON `p`.`id` = `os`.`path_id`
INNER JOIN `cms_stat_sources_openstat_service` `s` ON `s`.`id` = `os`.`service_id`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . $cond_str . "
GROUP BY `s`.`id`
ORDER BY `abs` DESC
LIMIT " . $this->offset . ", " . $this->limit, true);
return array("all"=>$res['result'], "summ"=>$i_total, "total"=>$res['FOUND_ROWS']);
}
示例14: getAvg
/**
* метод получения почасовой информации за выходные и будни
*
* @return array
*/
private function getAvg()
{
$this->setUpVars();
$qry = "(SELECT 'routine' AS `type`, COUNT(*) / " . $this->routine_count . ".0 AS `avg`, `h`.`hour` FROM `cms_stat_paths` `p`
INNER JOIN `cms_stat_hits` `h` ON `h`.`path_id` = `p`.`id` AND `h`.`number_in_path` = 1
INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`
INNER JOIN `cms_stat_sources_sites` `ss` ON `ss`.`id` = `s`.`concrete_src_id`
LEFT JOIN `cms_stat_holidays` `holidays` ON `h`.`day` = `holidays`.`day` AND `h`.`month` = `holidays`.`month`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . " AND `s`.`src_type` = 1
AND `day_of_week` BETWEEN 1 AND 5 AND `holidays`.`id` IS NULL
GROUP BY `h`.`hour`)
UNION
(SELECT 'weekend' AS `type`, COUNT(*) / " . $this->holidays_count . ".0 AS `avg`, `h`.`hour` FROM `cms_stat_paths` `p`
INNER JOIN `cms_stat_hits` `h` ON `h`.`path_id` = `p`.`id` AND `h`.`number_in_path` = 1
INNER JOIN `cms_stat_sources` `s` ON `s`.`id` = `p`.`source_id`
INNER JOIN `cms_stat_sources_sites` `ss` ON `ss`.`id` = `s`.`concrete_src_id`
LEFT JOIN `cms_stat_holidays` `holidays` ON `h`.`day` = `holidays`.`day` AND `h`.`month` = `holidays`.`month`
WHERE `p`.`date` BETWEEN " . $this->getQueryInterval() . " " . $this->getHostSQL("p") . $this->getUserFilterWhere('p') . " AND `s`.`src_type` = 1
AND (`day_of_week` NOT BETWEEN 1 AND 5 OR `holidays`.`id` IS NOT NULL)
GROUP BY `h`.`hour`)";
$res = l_mysql_query($qry);
$result = array();
while ($row = mysql_fetch_assoc($res)) {
$result[$row['type']][$row['hour']] = $row['avg'];
}
return $result;
}
示例15: saveValue
protected function saveValue()
{
$this->deleteCurrentRows();
$v2817f701d5e1a1181e657251363295fd = 0;
foreach ($this->value as $v3a6d0284e743dc4a9b86f97d6dd1a3bf) {
if ($v3a6d0284e743dc4a9b86f97d6dd1a3bf === false || $v3a6d0284e743dc4a9b86f97d6dd1a3bf === "") {
continue;
}
if (strpos(".", $v3a6d0284e743dc4a9b86f97d6dd1a3bf) === false) {
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = str_replace(",", ".", $v3a6d0284e743dc4a9b86f97d6dd1a3bf);
}
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = abs((double) $v3a6d0284e743dc4a9b86f97d6dd1a3bf);
if ($v3a6d0284e743dc4a9b86f97d6dd1a3bf > 999999999.99) {
$v3a6d0284e743dc4a9b86f97d6dd1a3bf = 999999999.99;
}
$vac5c74b64b4b8352ef2f181affb5ac2a = "INSERT INTO {$this->tableName} (obj_id, field_id, float_val) VALUES('{$this->object_id}', '{$this->field_id}', '{$v3a6d0284e743dc4a9b86f97d6dd1a3bf}')";
l_mysql_query($vac5c74b64b4b8352ef2f181affb5ac2a);
if ($v56bd7107802ebe56c6918992f0608ec6 = l_mysql_error()) {
throw new coreException($v56bd7107802ebe56c6918992f0608ec6);
}
++$v2817f701d5e1a1181e657251363295fd;
}
$this->dbValue = $this->value;
if (!$v2817f701d5e1a1181e657251363295fd) {
$this->fillNull();
}
}