本文整理汇总了PHP中mysql_squid_builder::CheckTables方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::CheckTables方法的具体用法?PHP mysql_squid_builder::CheckTables怎么用?PHP mysql_squid_builder::CheckTables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_squid_builder
的用法示例。
在下文中一共展示了mysql_squid_builder::CheckTables方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CategorizeAWebSite
function CategorizeAWebSite($www, $category)
{
$md5 = md5($www . $category);
$q = new mysql_squid_builder();
$q->CheckTables();
$uuid = $GLOBALS["UUID"];
$category_table = $q->category_transform_name($category);
$sql_add = "INSERT IGNORE INTO categorize (zmd5,zDate,category,pattern,uuid) VALUES('{$md5}',NOW(),'{$category}','{$www}','{$uuid}')";
$sql_add2 = "INSERT IGNORE INTO category_{$category_table} (zmd5,zDate,category,pattern,uuid) VALUES('{$md5}',NOW(),'{$category}','{$www}','{$uuid}')";
$q->QUERY_SQL($sql_add);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql_add}\n";
return false;
}
$q->QUERY_SQL($sql_add2);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql_add2}\n";
return false;
}
$categories = $q->GET_CATEGORIES($www, true);
if ($categories != null) {
$sql = "UPDATE visited_sites SET category='{$categories}' WHERE sitename='{$www}'";
$q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql}\n";
return false;
}
}
}
示例2: popup
function popup()
{
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
if ($SquidPerformance > 1) {
echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}"));
return;
}
$q = new mysql_squid_builder();
$q->CheckTables();
$type = $tpl->_ENGINE_parse_body("{type}");
$browsers = $tpl->_ENGINE_parse_body("{browsers}");
$items = $tpl->_ENGINE_parse_body("{items}");
$add = $tpl->_ENGINE_parse_body("{add}");
$delete_group_ask = $tpl->javascript_parse_text("{inputbox delete group}");
$title = $tpl->javascript_parse_text("{browsers}");
$t = time();
$table_width = 630;
$table_height = 450;
$buttons = "buttons : [\n\t{name: '{$new_group}', bclass: 'add', onpress : AddGroup},\n\t\t],\t";
$buttons = null;
$html = $tpl->_ENGINE_parse_body("") . "\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$browsers}', name : 'pattern', width : 904, sortable : true, align: 'left'},\n\t\t{display: '{$add}', name : 'pattern', width : 81, sortable : false, align: 'center'},\n\t\t\n\t\t\n\t],\n\n\tsearchitems : [\n\t\t{display: '{$browsers}', name : 'pattern'},\n\t\t],\n\tsortname: 'pattern',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: {$table_height},\n\tsingleSelect: true\n\t\n\t}); \n});\n</script>\n\t";
echo $html;
}
示例3: save
function save()
{
$sock = new sockets();
if ($_POST["ID"] == 0) {
$ligne = unserialize(base64_decode($sock->GET_INFO("DansGuardianDefaultMainRule")));
$ligne["bypass"] = $_POST["bypass"];
$ligne["BypassSecretKey"] = $_POST["BypassSecretKey"];
writelogs("Default rule, saving DansGuardianDefaultMainRule", __FUNCTION__, __FILE__, __LINE__);
$sock->SaveConfigFile(base64_encode(serialize($ligne)), "DansGuardianDefaultMainRule");
writelogs("Ask to compile rule...", __FUNCTION__, __FILE__, __LINE__);
$sock->getFrameWork("webfilter.php?compile-rules=yes");
return;
}
$q = new mysql_squid_builder();
$sql = "UPDATE webfilter_rules SET bypass='{$_POST["bypass"]}',BypassSecretKey='{$_POST["bypass"]}' WHERE ID='{$_POST["ID"]}'";
$q->QUERY_SQL($sql);
if (!$q->ok) {
if (strpos($q->mysql_error, "Unknown column") > 0) {
$q->CheckTables();
$q->QUERY_SQL($sql);
}
}
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$sock->getFrameWork("webfilter.php?compile-rules=yes");
}
示例4: items_add
function items_add()
{
$q = new mysql_squid_builder();
if (!$q->TABLE_EXISTS("webfilter_avwhitedoms")) {
$q->CheckTables();
}
$q->QUERY_SQL("INSERT IGNORE INTO webfilter_avwhitedoms (websitename) VALUES ('{$_POST["add-item"]}')");
if (!$q->ok) {
echo $q->mysql_error;
}
}
示例5: reconstruct
function reconstruct()
{
$database = $_POST["reconstruct"];
$tpl = new templates();
if ($database == "squidlogs") {
$q = new mysql_squid_builder();
$q->CheckTables();
echo $tpl->javascript_parse_text("{success}");
return;
}
$q = new mysql();
$q->BuildTables();
echo $tpl->javascript_parse_text("{success}");
}
示例6: repair_table_days
function repair_table_days()
{
$q = new mysql_squid_builder();
echo "Delete table tables_day\n";
$q->DELETE_TABLE("tables_day");
echo "Check databases...\n";
$q->CheckTables();
$array = $q->LIST_TABLES_dansguardian_events();
while (list($tablename, $none) = each($array)) {
echo $tablename . "\n";
$time = $q->TIME_FROM_DANSGUARDIAN_EVENTS_TABLE($tablename);
$date = date("Y-m-d", $time);
$q->QUERY_SQL("INSERT IGNORE INTO tables_day (tablename,zDate) VALUES ('{$tablename}','{$date}')");
}
}
示例7: myhome1
function myhome1()
{
$tpl = new templates();
$page = CurrentPageName();
$ip = $_SERVER["REMOTE_ADDR"];
$you_need_to_update_your_ip_address = $tpl->_ENGINE_parse_body("{you_need_to_update_your_ip_address}");
$update_your_ip_address = $tpl->_ENGINE_parse_body("{update_your_ip_address}");
$q = new mysql_squid_builder();
$tcip = new networking();
$tcp_array = $tcip->ALL_IPS_GET_ARRAY();
$prefix = "http";
$port = $_SERVER["SERVER_PORT"];
if ($_SERVER["HTTPS"] == "on") {
$prefix = "https";
}
if ($port == "80" or $port == "443") {
$port = null;
} else {
$port = ":{$port}";
}
$orignaluri = "{$prefix}://{$_SERVER["SERVER_NAME"]}{$port}";
$q->QUERY_SQL("UPDATE usersisp SET wwwname='{$orignaluri}' WHERE userid='{$_SESSION["uid"]}'");
if (strpos(" {$q->mysql_error}", "Unknown column") > 0) {
$q->CheckTables();
echo "<script>\n\t\tLoadAjax('myhome1','{$page}?myhome1=yes');\n\t\t</script>";
}
if (!$q->ok) {
echo "<strong style='color:#D20404'>{$q->mysql_error}</strong>";
}
$sql = "SELECT publicip,wwwname FROM usersisp WHERE userid='{$_SESSION["uid"]}'";
$ligne = @mysql_fetch_array($q->QUERY_SQL($sql));
if ($ligne["publicip"] != null) {
$hostname = gethostbyaddr($ip);
if ($tcp_array[$ligne["publicip"]] != null) {
$hostname = null;
$hostname = "<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/warning-panneau-32.png'>\n\t\t\t<td><strong style='color:#D20404'>\n\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:UpdatePublicIPBox();\" style='font-size:12px;text-decoration:underline;color:#D20404'>\n\t\t\t\t\t{$you_need_to_update_your_ip_address}</a>\n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t";
}
} else {
$hostname = "<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td width=1%><img src='img/warning-panneau-32.png'>\n\t\t\t<td><strong style='color:#D20404'>\n\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:UpdatePublicIP();\" style='font-size:12px;text-decoration:underline;color:#D20404'>\n\t\t\t\t\t{$you_need_to_update_your_ip_address}</a>\n\t\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t";
}
$html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{public_ip}:</td>\n\t\t<td><strong style='font-size:14px'><a href=\"javascript:blur();\" OnClick=\"javascript:UpdatePublicIPBox();\" style='font-size:14px;text-decoration:underline;'>{$ligne["publicip"]}</a></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{hostname}:</td>\n\t\t<td><strong style='font-size:14px'>{$hostname}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{howto}:</ \n\t\n\t\n\t</table>\n\t\n\t<script>\n\t\tvar x_UpdatePublicIP= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tLoadAjax('myhome1','{$page}?myhome1=yes');\n\t\t\t}\t\t\n\t\n\t\n\t\tfunction UpdatePublicIP(){\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('update-public-ip','yes');\n\t\t\tAnimateDiv('myhome1');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_UpdatePublicIP);\t\t\n\t\t}\n\t\t\n\t\tfunction UpdatePublicIPBox(){\n\t\t\tYahooWin2('445','{$page}?UpdatePublicIPBox=yes','{$update_your_ip_address}');\n\t\t}\n\t\t\n\t\tLoadAjax('myhome2','{$page}?myhome2=yes');\n\t\t\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例8: popup
function popup()
{
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$q->CheckTables();
$mac = $tpl->javascript_parse_text("{MAC}");
$enabled = $tpl->javascript_parse_text("{enabled}");
$pattern = $tpl->javascript_parse_text("{pattern}");
$hostname = $tpl->javascript_parse_text("{hostname}");
$Apply = $tpl->javascript_parse_text("{apply}");
$description = $tpl->javascript_parse_text("{description} / {allowed}");
$title = $tpl->javascript_parse_text("{members}: {internet_access_restrictions}");
$t = time();
$table_width = 630;
$table_height = 450;
$buttons = "buttons : [\n\t{name: '{$Apply}', bclass: 'Apply', onpress : Apply{$t}},\n\t\t],\t";
$html = $tpl->_ENGINE_parse_body("") . "\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?list=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$mac}', name : 'MAC', width : 152, sortable : true, align: 'left'},\n\t\t{display: '{$hostname}', name : 'hostname', width : 315, sortable : false, align: 'left'},\n\t\t{display: '{$description}', name : 'description', width : 452, sortable : false, align: 'left'},\n\t\t{display: '{$enabled}', name : 'enabled', width : 54, sortable : false, align: 'left'},\n\t\t{display: ' ', name : 'delete', width : 60, sortable : false, align: 'left'},\n\t\t\n\t\t\n\t\t\n\t],\n\n\tsearchitems : [\n\t\t{display: '{$mac}', name : 'MAC'},\n\t\t],\n\tsortname: 'MAC',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: {$table_height},\n\tsingleSelect: true\n\t\n\t}); \n});\n\nvar xRtResProxyEnable= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#table-{$t}').flexReload();\n\t}\n\nfunction BlksProxyDelete(pattern){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('delete-pattern',pattern);\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('squid.hosts.blks.php', 'POST',xBlksProxyDelete);\n}\n\n\nfunction Apply{$t}(){\n\tLoadjs('squid.computer.access.progress.php');\n}\n\n\n\nfunction RtResProxyEnable(pattern,id){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById(id).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n\t\tXHR.appendData('enable-pattern',pattern);\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xRtResProxyEnable);\n}\n</script>\n\t";
echo $html;
}
示例9: popup
function popup()
{
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$q->CheckTables();
$type = $tpl->javascript_parse_text("{type}");
$browsers = $tpl->javascript_parse_text("{browsers}");
$pattern = $tpl->javascript_parse_text("{pattern}");
$items = $tpl->javascript_parse_text("{items}");
$add = $tpl->javascript_parse_text("{add}");
$description = $tpl->javascript_parse_text("{description}");
$title = $tpl->javascript_parse_text("{blocked_members}");
$t = time();
$table_width = 630;
$table_height = 450;
$buttons = "buttons : [\n\t{name: '{$new_group}', bclass: 'add', onpress : AddGroup},\n\t\t],\t";
$buttons = null;
$html = $tpl->_ENGINE_parse_body("") . "\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$type}', name : 'PatternType', width : 231, sortable : true, align: 'left'},\n\t\t{display: '{$pattern}', name : 'pattern', width : 231, sortable : false, align: 'left'},\n\t\t{display: '{$description}', name : 'description', width : 231, sortable : false, align: 'left'},\n\t\t{display: ' ', name : 'enable', width : 60, sortable : false, align: 'left'},\n\t\t{display: ' ', name : 'delete', width : 60, sortable : false, align: 'left'},\n\t\t\n\t\t\n\t\t\n\t],\n\n\tsearchitems : [\n\t\t{display: '{$pattern}', name : 'pattern'},\n\t\t],\n\tsortname: 'pattern',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: {$table_height},\n\tsingleSelect: true\n\t\n\t}); \n});\n\n\tvar xBlksProxyDelete= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#table-{$t}').flexReload();\n\t}\n\nfunction BlksProxyDelete(pattern){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('delete-pattern',pattern);\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('squid.hosts.blks.php', 'POST',xBlksProxyDelete);\n}\n\n\n\nfunction BlksProxyEnable(pattern,id){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById(id).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n\t\tXHR.appendData('enable-pattern',pattern);\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('squid.hosts.blks.php', 'POST');\n}\n</script>\n\t";
echo $html;
}
示例10: main_table
function main_table()
{
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$q->CheckTables();
$type = $tpl->_ENGINE_parse_body("{type}");
$ipaddr = $tpl->_ENGINE_parse_body("{ipaddr}");
$sitename = $tpl->_ENGINE_parse_body("{websites}");
$uid = $tpl->_ENGINE_parse_body("{member}");
$MAC = $tpl->javascript_parse_text("{MAC}");
$size = $tpl->javascript_parse_text("{size}");
$title = $tpl->javascript_parse_text("{realtime_flow} {members} {today} {time}:" . date("H") . "h");
$t = time();
$table_width = 630;
$table_height = 450;
$buttons = "buttons : [\n{name: '{$new_group}', bclass: 'add', onpress : AddGroup},\n],\t";
$buttons = null;
$html = $tpl->_ENGINE_parse_body("") . "\n<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\t\t\$('#table-{$t}').flexigrid({\n\t\turl: '{$page}?list=yes',\n\t\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '{$sitename}', name : 'sitename', width : 230, sortable : true, align: 'left'},\n\t\t{display: '{$ipaddr}', name : 'ipaddr', width : 120, sortable : true, align: 'left'},\n\t\t{display: '{$uid}', name : 'uid', width : 230, sortable : true, align: 'left'},\n\t\t{display: '{$MAC}', name : 'MAC', width : 230, sortable : true, align: 'left'},\n\t\t{display: '{$size}', name : 'size', width : 150, sortable : true, align: 'right'},\n\n\n\t\t],\n\n\t\tsearchitems : [\n\t\t{display: '{$ipaddr}', name : 'ipaddr'},\n\t\t{display: '{$uid}', name : 'uid'},\n\t\t{display: '{$MAC}', name : 'MAC'},\n\t\t],\n\t\tsortname: 'size',\n\t\tsortorder: 'desc',\n\t\tusepager: true,\n\t\ttitle: '<span style=font-size:18px>{$title}</span>',\n\t\tuseRp: true,\n\t\trp: 15,\n\t\tshowTableToggleBtn: false,\n\t\twidth: '99%',\n\t\theight: {$table_height},\n\t\tsingleSelect: true\n\n});\n});\n</script>\n";
echo $html;
}
示例11: popup
function popup()
{
$page = CurrentPageName();
$sock = new sockets();
$tpl = new templates();
$q = new mysql_squid_builder();
$q->CheckTables();
$tOrg = $_GET["t"];
$t = $_GET["tt"];
$mainrule = $_GET["mainrule"];
$rule = $tpl->_ENGINE_parse_body("{rule}");
$new_rule = $tpl->_ENGINE_parse_body("{new_rule}");
$groups = $tpl->_ENGINE_parse_body("{proxy_objects}");
$delete_rule_ask = $tpl->javascript_parse_text("{delete_rule_ask}");
$period = $tpl->javascript_parse_text("{period}");
$budget = $tpl->_ENGINE_parse_body("{budget}");
$enabled = $tpl->javascript_parse_text("{enabled}");
$delete = $tpl->javascript_parse_text("{delete}");
$tt = time();
$html = "\n\t\t<table class='table-{$tt}' style='display: none' id='table-{$tt}' style='width:99%'></table>\n\t\t<script>\n\t\tvar DeleteSquidAclGroupTemp{$tt}=0;\n\t\t\$(document).ready(function(){\n\t\t\$('#table-{$tt}').flexigrid({\n\t\turl: '{$page}?sessions-rules-list=yes&t={$t}&tOrg={$tOrg}&mainrule={$mainrule}&tt={$tt}',\n\t\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '{$rule}', name : 'rulename', width : 300, sortable : true, align: 'left'},\n\t\t{display: '{$budget}', name : 'budget', width : 76, sortable : true, align: 'left'},\n\t\t{display: '{$period}', name : 'period', width : 76, sortable : true, align: 'left'},\n\t\t{display: '{$enabled}', name : 'enabled', width : 31, sortable : true, align: 'center'},\n\t\t{display: '{$delete}', name : 'del', width : 31, sortable : false, align: 'center'},\n\t\t],\n\t\tbuttons : [\n\t\t{name: '{$new_rule}', bclass: 'add', onpress : AddSessionRule{$tt}},\n\t\t],\n\t\tsearchitems : [\n\t\t{display: '{$rule}', name : 'QuotaName'},\n\t\t],\n\t\tsortname: 'ID',\n\t\tsortorder: 'desc',\n\t\tusepager: true,\n\t\ttitle: '',\n\t\tuseRp: true,\n\t\trp: 15,\n\t\tshowTableToggleBtn: false,\n\t\twidth: 600,\n\t\theight: 450,\n\t\tsingleSelect: true\n\t\n\t});\n\t});\n\tfunction AddSessionRule{$tt}() {\n\t\tLoadjs('{$page}?session-rule-js=yes&ID=-1&t={$t}&tOrg={$tOrg}&tt={$tt}&mainrule={$mainrule}');\n\t\n\t}\n\t\n\tvar x_DeleteSquidAclRule{$tt}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#rowacl'+DeleteSquidAclGroupTemp{$tt}).remove();\n\t\t\$('#table-{$tOrg}').flexReload();\n\t\t\$('#table-{$t}').flexReload();\t\t\n\t}\n\tvar x_EnableDisableAclRule{$tt}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#table-{$tOrg}').flexReload();\n\t\t\$('#table-{$t}').flexReload();\n\t\t\$('#table-{$tt}').flexReload();\n\t}\t\n\t\n\n\tfunction DeleteSessionRule{$tt}(ID){\n\t\tDeleteSquidAclGroupTemp{$tt}\n\t\tif(confirm('{$delete_rule_ask} :'+ID)){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('acl-rule-delete', ID);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteSquidAclRule{$tt});\t\n\t\t\t\n\t\t\t}\n\t\n\t}\n\t\n\tfunction EnableDisableSessionRule{$tt}(ID){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('acl-rule-enable', ID);\n\t\tif(document.getElementById('sessionid_'+ID).checked){XHR.appendData('enable', '1');}else{XHR.appendData('enable', '0');}\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableAclRule{$tt});\n\t}\n\t\n\t\n\t\n\t\n\t</script>\n\t\n\t";
echo $html;
}
示例12: page
function page()
{
$ID = $_GET["ID"];
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$q->CheckTables();
$type = $tpl->_ENGINE_parse_body("{type}");
$description = $tpl->_ENGINE_parse_body("{description}");
$new_group = $tpl->_ENGINE_parse_body("{new_proxy_object}");
$items = $tpl->_ENGINE_parse_body("{items}");
$delete_group_ask = $tpl->javascript_parse_text("{inputbox delete group}");
$wpad = null;
if (isset($_GET["wpad"])) {
$wpad = "&wpad=yes";
}
$t = time();
$buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:18px>{$new_group}</strong>', bclass: 'add', onpress : AddGroup{$t}},\n\t],";
$html = $tpl->_ENGINE_parse_body("") . "\n\t<input type='hidden' id='TABLE_BROWSE_ACL_GROUPS_ID' value='table-{$t}'>\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\nvar DeleteSquidAclGroupTemp=0;\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?groups-list=yes&callback={$_GET["callback"]}&t={$t}&FilterType={$_GET["FilterType"]}{$wpad}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$description}', name : 'GroupName', width : 277, sortable : true, align: 'left'},\n\t\t{display: '{$time}', name : 'GroupType', width : 119, sortable : true, align: 'left'},\n\t\t{display: '{$items}', name : 'items', width : 67, sortable : false, align: 'center'},\n\t\t{display: '', name : 'none3', width : 31, sortable : false, align: 'left'},\n\t\t\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t\t{display: '{$description}', name : 'GroupName'},\n\t\t],\n\tsortname: 'GroupName',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 570,\n\theight: 350,\n\tsingleSelect: true\n\t\n\t}); \n});\nfunction AddGroup{$t}() {\n\tLoadjs('squid.acls.groups.php?AddGroup-js=yes&ID=-1&table-acls-t={$t}&FilterType={$_GET["FilterType"]}&callback={$_GET["callback"]}{$wpad}');\n\t\n}\t\n\nfunction RefreshSquidGroupTable(){\n\n\tif(document.getElementById('GLOBAL_SSL_CENTER_ID')){\n\t\t\$('#'+document.getElementById('GLOBAL_SSL_CENTER_ID').value).flexReload();\n\t}\n\tif(document.getElementById('SSL_RULES_GROUPS_ID')){\n\t\t\$('#'+document.getElementById('SSL_RULES_GROUPS_ID').value).flexReload();\n\t}\t\n\t\n\tif(document.getElementById('flexRT-refresh-1')){ \n\t\t\$('#'+document.getElementById('flexRT-refresh-1').value).flexReload();\n\t}\n\t\n\t\$('#table-{$t}').flexReload();\n\t\n}\n\n\n\tvar x_DeleteSquidAclGroup= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\tif(document.getElementById('main_filter_rule_edit')){RefreshTab('main_filter_rule_edit');}\n\t\tif(document.getElementById('main_dansguardian_tabs')){RefreshTab('main_dansguardian_tabs');}\n\t\t\$('#rowtime'+TimeRuleIDTemp).remove();\n\t}\n\t\n\tvar x_EnableDisableGroup= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\n\t\t\n\t}\t\n\t\n\tfunction DeleteSquidAclGroup(ID){\n\t\tDeleteSquidAclGroupTemp=ID;\n\t\tif(confirm('{$delete_group_ask} :'+ID)){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DeleteGroup', 'yes');\n\t\t\tXHR.appendData('ID', ID);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteSquidAclGroup);\n\t\t} \t\t\n\t}\n\n\tvar x_DeleteSquidAclGroup= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#rowgroup'+DeleteSquidAclGroupTemp).remove();\n\t}\n\t\n\tfunction EnableDisableGroup(ID){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('EnableGroup', 'yes');\n\t\tXHR.appendData('ID', ID);\n\t\tif(document.getElementById('groupid_'+ID).checked){XHR.appendData('enable', '1');}else{XHR.appendData('enable', '0');}\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableGroup); \t\t\n\t}\t\t\n\t\n\t\n\n\t\n</script>\n\t\n\t";
echo $html;
}
示例13: rebuild_tables
function rebuild_tables(){
$q=new mysql_squid_builder();
$q->QUERY_SQL("DROP TABLE `wpad_rules`");
$q->QUERY_SQL("DROP TABLE `wpad_sources_link`");
$q->QUERY_SQL("DROP TABLE `wpad_white_link`");
$q->QUERY_SQL("DROP TABLE `wpad_destination`");
$q->CheckTables(null,true);
}
示例14: quota_destination_list
function quota_destination_list()
{
//ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$ID = $_GET["ID"];
$acl = new squid_acls();
$t0 = $_GET["t"];
$search = '%';
$table = "(SELECT webfilters_quotas_grp.gpid,webfilters_quotas_grp.zmd5, webfilters_quotas_grp.ID as LINKID, webfilters_sqgroups.* FROM webfilters_quotas_grp, webfilters_sqgroups WHERE webfilters_quotas_grp.gpid=webfilters_sqgroups.ID AND webfilters_quotas_grp.ruleid={$ID}) as t";
$page = 1;
if (!$q->TABLE_EXISTS("webfilters_quotas_grp")) {
$q->CheckTables(null, true);
}
if ($q->COUNT_ROWS("webfilters_quotas_grp") == 0) {
json_error_show("No datas");
}
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));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
$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 * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql}";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
json_error_show($q->mysql_error . "\n{$sql}");
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (mysql_num_rows($results) == 0) {
json_error_show("No item");
}
$rules = $tpl->_ENGINE_parse_body("{rules}");
$acl = new squid_acls_groups();
while ($ligne = mysql_fetch_assoc($results)) {
$val = 0;
$ID = $ligne["ID"];
$md5 = $ligne["zmd5"];
$arrayF = $acl->FlexArray($ligne['gpid']);
$delete = imgsimple("delete-24.png", null, "DeleteObjectLinks{$t0}('{$md5}')");
$data['rows'][] = array('id' => "{$md5}", 'cell' => array($arrayF["ROW"], "<span style='font-size:14px;font-weight:bold'>{$arrayF["ITEMS"]}</span>", $delete));
}
echo json_encode($data);
}
示例15: items
function items()
{
include_once dirname(__FILE__) . "/ressources/class.squid.inc";
$tpl = new templates();
$squid = new squidbee();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$t = $_GET["t"];
$search = '%';
$table = "transparent_networks";
$page = 1;
$FORCE_FILTER = null;
$total = 0;
$SSL = $squid->SSL_BUMP;
if (!$q->TABLE_EXISTS("transparent_networks")) {
$q->CheckTables(null, true);
}
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));
$total = $ligne["TCOUNT"];
} else {
$total = $q->COUNT_ROWS($table);
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
if (is_numeric($rp)) {
$limitSql = "LIMIT {$pageStart}, {$rp}";
}
$sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
$results = $q->QUERY_SQL($sql);
$no_rule = $tpl->_ENGINE_parse_body("{no_item}");
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
$fontsize = "18";
$color = "black";
$check32 = "<img src='img/check-32.png'>";
$arrow_right = "<img src='img/arrow-right-32.png'>";
$AllSystems = $tpl->_ENGINE_parse_body("{AllSystems}");
$AllDestinations = $tpl->_ENGINE_parse_body("{all_destinations}");
$local_proxy = $tpl->_ENGINE_parse_body("{local_proxy}");
$proxy = $local_proxy;
$port = $tpl->_ENGINE_parse_body("{port}");
if (!$q->ok) {
json_error_show($q->mysql_error . "<br>{$sql}", 1);
}
if (mysql_num_rows($results) == 0) {
$data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>0</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>HTTP</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllSystems}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$arrow_right}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllDestinations} {$port} 80<div style='font-size:12px;text-align:right'>{$proxy}</div></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>"));
if ($SSL == 0) {
$color = "#8a8a8a";
$check32 = "<img src='img/check-32-grey.png'>";
$arrow_right = "<img src='img/arrow-right-32-grey.png'>";
}
$data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>0</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>HTTPS</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllSystems}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$arrow_right}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllDestinations} {$port} 443<div style='font-size:12px;text-align:right'>{$proxy}</div></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>"));
$data['total'] = 1;
echo json_encode($data);
return;
}
$all = $tpl->_ENGINE_parse_body("{all}");
$fontsize = "18";
$color = "black";
$check32 = "<img src='img/check-32.png'>";
$local_proxy = $tpl->_ENGINE_parse_body("{local_proxy}");
$redirect_to = $tpl->_ENGINE_parse_body("{redirect_to}");
$not = $tpl->_ENGINE_parse_body("{not} ");
$AVAILABLE_MACROS["google"] = true;
$AVAILABLE_MACROS["teamviewer"] = true;
$AVAILABLE_MACROS["office365"] = true;
$AVAILABLE_MACROS["skype"] = true;
$AVAILABLE_MACROS["dropbox"] = true;
while ($ligne = mysql_fetch_assoc($results)) {
$color = "black";
$check32 = "<img src='img/check-32.png'>";
$check32T = "<img src='img/cloud-filtered-42.png'>";
$arrow_right = "<img src='img/arrow-right-32.png'>";
$proxy = $local_proxy;
$ligne["remote_proxy"] = trim($ligne["remote_proxy"]);
if (!preg_match("#^(.+?):(.+)#", $ligne["remote_proxy"])) {
$ligne["remote_proxy"] = null;
}
$eth = $ligne["eth"];
if (is_numeric($eth)) {
$eth = null;
}
if ($eth != null) {
$eth = "{$eth}:";
}
//.........这里部分代码省略.........