function sendText($text, $type) { if ($type == 1) { //error } elseif ($type == 2) { //success } else { $text = lText('sheamowmet messijis gagzavnis tipi!'); $type = 3; } putsesText($text, $type); }
function headerElements($el, $mp = '') { if (is_array($el)) { foreach ($el as $row) { $ex = 'SELECT * FROM `header_tags` WHERE `tags`="' . $row . '" AND `mp_name`="' . $mp . '"'; $tags = getOnedb($ex); if (empty($tags->id)) { $ins = 'INSERT INTO `header_tags`(`tags`,`mp_name`)' . 'VALUES' . '("' . dbstring($row) . '","' . $mp . '")'; insert($ins); } } } else { $text = lText('elementi unda iyos array'); $type = 1; sendText($text, $mtype); return true; } }
function gtinfo($testid) { global $NATS; $o = "Error fetching test"; $test = $NATS->GetTest($testid); if ($test['class'] == "L") { $o = lText($test['testtype']); if ($test['testparam'] != "") { $o .= " (" . $test['testparam'] . ")"; } if ($test['testname'] != "") { $o = $test['testname']; } $u = lUnit($test['testtype']); if ($u != "") { $o .= " (" . $u . ")"; } } else { if ($test['name'] != "") { $o = $test['name']; } else { $o = $test['testtype']; } } /* if ($testid[0]=="L") { // local test $q="SELECT testtype,testparam,testname FROM fnlocaltest WHERE localtestid=".ss(substr($testid,1,128)); $r=$NATS->DB->Query($q); if ($row=$NATS->DB->Fetch_Array($r)) { $o=lText($row['testtype']); if ($row['testparam']!="") $o.=" (".$row['testparam'].")"; if ($row['testname']!="") $o=$row['testname']; $u=lUnit($row['testtype']); if ($u!="") $o.=" (".$u.")"; } else $o="Error fetching test"; } */ return $o; }
function LocalTestDesc($ltid) { global $NATS; $q = "SELECT nodeid,testtype,testparam,testname FROM fnlocaltest WHERE localtestid=" . ss($ltid); $r = $NATS->DB->Query($q); if ($row = $NATS->DB->Fetch_Array($r)) { if ($row['testname'] != "") { $ret = $row['testname']; } else { $ret = lText($row['testtype']); //if ($row['testparam']!="") $ret.=" (".substr($row['testparam'],0,20).")"; if ($row['testparam'] != "") { $ret .= " (" . $row['testparam'] . ")"; } } $ret .= " on " . $row['nodeid']; } else { $ret = "Unknown2 on Unknown" . $ltid; } return $ret; }
echo "<br><br>"; $title = "<b class=\"sectitle\">" . $NATS->Lang->Item("node.tests") . "</b>"; Start_Round($title, 600); echo "<table class=\"nicetable\" width=100%>"; $q = "SELECT * FROM fnlocaltest WHERE nodeid=\"" . ss($_REQUEST['nodeid']) . "\" AND testtype!=\"ICMP\" ORDER BY localtestid ASC"; $r = $NATS->DB->Query($q); while ($row = $NATS->DB->Fetch_Array($r)) { echo "<tr><td>"; echo "<b class=\"al" . $row['alertlevel'] . "\">"; if (strlen($row['testparam']) > 10) { $tp = substr($row['testparam'], 0, 8) . ".."; } else { $tp = $row['testparam']; } if ($row['testname'] == "") { echo lText($row['testtype']) . " (" . $tp . ")"; } else { echo $row['testname']; } echo "</b>"; echo "</td>"; echo "<td> <a href=localtest.edit.php?localtestid=" . $row['localtestid'] . ">"; echo "<img src=images/options/application.png border=0 title=\"" . $NATS->Lang->Item("edit.options") . "\"></a> "; echo "<a href=localtest.action.php?action=delete&localtestid=" . $row['localtestid'] . ">"; echo "<img src=images/options/action_delete.png border=0 title=\"" . $NATS->Lang->Item("delete") . "\"></a>"; echo " <i>" . $NATS->Lang->Item("last.tested") . ": " . dtago($row['lastrunx']) . "</i>"; echo "</td></tr>"; } if ($nodeside) { $q = "SELECT * FROM fnnstest WHERE nodeid=\"" . ss($_REQUEST['nodeid']) . "\" AND testenabled=1 ORDER BY testtype"; $r = $NATS->DB->Query($q);
np_tiny($_REQUEST['nodeid']); echo "</td></tr></table>"; echo "<br><br>"; echo "<b class=\"subtitle\">" . $NATS->Lang->Item("local.tests") . "</b><br><br>"; echo "<table class=\"nicetable\">"; $q = "SELECT * FROM fnlocaltest WHERE nodeid=\"" . ss($_REQUEST['nodeid']) . "\" ORDER BY localtestid ASC"; $r = $NATS->DB->Query($q); while ($row = $NATS->DB->Fetch_Array($r)) { echo "<tr><td>"; if ($row['testname'] == "") { if (strlen($row['testparam']) > 10) { $tp = substr($row['testparam'], 0, 8) . ".."; } else { $tp = $row['testparam']; } echo lText($row['testtype']); if ($tp != "") { echo " (" . $tp . ")"; } } else { echo $row['testname']; } echo "</td>"; echo "<td><b class=\"al" . $row['alertlevel'] . "\">" . oText($row['alertlevel']) . "</b></td>"; echo "<td>(" . dtago($row['lastrunx']) . ")</td>"; echo "<td>"; if ($row['testrecord'] == 1 || $row['testtype'] == "ICMP") { echo "[ <a href=\"history.test.php?testid=L" . $row['localtestid'] . "\">" . $NATS->Lang->Item("history") . "</a> ]"; } else { echo " "; }
//echo "<div id=\"iconDiv\"></div>"; echo "<br><br>"; $title="<b class=\"sectitle\">Node Tests</b>"; Start_Round($title,600); echo "<table class=\"nicetable\" width=100%>"; $q="SELECT * FROM fnlocaltest WHERE nodeid=\"".ss($_REQUEST['nodeid'])."\" AND testtype!=\"ICMP\" ORDER BY localtestid ASC"; $r=$NATS->DB->Query($q); while ($row=$NATS->DB->Fetch_Array($r)) { echo "<tr><td>"; echo "<b class=\"al".$row['alertlevel']."\">"; if (strlen($row['testparam'])>10) $tp=substr($row['testparam'],0,8).".."; else $tp=$row['testparam']; if ($row['testname']=="") echo lText($row['testtype'])." (".$tp.")"; else echo $row['testname']; echo "</b>"; echo "</td>"; echo "<td> <a href=localtest.edit.php?localtestid=".$row['localtestid'].">"; echo "<img src=images/options/application.png border=0 title=\"Edit Test Options\"></a> "; echo "<a href=localtest.action.php?action=delete&localtestid=".$row['localtestid'].">"; echo "<img src=images/options/action_delete.png border=0 title=\"Delete Test\"></a>"; echo " <i>Last Tested: ".dtago($row['lastrunx'])."</i>"; echo "</td></tr>"; } if ($nodeside) {
function GetTest($testid, $protect = false) { if ($testid == "") { return false; } $class = $testid[0]; if (is_numeric($class)) { // test ID will stay the same $class = "L"; $anytestid = $testid; } else { //$testid=substr($testid,1); // as it will here also so direct use to graphs can be made $anytestid = substr($testid, 1); // the classless version } $q = ""; switch ($class) { case "L": // local tests $q = "SELECT * FROM fnlocaltest WHERE localtestid=" . ss($anytestid) . " LIMIT 0,1"; break; case "N": // node-side test $q = "SELECT * FROM fnnstest WHERE nstestid=" . ss($anytestid) . " LIMIT 0,1"; break; default: return false; // can't lookup this class } if ($q == "") { return false; } $r = $this->DB->Query($q); if (!($row = $this->DB->Fetch_Array($r))) { return false; } $row['class'] = $class; $row['testid'] = $testid; $row['anytestid'] = $anytestid; $row['alerttext'] = oText($row['alertlevel']); $row['lastrundt'] = nicedt($row['lastrunx']); $row['lastrunago'] = dtago($row['lastrunx'], false); if ($row['testname'] != "") { $row['name'] = $row['testname']; } else { if ($class == "L") { $row['name'] = lText($row['testtype']); // TODO OTHER TESTS if ($row['testparam'] != "") { $row['name'] .= " (" . $row['testparam'] . ")"; } } else { if ($class == "N") { if ($row['testdesc'] != "") { $row['name'] = $row['testdesc']; } else { $row['name'] = $row['testtype']; } } } } if ($protect && $class == "L") { if ($this->Tests->Exists($row['testtype'])) { $this->Tests->Tests[$row['testtype']]->Create(); $this->Tests->Tests[$row['testtype']]->instance->ProtectOutput($row); } } $this->DB->Free($r); return $row; }
} else { $nicename = lText($row['testtype']); } echo "<b class=\"subtitle\">" . $NATS->Lang->Item("editing.test") . ": <a href=node.edit.php?nodeid=" . $row['nodeid'] . ">" . $row['nodeid'] . "</a> > " . $nicename . "</b><br><br>"; if (isset($_REQUEST['message'])) { echo "<b>" . $_REQUEST['message'] . "</b><br><br>"; $poplist[] = $_REQUEST['message']; } $title = "<b class=\"sectitle\">" . $NATS->Lang->Item("test.settings") . "</b>"; Start_Round($title, 600); echo "<table border=0 width=100%>"; echo "<form action=localtest.action.php method=post>"; echo "<input type=hidden name=localtestid value=" . $_REQUEST['localtestid'] . ">"; echo "<input type=hidden name=action value=save_form>"; echo "<tr><td><b>" . $NATS->Lang->Item("test.type") . ": </b></td>"; echo "<td><b>" . lText($row['testtype']); echo "</b></td></tr>"; echo "<tr><td colspan=2><hr class=\"nspacer\"></td></tr>"; echo "<tr><td valign=top align=left>" . $NATS->Lang->Item("test.options") . ":</td><td>"; // new style multi-param options switch ($row['testtype']) { case "web": case "wsize": case "wtime": echo $NATS->Lang->Item("url") . ": <input type=text name=testparam size=30 maxlength=128 value=\"" . $row['testparam'] . "\"><br>"; echo "<i>" . $NATS->Lang->Item("full.url") . "</i>"; break; case "icmp": case "ping": echo $NATS->Lang->Item("host.ip") . ": <input type=text name=testparam size=30 maxlength=128 value=\"" . $row['testparam'] . "\"><br>"; echo "<i>" . $NATS->Lang->Item("host.ip.lookup") . "</i>";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo lText('binuli.ge'); ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <LINK REL="SHORTCUT ICON" HREF="image/favicon.ico"/> <link rel="stylesheet" type="text/css" href="<?php echo base_url_admin; ?> /template/css/style.css"> <link rel="stylesheet" type="text/css" href="<?php echo base_url_admin; ?> /PgwSlider-master/pgwslider.css"> <?php include_once 'template/js.php'; ?> <script src="<?php echo base_url_admin; ?> /PgwSlider-master/pgwslider.js"></script> <script src="<?php echo base_url_admin; ?> /PgwSlider-master/pgwslider.min.js"></script> <script src="<?php
} echo "</select>"; echo "</b><br>"; echo "Display Name: <input type=text name=iname_testdetail size=30 maxlength=64 onclick=\"view_radio_select('testdetail')\"></td></tr>"; echo "<tr><td align=center>"; echo "<input type=radio name=itype value=testgraph id=\"newitem_testgraph\">"; echo "</td><td colspan=3 align=left><b>"; echo "Graph for Test </b>"; echo "<select name=ioption_testgraph onchange=\"view_radio_select('testgraph')\">"; foreach ($tests as $test) { if ($test['testrecord'] > 0 || $test['testtype'] == "ICMP") { echo "<option value=" . $test['testid'] . ">"; if ($test['testname'] != "") { $tn = $test['testname']; } else { $tn = lText($test['testtype']); if ($test['testparam'] != "") { $tn .= " (" . $test['testparam'] . ")"; } } echo $test['nodeid'] . " > " . $tn; echo "</option>"; } } echo "</select><br>"; echo "Show Last <input type=text size=4 maxlength=4 name=ioption_testgraph_time value=24 onclick=\"view_radio_select('testgraph')\"> Hours"; echo "</td></tr>"; echo "<tr><td align=center>"; echo "<input type=radio name=itype value=title id=\"newitem_title\">"; echo "</td><td colspan=3 align=left><b>"; echo "Title: </b><input type=text name=ioption_title size=30 maxlength=120 onclick=\"view_radio_select('title')\">";
$r = $NATS->DB->Query($q); if (!($row = $NATS->DB->Fetch_Array($r))) { header("main.php?message=Error+opening+test+history"); exit; } $tnode = $row['nodeid']; $ttype = $row['testtype']; if (isset($row['testparam'])) { $tparam = $row['testparam']; } else { $tparam = ""; } $tlastrunx = $row['lastrunx']; $tunit = ""; if ($tmode == "local") { $tname = lText($ttype); $tunit = lUnit($ttype); if ($tparam != "") { $tname .= " (" . $tparam . ")"; } if ($row['testname'] != "") { $subtname = $tname; $tname = $row['testname']; $usesubname = true; } else { $usesubname = false; } } else { if ($tmode == "nodeside") { if ($row['testname'] != "") { $tname = $row['testname'];
public function login($post) { if (isset($post['post'])) { $sql = 'SELECT * FROM `users` WHERE `mail`="' . dbstring($post['mail']) . '" AND `password` = "' . md5($post['password']) . '" ORDER BY `id` DESC LIMIT 1'; $res = getOnedb($sql); if (isset($res->id)) { $text = lText('tqven warmatebit gaiaret avtorizacia!'); //message type success $mtype = 2; $_SESSION['mail'] = $post['mail']; } else { $text = lText('paroli da maili sheusabamoa!'); $mtype = 1; } } sendText($text, $mtype); if ($mtype != 2) { $link = getLink('?mp=login'); } else { $link = getLink('?'); } redirect($link); return true; }