本文整理汇总了PHP中boostrap_form::TableOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP boostrap_form::TableOrder方法的具体用法?PHP boostrap_form::TableOrder怎么用?PHP boostrap_form::TableOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boostrap_form
的用法示例。
在下文中一共展示了boostrap_form::TableOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: section_websites_search
function section_websites_search()
{
$boot = new boostrap_form();
$tpl = new templates();
$q = new mysql_squid_builder();
$page = CurrentPageName();
$table = "visited_sites_tot";
$searchstring = string_to_flexquery("sites-search");
$ORDER = $boot->TableOrder(array("size" => "ASC"));
if ($q->COUNT_ROWS($table) == 0) {
senderrors("no data");
}
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$sitenameenc = urlencode($ligne["familysite"]);
$js = "Loadjs('miniadm.webstats.familysite.all.php?familysite={$sitenameenc}')";
$link = $boot->trswitch($js);
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:16px' width=10% nowrap {$link}>{$ligne["familysite"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["hits"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["size"]}</td>\n\t\t</tr>\n\t\t";
}
echo $boot->TableCompile(array("familysite" => "{familysite}", "hits" => "{hits}", "size" => "{size}"), $tr);
}
示例2: bridge_search
function bridge_search()
{
$boot = new boostrap_form();
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$q = new mysql();
$table = "iptables_bridge";
$database = "artica_backup";
$t = time();
$ORDER = $boot->TableOrder(array("ID" => "DESC"));
$sock = new sockets();
$net = new networking();
$ip = new IP();
$interfaces = unserialize(base64_decode($sock->getFrameWork("cmd.php?ifconfig-interfaces=yes")));
$searchstring = string_to_flexquery("search-bridge");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, $database);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
$net = new networking();
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$ip = new IP();
$img = "folder-network-48.png";
$cdir = $ligne["cdir"];
$eth = "br{$ligne["ID"]}";
$eth_text = "br{$ligne["ID"]}";
$array = $net->GetNicInfos($ligne["nic_inbound"]);
$nic_inbound_ip = $array["IPADDR"];
$array = $net->GetNicInfos($ligne["nic_linked"]);
$nic_linked_ip = $array["IPADDR"];
$delete = imgsimple("delete-48.png", "{delete}", "Delete{$t}('{$ligne["ID"]}','{$md}')");
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:18px' width=1% nowrap><img src='img/{$img}'></td>\n\t\t\t<td style='font-size:18px' width=1% nowrap>{$ligne["nic_inbound"]} - {$nic_inbound_ip}</td>\n\t\t\t<td style='font-size:18px' width=10% nowrap>{$ligne["nic_linked"]} - {$nic_linked_ip}</td>\n\t\t\t<td style='font-size:18px' width=1% nowrap>{$delete}</td>\n\t\t</tr>\n\t\t";
}
$delete_text = $tpl->javascript_parse_text("{delete_nic_bridge}");
echo $boot->TableCompile(array("ID" => "ID", "nic_inbound" => "{from}", "nic_linked" => "{to}", "delete" => null), $tr) . "\n\t\t\t\t\t\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: '+ID+'?')){\n\t\tmem{$t}=mem;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('bridge-delete',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t\t}\n\t}\n</script>\t\t\t\t\t\n";
}
示例3: section_websites_search
function section_websites_search()
{
$boot = new boostrap_form();
$tpl = new templates();
$q = new mysql_squid_builder();
$page = CurrentPageName();
$current_month = date("Ym", $_GET["xtime"]);
$table = "{$current_month}_catfam";
$searchstring = string_to_flexquery("sites-search");
$ORDER = $boot->TableOrder(array("size" => "DESC"));
if (!$q->TABLE_EXISTS($table)) {
senderrors("no such table");
}
if ($q->COUNT_ROWS($table) == 0) {
senderrors("no data");
}
//zDate | client | uid | hostname | MAC | familysite | catfam | hits | size
$table = "( SELECT familysite,catfam,SUM(size) as size,SUM(hits) as hits FROM `{$table}` GROUP BY familysite HAVING catfam='{$_GET["catfam"]}') as t";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$sitenameenc = urlencode($ligne["familysite"]);
$js = "Loadjs('miniadm.webstats.familysite.all.php?familysite={$sitenameenc}')";
$link = $boot->trswitch($js);
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:16px' width=10% nowrap {$link}>{$ligne["familysite"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["hits"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["size"]}</td>\n\t\t</tr>\n\t\t";
}
echo $boot->TableCompile(array("familysite" => "{familysite}", "hits" => "{hits}", "size" => "{size}"), $tr);
}
示例4: 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);
}
示例5: topmembers_table_search
function topmembers_table_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("size" => "DESC"));
$searchstring = string_to_flexquery("topmembers-search");
$year = $_GET["year"];
$month = $_GET["month"];
$familysite = mysql_escape_string2($_GET["familysite"]);
$table = "quotamonth_{$year}{$month}";
$table = "(SELECT `uid`,familysite,SUM(size) as `size` FROM {$table} GROUP BY `uid`,familysite \n\tHAVING familysite='{$familysite}' ORDER BY `size` DESC LIMIT 0,50) as t";
$size_text = $tpl->_ENGINE_parse_body("{size}");
$members_text = $tpl->_ENGINE_parse_body("{members}");
$websites_text = $tpl->_ENGINE_parse_body("{websites}");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,20";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error_html();
}
$suffix = suffix();
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$color = "black";
$size = FormatBytes($ligne["size"] / 1024);
$websiteenc = urlencode($ligne["familysite"]);
$js = $boot->trswitch("Loadjs('miniadm.webstats.popup.ByMonthByUserByFamilysite.php?uid={$ligne["uid"]}{$suffix}')");
$tr[] = "\n\t\t<tr>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=99% nowrap {$js}>{$ligne["uid"]}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% nowrap {$js}>{$size}</td>\n\t\t</tr>";
}
echo $boot->TableCompile(array("uid" => "{$members_text}", "size" => "{$size_text}"), $tr);
}
示例6: etchosts_search
function etchosts_search()
{
$boot = new boostrap_form();
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$q = new mysql();
$table = "net_hosts";
$database = "artica_backup";
$t = time();
if ($q->COUNT_ROWS($table, $database) == 0) {
$sock->getFrameWork("system.php?etchosts-default=yes");
}
$ORDER = $boot->TableOrder(array("hostname" => "ASC"));
$sock = new sockets();
$net = new networking();
$ip = new IP();
$interfaces = unserialize(base64_decode($sock->getFrameWork("cmd.php?ifconfig-interfaces=yes")));
$searchstring = string_to_flexquery("search-etchosts");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, $database);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
$net = new networking();
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$delete = imgsimple("delete-48.png", "{delete}", "Delete{$t}('{$ligne["zmd5"]}','{$md}','{$ligne["hostname"]}@{$ligne["ipaddr"]}')");
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:20px' width=90% nowrap >{$ligne["hostname"]}</td>\n\t\t\t<td style='font-size:20px' width=5% nowrap >{$ligne["ipaddr"]}</td>\n\t\t\t<td style='font-size:20px' width=5% nowrap >{$ligne["alias"]}</td>\n\t\t\t<td style='font-size:20px' width=1% nowrap>{$delete}</td>\n\t\t</tr>\n\t\t";
}
$delete_text = $tpl->javascript_parse_text("{delete_nic_etchosts}");
echo $boot->TableCompile(array("hostname" => "{hostname}", "ipaddr" => "{ipaddr}", "alias" => "{alias}", "delete" => null), $tr) . "\n\t\t\t\t\t\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}(md5,mem,ipaddr){\n\tmem{$t}=mem;\n\tif(confirm('{$delete_text}: '+ipaddr+'?')){\n\t\tmem{$t}=mem;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('etchosts-delete',md5);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t\t}\n\t}\n</script>\t\t\t\t\t\n";
}
示例7: events_rotate_table
function events_rotate_table()
{
$q = new mysql_storelogs();
$boot = new boostrap_form();
$table = "evnts";
$rows = $q->COUNT_ROWS($table);
if ($rows == 0) {
senderror("{$table} is empty");
}
$ORDER = $boot->TableOrder(array("zDate" => "DESC"));
$searchstring = string_to_flexquery("search-rotate-events");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, $database);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
$tpl = new templates();
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
$ligne["content"] = $tpl->_ENGINE_parse_body($ligne["content"]);
$ligne["content"] = str_replace("\n", "<br>", $ligne["content"]);
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t<td style='font-size:12px' width=1% nowrap>{$ligne["zDate"]}</td>\n\t\t<td style='font-size:12px' width=1% nowrap>{$ligne["hostname"]}</td>\n\t\t<td style='font-size:12px' width=30% nowrap>{$ligne["subject"]}</td>\n\t\t<td style='font-size:12px' width=70% nowrap>{$ligne["content"]}</td>\n\t\t</tr>\n\t\t";
}
echo $boot->TableCompile(array("zDate" => " {zDate} {$rows} {rows}", "hostname" => "{hostname}", "subject" => "{subject}", "content" => null), $tr);
}
示例8: 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>";
}
示例9: search_websites
function search_websites()
{
$q = new mysql_squid_builder();
$tpl = new templates();
$searchstring = string_to_flexquery("search-websites");
$Params = url_decode_special_tool($_GET["Params"]);
$table = "notcategorized";
$boot = new boostrap_form();
$ORDER = $boot->TableOrder(array("hits" => "DESC"));
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,30";
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)) {
$id = md5($ligne["sitename"]);
$ligne["size"] = FormatBytes($ligne["size"] / 1024);
$ligne["hits"] = FormatNumber($ligne["hits"]);
$dates = unserialize($ligne["seen"]);
$trg = array();
if (is_array($dates)) {
while (list($none, $xtime) = each($dates)) {
$trg[] = time_to_date($xtime);
}
}
$params = BuildDiv($ligne["sitename"]);
$link = $boot->trswitch($params[2]);
$content = $params[0];
$js[] = $params[1];
$tr[] = "\n\t<tr id='{$id}'>\n\t<td {$link}><i class='icon-globe'></i> {$ligne["sitename"]}{$content}<br><i style='font-size:10px'>" . @implode(", ", $trg) . "</td>\n\t<td {$link} nowrap><i class='icon-globe'></i> {$ligne["familysite"]}</td>\n\t<td {$link} nowrap><i class='icon-globe'></i> {$ligne["country"]}</td>\n\t<td {$link} nowrap><i class='icon-globe'></i> {$ligne["size"]}</td>\n\t<td {$link} nowrap><i class='icon-star'></i> {$ligne["hits"]}</td>\n\t</tr>";
}
echo $boot->TableCompile(array("sitename" => "{website}", "familysite" => "{familysite}", "country" => "{country}", "size" => "{size}", "hits" => "{hits}"), $tr) . "\n\t\t\t<script>" . @implode("\n", $js) . "</script>\t\n\t\t\t\t\t\n\t\t\t";
}
示例10: rules_search
function rules_search()
{
$boot = new boostrap_form();
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$q = new mysql_squid_builder();
$table = "authenticator_rules";
$t = time();
$ORDER = $boot->TableOrder(array("ID" => "DESC"));
if (!$q->TABLE_EXISTS($table)) {
$f = new squid_reverse();
}
$searchstring = string_to_flexquery("rules-search");
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
$AdminPrivs = AdminPrivs();
while ($ligne = mysql_fetch_assoc($results)) {
$edit = $boot->trswitch("Loadjs('{$page}?rules-js={$ligne["ID"]}');");
$md = md5(serialize($ligne));
if ($AdminPrivs) {
$delete = imgsimple("delete-48.png", "{delete}", "Delete{$t}('{$ligne["ID"]}','{$md}')");
}
$explaintext = EXPLAIN_RULE($ligne["ID"]);
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t<td style='font-size:18px' width=1% nowrap {$edit}>{$ligne["rulename"]}</td>\n\t\t<td style='font-size:18px' width=90% nowrap>{$ligne["explain"]}<div style='font-size:12px'>{$explaintext}</div></td>\n\t\t<td style='font-size:18px' width=1% nowrap>{$delete}</td>\n\t\t</tr>\n\t\t";
}
$delete_text = $tpl->javascript_parse_text("{delete}");
echo $boot->TableCompile(array("rulename" => " {rulename}", "explain:no" => "{explain}", "delete" => null), $tr) . "\n\t\t\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: '+ID+'?')){\n\t\tmem{$t}=mem;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('rules-delete',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n}\n</script>\n";
}
示例11: container_search
function container_search()
{
$t = time();
ini_set('display_errors', 1);
ini_set('error_prepend_string', "<p class=text-error>");
ini_set('error_append_string', "</p>\n");
$q = new mysql();
$users = new usersMenus();
$boot = new boostrap_form();
$page = CurrentPageName();
$tpl = new templates();
$ORDER = $boot->TableOrder(array("container_name" => "ASC"));
$searchstring = string_to_flexquery("container-search");
$table = "users_containers";
$gpidenc = urlencode($_GET["gpid"]);
$sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}<hr>{$sql}</p>\n";
}
$available = $tpl->_ENGINE_parse_body("{available}");
$used_text = $tpl->_ENGINE_parse_body("{used}");
$error = $tpl->_ENGINE_parse_body("{error}");
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT maxsize FROM storage_containers WHERE `groupid`='" . mysql_escape_string2($_GET["gpid"]) . "'", "artica_backup"));
$maxsize = $ligne["maxsize"];
if ($maxsize > 0) {
$uidenc = mysql_escape_string2($_SESSION["uid"]);
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(container_size) as tSize FROM users_containers WHERE `uid`='{$uidenc}'", "artica_backup"));
$tSize = $ligne["tSize"];
$prc = $tSize / $maxsize * 100;
$status = "\n\t\t<div style='width:100%;text-align:right;margin-top:25px'>{global_size}: " . pourcentage($prc) . "\n\t\t</div>";
}
$iscsi_chap_secret_explain = $tpl->_ENGINE_parse_body("{iscsi_chap_secret_explain}");
$delete_container_ask = $tpl->javascript_parse_text("{delete_container_ask}");
$tr = array();
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$ID = $ligne["container_id"];
$addtext = null;
$md5 = md5(serialize($ligne));
$container_name = $ligne["container_name"];
$container_size = $ligne["container_size"];
$container_size_UNIT = "MB";
$per = null;
$iscsi_error = null;
$CMD_WEBDAV_ICON = null;
$CMD_ISCSI_JS = null;
$CMD_ISCSI_ICON = null;
if ($container_size >= 1000) {
$container_size = $container_size / 1000;
$container_size_UNIT = "GB";
}
$delete = imgsimple("delete-32.png", null, "Delete{$t}('{$ID}','{$md5}')");
$color = "black";
$availble = null;
$lock = "<img src='img/lock.gif' style='float:right'>";
$status_img = "ok32-grey.png";
if ($ligne["created"] == 0) {
$color = "#C1C1C1";
$addtext = $tpl->_ENGINE_parse_body(" {building} {please_wait}...");
}
if ($ligne["onerror"] == 1) {
$color = "#A10000";
$addtext = " {$error}:" . $ligne["onerrortext"];
}
$statusA = unserialize(base64_decode($ligne["status"]));
if (is_array($statusA)) {
if ($statusA["MOUNTED"] != null) {
$status_img = "ok32.png";
}
$availble = " {$available}:" . FormatBytes($statusA["STATUS"]["AIVA"]) . " {$used_text} {$statusA["STATUS"]["POURC"]}%";
$per = pourcentage($statusA["STATUS"]["POURC"]);
} else {
$addtext = " No status...";
}
$webdav_creds = unserialize(base64_decode($ligne["webdav_creds"]));
if ($webdav_creds["username"] == null) {
$lock = null;
}
if ($ligne["iscsid"] == 1) {
$length = strlen($webdav_creds["password"]);
if ($length < 12) {
$iscsi_error = "<div style='color:#C50808'>{$iscsi_chap_secret_explain}</div>";
}
if ($length > 16) {
$iscsi_error = "<div style='color:#C50808'>{$iscsi_chap_secret_explain}</div>";
}
$CMD_ISCSI_JS = $boot->trswitch("Loadjs('{$page}?iscsi-cmd-js=yes&ID={$ID}')");
$CMD_ISCSI_ICON = "<img src='img/32-infos.png'>";
////http://nas-appliance.org/index.php?cID=220
}
$trjs = $boot->trswitch("Loadjs('{$page}?wizard-js=yes&ID={$ID}&gpid={$gpidenc}')");
if ($ligne["webdav"] == 1) {
$CMD_WEBDAV_ICON = "<img src='img/cmd-32.png'>";
$CMD_WEBDAV_JS = $boot->trswitch("Loadjs('{$page}?webdav-cmd-js=yes&ID={$ID}')");
}
$tr[] = "\n\t\t<tr id='{$md5}'>\n\t\t<td style='font-size:18px;color:{$color}' nowrap {$trjs}>{$lock}[disk{$ID}] {$container_name} ({$container_size}{$container_size_UNIT}) {$addtext}{$availble}{$iscsi_error}</td>\n\t\t<td style='font-size:18px;color:{$color};text-align:center' nowrap width=1% {$CMD_ISCSI_JS}>{$CMD_ISCSI_ICON}</td>\n\t\t<td style='font-size:18px;color:{$color};text-align:center' nowrap width=1% {$CMD_WEBDAV_JS}>{$CMD_WEBDAV_ICON}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% {$trjs}><img src='img/{$status_img}'></td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% {$trjs}>{$per}</td>\n\t\t<td style='font-size:18px;color:{$color}' nowrap width=1% >{$delete}</td>\n\t\t</tr>";
}
echo $status . $boot->TableCompile(array("container_name" => "{name}", "5:no" => "iSCSI", "3:no" => "WebDav", "1:no" => "{status}", "delete" => "{delete}", "2:no" => ""), $tr) . "\n\t\t\t\t\n<script>\nvar id{$t}='';\nvar xDelete{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\t\$('#'+id{$t}).remove();\n}\n\t\nfunction Delete{$t}(ID,md){\n\tif(!confirm('{$delete_container_ask}')){return;}\n\tid{$t}=md;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('delete-container',ID);\n\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n}\n</script>";
}
示例12: tasks_search
function tasks_search()
{
$boot = new boostrap_form();
$tpl = new templates();
$q = new mysql();
$t = time();
if (isset($_GET["t"])) {
$t = $_GET["t"];
}
$page = CurrentPageName();
$table = "system_schedules";
$searchstring = string_to_flexquery("search-tasks");
$ORDER = $boot->TableOrder(array("ID" => "DESC"));
if ($q->COUNT_ROWS($table, "artica_backup") == 0) {
senderrors("{no_task}");
}
if ($_GET["task-section"] > 0) {
$table = "( SELECT * FROM {$table} WHERE `TaskType`={$_GET["task-section"]} ) as T";
}
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
$schedules = new system_tasks();
while ($ligne = mysql_fetch_assoc($results)) {
$color = "black";
$events = " ";
$md = md5(serialize($ligne));
$TaskType = $ligne["TaskType"];
$jstaskexplain = $tpl->javascript_parse_text($schedules->tasks_array[$ligne["TaskType"]]);
$ligne["TaskType"] = $tpl->_ENGINE_parse_body($schedules->tasks_array[$ligne["TaskType"]]);
$TimeDescription = $ligne["TimeDescription"];
$delete = imgtootltip("delete-32.png", "{delete} {$ligne['ID']}", "Delete{$t}('{$ligne['ID']}','{$md}')");
$run = $tpl->_ENGINE_parse_body(imgtootltip("24-run.png", "{run} {$ligne['ID']}", "SystemTaskRun('{$ligne['ID']}','{$jstaskexplain}')"));
if ($ligne["enabled"] == 0) {
$color = "#A0A0A0";
}
$tablename = "Taskev{$ligne['ID']}";
if (!$q->TABLE_EXISTS($tablename, "artica_events")) {
$events = null;
} else {
$evs = $q->COUNT_ROWS($tablename, "artica_events");
if ($evs > 0) {
$events = imgsimple("events-32.png");
}
}
$explainTXT = $tpl->_ENGINE_parse_body($schedules->tasks_explain_array[$TaskType]);
$TimeText = $tpl->_ENGINE_parse_body($schedules->PatternToHuman($ligne["TimeText"]));
$TimeText = str_replace("<br>", "", $TimeText);
if (preg_match("#(.+?)\\s+(.+?)\\s+(.+?)\\s+(.+?)\\s+(.+?)#", $TimeDescription, $re)) {
$TimeDescription = $TimeText;
$TimeText = null;
}
$js = "Loadjs('{$page}?schedule-js=yes&ID={$ligne['ID']}')";
$link = $boot->trswitch($js);
$ligne["TimeDescription"] = utf8_encode($ligne["TimeDescription"]);
$ligne["TaskType"] = utf8_encode($ligne["TaskType"]);
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne['ID']}</td>\n\t\t<td style='font-size:16px' width=25% nowrap {$link}>{$ligne["TaskType"]}</td>\n\t\t<td style='font-size:16px' width=70% {$link}>{$TimeDescription}<br>{$explainTXT}</td>\n\t\t<td style='font-size:16px' width=1% nowrap >{$run}</td>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$events}</td>\n\t\t<td style='font-size:12px' width=1%>{$delete}</td>\n\t\t</tr>\n\t\t";
}
$run_this_task_now = $tpl->javascript_parse_text("{run_this_task_now}");
$delete_text = $tpl->javascript_parse_text("{delete_this_task}");
echo $boot->TableCompile(array("ID" => "ID", "TaskType" => "{type}", "TimeText" => "{explain}", "run:no" => "{run}", "event:no" => "{events}", "delete:no" => 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: '+ID+'?')){\n\t\tmem{$t}=mem;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('task-delete',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n}\nvar xSystemTaskEnable{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tExecuteByClassName('SearchFunction');\t\t\n}\n\nfunction SystemTaskRun{$t}(ID){\n\tif(confirm('{$run_this_task_now} :`'+ID+'`')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('task-run',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSystemTaskEnable{$t});\t\t\n\t}\n}\n\t\t\t\n</script>\n\t\t\t\n";
}
示例13: events_search
function events_search()
{
$boot = new boostrap_form();
$tpl = new templates();
$q = new mysql();
$page = CurrentPageName();
$table = "mirror_logs";
$searchstring = string_to_flexquery("search-events");
$ORDER = $boot->TableOrder(array("zDate" => "DESC"));
if ($q->COUNT_ROWS($table, "artica_events") == 0) {
senderrors("no data");
}
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, "artica_events");
if (!$q->ok) {
senderrors($q->mysql_error . "<br>{$sql}");
}
while ($ligne = mysql_fetch_assoc($results)) {
$md = md5(serialize($ligne));
if ($ligne["totalsize"] > 0) {
$ligne["totalsize"] = FormatBytes($ligne["totalsize"] / 1024);
}
$distance = $tpl->_ENGINE_parse_body(distanceOfTimeInWords($ligne["starton"], $ligne["endon"]));
$link = null;
$tr[] = "\n\t\t<tr id='{$md}'>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["zDate"]}</td>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["pid"]}</td>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$distance}</td>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["filesnumber"]}</td>\n\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["totalsize"]}</td>\n\t\t<td style='font-size:12px' width=99% {$link}>{$ligne["error"]}</td>\n\t\t</tr>\n\t\t";
}
echo $boot->TableCompile(array("zDate" => "{date}", "pid" => "pid", "endon" => "{duration}", "filesnumber" => "{files}", "size" => "{size}", "error" => "{error}"), $tr);
}
示例14: events_search
function events_search()
{
$page = CurrentPageName();
$boot = new boostrap_form();
$tpl = new templates();
$searchstring = string_to_flexquery("events-search");
$ORDER = $boot->TableOrder(array("zDate" => "DESC"));
$limitSql = "LIMIT 0,250";
$sql = "SELECT * FROM nginx_exploits_fwev WHERE servername='{$_GET["servername"]}' {$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)) {
$tr[] = "\n\t\t\t\t\t<tr id='{$ligne["ID"]}'>\n\t\t\t\t\t<td width='25%' nowrap><i class='icon-time'></i> {$ligne["zDate"]}</a></td>\n\t\t\t\t\t<td width='25%' nowrap>{$ligne["ipaddr"]}</a></td>\n\t\t\t\t\t<td width='25%' nowrap>{$ligne["hostname"]}</td>\n\t\t\t\t\t<td width='25%' nowrap>{$ligne["country"]}</td>\n\t\t\t\t\t</tr>";
}
$html = $boot->TableCompile(array("zDate" => "{date}", "ipaddr" => "{ipaddr}", "hostname" => "{hostname}", "country" => "{country}"), $tr);
echo $tpl->_ENGINE_parse_body($html);
}
示例15: computers_search
function computers_search()
{
$tpl = new templates();
$MyPage = CurrentPageName();
$boot = new boostrap_form();
$q = new mysql();
$sock = new sockets();
$fontsize = "14px";
$page = 1;
if (!$q->DATABASE_EXISTS("ocsweb")) {
$sock->getFrameWork("services.php?mysql-ocs=yes");
}
if (!$q->TABLE_EXISTS("hardware", "ocsweb")) {
$sock->getFrameWork("services.php?mysql-ocs=yes");
}
if (!$q->TABLE_EXISTS("networks", "ocsweb", true)) {
$sock->getFrameWork("services.php?mysql-ocs=yes");
}
$EnableScanComputersNet = $sock->GET_INFO("EnableScanComputersNet");
if (!is_numeric($EnableScanComputersNet)) {
$EnableScanComputersNet = 0;
}
if (!$q->FIELD_EXISTS("networks", "isActive", "ocsweb")) {
$q->QUERY_SQL("ALTER TABLE `networks` ADD `isActive` SMALLINT( 1 ) NOT NULL DEFAULT '0',ADD INDEX ( `isActive` ) ", "ocsweb");
}
$ORDER = $boot->TableOrder(array("NAME" => "ASC"));
$searchstring = string_to_flexquery("computer-search");
$table = "(SELECT networks.MACADDR,networks.IPADDRESS,\n\t\t\thardware.OSNAME,\n\t\t\thardware.LASTDATE,\n\t\t\thardware.NAME,\n\t\t\thardware.IPADDR,\n\t\t\thardware.IPSRC\n\t\t\tFROM networks,hardware WHERE networks.HARDWARE_ID=hardware.ID) as t";
$sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
$results = $q->QUERY_SQL($sql, "ocsweb");
if (!$q->ok) {
echo $q->mysql_error . "<br>{$sql}\n";
}
$computer = new computers();
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
if ($ligne["MACADDR"] == "unknown") {
continue;
}
$uid = null;
$OSNAME = null;
if ($ligne["OSNAME"] == "Unknown") {
$ligne["OSNAME"] = null;
}
$color = "#7D7D7D";
$md = md5($ligne["MACADDR"]);
$uri = strtolower($ligne["NAME"]);
$uid = $computer->ComputerIDFromMAC($ligne["MACADDR"]);
$view = " ";
$jsfiche = MEMBER_JS($uid, 1, 1);
$js = null;
if ($uid != null) {
$js = $boot->trswitch($jsfiche);
}
if ($ligne["OSNAME"] != null) {
$OSNAME = "<div style='font-size:9px'><i>{$ligne["OSNAME"]}</i></div>";
}
$isActive = "img/unknown24.png";
if ($EnableScanComputersNet == 1) {
if ($ligne["isActive"] == 1) {
$isActive = "img/ok24.png";
} else {
$isActive = "img/danger24.png";
}
}
if (!IsPhysicalAddress($ligne["MACADDR"])) {
if ($_GET["CorrectMac"] == 1) {
continue;
}
}
$AlreadyMAC[$ligne["MACADDR"]] = true;
$zdate = null;
if (isset($ligne["zDate"])) {
$zdate = "<div style='font-size:11px;color:#7D7D7D'>{$ligne["zDate"]}</div>";
}
$tr[] = "\n\t\t<tr>\n\t\t\t<td style='font-size:18px' nowrap width=1% {$js}>{$ligne["LASTDATE"]}</td>\n\t\t\t<td style='font-size:18px' nowrap {$js}>{$ligne["NAME"]}</td>\n\t\t\t<td style='font-size:18px' nowrap width=1% {$js}>{$ligne["IPADDRESS"]}</td>\n\t\t\t<td style='font-size:18px' nowrap width=1% {$js}>{$ligne["MACADDR"]}</td>\n\t\t\t<td style='font-size:18px' nowrap width=1% {$js}><img src='{$isActive}'></td>\t\t\t\n\t\t\t\t\n\t\t</tr>";
}
echo $boot->TableCompile(array("LASTDATE" => "{date}", "NAME" => "{hostname}", "IPADDRESS" => "{ipaddr}", "MACADDR" => "{MAC}"), $tr);
}