本文整理汇总了PHP中mysql::COUNT_ROWS方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::COUNT_ROWS方法的具体用法?PHP mysql::COUNT_ROWS怎么用?PHP mysql::COUNT_ROWS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql
的用法示例。
在下文中一共展示了mysql::COUNT_ROWS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: table
function table()
{
$page = CurrentPageName();
$tpl = new templates();
$t = time();
$explain_section = $tpl->_ENGINE_parse_body("{routes_center_explain}");
$t = time();
$type = $tpl->_ENGINE_parse_body("{type}");
$gateway = $tpl->_ENGINE_parse_body("{gateway}");
$items = $tpl->_ENGINE_parse_body("{items}");
$nic = $tpl->javascript_parse_text("{nic}");
$order = $tpl->javascript_parse_text("{order}");
$title = $tpl->javascript_parse_text("{boots}");
$ttl = $tpl->_ENGINE_parse_body("{ttl}");
$date = $tpl->_ENGINE_parse_body("{date}");
$subject = $tpl->_ENGINE_parse_body("{infos}");
$q = new mysql();
$sys_alerts = FormatNumber($q->COUNT_ROWS("last_boot", "artica_events"));
// $sql="INSERT INTO nic_routes (`type`,`gateway`,`pattern`,`zmd5`,`nic`)
// VALUES('$type','$gw','$pattern/$cdir','$md5','$route_nic');";
$buttons = "\n\tbuttons : [\n\t{name: '{$new_route}', bclass: 'add', onpress : Add{$t}},\n\t{name: '{$test_a_route}', bclass: 'Search', onpress : TestRoute{$t}},\n\t{name: '{$apply}', bclass: 'apply', onpress : Apply{$t}},\n\n\n\t],";
$buttons = null;
$html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\n\t<script>\n\tvar rowid=0;\n\t\$(document).ready(function(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?search=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$date}', name : 'zDate', width : 450, sortable : true, align: 'left'},\n\t{display: '{$subject}', name : 'subject', width : 341, sortable : true, align: 'left'},\n\t{display: '{$ttl}', name : 'load', width : 312, sortable : true, align: 'right'},\n\t\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$date}', name : 'zDate'},\n\t{display: '{$subject}', name : 'subject'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$title}:: {$sys_alerts}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\n});\n});\n\n\nfunction Add{$t}(){\nLoadjs('{$page}?route-js=yes&zmd5=&t={$t}');\n}\nfunction TestRoute{$t}(){\n\tLoadjs('{$page}?test-route-js=yes');\n}\n\nfunction Apply{$t}(){\n\tLoadjs('network.restart.php?t={$t}')\n\n}\n\nvar x_DansGuardianDelGroup= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\t\$('#row'+rowid).remove();\n}\n\nfunction DansGuardianDelGroup(ID){\n\tif(confirm('{$do_you_want_to_delete_this_group} ?')){\n\t\trowid=ID;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Delete-Group', ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_DansGuardianDelGroup);\n\t}\n}\n</script>\n";
echo $html;
}
示例2: status
function status()
{
$tpl = new templates();
$page = CurrentPageName();
$script = null;
if (is_file("ressources/logs/global.status.ini")) {
$ini = new Bs_IniHandler("ressources/logs/global.status.ini");
} else {
writelogs("ressources/logs/global.status.ini no such file");
$sock = new sockets();
$datas = base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
$ini = new Bs_IniHandler($datas);
}
$sock = new sockets();
$datas = $sock->getFrameWork('cmd.php?refresh-status=yes');
$status = DAEMON_STATUS_ROUND("CLAMAV", $ini, null, 1);
$q = new mysql();
if ($q->TABLE_EXISTS("clamd_mem", "artica_events")) {
if ($q->COUNT_ROWS("clamd_mem", "artica_events") > 1) {
$script = "LoadAjax('clamd-graphs','{$page}?clamd-graphs=yes');";
}
}
$html = "\n\t<div style='width:100%'>{$status}</div>\n\t<center style='margin-top:10px' id='clamd-graphs'></center>\n\t\n\t<script>\n\t\t{$script}\n\t</script>\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例3: status
function status(){
$q=new mysql();
$page=CurrentPageName();
$tpl=new templates();
$total=FormatNumber($q->COUNT_ROWS("dansguardian_community_categories","artica_backup"),0,'.',' ',3);
$sql="SELECT count(*) as tcount FROM `dansguardian_sitesinfos` WHERE `dbpath` = ''";
$ligne=@mysql_fetch_array($q->QUERY_SQL($sql,'artica_backup'));
$pp=Paragraphe("64-categories.png",$ligne["tcount"]." {websites_not_categorized}",
"{websites_not_categorized_text}","javascript:Loadjs('squid.visited.php')",null,300,76);
$html="
<table style='width:100%'>
<tr>
<td valign='top'><img src='img/webfilter-community-128.png'></td>
<td valign='top' width=99%'>
<div class=explain>{APP_WEBFILTER_COMMUNITY_EXPLAIN}</div>
<div style='font-size:14px;font-weight:bold'>$total {websites} ({community})</div>
$pp
</td>
</tr>
</table>
";
echo $tpl->_ENGINE_parse_body($html);
}
示例4: table
function table()
{
$page = CurrentPageName();
$tpl = new templates();
$t = time();
$dnsmasq_address_text = $tpl->_ENGINE_parse_body("{dnsmasq_address_text}");
$hosts = $tpl->_ENGINE_parse_body("{hosts}");
$addr = $tpl->_ENGINE_parse_body("{addr}");
$new_interface = $tpl->_ENGINE_parse_body("{new_interface}");
$rulename = $tpl->_ENGINE_parse_body("{rulename}");
$explain = $tpl->javascript_parse_text("{explain}");
$title = $tpl->_ENGINE_parse_body("{rules}");
$category = $tpl->_ENGINE_parse_body("{category}");
$enabled = $tpl->_ENGINE_parse_body("{enabled}");
$q = new mysql();
if (!$q->TABLE_EXISTS("suricata_rules_packages", "artica_backup")) {
$sql = "CREATE TABLE IF NOT EXISTS `artica_backup`.`suricata_rules_packages` (\n\t\t`rulefile` VARCHAR(128) NOT NULL PRIMARY KEY ,\n\t\t`category` VARCHAR(40) NOT NULL,\n\t\t`enabled` smallint(1) NOT NULL DEFAULT 0,\n\t\tINDEX ( `category`),\n\t\tINDEX ( `enabled`)\n\t\t)";
$q->QUERY_SQL($sql, 'artica_backup');
if (!$q->ok) {
echo $q->mysql_error . "\n";
}
}
if ($q->COUNT_ROWS("suricata_rules_packages", "artica_backup") == 0) {
$sql = "INSERT IGNORE INTO suricata_rules_packages (rulefile,enabled,category) VALUES \n\t\t\t\t('botcc.rules',0,'DMZ'),('ciarmy.rules',0,'DMZ'),('compromised.rules','0','DMZ'),\n\t\t\t\t('drop.rules',1,'DMZ'),\n\t\t\t\t('dshield.rules',1,'DMZ'),('snort.rules',1,'ALL'),\n\t\t\t\t('emerging-activex.rules',1,'WEB'),\n\t\t\t\t('emerging-attack_response.rules',1,'ALL'),\n\t\t\t\t('emerging-chat.rules',0,'WEB'),\n\t\t\t\t('emerging-current_events.rules',0,'ALL'),\n\t\t\t\t('emerging-dns.rules',0,'DMZ'),\n\t\t\t\t('emerging-dos.rules',0,'DMZ'),\n\t\t\t\t('emerging-exploit.rules',0,'DMZ'),\n\t\t\t\t('emerging-ftp.rules',0,'DMZ'),\n\t\t\t\t('emerging-games.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp_info.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp.rules',0,'ALL'),\n\t\t\t\t('emerging-imap.rules',0,'DMZ'),\n\t\t\t\t('emerging-inappropriate.rules',0,'WEB'),\n\t\t\t\t('emerging-malware.rules',1,'WEB'),\n\t\t\t\t('emerging-mobile_malware.rules',0,'WEB'),\n\t\t\t\t('emerging-netbios.rules',0,'ALL'),\n\t\t\t\t('emerging-p2p.rules',0,'WEB'),\n\t\t\t\t('emerging-policy.rules',1,'WEB'),\n\t\t\t\t('emerging-pop3.rules',0,'DMZ'),\n\t\t\t\t('emerging-rpc.rules',0,'ALL'),\n\t\t\t\t('emerging-scada.rules',0,'ALL'),\n\t\t\t\t('emerging-scan.rules',1,'ALL'),\n\t\t\t\t('emerging-shellcode.rules',1,'ALL'),\n\t\t\t\t('emerging-smtp.rules',0,'DMZ'),\n\t\t\t\t('emerging-snmp.rules',0,'ALL'),\n\t\t\t\t('emerging-sql.rules',0,'ALL'),\n\t\t\t\t('emerging-telnet.rules',0,'ALL'),\n\t\t\t\t('emerging-tftp.rules',0,'ALL'),\n\t\t\t\t('emerging-trojan.rules',1,'ALL'),\n\t\t\t\t('emerging-user_agents.rules',0,'ALL'),\n\t\t\t\t('emerging-voip.rules',0,'ALL'),\n\t\t\t\t('emerging-web_client.rules',1,'HTTP'),\n\t\t\t\t('emerging-web_server.rules',0,'HTTP'),\n\t\t\t\t('emerging-web_specific_apps.rules',0,'HTTP'),\n\t\t\t\t('emerging-worm.rules',1,'ALL'),\n\t\t\t\t('tor.rules',0,'ALL'),\n\t\t\t\t('decoder-events.rules',0,'ALL'),\n\t\t\t\t('stream-events.rules',0,'ALL'),\n\t\t\t\t('http-events.rules',0,'HTTP'),\n\t\t\t\t('smtp-events.rules',0,'DMZ'),\n\t\t\t\t('dns-events.rules',0,'DMZ'),\n\t\t\t\t('tls-events.rules',0,'DMZ')";
$q->QUERY_SQL($sql, 'artica_backup');
}
$apply = $tpl->javascript_parse_text("{apply}");
$buttons = "\n\tbuttons : [\n\t\n\t{name: '<strong style=font-size:18px>{$apply}</strong>', bclass: 'Apply', onpress : Apply{$t}},\n\t],";
$html = "\n\t\n\t\n\t<table class='TABLE_SURICATA_MAIN_RULES' style='display: none' id='TABLE_SURICATA_MAIN_RULES'\n\tstyle='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\tvar md5H='';\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\n\t{display: '<span style=font-size:22px>{$rulename}</span>', name : 'rulefile', width : 300, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:22px>{$category}</span>', name : 'category', width : 156, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>{$explain}</span>', name : 'none', width : 833, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:22px>{$enabled}</span>', name : 'enabled', width : 105, sortable : true, align: 'center'},\n\n\t],\n\t{$buttons}\nsearchitems : [\n\t\t{display: '{$rulename}', name : 'rulefile'},\n\t\t{display: '{$category}', name : 'category'},\n\t\t\n\n\t],\t\n\tsortname: 'rulefile',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n\t});\n\t\n\t\nfunction Add{$t}(){\n\tLoadjs('{$page}?add-interface-js=yes&t={$t}');\n}\nvar xSuricataRuleEnabled= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexReload();\n}\n\t\nfunction SuricataRuleEnabled(filename){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('filename',filename);\n\tXHR.sendAndLoad('{$page}', 'POST',xSuricataRuleEnabled);\n}\nfunction Apply{$t}(){\n\tLoadjs('suricata.progress.php');\n}\n</script>\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例5: 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
}
示例6: left_infos_1
function left_infos_1()
{
$newfrontend = false;
$users = new usersMenus();
$sock = new sockets();
$tpl = new templates();
$ldap = new clladp();
if (!$users->AsArticaAdministrator) {
die("<H2 style='color:red'>permission denied</H2>");
}
$page = CurrentPageName();
$DisablePurchaseInfo = $sock->GET_INFO("DisablePurchaseInfo");
if (!is_numeric($DisablePurchaseInfo)) {
$DisablePurchaseInfo = 0;
}
if ($DisablePurchaseInfo == 0) {
echo $tpl->_ENGINE_parse_body(ParagrapheTEXT("technical-support-32.png", '{ARTICA_P_SUPPORT}', '{ARTICA_P_SUPPORT_TEXT}', "javascript:Loadjs('artica.subscription.php');"));
}
if (is_file("ressources/logs/status.inform.html")) {
echo $tpl->_ENGINE_parse_body(@file_get_contents("ressources/logs/status.inform.html"));
}
if ($ldap->ldap_password == "secret") {
echo ParagrapheTEXT("danger32-user-lock.png", '{MANAGER_DEFAULT_PASSWORD}', '{MANAGER_DEFAULT_PASSWORD_TEXT}', "javascript:Loadjs('artica.settings.php?js=yes&bigaccount-interface=yes');", null, 330);
}
if (!function_exists("browser_detection")) {
include dirname(__FILE__) . '/ressources/class.browser.detection.inc';
}
$browser = browser_detection();
if ($browser == "ie") {
echo ParagrapheTEXT("no-ie-32.png", '{NOIEPLEASE} !!', '{NOIEPLEASE_TEXT}', "javascript:s_PopUp('http://www.mozilla-europe.org/en/firefox/','800',800);", null, 330);
}
if ($sock->GET_INFO("EnableNightlyInFrontEnd") == 1) {
NightlyNotifs();
}
if ($users->VMWARE_HOST) {
if (!$users->VMWARE_TOOLS_INSTALLED) {
echo ParagrapheTEXT("vmware-logo-48.png", '{INSTALL_VMWARE_TOOLS}', '{INSTALL_VMWARE_TOOLS_TEXT}', "javascript:Loadjs('setup.index.progress.php?product=APP_VMTOOLS&start-install=yes');", null, 330);
}
}
if ($GLOBALS["VERBOSE"]) {
echo "{$page} LINE:" . __LINE__ . "\n";
}
if ($users->VIRTUALBOX_HOST) {
if (!$users->APP_VBOXADDINTION_INSTALLED) {
echo ParagrapheTEXT("virtualbox-48.png", '{INSTALL_VBOX_TOOLS}', '{INSTALL_VBOX_TOOLS_TEXT}', "javascript:Loadjs('setup.index.progress.php?product=APP_VBOXADDITIONS&start-install=yes');", null, 330);
}
}
if ($users->ZARAFA_INSTALLED) {
$q = new mysql();
$ctc = $q->COUNT_ROWS("zarafa_orphaned", "artica_backup");
if ($ctc > 0) {
echo ParagrapheTEXT("inbox-error-48.png", "{$ctc} {ORPHANED_STORES}", '{ORPHANED_STORES_TEXT}', "javascript:Loadjs('zarafa.orphans.php?js=yes');", null, 330);
}
}
}
示例7: tabs
function tabs()
{
$q = new mysql();
$page = CurrentPageName();
$tpl = new templates();
$count = $q->COUNT_ROWS("samba_domains_info", "artica_backup");
$tpl = new templates();
$array["domains"] = "{$count} {domains}";
while (list($num, $ligne) = each($array)) {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\"><span>{$ligne}</span></a></li>\n");
}
echo "\n\t<div id=main_smbwbinfodomains style='width:100%;height:550px;overflow:auto'>\n\t\t<ul>" . implode("\n", $html) . "</ul>\n\t</div>\n\t\t<script>\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#main_smbwbinfodomains').tabs();\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t</script>";
}
示例8: perform_reset
function perform_reset()
{
$q = new mysql();
$table_smtp_logs = $q->COUNT_ROWS("smtp_logs", "artica_events");
$q->QUERY_SQL("TRUNCATE TABLE `smtp_logs`", "artica_events");
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$tpl = new templates();
$table_smtp_logs2 = $q->COUNT_ROWS("smtp_logs", "artica_events");
echo $tpl->javascript_parse_text("{success} smtp_logs: {$table_smtp_logs} -> {$table_smtp_logs2} {rows}") . "\n";
$table_smtp_logs = $q->COUNT_ROWS("smtp_logs_day", "artica_events");
$q->QUERY_SQL("TRUNCATE TABLE `smtp_logs_day`", "artica_events");
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$tpl = new templates();
$table_smtp_logs2 = $q->COUNT_ROWS("smtp_logs_day", "artica_events");
echo $tpl->javascript_parse_text("{success}: smtp_logs_day {$table_smtp_logs} -> {$table_smtp_logs2} {rows}") . "\n";
}
示例9: tabs
function tabs()
{
$q = new mysql();
$page = CurrentPageName();
$tpl = new templates();
$count = $q->COUNT_ROWS("smbstatus_users", "artica_events");
$tpl = new templates();
$array["members"] = "{$count} {members_connected}";
$array["files"] = '{files}';
while (list($num, $ligne) = each($array)) {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\"><span>{$ligne}</span></a></li>\n");
}
echo "\n\t<div id=main_smbtsatustab style='width:100%;height:550px;overflow:auto'>\n\t\t<ul>" . implode("\n", $html) . "</ul>\n\t</div>\n\t\t<script>\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#main_smbtsatustab').tabs();\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t</script>";
}
示例10: table
function table()
{
$sock = new sockets();
$q = new mysql();
$CountDeFreeWebs = $q->COUNT_ROWS("freeweb", "artica_backup");
$EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb");
if (!is_numeric($EnableFreeWeb)) {
$EnableFreeWeb = 0;
}
$q = new mysql_squid_builder();
if (!$q->TABLE_EXISTS("reverse_www")) {
$f = new squid_reverse();
}
if (!$q->TABLE_EXISTS("reverse_sources")) {
$f = new nginx_sources();
$f->PatchTables();
}
if (!$q->FIELD_EXISTS("reverse_sources", "OnlyTCP")) {
$q->QUERY_SQL("ALTER TABLE `reverse_sources` ADD `OnlyTCP` smallint(1) NOT NULL DEFAULT '0'");
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error} in " . basename(__FILE__) . " line " . __LINE__ . "</p>";
}
}
$page = CurrentPageName();
$tpl = new templates();
$date = $tpl->_ENGINE_parse_body("{zDate}");
$description = $tpl->_ENGINE_parse_body("{description}");
$context = $tpl->_ENGINE_parse_body("{context}");
$events = $tpl->_ENGINE_parse_body("{events}");
$destination = $tpl->_ENGINE_parse_body("{destination}");
$website = $tpl->_ENGINE_parse_body("{website}");
$settings = $tpl->javascript_parse_text("{watchdog_squid_settings}");
$empty_events_text_ask = $tpl->javascript_parse_text("{empty_events_text_ask}");
$apply_parameters = $tpl->javascript_parse_text("{rebuild_all_websites}");
$purge_caches = $tpl->javascript_parse_text("{purge_caches}");
$import_export = $tpl->javascript_parse_text("{import_export}");
$new_server = $tpl->javascript_parse_text("{new_server}");
$TB_HEIGHT = 450;
$TB_WIDTH = 927;
$TB2_WIDTH = 551;
$all = $tpl->_ENGINE_parse_body("{all}");
$t = time();
$buttons = "\n\tbuttons : [\n\t\n\t{name: '{$apply_parameters}', bclass: 'apply', onpress : apply_parameters{$t}},\n\t{name: '{$purge_caches}', bclass: 'Delz', onpress : purge_caches{$t}},\n\t{name: '{$import_export}', bclass: 'Down', onpress : import_export{$t}},\n\n\n\n\n\t],\t";
$buttons = "\n\tbuttons : [\n\t{name: '{$new_server}', bclass: 'add', onpress : New{$t}},\n\t{name: '{$apply_parameters}', bclass: 'apply', onpress : apply_parameters{$t}},\n\t],\t";
$html = "\n\t<table class='NGINX_MAIN_TABLE2' style='display: none' id='NGINX_MAIN_TABLE2' style='width:99%'></table>\n\t<script>\n\tfunction BuildTable{$t}(){\n\t\$('#NGINX_MAIN_TABLE2').flexigrid({\n\turl: '{$page}?list=yes&t={$t}&ID={$_GET["ID"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: ' ', name : 'severity', width :70, sortable : false, align: 'center'},\n\t{display: '{$website}', name : 'servername', width :560, sortable : true, align: 'left'},\n\t{display: ' ', name : 'compile', width :60, sortable : false, align: 'center'},\n\t{display: ' ', name : 'delete', width :60, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t{display: '{$website}', name : 'servername'},\n\t],\n\tsortname: 'zOrder',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\n});\n}\n\nfunction apply_parameters{$t}(){\n\tLoadjs('nginx.destination.progress.php?cacheid={$_GET["ID"]}')\n}\nfunction purge_caches{$t}(){\nLoadjs('system.services.cmd.php?APPNAME=APP_NGINX&action=purge&cmd=%2Fetc%2Finit.d%2Fnginx&appcode=APP_NGINX');\n}\nfunction import_export{$t}(){\nLoadjs('miniadmin.proxy.reverse.import.php');\n}\n\nfunction New{$t}(){\nLoadjs('nginx.new.php?peer-id={$_GET["ID"]}');\n}\n\tBuildTable{$t}();\n\t</script>";
echo $html;
}
示例11: start
function start()
{
$unix = new unix();
$q = new mysql();
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$pidfileTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
$pid = $unix->get_pid_from_file($pidfile);
if ($unix->process_exists($pid, basename(__FILE__))) {
system_admin_events("Already process {$pid} exists", __FUNCTION__, __FILE__, __LINE__, "backup");
die;
}
@file_put_contents($pidfile, getmypid());
if ($q->COUNT_ROWS("mysqldb_backup", "artica_backup") == 0) {
system_admin_events("Nothing to do ...", __FUNCTION__, __FILE__, __LINE__, "backup");
die;
}
$sql = "SELECT * FROM `mysqldb_backup` WHERE enabled=1";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
system_admin_events("{$q->mysql_error}\n{$sql}", __FUNCTION__, __FILE__, __LINE__, "backup");
}
$rows = mysql_num_rows($results);
if ($rows == 0) {
system_admin_events("No backup to do ...", __FUNCTION__, __FILE__, __LINE__, "backup");
die;
}
system_admin_events("{$rows} database(s) to backup", __FUNCTION__, __FILE__, __LINE__, "backup");
while ($ligne = mysql_fetch_assoc($results)) {
$database = $ligne["database"];
$InstanceID = $ligne["InstanceID"];
$targetDir = $ligne["targetDir"];
$compress = $ligne["compress"];
$MaxDay = $ligne["MaxDay"];
if (!is_numeric($MaxDay)) {
$MaxDay = 90;
}
if (!is_numeric($InstanceID)) {
$InstanceID = 0;
}
system_admin_events("Starting backup `{$database}` (instance {$InstanceID}, compress={$compress})", __FUNCTION__, __FILE__, __LINE__, "backup");
perform_db_backup($InstanceID, $database, $targetDir, $compress);
perform_db_clean($InstanceID, $database, $MaxDay);
system_admin_events("Finish backup `{$database}`...", __FUNCTION__, __FILE__, __LINE__, "backup");
}
}
示例12: community_status
function community_status(){
$page=CurrentPageName();
$tpl=new templates();
$q=new mysql();
$all_count=FormatNumber($q->COUNT_ROWS("dansguardian_community_categories","artica_backup"),0,'.',' ',3);
$artica_community=Paragraphe('webfilter-community-64.png','{community}','{webfilter_community_text}',"javascript:Loadjs('webfilter.community.php')");
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
$html="
<table style='width:100%'>
<tr>
<td width=99% valign='top'>
<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>
<thead class='thead'>
<tr>
<th colspan=2></th>
<th> </th>
</tr>
</thead>
<tbody class='tbody'>
<tr class=$classtr>
<td style='font-size:14px' colspan=2><i>{websites_number}:</i> <strong>$all_count</i></td>
</tr>
";
$array=unserialize(@file_get_contents("ressources/logs/web.community.db.status.txt"));
while (list ($num, $ligne) = each ($array) ){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
$f=FormatNumber($ligne,0,'.',' ',3);
$html=$html."<tr class=$classtr>
<td style='font-size:14px;text-align:right' width=1% nowrap><strong>$num:</td>
<td style='font-size:14px' width=99%><strong>$f</strong></td>
</tr>";
}
$html=$html."</table>
</td>
<td valign='top' width=1%>$artica_community</td>
</tr>
</table>
";
echo $tpl->_ENGINE_parse_body($html);
}
示例13: popup
function popup()
{
$q = new mysql();
$page = CurrentPageName();
$tpl = new templates();
$array["popup-status"] = "{status}";
$array["popup-www"] = "{parameters}";
if ($q->COUNT_ROWS("zarafa_orphaned", "artica_backup") > 0) {
$array["popup-orphans"] = "{orphans}";
}
if (isset($_GET["font-size"])) {
$fontsize = "font-size:{$_GET["font-size"]}px;";
}
$array["popup-mysql"] = "{mysql_tuning}";
$array["popup-indexer"] = "{APP_ZARAFA_INDEXER}";
$array["popup-mailbox"] = "{mailboxes}";
$array["popup-license"] = "{zarafa_license}";
$array["tools"] = "{tools}";
while (list($num, $ligne) = each($array)) {
if ($num == "popup-indexer") {
$html[] = "<li><a href=\"zarafa.indexer.php\"><span>{$ligne}</span></a></li>\n";
continue;
}
if ($num == "popup-mysql") {
$html[] = "<li><a href=\"zarafa.mysql.php\"><span>{$ligne}</span></a></li>\n";
continue;
}
if ($num == "tools") {
$html[] = "<li><a href=\"zarafa.tools.php\"><span>{$ligne}</span></a></li>\n";
continue;
}
if ($num == "popup-orphans") {
$html[] = "<li><a href=\"zarafa.orphans.php\"><span>{$ligne}</span></a></li>\n";
continue;
}
$html[] = "<li><a href=\"{$page}?{$num}=yes\"><span>{$ligne}</span></a></li>\n";
}
$tab = "<div id=main_config_zarafa style='width:759px;height:100%;overflow:auto;{$fontsize}'>\n\t\t<ul>" . implode("\n", $html) . "</ul>\n\t</div>\n\t\t<script>\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#main_config_zarafa').tabs();\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t</script>";
echo $tpl->_ENGINE_parse_body($tab);
}
示例14: _CleanLogsDatabases
function _CleanLogsDatabases($tablename, $max_events)
{
$q = new mysql();
$NumRows = $q->COUNT_ROWS($tablename, "artica_events");
if ($GLOBALS["VERBOSE"]) {
echo "{$tablename}::{$NumRows}/{$max_events}\n";
}
if ($NumRows > $max_events) {
$toDelete = $NumRows - $max_events;
$q->QUERY_SQL("DELETE FROM {$tablename} ORDER BY zDate LIMIT {$toDelete}", "artica_events");
}
}
示例15: find
function find(){
$tpl=new templates();
$lang=$_COOKIE["artica-language"];
if($lang==null){$lang="en";}
$uid=$_SESSION["uid"];
if($uid==-100){$uid="RootMaster";}
$_GET["find"]=strtolower($_GET["find"]);
$sql="SELECT * ,MATCH (`text`) AGAINST ('{$_GET["find"]}') AS score FROM icons_db WHERE MATCH (title,`text`) AGAINST ('{$_GET["find"]}' IN BOOLEAN MODE)
AND uid='$uid' AND lang='$lang' ORDER BY score DESC LIMIT 0,30";
if(strlen(trim($_GET["find"]))<2){
$sql="SELECT * FROM icons_db WHERE uid='$uid' AND lang='$lang' LIMIT 0,30";
}
$q=new mysql();
if($q->COUNT_ROWS("icons_db","artica_backup")==0){
echo $tpl->_ENGINE_parse_body("<div style='font-size:18px;text-align:center;margin:30px;color:white'>{UNITY_NO_DATAS_TEXT}</div>");
return;
}
$results=$q->QUERY_SQL($sql,"artica_backup");
if(!$q->ok){echo "<div style='color:white;font-size:16px'>$q->mysql_error<p>$sql</p></div>";}
while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
$tr[]=UnityParagraphe($ligne);
}
$tables[]="<table style='width:100%'><tr>";
$t=0;
$CC=1;
while (list ($key, $line) = each ($tr) ){
$line=trim($line);
if($line==null){continue;}
$CC++;
$t=$t+1;
$tables[]="<td valign='top'>$line</td>";
if($t==3){$t=0;$tables[]="</tr><tr>";}
if($CC>15){break;}
}
if($t<3){
for($i=0;$i<=$t;$i++){
$tables[]="<td valign='top'> </td>";
}
}
$tables[]="</table>";
$html=implode("\n",$tables);
echo $tpl->_ENGINE_parse_body($html);
}