本文整理汇总了PHP中numberFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP numberFormat函数的具体用法?PHP numberFormat怎么用?PHP numberFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了numberFormat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPlans
public function getPlans($where = '', $limit = ' LIMIT 3', $full_detail = true)
{
$plans = $this->db->query("SELECT\n \t\t\t\ta.id AS id,\n \t\t\t\ta.id_status AS id_status,\n \t\t\t\ta.name AS name,\n \t\t\t\ta.monthly AS month,\n a.quarterly AS quarter,\n a.semesterly AS semester,\n a.yearly AS year,\n a.content_id,\n (SELECT c.text_small FROM contents c WHERE c.id = a.content_id) AS text_small\n \t\t\tFROM {$this->table} a\n \t\t\t{$where}\n \t\t\tORDER BY id\n \t\t\t{$limit}\n \t\t");
$i = 0;
foreach ($plans->result_array() as $array) {
//plans
$i = $array['id'];
$result[$i]['id'] = $array['id'];
$result[$i]['name'] = formatString($array['name']);
$result[$i]['month'] = numberFormat($array['month'], 2);
$result[$i]['quarter'] = numberFormat($array['quarter'], 2);
$result[$i]['semester'] = numberFormat($array['semester'], 2);
$result[$i]['year'] = numberFormat($array['year'], 2);
$result[$i]['text_small'] = $array['text_small'];
$result[$i]['content_id'] = $array['content_id'];
$details = $this->db->query('SELECT description
FROM ' . $this->table . "_details\n \t\t\t\tWHERE id_plan = '" . $array['id'] . "'\n \t\t\t\tORDER BY id\n \t\t\t\t" . ($full_detail ? '' : ' LIMIT 3') . '
');
$j = 0;
foreach ($details->result_array() as $detail) {
//details
$result[$i]['details'][$j++] = formatString($detail['description']);
}
$i++;
}
return $result;
}
示例2: page
function page()
{
$sock = new sockets();
$EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
$MalwarePatrolDatabasesCount = $sock->getFrameWork("cmd.php?MalwarePatrolDatabasesCount=yes");
if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) {
return;
}
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$users = new usersMenus();
$websitesnums = $q->COUNT_ROWS("visited_sites");
$websitesnums = numberFormat($websitesnums, 0, "", " ");
$sql = "DELETE FROM categorize WHERE LENGTH(pattern)=0";
$q->QUERY_SQL($sql);
$export = $q->COUNT_ROWS("categorize");
$export = numberFormat($export, 0, "", " ");
$categories = $q->COUNT_CATEGORIES();
$categories = numberFormat($categories, 0, "", " ");
$tablescat = $q->LIST_TABLES_CATEGORIES();
$tablescatNUM = numberFormat(count($tablescat), 0, "", " ");
$q = new mysql_squid_builder();
$requests = $q->EVENTS_SUM();
$requests = numberFormat($requests, 0, "", " ");
$PhishingURIS = $q->COUNT_ROWS("uris_phishing");
$PhishingURIS = numberFormat($PhishingURIS, 0, "", " ");
$MalwaresURIS = $q->COUNT_ROWS("uris_malwares");
$MalwaresURIS = numberFormat($MalwaresURIS, 0, "", " ");
$Computers = $q->COUNT_ROWS("webfilters_nodes");
$Computers = numberFormat($Computers, 0, "", " ");
$DAYSNumbers = $q->COUNT_ROWS("tables_day");
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(totalsize) as tsize FROM tables_day"));
$totalsize = FormatBytes($ligne["tsize"] / 1024);
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT AVG(cache_perfs) as pourc FROM tables_day"));
$pref = round($ligne["pourc"]);
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
$websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
$CachePermformance = $q->CachePerfHour();
if ($CachePermformance > -1) {
$color = "#E01313";
if ($CachePermformance > 20) {
$color = "#6DBB6A";
}
$cachePerfText = "\n\t\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b style='color:{$color}'>{$CachePermformance}%</b> {cache_performance} ({now})</td>\n\t\t</tr>\n\t\t";
}
$mouse = "OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\"";
$submenu = "\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$totalsize}</b> {downloaded_flow}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$pref}%</b> {cache_performance}</td>\n\t</tr>\n\t";
$main_table = "\n\t<table style='width:98%' class=form>\n\t<tr><td style='font-size:16px'>{statistics}::{status}</td></tr>\n\t{$cachePerfText}\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;><b>{$DAYSNumbers}</b> {daysOfStatistics}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$requests}</b> {requests}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$Computers}</b> {computers}</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnums}</b> {visited_websites}</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$categories}</b> {websites_categorized}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$PhishingURIS}</b> {phishing_uris}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwaresURIS}</b> {viruses_uris}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwarePatrolDatabasesCount}</b> Malware Patrol</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnumsNot}</b> {not_categorized}</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$tablescatNUM}</b> {categories}</td>\n\t</tr>\n\t</table>\t\n";
$main_table = $tpl->_ENGINE_parse_body($main_table);
SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $main_table);
echo $main_table;
}
示例3: page
function page()
{
$users = new usersMenus();
$title = $users->hostname . " For Android/Tablets Login.";
include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
$p = new pagebuilder();
$jsArtica = $p->jsArtica();
$yahoo = $p->YahooBody();
$css = $p->headcss();
$q = new mysql_squid_builder();
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
$websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
$html = "\n\t<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=9; IE=8\">\n <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-type\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/artica-theme/jquery-ui.custom.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.jgrowl.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.cluetip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.treeview.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/thickbox.css\" media=\"screen\"/>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.qtip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/fonts.css.php\"/>\n\t\t\n{$css}\n <title>{$title}</title>\n{$jsArtica}\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/android.css\" />\n</head>\n\n<body style=\"margin:0px;padding:0px\">\n<div style=\"postition:absolute;top:0px;left:80%;width:980px;min-height:490px;overflow-y:auto\">\n\t\n\t<table style='width:980px;'>\n\t<tr>\n\t<td valign='top' width=5%>\n\t <ul class=\"vertical fl\" rel=\"ver1\">\n <li><a href=\"android.index.php\">{home}</a><span>{main_page}</span></li>\n <li><a href=\"javascript:LoadAjax('mainpage','android.squidstats.members.php')\">{members}</a><span>{list_your_members}</span></li>\n <li><a href=\"#\">Under construction</a><span>to define</span></li>\n <li><a href=\"#\">Under construction</a><span>Under construction</span></li>\n <li><a href=\"javascript:LoadAjax('mainpage','android.squidstats.nocat.php')\"\">{not_categorized}</a><span><b>{$websitesnumsNot}</b> {websites} {not_categorized}</span></li>\n <li><a rel=\"#\">About</a><span>{parameters}</span></li>\n </ul>\n </td>\n <td valign='top' width=95%>\n \t<table style='width:103.5%;margin-left:-23px;margin-top:2px' class=form>\n \t\t<tr>\n \t\t\t<td style='margin:0px;padding:0px;border:0px'>\n \t\t\t\t<div style='margin:0px;padding:0px;border:0px;min-height:475px;height:475px;overflow:auto' id='mainpage'></div>\n \t\t\t</td>\n \t\t</tr>\n \t</table>\n </tr>\n\t</table>\n</div>\n<script>\n\tLoadAjax('mainpage','android.index.server.php');\n</script>\n{$yahoo}\n</body>\n</html>\n\t\n\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例4: table
function table()
{
$page = CurrentPageName();
$tpl = new templates();
$description = $tpl->_ENGINE_parse_body("{description}");
$select = $tpl->javascript_parse_text("{select}");
$date = $tpl->_ENGINE_parse_body("{date}");
$empty = $tpl->javascript_parse_text("{empty}");
$t = time();
$tablesize = 629;
$descriptionsize = 465;
$bts = array();
if (is_numeric($_GET["tablesize"])) {
$tablesize = $_GET["tablesize"];
}
if (is_numeric($_GET["descriptionsize"])) {
$descriptionsize = $_GET["descriptionsize"];
}
if ($_GET["table"] != null) {
if ($_GET["taskid"] == 0) {
$bts[] = "{name: '{$select}', bclass: 'Search', onpress : SelectFields{$t}},";
}
}
$tablejs = "ufdbguard_admin_events";
if ($_GET["table"] != null) {
$tablejs = $_GET["table"];
}
if ($_GET["taskid"] > 0) {
$bts[] = "{name: '{$empty}', bclass: 'Delz', onpress : EmptyTask{$t}},";
}
if (count($bts) > 0) {
$buttons = "buttons : [" . @implode("\n", $bts) . " ],";
}
$q = new mysql();
if ($q->COUNT_ROWS("ufdbguard_admin_events", "artica_events") > 0) {
$q->QUERY_SQL("TRUNCATE TABLE ufdbguard_admin_events", "artica_events");
}
if ($q->COUNT_ROWS("system_admin_events", "artica_events") > 0) {
$q->QUERY_SQL("TRUNCATE TABLE system_admin_events", "artica_events");
}
$CountEvents = $q->COUNT_ROWS($tablejs, "artica_events");
$CountEvents = numberFormat($CountEvents, 0, '.', ' ');
$title = $tpl->_ENGINE_parse_body("{$CountEvents} {events}");
$html = "\n\t<div style='margin-left:5px'>\n\t<table class='update-events-{$t}' style='display: none' id='update-events-{$t}' style='width:99%'></table>\n\t</div>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#update-events-{$t}').flexigrid({\n\turl: '{$page}?search=yes&filename={$_GET["filename"]}&taskid={$_GET["taskid"]}&category={$_GET["category"]}&table={$_GET["table"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$date}', name : 'zDate', width : 120, sortable : true, align: 'left'},\n\t{display: '{$description}', name : 'description', width : 767, sortable : false, align: 'left'},\n\t],{$buttons}\n\tsearchitems : [\n\t{display: '{$description}', name : 'description'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 25,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 350,\n\tsingleSelect: true\n\t\n\t});\n\t});\n\t\n\tfunction SelectFields{$t}(){\n\tYahooWin2('550','{$page}?Select-fields=yes&table={$_GET["table"]}&t={$t}&taskid={$_GET["taskid"]}','{$select}');\n\t\n\t}\n\t\n\tvar x_EmptyTask{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#ufdbguard-events-{$t}').flexReload();\n\t}\n\t\n\tfunction EmptyTask{$t}(){\n\tif(confirm('{$empty}::{$_GET["taskid"]}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('EmptyTask','{$_GET["taskid"]}');\n\t\t\tXHR.appendData('Table','{$_GET["table"]}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyTask{$t});\n\t}\n\t}\n\t\n\t</script>\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
// webfilter_updateev
}
示例5: WeightedPhraseEdit_search
function WeightedPhraseEdit_search()
{
$search = $_GET["search"];
$search = "*{$search}*";
$search = str_replace("**", "*", $search);
$search = str_replace("**", "*", $search);
$search = str_replace("*", "%", $search);
$language = $_GET["language"];
$category = $_GET["category"];
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
if ($language != null) {
$language_q = " AND language='{$language}'";
}
$sql = "SELECT zmd5,category,language,pattern,score FROM phraselists_weigthed WHERE category='{$category}' \n\tAND language='{$language}' AND pattern LIKE '{$search}' ORDER BY zDate DESC LIMIT 0,50";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<H2>Fatal Error: {$q->mysql_error}</H2>";
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
if ($classtr == "oddRow") {
$classtr = null;
} else {
$classtr = "oddRow";
}
$select = imgsimple("32-parameters.png", "{apply}", "WeightedPhraseEdit('{$ligne["language"]}','{$ligne["category"]}')");
$delete = imgsimple("delete-32.png", "{delete}", "DeleteWords('{$ligne["zmd5"]}')");
$compile = imgsimple("compile-distri-32.png", "{saveToDisk}", "DansGuardianCompileDB('{$categoryname}')");
$color = "black";
if (trim($ligne["pattern"] == null)) {
continue;
}
$ligne["pattern"] = htmlentities($ligne["pattern"]);
$js = "<a href=\"javascript:blur();\" OnClick=\"javascript:EditWords('{$ligne["zmd5"]}','{$ligne["language"]}','{$ligne["category"]}')\" style='font-size:14px;font-weight:bold;color:{$color};font-family:Courier New;text-decoration:underline'>";
$html = $html . "\n\t\t<tr class={$classtr} id='{$ligne["zmd5"]}'>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color};font-family:Courier New' width=99% colspan=2>{$js}{$ligne["pattern"]}</a></td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color};font-family:Courier New' width=1%>{$ligne["score"]}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=1% nowrap align='left'>{$delete}</td>\n\t\t</tr>\n\t\t";
}
$TOTAL_ITEMS = numberFormat($TOTAL_ITEMS, 0, "", " ");
$add = imgtootltip("plus-24.png", "{add} {words}", "EditWords('','{$_GET["language"]}','{$_GET["category"]}')");
$header = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th width=99%>{items}</th>\n\t\t<th width=1%>{score}</th>\n\t\t<th width=1%> </th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
$html = $header . $html . "</table>\n\t</center>\n\t\n\t<script>\n\t\tvar xzmd5='';\n\t\tfunction EditWords(zmd5,language,category){\n\t\t\tYahooWin5('600','{$page}?WeightedPhraseEdit-edit=yes&zmd5='+zmd5+'&language='+language+'&category='+category+'&t={$_GET["t"]}',zmd5);\n\t\t}\n\t\t\n\tvar x_DeleteWords=function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);}\n\t\t\$('#'+xzmd5).remove();\n\t\t\n\t}\t\n\t\tfunction DeleteWords(zmd5){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('WeightedPhraseEdit-delete','yes');\n\t\tXHR.appendData('zmd5',zmd5);\n\t\txzmd5=zmd5;\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteWords);\t\n\t}\t\n\t\t\n\t\tfunction CheckStatsApplianceC(){\n\t\t\tLoadAjax('CheckStatsAppliance','{$page}?CheckStatsAppliance=yes');\n\t\t}\n\t\t\n\t\tfunction WeightedPhraseEdit(lang,cat){\n\t\t\tLoadjs('{$page}?WeightedPhraseEdit-js=yes&language='+lang+'&category='+cat);\n\t\t\n\t\t}\n\t\t\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例6: json_familysite
function json_familysite()
{
$q = new mysql_squid_builder();
$search = '%';
$table = "visited_sites";
$page = 1;
$ORDER = "ORDER BY HitsNumber DESC";
if ($q->COUNT_ROWS($table) == 0) {
echo "<H2>" . $tpl->_ENGINE_parse_body("TABLE:{$table}<br>{error_no_datas}") . "</H2>";
return;
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
if ($_POST["query"] != null) {
$_POST["query"] = str_replace("*", "%", $_POST["query"]);
$search = $_POST["query"];
$sql = "SELECT COUNT(sitename) as TCOUNT FROM `{$table}` WHERE (`sitename` LIKE '{$search}') AND familysite='{$_GET["familysite"]}'";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(sitename) as TCOUNT FROM `{$table}` WHERE familysite='{$_GET["familysite"]}'";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
$total = $ligne["TCOUNT"];
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
$sql = "SELECT sitename,HitsNumber ,Querysize,category FROM `{$table}` WHERE (`sitename` LIKE '{$search}') AND familysite='{$_GET["familysite"]}' {$ORDER} {$limitSql}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$div = "<div style=\"padding-top:10px;font-size:14px\">";
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
$results = $q->QUERY_SQL($sql);
while ($ligne = mysql_fetch_assoc($results)) {
$thumbs = $q->GET_THUMBNAIL($ligne['sitename'], 48);
$ligne["Querysize"] = FormatBytes($ligne["Querysize"] / 1024);
$ligne['HitsNumber'] = numberFormat($ligne['HitsNumber'], 0, "", " ");
$data['rows'][] = array('id' => $ligne['sitename'], 'cell' => array($thumbs, "{$div}{$ligne['sitename']}</div>", $div . $ligne['HitsNumber'] . "</div>", $div . $ligne["Querysize"] . "</div>", $div . $ligne['category'] . "</div>"));
}
echo json_encode($data);
}
示例7: categories_search
//.........这里部分代码省略.........
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
if ($searchstring != null) {
$sql = "SELECT COUNT( * ) AS tcount FROM {$table} WHERE 1 {$searchstring}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
if (!$q->ok) {
json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}.<br>{$sql}", 1);
}
$total = $ligne["tcount"];
} else {
$total = $q->COUNT_ROWS($table);
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql} ";
writelogs("{$q->mysql_admin}:{$q->mysql_password}:{$sql}", __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
if ($q->mysql_error != null) {
json_error_show(date("H:i:s") . "<br>SORT:{$_POST["sortname"]}:<br>Mysql Error [L." . __LINE__ . "]: {$q->mysql_error}<br>{$sql}", 1);
}
}
if (mysql_num_rows($results) == 0) {
json_error_show("Not found...", 1);
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
$enc = new mysql_catz();
$field = "category";
$field_description = "category_description";
$CATZ_ARRAY = unserialize(@file_get_contents("/home/artica/categories_databases/CATZ_ARRAY"));
$TransArray = $enc->TransArray();
while (list($tablename, $items) = each($CATZ_ARRAY)) {
if (!isset($TransArray[$tablename])) {
continue;
}
$CATZ_ARRAY2[$TransArray[$tablename]] = $items;
}
while ($ligne = mysql_fetch_assoc($results)) {
$color = "black";
$categorykey = $ligne["category"];
if ($categorykey == null) {
$categorykey = "UnkNown";
}
//Array ( [category] => [category_description] => Ma catégorie [master_category] => [sended] => 1 )
if ($GLOBALS["VERBOSE"]) {
echo "Found {$field}:{$categorykey}<br>\n";
}
$categoryname = $categorykey;
$text_category = null;
$table = $q->cat_totablename($categorykey);
if ($GLOBALS["VERBOSE"]) {
echo "Scanning table {$table}<br>\n";
}
$itemsEncTxt = null;
$items = $q->COUNT_ROWS($table);
if (!preg_match("#^category_(.+)#", $table, $re)) {
continue;
}
$compile = imgsimple("compile-distri-32.png", "{saveToDisk}", "DansGuardianCompileDB('{$categoryname}')");
if ($dans->array_pics[$categoryname] != null) {
$pic = "<img src='img/{$dans->array_pics[$categoryname]}'>";
} else {
$pic = " ";
}
$sizedb_org = $q->TABLE_SIZE($table);
$sizedb = FormatBytes($sizedb_org / 1024);
$linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.categories.php?category={$categoryname}&t={$t}',true)\"\n\t\t\tstyle='font-size:18px;font-weight:bold;color:{$color};text-decoration:underline'>";
$text_category = $tpl->_ENGINE_parse_body(utf8_decode($ligne[$field_description]));
$text_category = trim($text_category);
$linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?add-perso-cat-js=yes&cat={$categoryname}&t={$t}',true)\"\n\t\t\tstyle='font-size:18px;font-weight:bold;color:{$color};text-decoration:underline'>";
$viewDB = imgsimple("mysql-browse-database-32.png", null, "javascript:Loadjs('squid.categories.php?category={$categoryname}',true)");
$text_category = utf8_encode($text_category);
$categoryname_text = utf8_encode($categoryname);
$categoryText = $tpl->_ENGINE_parse_body("<span style='font-size:18px';font-weight:bold'>{$linkcat}{$categoryname_text}</span>\n\t\t\t\t\t</a><br><span style='font-size:16px;width:100%;font-weight:normal'><i>{$text_category}</i></span>");
$itemsEncTxt = "<span style='font-size:18px;font-weight:bold'>" . numberFormat($items, 0, "", " ");
"</span>";
$compile = imgsimple("compile-distri-48.png", null, "DansGuardianCompileDB('{$categoryname}')");
$delete = imgsimple("dustbin-48.png", null, "TableCategoryPurge('{$table}')");
if ($categoryname == "UnkNown") {
$linkcat = null;
$delete = imgsimple("delete-48.png", null, "TableCategoryPurge('')");
}
$cell = array();
$cell[] = $categoryText;
$cell[] = "<span style='font-size:18px;padding-top:15px;font-weight:bold'>{$sizedb}</div>";
$cell[] = $itemsEncTxt;
$cell[] = $compile;
$cell[] = $delete;
$data['rows'][] = array('id' => $ligne['ID'], 'cell' => $cell);
}
echo json_encode($data);
}
示例8: getUserData
function getUserData($uid)
{
$CI =& get_instance();
$CI->load->model('user_account_count_model', 'user_account_count');
$CI->load->model('repay_log_model', 'repay_log');
if (empty($uid)) {
return false;
}
$userAcc = array();
//用户统计表
$uacount = $CI->user_account_count->get($uid);
$params = array('income_today_count');
foreach ($params as $value) {
if (isset($uacount[$value])) {
$userAcc[$value] = $uacount[$value];
} else {
$userAcc[$value] = 0;
}
}
//即将还本 [取明日还本金额]
$where = array('sum' => 'recover_capital', 'uid' => $uid, 'status' => 'wait', 'scope' => array('ltt' => array('recover_time' => strtotime(date('Y-m-d') + 86400)), 'mt' => array('recover_time' => strtotime(date('Y-m-d') + 86400 * 2))));
$watiCapital = $CI->repay_log->getWidgetRow($where);
$userAcc['recover_capital'] = !empty($watiCapital['recover_capital']) ? $watiCapital['recover_capital'] : 0;
//数字格式
foreach ($userAcc as &$value) {
$value = numberFormat($value);
}
unset($value);
return array('income_today_count' => $userAcc['income_today_count'], 'recover_capital' => $userAcc['recover_capital']);
}
示例9: subtitle_categories
function subtitle_categories(){
if(CACHE_SESSION_GET(__FUNCTION__, __FILE__,15)){return;}
$tpl=new templates();
$q=new mysql_squid_builder();
$categories=$q->COUNT_CATEGORIES();
$categories=numberFormat($categories,0,""," ");
$tablescat=$q->LIST_TABLES_CATEGORIES();
$tablescatNUM=numberFormat(count($tablescat),0,""," ");
$html="<div style='font-size:16px'><b>$categories</b> {websites_categorized} | <b>$tablescatNUM</b> {categories}</div>";
CACHE_SESSION_SET(__FUNCTION__, __FILE__, $tpl->_ENGINE_parse_body($html));
}
示例10: categories_search
function categories_search()
{
$tpl = new templates();
$catz = new mysql_catz();
$tables = $catz->LIST_TABLES_CATEGORIES();
$dans = new dansguardian_rules();
$dans->LoadBlackListes();
$search = string_to_flexregex("categories-search");
$TransArray = $catz->TransArray();
while (list($key, $value) = each($tables)) {
$categoryname = $TransArray[$key];
$text_category = $tpl->_ENGINE_parse_body($dans->array_blacksites[$categoryname]);
if (!isset($dans->array_blacksites[$categoryname])) {
continue;
}
if ($dans->array_pics[$categoryname] != null) {
$pic = "<img src='img/{$dans->array_pics[$categoryname]}'>";
} else {
$pic = " ";
}
$CTCOUNT = $catz->COUNT_ROWS($key);
if ($CTCOUNT == 0) {
continue;
}
$items = numberFormat($CTCOUNT, 0);
if ($search != null) {
if (!preg_match("#{$search}#", $categoryname)) {
if (!preg_match("#{$search}#", $text_category)) {
continue;
}
}
}
$tr[] = "\n\t\t<tr id='{$id}'>\n\t\t<td width=1% nowrap>{$pic}</td>\n\t\t<td><i class='icon-globe'></i> <strong>{$categoryname}</strong><div>{$text_category}</div></td>\n\t\t<td nowrap><i class='icon-info-sign'></i> <span style='font-size:18px'>{$items}</span></td>\n\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=2>{category}</th>\n\t\t\t\t\t<th>{websites}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("", $tr) . "</tbody></table>";
}
示例11: items
function items()
{
$t = $_GET["t"];
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$users = new usersMenus();
$sock = new sockets();
$ID = $_GET["ID"];
$tablename = "WebTrackMem{$ID}";
$search = '%';
$table = "(SELECT SUM(hits) as hits, SUM(size) as size,sitename,zDate FROM {$tablename} GROUP BY sitename,zDate HAVING sitename='{$_GET["sitename"]}') as t ";
$page = 1;
$FORCE_FILTER = null;
if (!$q->TABLE_EXISTS($tablename, $database)) {
json_error_show("{$table} doesn't exists...");
}
if ($q->COUNT_ROWS($tablename, $database) == 0) {
json_error_show("No rules");
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$searchstring = string_to_flexquery();
if ($searchstring != null) {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql, $database);
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (!$q->ok) {
json_error_show($q->mysql_error);
}
$rp = new squid_report($ID);
while ($ligne = mysql_fetch_assoc($results)) {
$zmd5 = md5(serialize($ligne));
$color = "black";
//familysite size hits
$urljsSIT = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:Loadjs('squid.traffic.statistics.hours.php?filterby={$rp->userfield}&filterdata=" . urlencode($rp->userdata) . "&day={$ligne["zDate"]}&familysite={$ligne["sitename"]}');\"\n\tstyle='font-size:14px;text-decoration:underline;color:{$color}'>";
$ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$data['rows'][] = array('id' => "{$zmd5}", 'cell' => array("<span style='font-size:14px;color:{$color}'>{$urljsSIT}{$ligne["zDate"]}</a></span>", "<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["size"]}</span>", "<span style='font-size:14px;color:{$color}'>{$ligne["hits"]}</span>"));
}
echo json_encode($data);
}
示例12: numberFormat
<h1>
<?php
if ($wind['sug_money'] == $wind['max_money']) {
?>
¥<?php
echo numberFormat($wind['max_money'], 2);
?>
万
<?php
} else {
?>
¥<?php
echo numberFormat($wind['sug_money'], 2);
?>
~¥<?php
echo numberFormat($wind['max_money'], 2);
?>
万
<?php
}
?>
</h1>
<p>风控最终审核价格</p>
</div>
<div class="hei101"></div>
<div class="list mb15">
<!--车辆信息-->
<?php
if (!empty($car)) {
?>
<?php
示例13: showlist
function showlist()
{
$q = new mysql_squid_builder();
$table = "mgr_client_list";
if (!$q->TABLE_EXISTS($table)) {
$q->CheckReportTable();
}
$tpl = new templates();
$page = 1;
$FORCE_FILTER = null;
$total = 0;
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$searchstring = string_to_flexquery();
if ($searchstring != null) {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
if (!$q->ok) {
json_error_show("{$q->mysql_error}");
}
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
if (!$q->ok) {
json_error_show("{$q->mysql_error}");
}
$total = $ligne["TCOUNT"];
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
json_error_show("{$q->mysql_error}");
}
if (mysql_num_rows($results) == 0) {
json_error_show("No data, {$sql}");
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
while ($ligne = mysql_fetch_assoc($results)) {
$md5 = md5(serialize($line));
$CUR_CNX = numberFormat($ligne["CUR_CNX"], 0, "", " ");
$RQS = numberFormat($ligne["RQS"], 0, "", " ");
$TCP_HIT = numberFormat($ligne["TCP_HIT"], 0, "", " ");
$TCP_MISS = numberFormat($ligne["TCP_MISS"], 0, "", " ");
$TCP_REDIRECT = numberFormat($ligne["TCP_REDIRECT"], 0, "", " ");
$TCP_TUNNEL = numberFormat($ligne["TCP_TUNNEL"], 0, "", " ");
$TAG_NONE = numberFormat($ligne["TAG_NONE"], 0, "", " ");
$data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:16px'>{$ligne["uid"]}</a></span>", "<span style='font-size:16px'>{$ligne["ipaddr"]}</a></span>", "<span style='font-size:16px'>{$CUR_CNX}</span>", "<span style='font-size:16px'>{$RQS}</span>", "<span style='font-size:16px'>{$TCP_HIT}</span>", "<span style='font-size:16px'>{$TCP_MISS}</span>", "<span style='font-size:16px'>{$TCP_REDIRECT}</span>", "<span style='font-size:16px'>{$TCP_TUNNEL}</span>", "<span style='font-size:16px'>{$TAG_NONE}</span>"));
}
echo json_encode($data);
}
示例14: items
function items()
{
$t = $_GET["t"];
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$users = new usersMenus();
$sock = new sockets();
$search = '%';
$table = $_GET["table"];
$page = 1;
$FORCE_FILTER = null;
if ($_GET["field"] != null) {
$FORCE_FILTER = " AND `{$_GET["field"]}`='{$_GET["value"]}'";
}
if ($_GET["sitename"] != null) {
$FORCE_FILTER = $FORCE_FILTER . " AND `sitename`='{$_GET["sitename"]}'";
}
if (!$q->TABLE_EXISTS($table, $database)) {
json_error_show("{$table} doesn't exists...");
}
if ($q->COUNT_ROWS($table, $database) == 0) {
json_error_show("No data");
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$searchstring = string_to_flexquery();
if ($searchstring != null) {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
$results = $q->QUERY_SQL($sql, $database);
if (mysql_num_rows($results) == 0) {
json_error_show("{$sql}<hr>No row", 1);
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (!$q->ok) {
json_error_show($q->mysql_error);
}
while ($ligne = mysql_fetch_assoc($results)) {
$zmd5 = md5(serialize($ligne));
$color = "black";
$date = strtotime($ligne["zDate"]);
$Hour = date("H:i");
//familysite size hits
$urljsSIT = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:Loadjs('squid.website-zoom.php?js=yes&sitename={$ligne["sitename"]}&xtime={$_GET["xtime"]}');\"\n\tstyle='font-size:14px;text-decoration:underline;color:{$color}'>";
$urijs = "s_PopUpFull('{$ligne["uri"]}','1024','900');";
$ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$ligne["familysite"] = $q->GetFamilySites($ligne["sitename"]);
$data['rows'][] = array('id' => "{$zmd5}", 'cell' => array("<span style='font-size:12px;color:{$color}'>{$Hour}</a></span>", "<span style='font-size:12px;color:{$color}'><a href=\"javascript:blur();\" OnClick=\"javascript:{$urijs}\" style='text-decoration:underline'>{$ligne["uri"]}</a></span>", "<span style='font-size:12px;color:{$color}'>{$ligne["size"]}</span>", "<span style='font-size:12px;color:{$color}'>{$ligne["hits"]}</span>"));
}
echo json_encode($data);
}
示例15: who_items
function who_items()
{
$t = $_GET["t"];
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$users = new usersMenus();
$sock = new sockets();
$youtubeid = $_GET["youtubeid"];
$searchstring = string_to_flexregex("who-items");
$table = "youtube_all";
$page = 1;
$FORCE_FILTER = " AND ";
if ($searchstring != null) {
$searchstring = "{$searchstring}";
}
$sql = "SELECT zDate,uid,MAC,youtubeid,SUM(hits) as hits FROM {$table} GROUP BY youtubeid,zDate,uid,MAC HAVING youtubeid='{$youtubeid}' {$searchstring} ORDER BY zDate DESC LIMIT 0,250";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
throw new Exception("ERROR {$q->mysql_error} `{$sql}`", 500);
}
$boot = new boostrap_form();
while ($ligne = mysql_fetch_assoc($results)) {
$zmd5 = md5(serialize($ligne));
$color = "black";
$urljsSIT = "Loadjs('miniadm.webstats.youtubeid.php?youtubeid={$youtubeid}')";
$link = $boot->trswitch($urljsSIT);
$jsvideo = $boot->trswitch("Loadjs('miniadm.webstats.youtubeid.php?youtubeid={$youtubeid}');");
$urljsSIT = "Loadjs('miniadm.webstats.youtubeid.php?youtubeid={$youtubeid}&xtime={$_GET["xtime"]}');";
$link = $boot->trswitch($urljsSIT);
$ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
$urljsSIT = null;
$link = null;
$xtime = strtotime($ligne["zDate"] . " 00:00:00");
$linkuid = $boot->trswitch("Loadjs('miniadm.webstats.ByMember.ByYoutubeByHour.php?filterBy=uid&xtime={$xtime}&value={$ligne["uid"]}&youtubeid={$youtubeid}')");
$linkMAC = $boot->trswitch("Loadjs('miniadm.webstats.ByMember.ByYoutubeByHour.php?filterBy=MAC&xtime={$xtime}&value={$ligne["MAC"]}&youtubeid={$youtubeid}')");
$tr[] = "\n\t\t<tr id='{$id}'>\n\t\t<td {$link} nowrap><i class='icon-time'></i> {$ligne["zDate"]}</td>\n\t\t<td {$linkuid}><i class='icon-info-sign'></i> {$ligne["uid"]}</td>\n\t\t<td {$linkMAC}><i class='icon-info-sign'></i> {$ligne["MAC"]}</td>\n\t\t<td {$link}><i class='icon-info-sign'></i> {$ligne["hits"]}</td>\n\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t<table class='table table-bordered table-hover'>\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>{zDate}</th>\n\t\t\t\t<th>{member}</th>\n\t\t\t\t<th>{MAC}</th>\n\t\t\t\t<th>{hits}</th>\n\t\t\t</tr>\n\t\t</thead>\n\t<tbody>\n\t") . @implode("", $tr) . "</tbody></table>";
}