本文整理汇总了PHP中mysql_squid_builder::MAC_TO_NAME方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::MAC_TO_NAME方法的具体用法?PHP mysql_squid_builder::MAC_TO_NAME怎么用?PHP mysql_squid_builder::MAC_TO_NAME使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_squid_builder
的用法示例。
在下文中一共展示了mysql_squid_builder::MAC_TO_NAME方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: items_list
function items_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"];
$FORCE_FILTER=null;
$search='%';
$table="webfilters_sqitems";
$page=1;
if($q->COUNT_ROWS($table)==0){$data['page'] = $page;$data['total'] = $total;$data['rows'] = array();echo json_encode($data);return ;}
if(isset($_POST["sortname"])){
if($_POST["sortname"]<>null){
$ORDER="ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {$page = $_POST['page'];}
if($_POST["query"]<>null){
$_POST["query"]=str_replace("*", "%", $_POST["query"]);
$search=$_POST["query"];
$searchstring="AND (`{$_POST["qtype"]}` LIKE '$search')";
$sql="SELECT COUNT(*) as TCOUNT FROM `$table` WHERE gpid=$ID $FORCE_FILTER $searchstring";
$ligne=mysql_fetch_array($q->QUERY_SQL($sql));
$total = $ligne["TCOUNT"];
}else{
$sql="SELECT COUNT(*) as TCOUNT FROM `$table` WHERE gpid=$ID $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 gpid=$ID $searchstring $FORCE_FILTER $ORDER $limitSql";
writelogs($sql,__FUNCTION__,__FILE__,__LINE__);
$results = $q->QUERY_SQL($sql);
if(!$q->ok){json_error_show($q->mysql_error);}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if(mysql_num_rows($results)==0){json_error_show("no data");}
while ($ligne = mysql_fetch_assoc($results)) {
$val=0;
$disable=Field_checkbox("itemid_{$ligne['ID']}", 1,$ligne["enabled"],"EnableDisableItem('{$ligne['ID']}')");
$macname=$q->MAC_TO_NAME($ligne['pattern']);
$ligne['pattern']=utf8_encode($ligne['pattern']);
$delete=imgtootltip("delete-24.png","{delete} {$ligne['pattern']}","DeleteGroupItem('{$ligne['ID']}')");
$additional_text=null;
if($macname){
$additional_text="<div style='font-size:10px'>$macname</div>";
}
if(preg_match("#AD:(.*?):(.+)#", $ligne["pattern"],$re)){
$dnEnc=$re[2];
$LDAPID=$re[1];
$ad=new ActiveDirectory($LDAPID);
$tty=$ad->ObjectProperty(base64_decode($dnEnc));
$entries=$ad->search_users_from_group(base64_decode($dnEnc),0);
$ligne['pattern']="Active Directory: ".$tty["cn"]." - ".count($entries)." items";
}
$data['rows'][] = array(
'id' => "item{$ligne['ID']}",
'cell' => array("<span style='font-size:13px;font-weight:bold'>{$ligne['pattern']}</span>$additional_text",
"<div style='padding-top:5px'>$disable</div>",
$delete)
);
}
echo json_encode($data);
}
示例2: items_list
function items_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"];
$FORCE_FILTER = null;
$search = '%';
$table = "webfilters_sqitems";
$page = 1;
if ($q->COUNT_ROWS($table) == 0) {
json_error_show("no item");
}
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 gpid={$ID} {$FORCE_FILTER} {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE gpid={$ID} {$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 gpid={$ID} {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
json_error_show($q->mysql_error);
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (mysql_num_rows($results) == 0) {
json_error_show("no item");
}
while ($ligne = mysql_fetch_assoc($results)) {
$val = 0;
$disable = Field_checkbox("itemid_{$ligne['ID']}", 1, $ligne["enabled"], "EnableDisableItem('{$ligne['ID']}')");
$macname = $q->MAC_TO_NAME($ligne['pattern']);
$ligne['pattern'] = utf8_encode($ligne['pattern']);
$delete = imgtootltip("delete-24.png", "{delete} {$ligne['pattern']}", "DeleteGroupItem('{$ligne['ID']}')");
$additional_text = null;
if ($macname) {
$additional_text = "<div style='font-size:10px'>{$macname}</div>";
}
$data['rows'][] = array('id' => "item{$ligne['ID']}", 'cell' => array("<span style='font-size:14px;font-weight:bold'>{$ligne['pattern']}</span>{$additional_text}", "<div style='padding-top:5px'>{$disable}</div>", $delete));
}
echo json_encode($data);
}
示例3: items_list
function items_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"];
$FORCE_FILTER = null;
$search = '%';
$table = "webfilters_sqitems";
$page = 1;
if ($q->COUNT_ROWS($table) == 0) {
json_error_show("No data");
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
$searchstring = string_to_flexquery();
if ($searchstring != null) {
$sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE gpid={$ID} {$FORCE_FILTER} {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE gpid={$ID} {$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 gpid={$ID} {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
json_error_show($q->mysql_error);
}
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (mysql_num_rows($results) == 0) {
json_error_show("no data");
}
while ($ligne = mysql_fetch_assoc($results)) {
$val = 0;
$disable = Field_checkbox("itemid_{$ligne['ID']}", 1, $ligne["enabled"], "EnableDisableItem('{$ligne['ID']}')");
$macname = $q->MAC_TO_NAME($ligne['pattern']);
$ligne['pattern'] = utf8_encode($ligne['pattern']);
$delete = imgtootltip("delete-24.png", "{delete} {$ligne['pattern']}", "DeleteGroupItem('{$ligne['ID']}')");
$additional_text = null;
if ($macname) {
$additional_text = "<div style='font-size:10px'>{$macname}</div>";
}
if (preg_match("#MyPortNameID([0-9]+)#", $ligne["pattern"], $re)) {
$ligne_myportname = @mysql_fetch_array($q->QUERY_SQL("SELECT * FROM proxy_ports WHERE ID={$re[1]}"));
$ssl = null;
$PortName = $ligne_myportname["PortName"];
$port = $ligne_myportname["port"];
$eth = $ligne_myportname["nic"];
if ($ligne_myportname["FTP"] == 1) {
continue;
}
if ($ligne_myportname["ICP"] == 1) {
continue;
}
if ($ligne_myportname["WANPROXY"] == 1) {
continue;
}
if ($ligne_myportname["UseSSL"] == 1) {
$ssl = " SSL";
}
$PortName = $PortName . "{$ssl} ({$port})";
if ($eth != null) {
$nic = new system_nic($eth);
$test_ip = $nic->IPADDR;
$PortName = "{$PortName}{$ssl} ({$nic->IPADDR}:{$port})";
}
$ligne['pattern'] = $tpl->javascript_parse_text($PortName);
}
if (preg_match("#AD:(.*?):(.+)#", $ligne["pattern"], $re)) {
$dnEnc = $re[2];
$LDAPID = $re[1];
$ad = new ActiveDirectory($LDAPID);
$tty = $ad->ObjectProperty(base64_decode($dnEnc));
$entries = $ad->search_users_from_group(base64_decode($dnEnc), 0);
$ligne['pattern'] = "Active Directory: " . $tty["cn"] . " - " . count($entries) . " items";
}
$data['rows'][] = array('id' => "item{$ligne['ID']}", 'cell' => array("<span style='font-size:13px;font-weight:bold'>{$ligne['pattern']}</span>{$additional_text}", "<div style='padding-top:5px'>{$disable}</div>", $delete));
}
echo json_encode($data);
}