/**
 * page code function
 */
function ThisPageMainCode()
{
    global $logged;
    $ret = "";
    $member['ID'] = (int) $_COOKIE['memberID'];
    $owner = $_REQUEST['owner'] ? (int) $_REQUEST['owner'] : (int) $_COOKIE['memberID'];
    // Check if membership allows this action
    $check_res = checkAction($member['ID'], ACTION_ID_VIEW_GUESTBOOK);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin'] && $member['ID'] != $owner) {
        $ret .= "<br />\r\n\t\t\t<table width=\"100%\" cellpadding=1 cellspacing=1 border=0>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=text align=center>\r\n\t\t\t\t\t\t<br />" . $check_res[CHECK_ACTION_MESSAGE] . "<br />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\n";
        return $ret;
    }
    $check_res = checkAction($owner, ACTION_ID_USE_GUESTBOOK);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin']) {
        $ret .= $member['ID'] == $owner ? $check_res[CHECK_ACTION_MESSAGE] : _t_err("_This guestbook disabled by it's owner");
        return $ret;
    }
    if ($_GET['action'] == 'show_add' && $_GET['owner']) {
        $ret .= ShowAddRecord();
        return $ret;
    }
    if ($_POST['action'] == 'new' && $_POST['owner'] && strlen($_POST['newrecord'])) {
        $ret .= AddRecord();
    }
    if ($_GET['action'] == 'delete' && $_GET['owner'] && (int) $_GET['delete_id'] != 0) {
        $ret .= DeleteRecord();
    }
    $ret .= PrintGuestbook();
    return $ret;
}
Example #2
0
<?php
}
if($isadmin){
	if( is_array($mon) ){
		$most = TestImg($mon[3]);
	}else{
		if ($mon == 1 and $dev[1]){
			if($dev[14] & 3){
				$mma  = explode('/', $mema);
				if($dev[21] > 100){
					$most = AddRecord('monitoring',"name='$dev[0]'",'name,monip,test,device,memalert',"'$dev[0]','$dev[1]','uptime','$dev[0]','$mma[0]'");
				}else{
					$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device,memalert","'$dev[0]','$dev[1]','uptime','$dev[0]','$mma[1]'");
				}
			}else{
				echo AddRecord('monitoring',"name='$dev[0]'",'name,monip,test,device',"'$dev[0]','$dev[1]','ping','$dev[0]'");
			}
		}else{
			echo "<a href=\"?dev=$ud&mon=1\"><img src=\"img/16/bino.png\" title=\"Monitor $addlbl\"></a>";
		}
	}
	echo "<a href=\"Monitoring-Setup.php?in[]=name&op[]=%3D&st[]=$ud\">$most</a>";
?>
<a href="?del=<?= $ud ?>&dtx=+with+IP+<?= $ip ?>+SN+<?= $dev[2] ?>"><img src="img/16/bcnl.png" title="<?= $dellbl ?>!" onclick="return confirm('<?= $dellbl ?> <?= $dev[0] ?>, <?= $cfmmsg ?>')"></a>
<?}?>

</div>
</th>

</tr>
<tr>
Example #3
0
<?php

