function createXls() { $page = getQUERY("page"); $from = getQUERY("from"); $page1 = $page; $req = getQUERY("req"); $req1 = str_replace("**", "&", $req); $url = ""; $temp = explode("&", $req1); $cid = getQUERY("c"); $uid = getQUERY("u"); $sd = substr($temp[1], 3); $ed = substr($temp[2], 3); $lang = substr($temp[0], 2); opendb(); /* format na datum */ $datetimeformat = dlookup("select datetimeformat from users where id=" . $uid); //'Y-m-d h:i:s a'; // $datfor = explode(" ", $datetimeformat); $dateformat = $datfor[0]; $timeformat = $datfor[1]; if ($timeformat == "H:i:s") { $e_ = " 23:59"; $e1_ = "_23:59"; $s_ = " 00:00"; $s1_ = "_00:00"; $tf = " H:i"; } else { $e_ = " 11:59 PM"; $e1_ = "_11:59_PM"; $s_ = " 12:00 AM"; $s1_ = "_12:00_AM"; $tf = " h:i a"; } $sdG = DateTimeFormat($sd, 'd-m-Y H:i:s'); $edG = DateTimeFormat($ed, 'd-m-Y H:i:s'); /* format na datum */ $nameXls = $page1 . '_' . $cid . '_' . DateTimeFormat($sdG, $dateformat) . $s1_ . '_' . DateTimeFormat($edG, $dateformat) . $e1_ . '.xls'; $url = $page . "1.php?l=" . $lang . "&u=" . $uid . "&c=" . $cid . "&sd=" . DateTimeFormat($sd, "d-m-Y") . "%2000:00:00&ed=" . DateTimeFormat($ed, "d-m-Y") . "%2023:59:00&from=s"; closedb(); if ($from == "s") { $handle = fopen('../savePDF/' . $nameXls, 'w+') or die('Cannot open file: ' . $nameXls); $data = file_get_contents("http://panorama.gps.mk/settings/" . $url); fwrite($handle, $data); fclose($handle); echo $nameXls; } }
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; $_routeID = getQUERY("id"); $str = ""; opendb(); //echo "select ND.rbr, PP.ID, ST_X(pp.geom) lat, ST_Y(pp.geom) long, PP.Name from pointsofinterest PP left join rNalogDetail ND on PP.ID=ND.ppid where PP.ID in (select ND.ppid from rNalogDetail ND where ND.hederID=" . $_routeID . ") and pp.clientid=" . session("client_id") . " ND.hederID=" . $_routeID . " order by ND.rbr asc"; //exit; //$type = dlookup("select type from pointsofinterest where id = (select ppid from rNalogDetail where hederid=" . $_routeID . " limit 1)"); $str1 = ""; $str1 .= " (select ND.rbr, PP.ID, st_y(st_centroid(geom)) long, st_x(st_centroid(geom)) lat, PP.Name, PP.type "; $str1 .= " from pointsofinterest PP left join rNalogDetailpre ND on PP.ID=ND.ppid "; $str1 .= " where pp.active='1' and PP.type=2 and PP.ID in (select ND.ppid from rNalogDetailpre ND where ND.hederID=" . $_routeID . ") and "; $str1 .= " pp.clientid=" . session("client_id") . " and ND.hederID=" . $_routeID . " order by ND.rbr asc) "; $str1 .= " union "; $str1 .= " (select ND.rbr, PP.ID, st_y(st_centroid(geom)) long, st_x(st_centroid(geom)) lat, PP.Name, PP.type "; $str1 .= " from pointsofinterest PP left join rNalogDetailpre ND on PP.ID=ND.ppid "; $str1 .= " where pp.active='1' and PP.type=3 and PP.ID in (select ND.ppid from rNalogDetailpre ND where ND.hederID=" . $_routeID . ") and "; $str1 .= " pp.clientid=" . session("client_id") . " and ND.hederID=" . $_routeID . " order by ND.rbr asc) "; $str1 .= " union "; $str1 .= " (select ND.rbr, PP.ID, ST_X(ST_Transform(pp.geom,4326)) long, ST_Y(ST_Transform(pp.geom,4326)) lat, PP.Name, PP.type "; $str1 .= " from pointsofinterest PP left join rNalogDetailpre ND on PP.ID=ND.ppid "; $str1 .= " where pp.active='1' and PP.type=1 and PP.ID in (select ND.ppid from rNalogDetailpre ND where ND.hederID=" . $_routeID . ") and "; $str1 .= " pp.clientid=" . session("client_id") . " and ND.hederID=" . $_routeID . " order by ND.rbr asc) order by 1"; $dsR = query($str1); //$dsR = query("select ND.rbr, PP.ID, st_y(st_centroid(geom)) long, st_x(st_centroid(geom)) lat, PP.Name, PP.type from pointsofinterest PP left join rNalogDetail ND on PP.ID=ND.ppid where PP.ID in (select ND.ppid from rNalogDetail ND where ND.hederID=" . $_routeID . ") and pp.clientid=" . session("client_id") . " and ND.hederID=" . $_routeID . " order by ND.rbr asc");
$metric = pg_fetch_result($dsUsersSett, 0, 'metric'); $currency = pg_fetch_result($dsUsersSett, 0, 'currency'); $currencyvalue = dlookup("select value from currency where name='" . $currency . "'"); $currency = strtolower($currency); if ($metric == 'mi') { $metricvalue = 0.621371; $speedunit = "mph"; } else { $metricvalue = 1; $speedunit = "Km/h"; } $Allow = getPriv("idlingreport", session("user_id")); if ($Allow == False) { echo header('Location: ../permission/?l=' . $cLang); } $vh = getQUERY("v"); $datetimeformat = pg_fetch_result($dsUsersSett, 0, 'datetimeformat'); $datfor = explode(" ", $datetimeformat); $dateformat = $datfor[0]; $timeformat = $datfor[1]; if ($timeformat == 'h:i:s') { $timeformat = $timeformat . " a"; } if ($timeformat == "H:i:s") { $e_ = " 23:59"; $e1_ = "_23:59"; $s_ = " 00:00"; $s1_ = "_00:00"; $tf = " H:i"; } else { $e_ = " 11:59 PM";
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; session_start(); opendb(); $opis = getQUERY("o"); $rbr = getQUERY("rbr"); $h = getQUERY("h"); $ppid = getQUERY("ppid"); $pointkm = getQUERY("pointkm"); $pointtime = getQUERY("pointtime"); $sqlInsert = "insert into rnalogdetailpre (opis, ppid, hederid, rbr, poikm, poitime) values ('" . $opis . "', " . $ppid . ", " . $h . ", " . $rbr . ", " . $pointkm . ", " . $pointtime . ") "; runsql($sqlInsert); print "OK"; closedb();
<?php include "../include/db.php"; include "../include/functions.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php session_start(); header("Content-type: text/html; charset=utf-8"); ?> <?php $table = getQUERY("table"); $id = getQUERY("id"); opendb(); RunSQL("delete from " . $table . " where id = " . $id); if ($table == 'fmCosts') { RunSQL("delete from newcosts where costtypeid = " . $id); } closedb();
$sofer2 = getQUERY("d2"); $sofer3 = getQUERY("d3"); $datum = getQUERY("d"); $vreme = getQUERY("v"); $alarm = getQUERY("alarm"); $zadrz = getQUERY("zadrz"); $pause1 = getQUERY("pause1"); $pause2 = getQUERY("pause2"); $pause3 = getQUERY("pause3"); $pause4 = getQUERY("pause4"); $pause5 = getQUERY("pause5"); /*Za ZKPelagonija*/ $culid = nnull(getQUERY("culid"), 0); /*Za ZKPelagonija*/ $totalkm = getQUERY("totalkm"); $totaltime = getQUERY("totaltime"); if ($alarm == "/") { $alarm = 0; } if ($zadrz == "/") { $zadrz = 0; } //dim dat() as string = split(datum,"-") //dim datum1 = dat(2) & "-" & dat(1) & "-" & dat(0) $tmpDT = new DateTime($datum . ' ' . $vreme); $tmpDT = $tmpDT->format("Y-m-d H:i:s"); $sqlInsert = "insert into rnalogheder (datetime, VehicleID, DriverID1, DriverID2, DriverID3, StartDate, Name, ClientID, userID, Alarm, toStay, Pause1, Pause2, Pause3, Pause4, Pause5, TotalKm, TotalTime, culid) "; $sqlInsert .= " Values (now(), " . $vozilo . ", " . $sofer1 . ", " . $sofer2 . ", " . $sofer3 . ", '" . $tmpDT . "', '" . $naslov . "', " . session("client_id") . ", " . session("user_id") . ", " . $alarm . ", " . $zadrz . ", " . $pause1 . ", " . $pause2 . ", " . $pause3 . ", " . $pause4 . ", " . $pause5 . ", " . $totalkm . ", " . $totaltime . ", " . $culid . " )"; //$dsInsert = query($sqlInsert); $dsInsert = dlookup($sqlInsert . " RETURNING id"); //$dsInsert1 = query("select id from rnalogheder order by id desc limit 1");
<?php include "../include/db.php"; include "../include/functions.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php header("Content-type: text/html; charset=utf-8"); ?> <?php opendb(); $action = nnull(getQUERY("action"), ""); if ($action == 'delete') { } if ($action == 'read') { } closedb(); exit;
<link href="../css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" /> <!--script src="js/jquery-ui-timepicker-addon.js" type="text/javascript"></script--> <script src="../js/jquery-ui.js"></script> <script src="../js/jquery-ui-timepicker-addon.js" type="text/javascript"></script> <body> <?php $LastDay = DateTimeFormat(addDay(-1), "d-m-Y"); $vehID_ = getQUERY("vehid"); $tpoint = getQUERY("tpoint"); opendb(); $reg = ""; //dlookup("select registration from vehicles where id=" . $vehID); $cLang = getQUERY("l"); ?> <table class="text2_" width=400px align="center" style="padding-top: 13px; margin-left:60px"> <tr> <td width=160px style="font-size:13px" ><b><?php echo dic_("Reports.ChooseCost"); ?> :</b></td> <td style="padding-left:0px"> <input id="searchCost" type="text" onkeyup="OnKeyPressSearchCost(event.keyCode)" onclick="OnKeyPressSearchCost()" onblur="hideSearchCost()" style="margin-top:5px; color: #2F5185; font-family: Arial,Helvetica,sans-serif; font-size: 11px; height:25px; border: 1px solid #CCCCCC; border-radius: 5px 5px 5px 5px; width:180px; padding-left:5px"/> <div class="corner5" style="color:#2F5185; opacity:1; padding:5px; background-color:#fff; display:none; position:absolute; border:1px solid #CCCCCC; width:170px;height: 74px; float:left; overflow-y: auto; z-index:9999" id="listCost"> <a id="a-F" class="" onmouseover="overDiv('F')" onmouseout="outDiv('F')" style="cursor:pointer; color:#2F5185; width:100%; display: inline-block; float:left; padding-left:3px" onclick=""> <span onclick="OnCLickCost('F')"><?php echo dic_("Reports.Fuel"); ?>
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; set_time_limit(0); opendb(); $vehid = getQUERY("vehid"); $lon = getQUERY('lon'); $lat = getQUERY('lat'); $_name = nnull(utf8_urldecode(getQUERY('name')), ""); $_description = nnull(utf8_urldecode(getQUERY('description')), ""); $garminid = dlookup("select coalesce((select garminid from stopstatus where toid=" . $vehid . " order by datetime desc limit 1), 0)"); $garminid = $garminid + 1; $sqlAddPoi = "insert into stopstatus (fromid, toid, clientid, userid, datetime, text, garminid, latitude, longitude, location) values"; $sqlAddPoi .= "(" . session("user_id") . ", " . $vehid . ", " . session("client_id") . ", " . session("user_id") . ", now(),"; $sqlAddPoi .= "'" . $_name . "', " . $garminid . ", " . $lat . ", " . $lon . ", '" . $_description . "')"; $ret = RunSQL($sqlAddPoi); echo $garminid; closedb();
<script type="text/javascript" src="../js/OpenLayers.js"></script> <!--Marjan--> <link rel="stylesheet" href="../css/mlColorPicker.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript" src="../js/mlColorPicker.js"></script> <!--Marjan--> <script type="text/javascript"> top.ShowWait(); </script> <?php opendb(); $DefMap = nnull(dlookup("select defaultmap from users where id=" . session("user_id")), 1); $cntz = dlookup("select count(*) from pointsofinterest where clientid=" . session("client_id")); $dsStartLL = query("select * from cities where id = (select cityid from clients where id=" . session("client_id") . " limit 1)"); $idGroup = getQUERY("id"); $cntRows1 = dlookup("select count(*) from pointsofinterest where type = 1 and groupid=" . $idGroup); $cntRows2 = dlookup("select count(*) from pointsofinterest where type = 2 and groupid=" . $idGroup); $glavnoQuery = query("select st_x(st_transform(geom, 4326)) lon, st_y(st_transform(geom, 4326)) lat, type,groupid from pointsofinterest where type = 1 and groupid =" . $idGroup); $type = pg_fetch_result($glavnoQuery, 0, "type"); if ($type == "1") { $dsPp = query("select id,st_x(st_transform(geom, 4326)) lon, st_y(st_transform(geom, 4326)) lat, type,groupid from pointsofinterest where type = 1 and groupid =" . $idGroup); $idTocka = pg_fetch_result($dsPp, 0, "id"); $boicka = pg_fetch_result($dsPp, 0, "groupid"); if ($boicka == "1") { $boja2 = "ff0000"; } else { $boja = query("select * from pointsofinterestgroups where clientid=" . session("client_id") . " and id = " . $boicka . ""); $boja2 = pg_fetch_result($boja, 0, "fillcolor"); } $sLon = pg_fetch_result($dsPp, 0, "lon");
<body> <?php //$cLang = getQUERY('lang'); ?> <div id="div-add" style="display:none" title=""></div> <div id="dialog-message" title="<?php echo dic("Reports.Message"); ?> " style="display:none"> <p> <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span> <div id="div-msgbox" style="font-size:14px"></div> </p> </div> <?php $id = getQUERY('id'); opendb(); $code = NNull(DlookUP("select Code from organisation where id=" . $id), ""); $name = NNull(DlookUP("select Name from organisation where id=" . $id), ""); $desc = NNull(DlookUP("select Description from organisation where id=" . $id), ""); ?> <table style="padding-left:20px;" class="text2_" width=50%> <tr style="height:10px"></tr> <tr > <td width=20% style="font-weight:bold"><?php dic("Fm.Code"); ?> :</td> <td width=30% style="padding-left:10px"><input id="code" value="<?php
$ret = query("select cachetaxiparams2('" . $sdH . "', '" . $edH . "', ' clientid = " . $cid . "')"); } } } else { $date = nnull(getQUERY("date"), ''); if ($date != '') { $date = DateTimeFormat($date, 'Y-m-d'); $sd = $date . " 00:00:00"; $ed = $date . " 23:59:59"; $ret = query("select cachereportsparams('" . $sd . "', '" . $ed . "', ' clientid = " . $cid . "')"); if ($clienttypeid == 2) { $ret = query("select cachetaxiparams1('" . $sd . "', '" . $ed . "', ' clientid = " . $cid . "')"); $ret = query("select cachetaxiparams2('" . $sd . "', '" . $ed . "', ' clientid = " . $cid . "')"); } } else { $dayType = getQUERY("dayType"); $from = '00:00:00'; //getQUERY("from"); $to = '23:59:59'; //getQUERY("to"); $f = addToDate(now(), -1, "months"); while ($f < now()) { //ponedelnik-nedela if ($dayType >= 1 and $dayType <= 7) { if ($dayType == 7) { if (DateTimeFormat($f, 'w') == 0) { $ret = query("select cachereportsparams('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')"); if ($clienttypeid == 2) { $ret = query("select cachetaxiparams1('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')"); $ret = query("select cachetaxiparams2('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')"); }
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; session_start(); $userID = getQUERY("uid"); $lista = getQUERY("lista"); $lista1 = explode(",", $lista); $list1 = ''; for ($i = 0; $i < sizeof($lista1); $i++) { $list1 = $list1 . "'1'"; if ($i < sizeof($lista1) - 1) { $list1 = $list1 . ','; } } opendb(); RunSQL("delete from privilegessettings where userID = " . $userID); RunSQL("insert into privilegessettings (userid," . $lista . ") values (" . $userID . "," . $list1 . ")"); print "Ok"; closedb();
<script type="text/javascript" src="./js/highcharts.src.js"></script> <link href="../css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-ui.js"></script> <script src="../report/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script> </head> <?php $name = getQUERY("name"); $dtfrom = getQUERY("dtfrom"); $dtto = getQUERY("dtto"); $vozilo = getQUERY("vozilo"); $sofer = getQUERY("sofer"); $alarm = getQUERY("alarm"); $poiid = getQUERY("poiid"); if ($alarm == "/") { $alarm = 0; } /*echo "name=".$name."<br/>"; echo "dtfrom=".$dtfrom."<br/>"; echo "dtto=".$dtto."<br/>"; echo "vozilo=".$vozilo."<br/>"; echo "sofer=".$sofer."<br/>"; echo "alarm=".$alarm."<br/>"; echo "poiid=".$poiid."<br/>"; exit;*/ $user_id = session("user_id"); opendb(); $dsAll = query("select u.cityid, defaultmap, datetimeformat, timezone, metric, cl.clienttypeid, ci.latitude, ci.longitude, cl.allowedrouting, cl.allowedfm, cl.allowedmess, cl.allowedalarms from users u left outer join clients cl on cl.id = u.clientid left outer join cities ci on ci.id = cl.cityid where u.id = " . session("user_id")); $clientUnit = pg_fetch_result($dsAll, 0, "metric");
<?php ob_start(); header("Content-type: text/html; charset=utf-8"); include "../include/functions.php"; include "../include/db.php"; include "../include/params.php"; include "../include/dictionary2.php"; if (!is_numeric(session('user_id'))) { echo header('Location: ../sessionexpired/?l=' . $cLang); } $clientid = session("client_id"); $q = getQUERY("q"); $q1 = $q; $healthy = array("a", "b", "v", "g", "d", "g", "e", "z", "z", "dz", "i", "j", "k", "l", "lj", "m", "n", "nj", "o", "p", "r", "s", "t", "k", "u", "f", "h", "c", "c", "gz", "s"); $yummy = array("а", "б", "в", "г", "д", "ѓ", "е", "ж", "з", "ѕ", "и", "ј", "к", "л", "љ", "м", "н", "њ", "о", "п", "р", "с", "т", "ќ", "у", "ф", "х", "ц", "ч", "џ", "ш"); $q1 = mb_strtolower($q1, 'UTF-8'); $q1 = str_replace($healthy, $yummy, $q1); $q = mb_strtolower($q, 'UTF-8'); $q = str_replace($yummy, $healthy, $q); opendb(); // Vraboteni // vaka treba //$allowedUsers = "-1,".dlookup("select getmembers(".session("user_id").", ".$wsid.")"); //ama sega privremeno ke bide //$allowedUsers = "select userid from members where wsid=".$wsid." union all select ".session("user_id")." userid"; $srcStringUser = "******"; $srcStringUser .= "from pointsofinterest where type=1 and active='1' and (lower(name) like '%" . $q . "%' or lower(name) like '%" . $q1 . "%') and clientid=" . $clientid . " order by fullname) "; $srcStringUser .= "union "; $srcStringUser .= "(select id, name fullname, type, st_x(st_centroid(geom)) latitude, st_y(st_centroid(geom)) longitude "; $srcStringUser .= "from pointsofinterest where type=2 and active='1' and (lower(name) like '%" . $q . "%' or lower(name) like '%" . $q1 . "%') and clientid=" . $clientid . " order by fullname) ";
<?php include "../../include/functions.php"; include "../../include/db.php"; include "../../include/params.php"; header("Content-type: text/html; charset=utf-8"); $page = getQUERY("page"); $page1 = $page; $req = getQUERY("req"); $req1 = str_replace("**", "&", $req); $temp = explode("&", $req1); $uid = getQUERY("u"); $cid = getQUERY("c"); $sd = substr($temp[1], 3); $ed = substr($temp[2], 3); $namePDF = $page1 . '_' . $cid . '_' . $sd . '_' . $ed . '.pdf'; $namePDF1 = str_replace(" ", "_", $namePDF); $namePDF1 = str_replace("(", "_", $namePDF1); $namePDF1 = str_replace(")", "_", $namePDF1); $namePDF1 = str_replace("__", "_", $namePDF1); $req1 .= "&c=" . $cid . "&u=" . $uid; if ($page == 'LogReport') { $req1 .= "&foruser="******"foruser"); } $output = shell_exec('xvfb-run --server-args="-screen 0, 1200x800x24" wkhtmltopdf --dpi 300 "panorama.gps.mk/settings/' . $page . 'PDF.php?' . $req1 . '" --redirect-delay 10000 ../../savePDF/' . $namePDF1); echo $namePDF1;
} $toobject = nnull(getQUERY("toobj"), ""); $flag = '0'; $delivery = ""; $deliverycoll = ""; if ($action == 'user') { $fromid = session("user_id"); if ($toobject == 'vehicle') { $toid = nnull(getQUERY("toid"), ""); $toid = dlookup("select id from vehicles where gsmnumber='" . $toid . "'"); } else { $flag = '1'; $toid = nnull(getQUERY("toid"), ""); $delivery = ", now()"; $deliverycoll = ", dtdelivery"; } $garminid = dlookup("select coalesce((select garminid from messages where toid=" . $toid . " order by datetime desc limit 1), 0)"); $garminid = $garminid + 1; } $clientid = session("client_id"); $userid = session("user_id"); $datetime = nnull(getQUERY("dt"), now()); //$datetime = now(); $subject = nnull(getQUERY("subject"), ""); $body = nnull(utf8_urldecode(getQUERY("body")), ""); $checked = '0'; RunSQL("INSERT INTO messages (fromid, toobject, toid, clientid, userid, datetime, subject, body, checked, garminid, flag" . $deliverycoll . ") \r\n\t VALUES (" . $fromid . ", '" . $toobject . "', " . $toid . ", " . $clientid . ", " . $userid . ", \r\n\t '" . $datetime . "', '" . $subject . "', '" . $body . "', " . $checked . ", " . $garminid . ", '" . $flag . "'" . $delivery . ")"); closedb(); echo $garminid; //echo 54336; exit;
//dim allPOI as integer = dlookup("select count(*) from pinpoints where clientID=" & session("client_id")) //Dim allPOIs As String = "false" //If allPOI < 1000 Then allPOIs = "true" $user_id = Session("user_id"); $client_id = Session("client_id"); $roleid = Session("role_id"); $DefMap = pg_fetch_result($dsAll, 0, "defaultmap"); $currDateTime = new Datetime(); $cdt1 = $currDateTime->format("Y-m-d"); $currDateTime = $currDateTime->format("d-m-Y H:i"); $currDateTime1 = new Datetime(); $cdt2 = $currDateTime1->format("Y-m-d"); $currDateTime1 = $currDateTime1->format("d-m-Y"); $dateS = getQUERY("dateS"); $dateE = getQUERY("dateE"); $tourid = getQUERY("tourid"); if ($tourid == "") { if ($dateS == "") { if ($roleid == "2") { if (dlookup("select count(*) from rNalogHeder where clientid=" . $client_id . " and startdate < cast(now() as date) + cast('1 day' as interval)") > 0) { $currDateTime2 = dlookup("select cast(startdate as date) from rNalogHeder where clientid=" . $client_id . " and startdate < cast(now() as date) + cast('1 day' as interval) order by startdate desc limit 1"); } else { $currDateTime2 = ""; } } else { if (dlookup("select count(*) from rNalogHeder where userid=" . $user_id . " and startdate < cast(now() as date) + cast('1 day' as interval)") > 0) { $currDateTime2 = dlookup("select cast(startdate as date) from rNalogHeder where userid=" . $user_id . " and startdate < cast(now() as date) + cast('1 day' as interval) order by startdate desc limit 1"); } else { $currDateTime2 = ""; } }
opendb(); $city = nnull(utf8_urldecode(getQUERY('city')), ""); $country = getQUERY("country"); $elevation = nnull(utf8_urldecode(getQUERY('elevation')), ""); $fullname = nnull(utf8_urldecode(getQUERY('fullname')), ""); $lon = getQUERY("lon"); $lat = getQUERY("lat"); $otime = getQUERY("otime"); $temp = getQUERY("temp"); $feelslike = getQUERY("feelslike"); $wind = getQUERY("wind"); $visibility = getQUERY("visibility"); $weather = nnull(utf8_urldecode(getQUERY("weather")), ""); $humidity = getQUERY("humidity"); $icon = nnull(utf8_urldecode(getQUERY("icon")), ""); $iconurl = nnull(utf8_urldecode(getQUERY("iconurl")), ""); $cntW = dlookup("select count(*) from weatherstations where city='" . $city . "'"); if ($cntW > 0) { $sqlAddW = "UPDATE weatherstations set observationtime='" . $otime . "', temerature=" . $temp; $sqlAddW .= ", feelslike=" . $feelslike . ", weather='" . $weather . "', humidity='" . $humidity; $sqlAddW .= "', visibility=" . $visibility . ", wind=" . $wind . ", icon='" . $icon . "', iconurl='" . $iconurl . "'"; $sqlAddW .= " where city='" . $city . "'"; RunSQL($sqlAddW); echo "update"; } else { $sqlAddW = "INSERT INTO weatherstations (city, country, elevation, fullname, latitude, longitude, observationtime, temerature, feelslike, weather, humidity, visibility, wind, icon, iconurl) VALUES "; $sqlAddW .= "('" . $city . "', '" . $country . "', '" . $elevation . "', '" . $fullname . "', " . $lat . ", " . $lon . ", '" . $otime . "', " . $temp . ", " . $feelslike . ", '" . $weather . "', '" . $humidity . "', " . $visibility . ", " . $wind . ", '" . $icon . "', '" . $iconurl . "')"; RunSQL($sqlAddW); echo "insert"; } closedb();
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; session_start(); $dat = getQUERY("dt"); $reg = getQUERY("reg"); $type = getQUERY("type"); $note = getQUERY("note"); //list($d, $m, $y) = explode('-', $dat); //$a = explode(" ", $y); //$d1 = explode(":", $a[1]); //$d2 = explode(".", $d1[2]); //echo $dat . "<br />"; //echo $d . "_" . $m . "_" . $a[0] . "_" . $d1[0] . "_" . $d1[1] . "_" . $d2[0] . "_" . $d2[1]; //exit; opendb(); $vehID = dlookup("select id from vehicles where registration='" . $reg . "'"); RunSQL("update alarmshistory set note='" . $note . "' where datetime='" . $dat . "' and vehicleid=" . $vehID . " and name='" . $type . "'"); print "Ok"; closedb();
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <script> lang = '<?php echo $cLang; ?> ' </script> <?php $cLang = getQUERY("l"); $tpoint = getQUERY("tpoint"); if ($tpoint == '.') { ?> <script type="text/javascript" src="./main/main.js"></script> <?php } else { ?> <script type="text/javascript" src="../main/main.js"></script> <?php } ?> <body> <script>
<?php include "../include/db.php"; include "../include/functions.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php session_start(); header("Content-type: text/html; charset=utf-8"); ?> <?php $driverID = nnull(getQUERY("driID"), ""); opendb(); $payStr = ""; $payStr .= "<option value='g'>Готово</option>"; $payStr .= "<option value='f'>Фактура</option>"; if ($driverID != "") { $cntCards = dlookup("select count(*) from drivercard where driverid= " . $driverID); } else { $cntCards = 0; } if ($cntCards > 0) { $dsCards = query("select * from drivercard where driverid= " . $driverID); while ($drCards = pg_fetch_array($dsCards)) { $nameCard = dlookup("select cardname from clubcards where id=" . $drCards["cardid"]); $cardID = $drCards["cardid"]; //$payStr .= "<option value='k-" . $cardID . "' selected='selected'>" . $nameCard . "</option>"; $payStr .= "<option value='k-" . $cardID . "' >" . $nameCard . "</option>"; }
* * 1 - празник за сите граѓани на Р.М * 2 - православен празник * 3 - католички празник * 4 - муслимански празник * 5 - празник за албанската заедница * 6 - празник за српската заедница * 7 - празник за ромската заедница * 8 - празник за влашката заедница * 9 - празник за еврејската заедница * 10 - празник за бошњачката заедница * 11 - празник за турската заедница * */ $imePraznik = str_replace("'", "''", NNull($_GET['imePraznik'], '')); $datum = DateTimeFormat(getQUERY("Datum"), 'Y-m-d'); opendb(); $tipDen = str_replace("'", "''", NNull($_GET['tipDen'], '')); //$den = str_replace("'", "''", NNull($_GET['den'], '')); $den = dlookup("select getdayofweek(cast('" . $datum . "' as date))"); $color = str_replace("'", "''", NNull($_GET['boja'], '')); $tipPraznik = str_replace("'", "''", NNull($_GET['tipPraznik'], '')); if ($tipDen == 8) { $proverka = query("select * from companydays"); if (pg_num_rows($proverka) == 0) { $vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor\t,typeofholiday) values(1," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "','" . $tipPraznik . "'); "); } else { $posledno = dlookup("select Max(id)+1 from companydays"); $vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor,typeofholiday) values('" . $posledno . "'," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "','" . $tipPraznik . "'); "); } } else {
include "../include/functions.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php include "../include/db.php"; session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <?php opendb(); $cost = getQUERY("cost"); ?> <body> <div class="text5" style="font-size: 13px"><?php echo dic_('Reports.SureDelCost'); ?> <strong><?php echo $cost; ?> </strong>?</div> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <script> lang = '<?php echo $cLang; ?> ' </script> <?php $messid = getQUERY("messid"); $fromto = getQUERY("fromto"); opendb(); $datetimeformat = dlookup("select datetimeformat from users where id=" . session("user_id")); $datfor = explode(" ", $datetimeformat); $dateformat = $datfor[0]; $timeformat = $datfor[1]; if ($timeformat == 'h:i:s') { $timeformat = $timeformat . " a"; } ?> <body> <?php $mess = query("select * from messages where id= " . $messid); if ($fromto == 'inbox') { RunSQL("update messages set checked='1' where id= " . $messid);
$tzoneUser = $xml->timezone->dstOffset; $url = "http://ws.geonames.org/timezone?lat=41.995900&lng=21.431500"; $xml = simplexml_load_file($url); $tzoneLocal = $xml->timezone->dstOffset; $tzone1 = $tzoneUser - $tzoneLocal;*/ $dsUserSett = query("select tzone, datetimeformat from users where id=" . session("user_id")); $tzone1 = pg_fetch_result($dsUserSett, 0, "tzone"); $FormatDT = pg_fetch_result($dsUserSett, 0, 'datetimeformat'); $FormatDT1 = explode(" ", $FormatDT); $dateformat = $FormatDT1[0]; $timeformat = $FormatDT1[1]; if ($timeformat == 'h:i:s') { $timeformat = $timeformat . " A"; } $numveh = getQUERY("numofveh"); $valtraj = getQUERY("valtraj"); if ($valtraj != -1) { RunSQL("update users set trace = " . $valtraj . " where id=" . session("user_id")); } $dsv = query("select id from vehicles where clientid=" . session("client_id") . " and code='" . $numveh . "'"); $str = ""; $strSQL = "select latitude, longitude, datetime from historylog where vehicleid = " . pg_fetch_result($dsv, 0, "id"); $strSQL .= " and datetime > (select datetime from historylog where vehicleid = " . pg_fetch_result($dsv, 0, "id") . " and datetime <= now() + cast('" . $tzone1 . " hour' as interval) order by datetime desc limit 1)+cast('-' || (select trace from users where id=" . session("user_id") . ") || ' min' as interval)"; $strSQL .= " and datetime <= now() + cast('" . $tzone1 . " hour' as interval) order by datetime asc"; $ds = query($strSQL); //"select latitude, longitude from historylog where vehicleid = " . pg_fetch_result($dsv, 0, "id") . " order by datetime desc"); $str1 = ""; $str2 = ""; $dist = ""; $dt = ""; $alpha = "";
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; session_start(); opendb(); $opis = getQUERY("o"); $rbr = getQUERY("rbr"); $h = getQUERY("h"); $ppid = getQUERY("ppid"); $pointkm = getQUERY("pointkm"); $pointtime = getQUERY("pointtime"); $h1 = getQUERY("h1"); $predefined = getQUERY("predefined"); $sqlInsert = "insert into rnalogdetail (opis, ppid, hederid, rbr, poikm, poitime) values ('" . $opis . "', " . $ppid . ", " . $h . ", " . $rbr . ", " . $pointkm . ", " . $pointtime . ") "; runsql($sqlInsert); if ($predefined . '' == 'true') { $sqlInsert = "insert into rnalogdetailpre (opis, ppid, hederid, rbr, poikm, poitime) values ('" . $opis . "', " . $ppid . ", " . $h1 . ", " . $rbr . ", " . $pointkm . ", " . $pointtime . ") "; runsql($sqlInsert); } print "OK"; closedb();
$tzone = dlookup("select tzone from users where id=" . $uid); $CreationDate = strtoupper(DateTimeFormat(addToDateU(now(), $tzone, "hour", "Y-m-d H:i"), $datetimeformat)); /*format na datum*/ $_SESSION["user_fullname"] = dlookup("select fullname from users where id='" . $uid . "'"); $_SESSION["company"] = dlookup("select name from clients where id in (select clientid from users where id=" . $uid . " limit 1) limit 1"); $langArr = explode("?", getQUERY("l")); $cLang = $langArr[0]; $vh = getQUERY("vh"); $meseci = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $countALL = 0; $langArr = explode("?", getQUERY("l")); $cLang = $langArr[0]; ?> <?php if (getQUERY("from") == "a") { $filename = "Log_report_" . $cid . "_" . DateTimeFormat($sdG, $dateformat) . $s1_ . "_" . DateTimeFormat($edG, $dateformat) . $e1_ . ".xls"; header('Content-type: application/ms-excel; charset=utf-8'); header('Content-Disposition: attachment; filename=' . $filename); } ?> <body> <table> <tr><td colspan=13 style="border:1px solid #000000; font-weight:bold"><strong><?php echo mb_strtoupper(dic_("Reports.Log"), 'UTF-8'); ?> </strong></td></tr> <tr><td colspan=13></td></tr>
$s_ = " 00:00"; $s1_ = "_00:00"; $tf = " H:i"; } else { $e_ = " 11:59 PM"; $e1_ = "_11:59_PM"; $s_ = " 12:00 AM"; $s1_ = "_12:00_AM"; $tf = " h:i a"; } $sd = DateTimeFormat(getQUERY("sd"), $dateformat) . $s_; //'01-09-2012 00:00'; $ed = DateTimeFormat(getQUERY("ed"), $dateformat) . $e_; //'01-09-2012 23:59'; $sdG = DateTimeFormat(getQUERY("sd"), 'd-m-Y H:i:s'); $edG = DateTimeFormat(getQUERY("ed"), 'd-m-Y H:i:s'); $CreationDate = strtoupper(DateTimeFormat(now(), $datetimeformat)); $meseci = array("January1", "February1", "March1", "April1", "May1", "June1", "July1", "August1", "September1", "October1", "November1", "December1"); $idUsers = ""; ?> <body style="margin:0px 0px 0px 0px; padding:0px 0px 0px 0px; overflow:auto"> <div id="report-content" style="width:100%; text-align:left; height:500px; background-color:#fff;" class="corner5"> <div class="corner5" style="width:98%; border:1px solid #bbb; background-color:#fafafa; margin-left:1%"> <div style="padding-left:40px; padding-top:10px; width:500px" class="textTitle"> <?php echo mb_strtoupper(dic_("Reports.ReportFor") . ' ' . dic_("Settings.MessagesNew"), 'UTF-8'); ?> <br><br> <span class="text5"> <?php
<link href="../css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-ui.js"></script> <script src="../report/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="../tracking/live.js"></script> <script type="text/javascript" src="../tracking/live1.js"></script> <script type="text/javascript" src="../js/OpenLayers.js"></script> </head> <?php $sd = DateTimeFormat(getQUERY('sd'), 'Y-m-d 00:00:00'); $ed = DateTimeFormat(getQUERY('ed'), 'Y-m-d 23:59:59'); $vehid = getQUERY('vehid'); $culid = getQUERY('culid'); opendb(); $metric = dlookup("select metric from users where id=" . session("user_id")); if ($metric == 'mi') { $metricvalue = 0.621371; $metricvalue1 = 1.0936; $speedunit = "mph"; $metric1 = "yards"; } else { $metricvalue = 1; $metricvalue1 = 1; $speedunit = "Km/h"; $metric1 = "m"; } ?>