本文整理汇总了PHP中boostrap_form::trswitch方法的典型用法代码示例。如果您正苦于以下问题:PHP boostrap_form::trswitch方法的具体用法?PHP boostrap_form::trswitch怎么用?PHP boostrap_form::trswitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boostrap_form
的用法示例。
在下文中一共展示了boostrap_form::trswitch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
function search()
{
if (!CheckRights()) {
senderror("{ERROR_NO_PRIVS}");
}
$boot = new boostrap_form();
$sock = new sockets();
$users = new usersMenus();
$maillog_path = $users->maillog_path;
$tpl = new templates();
$t = time();
$query = base64_encode($_GET["search"]);
if (!is_numeric($_POST["rp"])) {
$_POST["rp"] = 500;
}
$array = unserialize(base64_decode($sock->getFrameWork("postfix.php?query-maillog=yes&filter={$query}&maillog={$maillog_path}&rp={$_POST["rp"]}&zarafa-filter={$_GET["zarafa-filter"]}&mimedefang-filter={$_GET["mimedefang-filter"]}")));
$array = explode("\n", @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/query.mail.log"));
krsort($array);
$zDate = $tpl->_ENGINE_parse_body("{zDate}");
$hostTXT = $tpl->_ENGINE_parse_body("{host}");
$serviceTXT = $tpl->_ENGINE_parse_body("{servicew}");
$eventsTXT = $tpl->_ENGINE_parse_body("{events}");
while (list($index, $line) = each($array)) {
$lineenc = base64_encode($line);
if (preg_match("#^[a-zA-Z]+\\s+[0-9]+\\s+([0-9\\:]+)\\s+(.+?)\\s+(.+?)\\[([0-9]+)\\]:(.+)#", $line, $re)) {
$date = "{$re[1]}";
$host = $re[2];
$service = $re[3];
$pid = $re[4];
$line = $re[5];
}
$class = LineToClass($line);
$img = statusLogs($line);
$loupejs = "ZoomEvents('{$lineenc}')";
$trSwitch = $boot->trswitch("blur()");
$tr[] = "\n\t\t<tr id='{$id}' class={$class} {$trSwitch}>\n\t\t<td style='font-size:12px' {$trSwitch} width=1% nowrap><i class='icon-time'></i> {$date}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap><i class='icon-arrow-right'></i> {$host}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap>{$service}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap>{$pid}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap><img src='{$img}'></td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=99% nowrap>{$line}</td>\n\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{$zDate}</th>\n\t\t\t\t\t<th>{$hostTXT}</th>\n\t\t\t\t\t<th>{$serviceTXT}</th>\n\t\t\t\t\t<th>PID</th>\n\t\t\t\t\t<th colspan=2>{$eventsTXT}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t\t</table>\n\t\t\t\t<script>\n\n\t</script>\n\t";
}
示例2: members_search
function members_search()
{
$tpl = new templates();
$MyPage = CurrentPageName();
$boot = new boostrap_form();
$q = new mysql_squid_builder();
$sock = new sockets();
$fontsize = "14px";
$page = 1;
$t = time();
$ORDER = $boot->TableOrder(array("uid" => "ASC"));
$searchstring = string_to_flexquery("search-members");
$table = "hotspot_members";
$minutes = $tpl->_ENGINE_parse_body("{minutes}");
$unlimited = $tpl->_ENGINE_parse_body("{unlimited}");
$ttl = $tpl->_ENGINE_parse_body("{ttl}");
$members = $tpl->_ENGINE_parse_body("{members}");
$MAC = $tpl->_ENGINE_parse_body("{MAC}");
$ttl = $tpl->_ENGINE_parse_body("{ttl}");
$finaltime = $tpl->_ENGINE_parse_body("{re_authenticate_each}");
$endtime = $tpl->_ENGINE_parse_body("{endtime}");
$title = $tpl->_ENGINE_parse_body("{sessions} " . date("{l} d {F}"));
$q = new mysql_squid_builder();
$hostname = $tpl->_ENGINE_parse_body("{hostname}");
$enabled = $tpl->_ENGINE_parse_body("{enabled}");
$new_account = $tpl->_ENGINE_parse_body("{new_account}");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error_html();
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$md5 = md5(serialize($ligne));
$uid = $ligne["uid"];
$ttl = intval($ligne["ttl"]);
$logintime = intval($ligne["logintime"]);
$Start = $tpl->_ENGINE_parse_body(date("{l} d H:i", $logintime));
$delete = imgsimple("delete-48.png", null, "DeleteMember{$t}('{$ligne["uid"]}','{$md5}')");
$End = $tpl->_ENGINE_parse_body(date("{l} d H:i", $ligne["finaltime"]));
$hostname = $ligne["hostname"];
$MAC = $ligne["MAC"];
$ipaddr = $ligne["ipaddr"];
$ttl = $ligne["ttl"];
if ($ttl == 0) {
$ttl = $unlimited;
} else {
$ttl = $tpl->_ENGINE_parse_body(date("{l} d H:i", $ttl));
}
$enabled = Field_checkbox("enable_{$uid}", 1, $ligne["enabled"], "MemberEnable{$t}('{$uid}')");
$color = "black";
if ($ligne["enabled"] == 0) {
$color = "#A4A1A1";
}
$uid_url = urlencode($ligne["uid"]);
$uid_url = urlencode($ligne["uid"]);
$js = $boot->trswitch("YahooWin4('600','miniadmin.hotspot.php?uid={$uid_url}&t={$t}','{$ligne["uid"]}');");
$jsttl = $boot->trswitch("YahooWin4('500','miniadmin.hotspot.php?ttl={$uid_url}&t={$t}','{$ttl}:{$ligne["uid"]}');");
$tr[] = "\n\t\t<tr>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% {$js}>{$ligne["uid"]}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap {$jsttl}>{$ttl}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% {$js}>{$ligne["sessiontime"]} {$minutes}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1%>{$enabled}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% {$js}>{$delete}</td>\n\n\t\t</tr>";
}
echo $boot->TableCompile(array("uid" => "{$members}", "ttl" => "{ttl}", "sessiontime" => "{$finaltime}", "enabled" => "{$enabled}", "delete" => " "), $tr) . "\t\n<script>\t\t\t\t\nvar x_DeleteSession{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#row'+mem{$t}).remove();\n}\n\nfunction DeleteSession{$t}(md){\n\tmem{$t}=md;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('DeleteSession',md);\t\n\tXHR.sendAndLoad('miniadmin.hotspot.php', 'POST',x_DeleteSession{$t});\t\n\n}\n\nfunction NewAccount{$t}(){\n\tYahooWin4('600','miniadmin.hotspot.php?uid=&t={$t}','{$new_account}');\n}\n\nvar x_MemberEnable{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#flexRT{$t}').flexReload();\n}\n\nfunction MemberEnable{$t}(uid){\n\tvar enabled=0;\n\tif(document.getElementById('enable_'+uid).checked){enabled=1;}\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('EnableMember',uid);\n\tXHR.appendData('value',enabled);\t\t\n\tXHR.sendAndLoad('miniadmin.hotspot.php', 'POST',x_MemberEnable{$t});\t\n\t\n}\n\nvar x_DeleteMember{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#row'+mem{$t}).remove();\n}\n\nfunction DeleteMember{$t}(uid,md){\n\tmem{$t}=md;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('DeleteMember',uid);\n\tXHR.sendAndLoad('miniadmin.hotspot.php', 'POST',x_DeleteMember{$t});\t\t\n}\n\n</script>";
}
示例3: table_sites_search
function table_sites_search()
{
$t = $_GET["t"];
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$users = new usersMenus();
$sock = new sockets();
$boot = new boostrap_form();
$database = "squidlogs";
$search = '%';
$table = "generic_categories";
$rp = 250;
$page = 1;
$FORCE_FILTER = null;
$ORDER = "ORDER BY size DESC";
if (!$q->TABLE_EXISTS($table, $database)) {
senderror("{$table} doesn't exists...");
}
if ($q->COUNT_ROWS($table, $database) == 0) {
senderror("No data");
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$search = string_to_flexquery("category-search");
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$category = mysql_escape_string2($_GET["category"]);
$sql = "SELECT SUM( size ) AS size,SUM(hits) as hits, zDate, category FROM generic_categories GROUP BY category,zDate\n\tHAVING category='{$_GET["category"]}' ORDER BY zDate";
$results = $q->QUERY_SQL($sql);
$results = $q->QUERY_SQL($sql, $database);
if (!$q->ok) {
senderror($q->mysql_error . "<br>{$sql}");
}
while ($ligne = mysql_fetch_assoc($results)) {
$color = "black";
$ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$xtime = strtotime($ligne["zDate"] . " 00:00:00");
$dateText = time_to_date($xtime);
$catz = urlencode($_GET["category"]);
$jsSitename = $boot->trswitch("Loadjs('miniadm.webstats.websites.ByDayByCategory.php?category={$catz}&xtime={$xtime}')");
$tr[] = "\n\t\t\t\t<tr {$jsSitename}>\n\t\t\t\t\t<td><i class='icon-time'></i> {$dateText}</a></td>\n\t\t\t\t\t<td><i class='icon-info-sign'></i> {$ligne["size"]}</td>\n\t\t\t\t\t<td><i class='icon-info-sign'></i> {$ligne["hits"]}</td>\n\t\t\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{day}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t\t") . @implode("", $tr) . "</tbody></table>";
}
示例4: items_search
function items_search()
{
$page = CurrentPageName();
$boot = new boostrap_form();
$tpl = new templates();
$searchstring = string_to_flexquery("items-search");
$ORDER = $boot->TableOrder(array("token" => "ASC"));
$limitSql = "LIMIT 0,150";
$sql = "SELECT * FROM nginx_exploits_items WHERE groupid={$_GET["groupid"]} {$searchstring} ORDER BY {$ORDER} {$limitSql}";
$q = new mysql_squid_builder();
$results = $q->QUERY_SQL($sql);
$sock = new sockets();
$not = $tpl->_ENGINE_parse_body("{is_not}");
if (!$q->ok) {
echo $q->mysql_error_html();
}
while ($ligne = mysql_fetch_assoc($results)) {
$reverse = null;
if ($ligne["reverse"] == 1) {
$reverse = "<strong>{$not}</strong> ";
}
$linkipaddr = $boot->trswitch("Loadjs('{$page}?js-item=yes&ID={$ligne["ID"]}&groupid={$ligne["groupid"]}&servername={$_GET["servername"]}')");
$ligne["token"] = $tpl->_ENGINE_parse_body("{{$ligne["token"]}}");
$delete = imgsimple("delete-24.png", null, "Loadjs('{$page}?delete-item-js={$ligne["ID"]}&ID={$ligne["ID"]}')");
$tr[] = "\n\t<tr id='{$ligne["ID"]}'>\n\t<td {$linkipaddr} width='30%' nowrap><i class='icon-list-alt'></i> {$ligne["token"]}</a></td>\n\t<td {$linkipaddr} width='70%' nowrap><i class='icon-list-alt'></i> {$reverse}{$ligne["pattern"]}</a></td>\n\t<td style='text-align:center' width='24px' nowrap>{$delete}</td>\n\t</tr>";
}
$html = $boot->TableCompile(array("token" => "{token}", "pattern" => "{pattern}", "delete" => "{delete}"), $tr);
echo $tpl->_ENGINE_parse_body($html);
}
示例5: search
function search()
{
$page = CurrentPageName();
$boot = new boostrap_form();
$tpl = new templates();
$searchstring = string_to_flexquery("search");
$ORDER = $boot->TableOrder(array("subject" => "ASC"));
$limitSql = "LIMIT 0,250";
$sql = "SELECT * FROM reverse_pages_content WHERE 1 {$searchstring} ORDER BY {$ORDER} {$limitSql}";
$q = new mysql_squid_builder();
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error_html();
}
while ($ligne = mysql_fetch_assoc($results)) {
$ID = $ligne["ID"];
$jsselect = null;
$select = null;
$js = $boot->trswitch("Loadjs('miniadmin.crm.pages.php?ID={$ID}')");
if ($_GET["field-id"] != null) {
$select = "Loadjs('{$page}?select-js=yes&ID={$ID}&field-id={$_GET["field-id"]}')";
$jsselect = $boot->trswitch($select);
$select_img = imgsimple("arrow-right-24.png", null, $select);
}
$delete_img = imgsimple("delete-24.png", null, "Loadjs('{$page}?delete-js=yes&ID={$ID}')");
$tr[] = "\n\t<tr id='{$ligne["ID"]}'>\n\t<td width='99%' nowrap {$js}><i class='icon-tags'></i> {$ligne["subject"]}</a></td>\n\t<td width='45px' nowrap style='vertical-align:middle;text-align:center'>{$select_img}</td>\n\t<td width='45px' nowrap style='vertical-align:middle;text-align:center'>{$delete_img}</td>\n\t</tr>";
}
$html = $boot->TableCompile(array("subject" => "{subject}", "ID" => "select", "delete" => "{delete}"), $tr);
echo $tpl->_ENGINE_parse_body($html);
}
示例6: charters_search
function charters_search()
{
$boot = new boostrap_form();
$tpl = new templates();
$page = CurrentPageName();
$searchstring = string_to_flexquery("itcharters-search");
$q = new mysql_squid_builder();
$ORDER = $boot->TableOrder(array("title" => "ASC"));
$table = "itcharters";
$t = time();
$sql = "SELECT ID,title,TextIntro,TextButton FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,150";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}<hr><code>{$sql}</code></p>";
}
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$link = $boot->trswitch("Loadjs('{$page}?charter-js=yes&ID={$ligne["ID"]}')");
$delete = imgtootltip("delete-24.png", null, "Delete{$t}({$ligne["ID"]},'{$md}')");
$tr[] = "\n\t<tr id='{$md}'>\n\t<td {$link}><i class='icon-globe'></i> {$ligne["title"]}</td>\n\t<td width=1% nowrap>{$delete}</td>\n\t</tr>";
}
$delete_text = $tpl->javascript_parse_text("{delete_this_itchart}");
echo $boot->TableCompile(array("title" => "{it_charters}", "delete" => null), $tr) . "\n<script>\nvar mem{$t}='';\nvar xDelete{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t\$('#'+mem{$t}).remove();\n}\nfunction Delete{$t}(ID,mem){\n\tmem{$t}=mem;\n\tif(confirm('{$delete_text} '+ID+'?')){\n\t\tmem{$t}=mem;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('itcharters-delete',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t\t}\n\t}\n</script>\t\t\t\t\t\n";
}
示例7: www_top_table
function www_top_table()
{
$q = new mysql_squid_builder();
$tpl = new templates();
$boot = new boostrap_form();
$tablename = "www_" . $q->uid_to_tablename($_GET["uid"]);
$member = urlencode($_GET["uid"]);
$q = new mysql_squid_builder();
if (!$q->TABLE_EXISTS($tablename)) {
echo "<p class=text-error>No table «{$tablename}» for {$_GET["uid"]}</p>";
return;
}
$sql = "SELECT SUM(hits) as hits,SUM(size) as size,familysite FROM `{$tablename}` GROUP BY\n\tcategory,familysite HAVING category='{$_GET["category"]}' ORDER BY size DESC,hits DESC LIMIT 0,100";
if ($_GET["category"] == null) {
$sql = "SELECT SUM(hits) as hits,SUM(size) as size,familysite FROM `{$tablename}` GROUP BY\n\tcategory,familysite HAVING category IS NULL ORDER BY size DESC,hits DESC LIMIT 0,100";
}
$results = $q->QUERY_SQL($sql);
$_GET["uid"] = urlencode($_GET["uid"]);
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}<br>{$sql}</p>";
return;
}
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$size = FormatBytes($ligne["size"] / 1024);
$hits = FormatNumber($ligne["hits"]);
$familysite = $ligne["familysite"];
$fsite = urlencode($familysite);
$jslink = "Loadjs('miniadm.webstats.ByMember.website.php?familysite={$fsite}&member-value={$member}&by=uid')";
$link = $boot->trswitch($jslink);
$tr[] = "\n\t<tr>\n\t<td {$link}><i class='icon-globe'></i> {$familysite}</a></td>\n\t<td {$link}><i class='icon-info-sign'></i> {$size}</td>\n\t<td {$link}><i class='icon-info-sign'></i> {$hits}</td>\n\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{websites}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</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>";
}
示例8: table_sites_search
function table_sites_search()
{
$t = $_GET["t"];
$tpl = new templates();
$MyPage = CurrentPageName();
$q = new mysql_squid_builder();
$users = new usersMenus();
$sock = new sockets();
$boot = new boostrap_form();
$database = "squidlogs";
$search = '%';
$table = date("Ymd", $_GET["xtime"]) . "_hour";
$rp = 250;
$page = 1;
$FORCE_FILTER = null;
$ORDER = "ORDER BY size DESC";
if (!$q->TABLE_EXISTS($table, $database)) {
senderror("{$table} doesn't exists...");
}
if ($q->COUNT_ROWS($table, $database) == 0) {
senderror("No data");
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$search = string_to_flexquery("sitename-search");
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$familysite = mysql_escape_string2($_GET["familysite"]);
$sql = "SELECT SUM(size) as size, sum(hits) as hits,sitename,familysite FROM {$table}\n\tGROUP BY sitename,familysite HAVING `familysite`='{$familysite}' {$search} {$ORDER} LIMIT 0,500";
$results = $q->QUERY_SQL($sql, $database);
if (!$q->ok) {
senderror($q->mysql_error . "<br>{$sql}");
}
while ($ligne = mysql_fetch_assoc($results)) {
$color = "black";
$ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$jsSitename = $boot->trswitch("Loadjs('miniadm.webstats.websites.ByDayBySiteName.php?sitename={$ligne["sitename"]}&xtime={$_GET["xtime"]}')");
$tr[] = "\n\t\t\t\t<tr id='{$id}'>\n\t\t\t\t\t<td {$jsSitename}><i class='icon-globe'></i> {$ligne["sitename"]}</a></td>\n\t\t\t\t\t<td {$link}><i class='icon-info-sign'></i> {$ligne["size"]}</td>\n\t\t\t\t\t<td {$link}><i class='icon-info-sign'></i> {$ligne["hits"]}</td>\n\t\t\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{website}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t\t") . @implode("", $tr) . "</tbody></table>";
}
示例9: www_requests_search
function www_requests_search()
{
$page = CurrentPageName();
$tpl = new templates();
$t = time();
$boot = new boostrap_form();
$search = string_to_flexquery("requests-search");
$xtime = $_GET["xtime"];
$hourtable = date("Ymd", $xtime) . "_hour";
$q = new mysql_squid_builder();
$sql = "SELECT SUM(size) as size,SUM(hits) as hits,`hour`,uid,category,sitename FROM {$hourtable} GROUP BY\n\tcategory,`hour`,sitename,uid \n\tHAVING `hour`='{$_GET["hour"]}' \n\tAND uid='{$_GET["uid"]}' {$search}\n\tORDER BY `size` DESC,`hits`,`sitename` DESC";
$results = $q->QUERY_SQL($sql);
$results = $q->QUERY_SQL($sql);
$_GET["uid"] = urlencode($_GET["uid"]);
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}<br>{$sql}</p>";
return;
}
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$size = FormatBytes($ligne["size"] / 1024);
$hits = FormatNumber($ligne["hits"]);
$sitename = $ligne["sitename"];
$uri = $ligne["uri"];
$urilenth = strlen($sitename);
if ($urilenth > 80) {
$sitename = substr($sitename, 0, 77) . "...";
}
$sitenameenc = urlencode($sitename);
$js = "Loadjs('miniadm.webstats.ByMember.ByHour.queries.php?sitename={$sitenameenc}&uid={$_GET["uid"]}&hour={$_GET["hour"]}&xtime={$_GET["xtime"]}')";
$link = $boot->trswitch($js);
$tr[] = "\n\t\t<tr>\n\t\t\t<td {$link}><i class='icon-globe'></i> {$sitename}</td>\n\t\t\t<td {$link}><i class='icon-globe'></i> {$ligne["category"]}</td>\n\t\t\t<td {$link} nowrap><i class='icon-info-sign'></i> {$size}</td>\n\t\t\t<td {$link} nowrap><i class='icon-info-sign'></i> {$hits}</td>\n\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\n\t\t\t<table class='table table-bordered table-hover'>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{websites}</th>\n\t\t\t\t\t<th>{category}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</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>";
}
示例10: caches_search
function caches_search()
{
$prox = new squid_reverse();
$searchstring = string_to_flexquery("caches-search");
$q = new mysql_squid_builder();
$sql = "SELECT * FROM nginx_caches WHERE 1 {$searchstring} ORDER BY directory LIMIT 0,250";
$results = $q->QUERY_SQL($sql, 'artica_backup');
$tpl = new templates();
$GLOBALS["CLASS_TPL"] = $tpl;
$boot = new boostrap_form();
$AdminPrivs = AdminPrivs();
$page = CurrentPageName();
$t = time();
$delete_text = $tpl->javascript_parse_text("{delete}");
$purge_cache = $tpl->javascript_parse_text("{purge_cache}");
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$icon = "disk-64.png";
$icon2 = "folder-network-64.png";
$color = "black";
$md = md5(serialize($ligne));
$keys_zone = $ligne["keys_zone"];
$delete = imgsimple("delete-64.png", null, "Delete{$t}('{$ligne["ID"]}','{$md}')");
$purge = imgsimple("dustbin-64.png", null, "Purge{$t}('{$ligne["ID"]}')");
if (!$AdminPrivs) {
$delete = imgsimple("delete-64-grey.png", null, "blur()");
$purge = imgsimple("dustbin-64-grey.png", null, "blur()");
}
$jsedit = $boot->trswitch("Loadjs('{$page}?js-cache=yes&ID={$ligne["ID"]}')");
$CurrentSize = $ligne["CurrentSize"];
$CurrentSizeText = FormatBytes($CurrentSize / 1024);
$tr[] = "\n\t\t<tr style='color:{$color}' id='{$md}'>\n\t\t<td width=1% nowrap {$jsedit} style='vertical-align:middle' nowrap><img src='img/{$icon}'></td>\n\t\t<td width=80% {$jsedit} style='vertical-align:middle'>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$ligne["directory"]}</span>\n\t\t\t<br><div style='font-size:16px'>{$CurrentSizeText}/{$ligne["max_size"]}G</div>\n\t\t</td>\n\t\t\n\t\t<td width=1% nowrap {$jsedit} style='vertical-align:middle' nowrap>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$keys_zone}</span>\n\t\t</td>\n\t\t<td width=1% nowrap {$jsedit} style='vertical-align:middle' nowrap>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$ligne["max_size"]}G</span>\n\t\t</td>\n\t\t<td width=1% nowrap style='vertical-align:middle;min-width:64px'>{$purge}</td>\n\t\t<td width=1% nowrap style='vertical-align:middle;min-width:64px'>{$delete}</td>\n\t\t\n\t\t\n\t\t</tr>\n\t\t";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=2>{directory}</th>\n\t\t\t\t\t<th >{name}</th>\n\t\t\t\t\t<th >{maxsize}</th>\n\t\t\t\t\t<th> </th>\n\t\t\t\t\t<th> </th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>") . @implode("", $tr) . "</tbody></table>\n<script>\nvar mem{$t}='';\n\nvar xDelete{$t} = function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);return}\n\t\$('#'+mem{$t}).remove();\n}\nvar xPurge{$t} = function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);return}\n\tExecuteByClassName('SearchFunction');\n\t\n}\t\t\t\n\nfunction Delete{$t}(id,md){\n\t\tmem{$t}=md;\n\t\tif(!confirm('{$delete_text}: '+id)){return;}\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DeleteCache',id);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\t\t\t\n}\n\t\nfunction Purge{$t}(id){\n\tif(!confirm('{$purge_cache}: '+id)){return;}\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('PurgeCache',id);\n\tXHR.sendAndLoad('{$page}', 'POST',xPurge{$t});\t\t\t\n}\t\n\t\n\t\n</script>\t\n\t\t\t \t\t\n";
}
示例11: www_table
function www_table()
{
$page = CurrentPageName();
$tpl = new templates();
$boot = new boostrap_form();
$q = new mysql_squid_builder();
$uidtable = $q->uid_to_tablename($_GET["member-value"]);
$_GET["member-value"] = urlencode($_GET["member-value"]);
$q = new mysql_squid_builder();
$sql = "SELECT SUM(hits) as hits,SUM(size) as size,zDate FROM `www_{$uidtable}`\n\tGROUP BY familysite,zDate HAVING familysite='{$_GET["familysite"]}' ORDER BY zDate DESC";
$results = $q->QUERY_SQL($sql);
$_GET["familysite"] = urlencode($_GET["familysite"]);
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}</p>";
return;
}
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$size = FormatBytes($ligne["size"] / 1024);
$date = strtotime($ligne["zDate"] . "00:00:00");
$hits = FormatNumber($ligne["hits"]);
$dateT = date("{l} {F} d", $date);
if ($tpl->language == "fr") {
$dateT = date("{l} d {F} ", $date);
}
$dateT = $tpl->_ENGINE_parse_body($dateT);
$jshost = "Loadjs('miniadm.webstats.ByMember.website.byday.php?xtime={$date}&uid={$_GET["member-value"]}&familysite={$_GET["familysite"]}')";
$link = $boot->trswitch($jshost);
$tr[] = "\n\t\t\t\t<tr id='{$id}'>\n\t\t\t\t\t<td {$link}><i class='icon-time'></i> {$dateT}</a></td>\n\t\t\t\t\t<td {$link}><i class='icon-info-sign'></i> {$size}</td>\n\t\t\t\t\t<td {$link}><i class='icon-info-sign'></i> {$hits}</td>\n\t\t\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{date}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</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>";
}
示例12: routes_search
function routes_search()
{
$q = new mysql();
$page = CurrentPageName();
$tpl = new templates();
$boot = new boostrap_form();
$t = time();
//$q->QUERY_SQL("DROP TABLE iproute_table","artica_backup");
$q->BuildTables();
$search = string_to_flexquery("routes-search");
$sql = "SELECT * FROM iproute_table WHERE 1 {$search} ORDER BY routename LIMIT 0,500";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
senderror($q->mysql_error);
}
while ($ligne = mysql_fetch_assoc($results)) {
$link = $boot->trswitch("Loadjs('{$page}?ruleid={$ligne["ID"]}');");
$sql = "SELECT * FROM iproute_rules WHERE ruleid={$ligne["ID"]} ORDER BY priority LIMIT 0,10";
$results2 = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
senderror($q->mysql_error);
}
$ff = array();
while ($ligne2 = mysql_fetch_assoc($results2)) {
$ff[] = "<div style='font-size:14px'>{$ligne2["src"]} - {$ligne2["destination"]}</div>";
}
$delete = imgtootltip("delete-64.png", null, "Delete{$t}({$ligne["ID"]})");
$tr[] = "<tr id='R{$ligne["ID"]}'>\n\t\t<td width=1% nowrap {$link}><img src='img/64-ip-settings.png'></td>\n\t\t<td style='font-size:18px' {$link}>{$ligne["routename"]}</td>\n\t\t<td style='font-size:18px' {$link} width=1% nowrap {$link}>{$ligne["interface"]}</td>\n\t\t<td style='font-size:18px' {$link} width=1% nowrap {$link}>{$ligne["gateway"]}</td>\n\t\t<td {$link} width=1% nowrap>" . @implode("\n", $ff) . "</td>\n\t\t<td width=1% nowrap>{$delete}</td>\n\t\t</tr>\t\t\n\t\t\t\t\n\t\t";
}
$deleteTXT = $tpl->javascript_parse_text("{delete_group}");
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=2>{groupname}</th>\n\t\t\t\t\t<th>{interface}</th>\n\t\t\t\t\t<th>{gateway}</th>\n\t\t\t\t\t<th> </th>\n\t\t\t\t\t<th> </th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t\t</table>\n\t<script>\nvar FreeWebIDMEM{$t}='';\n\tvar xDelete{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>10){alert(results);return;}\n\tExecuteByClassName('SearchFunction');\n\t}\n\t\nfunction Delete{$t}(id){\n\tif(confirm('{$deleteTXT} \"'+id+'\" ?')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('route-delete',id);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n}\n\t</script>\t\t\t\t\t\n\t\t\t\t\t\n";
}
示例13: DefaultRule
function DefaultRule()
{
$t = $_GET["t"];
$webfilter = new webfilter_rules();
$boot = new boostrap_form();
$styleTD = "style='font-size:16px;font-weight:bold'";
$styleTDCenter = "style='font-size:16px;font-weight:bold;text-align:center !important'";
$js = "DansGuardianEditRule('0','default')";
$jsblack = "<a href=\"javascript:blur();\"\n\t\tOnClick=\"javascript:document.getElementById('anim-img-0').innerHTML='<img src=img/wait.gif>';\"\n\t\tstyle='text-decoration:underline;font-weight:bold'>";
$delete = " ";
$duplicate = imgsimple("duplicate-24.png", null, "Loadjs('dansguardian2.duplicate.php?default-rule=yes&t={$t}')");
$sock = new sockets();
$ligne = unserialize(base64_decode($sock->GET_INFO("DansGuardianDefaultMainRule")));
$TimeSpace = $webfilter->rule_time_list_explain($ligne["TimeSpace"], 0, $t);
$link = $boot->trswitch($js);
$link_blacklist = $boot->trswitch("Loadjs('dansguardian2.edit.php?js-blacklist-list=yes&RULEID=0&modeblk=0&group=&TimeID=&t={$t}');");
$link_whitelist = $boot->trswitch("Loadjs('dansguardian2.edit.php?js-blacklist-list=yes&RULEID=0&modeblk=1&group=&TimeID=&t={$t}');");
$templatejs = $boot->trswitch("Loadjs('dansguardian.template.php?js=yes&ID=0')");
return "\n\t<tr id='0'>\n\t<td {$styleTD} {$link} width=99%><span id='anim-img-0'>Default</span> {$TimeSpace} " . $webfilter->rules_dans_time_rule(0) . "</td>\n\t<td {$styleTDCenter} {$link} width=1% align=center >*</td>\n\t<td {$styleTDCenter} {$link_blacklist} width=1% align=center>" . $webfilter->COUNTDEGBLKS(0) . "</td>\n\t<td {$styleTDCenter} {$link_whitelist} width=1% align=center>" . $webfilter->COUNTDEGBWLS(0) . "</td>\n\t<td> </td>\n\t<td {$styleTDCenter} {$templatejs} width=35px align=center nowrap><img src='img/banned-template-32.png'></td>\n\t<td width=35px align=center {$styleTDCenter}>{$duplicate}</td>\n\t<td> </td>\n\t</tr>";
}
示例14: visists_days_popup
function visists_days_popup()
{
$q = new mysql_squid_builder();
$page = CurrentPageName();
$tpl = new templates();
$t = time();
$sql = "SELECT SUM(hits) as hits,SUM(size) as size,MAC,zDate \n\tFROM members_mac GROUP BY MAC,zDate HAVING MAC='{$_GET["MAC"]}' ORDER BY zDate ";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
$sock = new sockets();
$boot = new boostrap_form();
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}<hr><code>{$sql}</code></p>";
}
while ($ligne = mysql_fetch_assoc($results)) {
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$ligne["hits"] = FormatNumber($ligne["hits"]);
$xtime = strtotime($ligne["zDate"] . " 00:00:00");
$dateT = date("{l} {F} d", $xtime);
if ($tpl->language == "fr") {
$dateT = date("{l} d {F} ", $xtime);
}
$linkVisit = $boot->trswitch("Loadjs('miniadm.webstats.ByMAC.popup.php?MAC={$ligne["MAC"]}&xtime={$xtime}')");
$tr[] = $tpl->_ENGINE_parse_body("\n\t\t\t\t\t<tr id='{$ligne["MAC"]}'>\n\t\t\t\t\t<td {$linkVisit}><i class='icon-time'></i> {$dateT}</a></td>\n\t\t\t\t\t<td {$linkVisit}><i class='icon-download'></i> {$ligne["size"]} </td>\n\t\t\t\t\t<td {$linkVisit}><i class='icon-signal'></i> {$ligne["hits"]} </td>\n\t\t\t\t\t</tr>");
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{date}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t</table>\n\t\t\t\t";
}
示例15: NicBuildTR
//.........这里部分代码省略.........
$snortInterfaces = unserialize(base64_decode($sock->GET_INFO("SnortNics")));
}
}
$tcp = new networking();
if (!isset($GLOBALS["ipsZ"])) {
$GLOBALS["ipsZ"] = $tcp->ALL_IPS_GET_ARRAY();
}
$nic = new system_nic($NicRequested);
if (!$nic->unconfigured) {
if ($LXCEthLocked == 1) {
if ($val == $LXCInterface) {
writelogs("LXCEthLocked:{$LXCEthLocked}; {$val}=={$LXCInterface} -> abort", __FUNCTION__, __FILE__, __LINE__);
return;
}
}
}
$NIC_UP = false;
if (trim($val) == null) {
continue;
}
$tcp->ifconfig(trim($val));
$array_ipcfg = listnicinfos(trim($val));
$ipddr = $array_ipcfg["tcp_address"];
$defaultroute_text = null;
if ($nic->defaultroute == 1) {
$defaultroute_text = "<div><i style='color:#C40000;font-size:11px'>{default_route}</i></div>";
}
/* return array(
"textColor"=>$textColor,
"tcp_address"=>$IPADDR,
"IPV6"=>$IPV6,
"NETMASK"=>$tbl[2],
"gateway"=>$tbl[4],
"mac_addr"=>$tbl[1],
"HAMACHI"=>$HAMACHI
);
*/
$js = "javascript:Loadjs('system.nic.edit.php?nic={$val}')";
if (!$tcp->linkup) {
$img_on = "net-card-64-grey.png";
} else {
$img_on = "net-card-64.png";
$NIC_UP = true;
if ($snortInterfaces[trim($val)] == 1) {
$img_on = "64-win-nic-snort.png";
}
}
$icon1 = imgtootltip("service-restart-16.png", "{rebuild}", "RebuildMyNic{$val}()");
$icon2 = imgtootltip("plus-16.png", "{add_virtual_ip_addr_explain_js}", "Loadjs('{$page}?js-add-nic={$val}')");
if ($array_ipcfg["HAMACHI"]) {
$img_on = "64-win-nic-hamachi.png";
$js = "javascript:Loadjs('hamachi.php')";
$icon1 = null;
$icon2 = null;
}
if ($IPBANS[$ipddr]) {
$img_on = "64-win-nic-off.png";
$icon1 = null;
$icon2 = null;
$js = null;
}
$boot = new boostrap_form();
$link = $boot->trswitch("Loadjs('miniadm.network.interfaces.NIC.php?nic={$NicRequested}')");
if (!$GLOBALS["AsSystemAdministrator"]) {
$link = null;
}
$nic = new system_nic($NicRequested);
$oldnic = null;
$oldMac = null;
$failover_text = null;
$error = null;
if ($nic->ucarp_enabled == 0) {
$failover_text = "{disabled}";
}
if ($nic->ucarp_enabled == 1) {
$oldnic = $ipddr;
$ipddr = $nic->ucarp_vip;
if (!isset($GLOBALS["ipsZ"][$nic->ucarp_vip])) {
$error = "<img src='img/ok24-grey.png' style='marign-right:10px;float-left'>";
}
if ($nic->ucarp_master == 1) {
$failover_text = "{master2}";
} else {
$failover_text = "{slave}";
}
$failover_text = $error . $failover_text . ": {$oldnic}";
$nicinfos = $sock->getFrameWork("cmd.php?nicstatus={$NicRequested}:ucarp");
$tbl = explode(";", $nicinfos);
$oldMac = "<div style='color:{$array_ipcfg["textColor"]};font-size:12px'><i>{$array_ipcfg["mac_addr"]}</i></div>";
$array_ipcfg["mac_addr"] = $tbl[1];
}
if (!$users->UCARP_INSTALLED) {
$failover_text = "{not_installed}";
}
if ($array_ipcfg["gateway"] == null) {
$nicz = new system_nic($NicRequested);
$array_ipcfg["gateway"] = $nicz->GATEWAY;
}
return $tpl->_ENGINE_parse_body("\n\t\t<tr style='font-size:18px' {$link}>\n\t\t\t<td><img src='img/{$img_on}'></td>\n\t\t\t<td style='color:{$array_ipcfg["textColor"]}'>{$NicRequested}</td>\n\t\t\t<td style='color:{$array_ipcfg["textColor"]}'><i class='icon-signal'></i> {$ipddr}<div style='color:{$array_ipcfg["textColor"]};font-size:12px'><i>{failover}:{$failover_text}</i><br>{$array_ipcfg["IPV6"]}</td>\n\t\t\t<td style='color:{$array_ipcfg["textColor"]}'><i class='icon-signal'></i> {$array_ipcfg["mac_addr"]}{$oldMac}</td>\n\t\t\t<td style='color:{$array_ipcfg["textColor"]}'>{$array_ipcfg["gateway"]}{$defaultroute_text}</td>\n\t\t\t<td style='color:{$array_ipcfg["textColor"]}'>{$array_ipcfg["NETMASK"]}</td>\n\t\t</tr>");
}