include_once "conn.php";
include_once "function.php";
if ($_GET["action"] == "") {
    exit;
}
if ($_GET["action"] == "register") {
    echo Register($_GET["phonenum"], $_GET["password"]);
}
if ($_GET["action"] == "login") {
    echo Login($_GET["phonenum"], $_GET["password"]);
}
if ($_GET["action"] == "add_guardian") {
    echo AddGuardian($_GET["phonenum"], $_GET["guardiantel"]);
}
if ($_GET["action"] == "del_guardian") {
    echo DelGuardian($_GET["phonenum"], $_GET["guardiantel"]);
}
if ($_GET["action"] == "get_guardian") {
    echo GetGuardian($_GET["phonenum"]);
}
if ($_GET["action"] == "add_record") {
    echo AddRecord($_GET["phonenum"], $_GET["value"], $_GET["food"], $_GET["sport"], $_GET["medicine"], $_GET["round"]);
}
if ($_GET["action"] == "get_record") {
    echo GetRecord($_GET["phonenum"], $_GET["starttime"], $_GET["endtime"]);
}
 $monst = '';
 while ($if = DbFetchRow($res)) {
     if ($row % 2) {
         $bg = "txta";
         $bi = "imga";
     } else {
         $bg = "txtb";
         $bi = "imgb";
     }
     $row++;
     $ud = urlencode($if[0]);
     $ui = urlencode($if[1]);
     list($fc, $lc) = Agecol($if[33], $if[34], $row % 2);
     list($cc, $cc) = Agecol($if[26], $if[26], $row % 2);
     if ($isadmin and $_GET['trk']) {
         $trkst = AddRecord('nodetrack', "device='{$if['0']}' AND ifname='{$if['1']}'", "device,ifname,value,source,usrname,time", "'{$if['0']}','{$if['1']}','-','-','{$_SESSION['user']}','" . time() . "'");
     }
     if ($isadmin and $_GET['upm']) {
         $query = GenQuery('interfaces', 'u', "CONCAT(device,ifname)", '=', "{$if['0']}{$if['1']}", array('trafalert', 'brcalert', 'macflood'), array(), array($tal, $bal, $maf));
         $monst = DbQuery($query, $link) ? "<img src=\"img/16/bchk.png\" title=\" {$monlbl} {$updlbl} OK\" vspace=\"4\">" : "<img src=\"img/16/bcnl.png\" title=\"" . DbError($link) . "\" vspace=\"4\">";
     }
     TblRow($bg);
     if (in_array("imBL", $col)) {
         list($ifbg, $ifst) = Ifdbstat($if[8]);
         list($ifimg, $iftyp) = Iftype($if[4]);
         TblCell("", "", "width=\"50\" class=\"" . ($ifbg ? $ifbg : $bi) . "\"", "<img src=\"img/{$ifimg}\" title=\"{$iftyp} - {$ifst}\">", "th-img");
     }
     if (in_array("ifname", $col)) {
         TblCell("{$if['1']} {$trkst} {$monst}", "?in[]=ifname&op[]==&st[]={$ui}", "align=\"left\"", "", "th");
     }
     if (in_array("ifidx", $col)) {
Example #5
0
		while( ($dev = DbFetchRow($res)) ){
			if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
			$row++;
			TblRow($bg);
			$ip  = long2ip($dev[1]);
			if( $del ){
				echo "<th class=\"$bi\"><img src=\"img/dev/$dev[18].png\" title=\"$dev[3]\"><br>$dev[0]</th><td>";
				DevDelete($dev[0]," with IP $ip and SN $dev[2]");
				echo "</td>";
			}else{
				if($isadmin and $mon and $dev[1]){
					if($dev[14] & 3){
						$myma = ($dev[21] > 100)?$mma[0]:$mma[1];
						$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device,memalert","'$dev[0]','$dev[1]','uptime','$dev[0]','$myma'");
					}else{
						$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device","'$dev[0]','$dev[1]','ping','$dev[0]'");
					}
				}
				$oi  = long2ip($dev[19]);
				$ud  = urlencode($dev[0]);
				$stk = ($dev[29] > 1)?"<img src=\"img/$dev[29].png\" title=\"Stack\">":"";
				list($fc,$lc) = Agecol($dev[4],$dev[5],$row % 2);

				if( in_array("device",$col) ){
					if( $moq and $dev[34] and $dev[34] != 'none' ){
						list($statbg,$stat) = StatusBg(1,1,$dev[35],$bi);
					}else{
						$statbg = $bi;
						$stat = '';
					}
					TblCell($dev[0],'',"class=\"$statbg\" width=\"100px\"","<a href=\"Devices-Status.php?dev=$ud\"><img src=\"img/dev/$dev[18].png\" title=\"$dev[3] $stat\"></a>$stk $most<br>","th-img");
Example #6
0
		$row = 0;
		while( ($n = DbFetchRow($res)) ){
			if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
			$row++;
			$most		= '';
			$name		= preg_replace("/^(.*?)\.(.*)/","$1", $n[0]);
			$ip		= long2ip($n[1]);
			$img		= Nimg($n[3]);
			list($fc,$lc)	= Agecol($n[4],$n[5],$row % 2);
			$wasup		= ($n[5] > time() - $rrdstep * 1.5)?1:0;
			$ud = urlencode($n[6]);
			$ui = urlencode($n[7]);

			if($isadmin and $mon and $n[1]){
				$mona = ($n[0])?$n[0]:$ip;
				$most = AddRecord('monitoring',"name='$mona'","name,monip,class,test,device,depend","'$mona','$n[1]','node','ping','$n[6]','$n[6]'");
			}
			TblRow($bg);
			if(in_array("imBL",$col)){
				TblCell("","","class=\"$bi\" width=\"50\"","<a href=\"Nodes-Status.php?mac=$n[2]&vid=$n[8]\"><img src=\"img/oui/$img.png\" title=\"$n[3] ($n[2])\"></a>","th-img");
			}
			if(in_array("name",$col)){	TblCell("<b>$n[0]</b> $most");}			
			if( in_array("mac",$col) ){	TblCell($n[2],"","class=\"mrn code\"",( array_key_exists('Flower', $mod['Other']) )?"<a href=\"Other-Flower.php?fsm=".rtrim(chunk_split($n[2],2,":"),":")."\"><img src=\"img/16/".$mod['Other']['Flower'].".png\"></a>":"");}
			if(in_array("oui",$col)){	TblCell($n[3],"?in[]=oui&op[]==&st[]=".urlencode($n[3]),"");}
			if(in_array("nodip",$col)){	TblCell($ip,"?in[]=nodip&op[]==&st[]=$ip","",( array_key_exists('Flower', $mod['Other']) )?"<a href=\"Other-Flower.php?fet=2048&fsi=$ip\"><img src=\"img/16/".$mod['Other']['Flower'].".png\"></a>":"");}
			if(in_array("nodip6",$col)){
				TblCell( DbIPv6($n[16]),"","class=\"prp code\"" );
			}
			if(in_array("ipupdate",$col)){	
				list($a1c,$a2c) = Agecol($n[12],$n[12],$row % 2);
				TblCell( date($datfmt,$n[12]),"?in[]=ipupdate&op[]==&st[]=$n[12]","nowrap bgcolor=\"#$a1c\"");