Beispiel #1
0
" width="16%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php 
            echo nnull($drOU["name"], "/");
            ?>
</td>          
                <td id="_td-4-<?php 
            echo $cnt_;
            ?>
" width="16%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php 
            echo DateTimeFormat($drOD["borndate"], $dateformat);
            ?>
</td>
                <td id="_td-5-<?php 
            echo $cnt_;
            ?>
" width="12%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php 
            echo nnull($drOD["licensetype"], "/");
            ?>
</td>
                <td id="_td-6-<?php 
            echo $cnt_;
            ?>
" width="15%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php 
            echo DateTimeFormat($drOD["licenseexp"], $dateformat);
            ?>
</td>
                <td id="_td-7-<?php 
            echo $cnt_;
            ?>
" width="8%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;">
                    <button id="_modBtn-<?php 
            echo $cnt_;
Beispiel #2
0
$naslov = getQUERY("n");
$vozilo = getQUERY("vo");
$sofer1 = getQUERY("d1");
$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 . " )";
Beispiel #3
0
    }
    ?>
 width:<?php 
    echo $width;
    ?>
%; font-size:11px; padding-left:3px" align="left" class="corner5 text5 <?php 
    echo $classTr;
    ?>
 colZone"><span id="spanZone-<?php 
    echo $drVehicle["id"];
    ?>
" onmousemove="ShowPopup(event, '<span class=\'text5\'><?php 
    echo dic("Reports.CurrZone");
    ?>
</span>')" onmouseout="HidePopup()"><?php 
    echo nnull(pg_fetch_result($dsCurrPos, 0, "zonenames"), "/");
    ?>
</span></td>
	              <?php 
    if ($clientType == 2) {
        $dsTaxiData = query("select count(*) cnt, sum(price) price, sum(pricewith) pricewith from reporttaxi where vehicleid=" . $drVehicle["id"] . " and startdate between '" . DateTimeFormat(now(), "Y-m-d 00:00:00") . "' and '" . DateTimeFormat(now(), "Y-m-d H:i:s") . "'");
        ?>
		            <td style="<?php 
        echo $dntoursS;
        ?>
; width:6%; font-size:11px;" align="center" class="corner5 text5 <?php 
        echo $classTr;
        ?>
 colNTours">
		            	<span id="spanCntTours-<?php 
        echo $drVehicle["id"];
Beispiel #4
0
	<script type="text/javascript" src="../js/jquery.js"></script>
	<script type="text/javascript" src="../js/iScroll.js"></script>
	<script type="text/javascript" src="../js/jquery-ui.js"></script>
	<script type="text/javascript" src="../js/settings.js"></script>
	<script type="text/javascript" src="../js/share.js"></script>
    <link href="../tracking/mlColorPicker.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../tracking/mlColorPicker.js" ></script>
    <script type="text/javascript" src="../main/main.js"></script>
    
</head>

<?php 
if (session('user_id') == "261") {
    echo header('Location: ../sessionexpired/?l=' . $cLang);
}
if (is_numeric(nnull(session("user_id")) . "") == false) {
    echo header('Location: ../sessionexpired/?l=' . $cLang);
}
opendb();
$sqlV = "";
if (session("role_id") == "2") {
    $sqlV = "select id from vehicles where clientID=" . session("client_id");
} else {
    $sqlV = "select vehicleID from uservehicles where userID=" . session("user_id") . "";
}
$Allow = getPriv("settings", session("user_id"));
if ($Allow == false) {
    echo header('Location: ../?l=' . $cLang . '&err=permission');
}
$AllowUSettings = true;
//getPriv("UserSettings", session("user_id"));
Beispiel #5
0
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();
Beispiel #6
0
<?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();
Beispiel #7
0
function DateTimeFormat($date, $format)
{
    return date_format(new Datetime(nnull($date, date($format))), $format);
}
Beispiel #8
0
        $pastKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId . " and Datetime >= '" . $lastDateKm . "' and Datetime <= '" . DateTimeFormat($LastDay, "Y-m-d" . " 23:59:59") . "'"), 0);
        $Km = nnull(dlookup("select km from currkm where vehicleid=" . $vehId), 0);
        $proKm = $pastKm + $Km;
    } else {
        $proKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId), 0);
    }
} else {
    if ($lastDateKm != "") {
        if ($lastDateKm <= $dt) {
            $pastKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId . " and Datetime >= '" . $lastDateKm . "' and Datetime <= '" . DateTimeFormat($dt, "Y-m-d" . " 23:59:59") . "'"), 0);
            $Km = nnull(dlookup("select km from currkm where vehicleid=" . $vehId), 0);
            $proKm = $pastKm + $Km;
        } else {
            $proKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId . " and Datetime <= '" . DateTimeFormat($dt, "Y-m-d" . " 23:59:59") . "' "), 0);
        }
        /*$pastKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId . " and Datetime >= '" . DateTimeFormat($lastDateKm, "Y-m-d H:i:s") . "' and Datetime <= '" . DateTimeFormat($dt, "Y-m-d" . " 23:59:59") . "'"), 0);
          $Km = nnull(dlookup("select km from currkm where vehicleid=" . $vehId), 0);
          $proKm = $pastKm + $Km;*/
    } else {
        $proKm = nnull(dlookup("select SUM(distance)/1000 from rshortreport where vehicleid=" . $vehId . " and Datetime <= '" . DateTimeFormat($dt, "Y-m-d" . " 23:59:59") . "' "), 0);
    }
}
$metric = dlookup("select metric from users where id=" . session("user_id"));
if ($metric == 'mi') {
    $metricvalue = 0.621371;
} else {
    $metricvalue = 1;
}
closedb();
echo number_format(round($proKm * $metricvalue, 0));
exit;
Beispiel #9
0
?>

<?php 
session_start();
header("Content-type: text/html; charset=utf-8");
?>

<?php 
$vehID = getQUERY("vehID");
$dt = DateTimeFormat(getQUERY("dt"), 'Y-m-d H:i:s');
$driver = nnull(getQUERY("driver"), "");
$km = getQUERY("km");
$loc = getQUERY("loc");
$liters = nnull(getQUERY("liters"), 0);
$litersLast = nnull(getQUERY("litersLast"), 0);
$price = nnull(getQUERY("price"), 0);
$pay = getQUERY("pay");
opendb();
$checkCnt = dlookup("select count(*) from fuel where vehicleid=" . $vehID . " and datetime = '" . $dt . "' and driverid=" . $driver . "\r\n\tand km = " . $km . " and price = " . $price . " and liters = " . $liters . " and literslast = " . $litersLast . " and pay = '" . $pay . "' and location = '" . $loc . "'");
if ($checkCnt == 0) {
    if ($driver == "") {
        RunSQL("INSERT INTO fuel (vehicleid, datetime, km, price, liters, literslast, pay, location) \r\n\t\t    VALUES (" . $vehID . ", '" . DateTimeFormat($dt, "Y-m-d H:i:s") . "', " . $km . ", " . $price . ", " . $liters . ", \r\n\t\t    " . $litersLast . ", '" . $pay . "','" . $loc . "')");
    } else {
        RunSQL("INSERT INTO fuel (vehicleid, datetime, driverid, km, price, liters, literslast, pay, location) \r\n\t\t    VALUES (" . $vehID . ", '" . DateTimeFormat($dt, "Y-m-d H:i:s") . "', " . $driver . ", " . $km . ", " . $price . ", " . $liters . ", \r\n\t\t    " . $litersLast . ", '" . $pay . "', '" . $loc . "')");
    }
    echo 1;
} else {
    echo 0;
}
closedb();
exit;
Beispiel #10
0
<?php include "../include/db.php" ?>

<?php include "../include/params.php" ?>
<?php include "../include/dictionary2.php" ?>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
lang = '<?php echo $cLang?>';
</script>
  

<?php
    opendb();  
	$clienttypeid = dlookup("select clienttypeid from clients where id = " . session("client_id"));
	$metric = nnull(dlookup("select metric from users where id = " . session("user_id")), "1");	
	if ($metric == 'mi') {
		$value = 0.621371;
	}	else {
		$value = 1;
	 }
	If ($metric == "Km" or $metric == 'km') {
	 $unitSpeed = "Km/h";
	} Else {
	 $unitSpeed = "mph";
	}
    $id = str_replace("'", "''", NNull($_GET['id'], ''));
	$dsedit = query("select * from alarms where id=" . $id . " and clientid = " . Session("client_id"));
    $tipotnaAlarmot = pg_fetch_result($dsedit, 0, "poiid");
?>
<script type="text/javascript">
Beispiel #11
0
<?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 
$datetime = getQUERY("dt");
$driver = nnull(getQUERY("driver"), "");
$veh = getQUERY("veh");
$km = getQUERY("km");
$type = getQUERY("type");
$loc = getQUERY("loc");
$desc = getQUERY("desc");
$comp = getQUERY("comp");
$price = getQUERY("price");
$pay = getQUERY("pay");
if (is_numeric($km) == false) {
    $km = "0";
}
if (is_numeric($price) == false) {
    $price = "0";
}
if ($type == 0) {
    $type = "Associate";
if (session('user_id') == "261") {
    echo header('Location: ../sessionexpired/?l=' . $cLang);
}
if (!is_numeric(session('user_id'))) {
    echo header('Location: ../sessionexpired/?l=' . $cLang);
}
$user_id = session("user_id");
$client_id = session("client_id");
opendb();
$dsAll = query("select defaultmap, datetimeformat, timezone, idleover, 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 = " . $user_id);
$allowedrouting = pg_fetch_result($dsAll, 0, "allowedrouting");
$allowedFM = pg_fetch_result($dsAll, 0, "allowedfm");
$allowedMess = pg_fetch_result($dsAll, 0, "allowedmess");
$allowedAlarms = pg_fetch_result($dsAll, 0, "allowedalarms");
$vh = nnull(getQUERY("v"), "0");
$mins = nnull(getQUERY("mins"), "0");
$DefMap = pg_fetch_result($dsAll, 0, "defaultmap");
$clientUnit = pg_fetch_result($dsAll, 0, "metric");
//$DefMap = "GOOGLEM";
$CPosition = "";
$strLon = "";
$strLat = "";
$AllowedMaps = "";
$MinMin = 1;
$strTaxi = "";
$strPas = "";
$sLon = "21.432767";
$sLat = "41.996434";
$isEmpty = 0;
$cntIgn = dlookup("select count(portname) from vehicleport where vehicleid=" . $vh . " and porttypeid=1");
if ($cntIgn == 0) {
Beispiel #13
0
$sql_ .= "left outer join vehicles v on v.id=hl.vehicleid ";
$sql_ .= "where hl.datetime='" . $dat . "' and hl.vehicleid=" . $vehID;
//$strLM = "select status, latitude, longitude, speed, " . $ign . " ignition, location, poinames, poiids from historylog where datetime='" . $dat . "' and vehicleid=" . $vehID;
$dsH = query($sql_);
//echo "select status, latitude, longitude, speed, " . $ign . " ignition, location, poinames, poiids from historylog where datetime='" . $dat . "' and vehicleid=" . $vehID;
//exit;
$status = pg_fetch_result($dsH, 0, "status");
$speed = pg_fetch_result($dsH, 0, "speed");
$sedista = pg_fetch_result($dsH, 0, "sedista");
$location = pg_fetch_result($dsH, 0, "location");
$poiname = pg_fetch_result($dsH, 0, "poinames");
$poiids = pg_fetch_result($dsH, 0, "poiids");
$ignition = pg_fetch_result($dsH, 0, $ign);
$sLon = pg_fetch_result($dsH, 0, "longitude");
$sLat = pg_fetch_result($dsH, 0, "latitude");
$tzone = nnull(dlookup("select timezone from users where id=" . $uid), 1);
$tzone = $tzone - 1;
$DFormat1 = "dd-MM-yyyy";
//nnull(dlookup("select DateFormat from usersettings where userid=" . $uid),"dd-MM-yyyy");
$TFormat1 = "24 Hour Time";
//nnull(dlookup("select TimeFormat from usersettings where userid=" . $uid),"24 Hour Time");
$TFormat = "";
$DFormat = "";
if ($DFormat1 == "dd-MM-yyyy") {
    $DFormat = "d-m-Y";
} else {
    if ($DFormat1 == "yyyy-MM-dd") {
        $DFormat = "Y-m-d";
    } else {
        $DFormat = "m-d-Y";
    }
Beispiel #14
0
             <td align=center style="background-color:#E5E3E3; border:1px dotted #2f5185; width:67px; color:#ff6633; font-weight:bold;"><?php dic("Fm.Delete") ?></td>
          </tr>

          <?php

          while ($drAd=pg_fetch_array($dsAD)) {
         		 $idDriver = $drAd["driverid"];
                 $cntDr = dlookup("select count(*) from drivers where ID=" . $idDriver);
         		 $sqlDrivers = "select fullname, code from drivers where id=" . $idDriver;
          		 $dsDrivers = query($sqlDrivers);
                 If ($cntDr > 0) {
          			//drDrivers = dsDrivers.Tables(0).Rows(0)
               ?>
                 <tr id="tr<?php echo $cnt ?>"  style=" color: #2F5185; font-family: Arial,Helvetica,sans-serif; font-size: 11px; ">
                     <td height=25px align=left style="background-color:#fff; border:1px dotted #B8B8B8; padding-left:10px"><?php echo nnull(pg_fetch_result($dsDrivers, 0, "code"), "/") ?></td>
                     <td height=25px align=left style="background-color:#fff; border:1px dotted #B8B8B8; padding-left:10px; width:200px"><?php echo nnull(pg_fetch_result($dsDrivers, 0, "fullname"), "/") ?></td>
                     <td height=25px  align=center style="background-color:#fff; border:1px dotted #B8B8B8; ">
                         <button id="btn<?php echo $cnt ?>" class="btn-driver" style="height:27px; margin-left:8px; margin-right:8px; width:30px" onclick="DelAllowedDriver(<?php echo $cnt ?>, <?php echo $drAd["id"] ?>)"></button>
                     </td>
                 </tr>
          <?php
              		$cnt = $cnt + 1;
     			 } //end if
             } //end while
      	}
		else
		{
        ?>

               <tr><td colspan=3 class="text2" style="font-style:italic"><?php dic("Fm.NoAllDrivers") ?></td></tr>
		<?php
Beispiel #15
0
$clienttypeid = dlookup("select clienttypeid from clients where id = " . $cid);
$holidays = nnull(getQUERY("holidays"), '');
if ($holidays == 1) {
    $dsNonworkingdays = query("select * from nonworkingdays where active='1' and datetime between '" . DateTimeFormat(now(), 'Y') . '-01-01' . " 00:00:00' and '" . DateTimeFormat(now(), 'Y') . '-12-31' . " 23:59:59'");
    while ($drHoliday = pg_fetch_array($dsNonworkingdays)) {
        $sdH = DateTimeFormat($drHoliday["datetime"], 'Y-m-d 00:00:00');
        $edH = DateTimeFormat($drHoliday["datetime"], 'Y-m-d 23:59:59');
        //$r = runsql("insert into test1(lastitem, dt) values ('".$sdH . " - ".$edH . "', '1900-01-01')");
        $ret = query("select cachereportsparams('" . $sdH . "', '" . $edH . "', ' clientid = " . $cid . "')");
        if ($clienttypeid == 2) {
            $ret = query("select cachetaxiparams1('" . $sdH . "', '" . $edH . "', ' clientid = " . $cid . "')");
            $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");
Beispiel #16
0
	            		<br>max: <?php 
    $maxspeed = nnull(round(dlookup("select MAX(speed)from rMaxSpeed where  Datetime>='" . DateTimeFormat(now(), "Y-m-d 00:00:00") . "' and  Datetime<='" . DateTimeFormat(now(), "Y-m-d H:i:s") . "' and vehicleID=" . $drVehicle["id"])), "/");
    echo $maxspeed;
    if ($maxspeed != "/") {
        echo " Km/h";
    }
    ?>
	            	</div>
	            </td>
	            <!--td width=80px style="font-size:11px" align="center" class="corner5 text5 <?php 
    echo $classTr;
    ?>
">
	            	<div>
	            	<?php 
    $maxspeed = nnull(round(dlookup("select MAX(speed)from rMaxSpeed where  Datetime>='" . DateTimeFormat(now(), "Y-m-d 00:00:00") . "' and  Datetime<='" . DateTimeFormat(now(), "Y-m-d H:i:s") . "' and vehicleID=" . $drVehicle["id"])), "/");
    echo $maxspeed;
    if ($maxspeed != "/") {
        echo " Km/h";
    }
    ?>
	            	</div>
	            </td-->
	            <?php 
    if ($clientType == 2) {
        $dsTaxiData = query("select count(*) cnt, sum(price) price, sum(pricewith) pricewith from reporttaxi where vehicleid=" . $drVehicle["id"] . " and startdate between '" . DateTimeFormat(now(), "Y-m-d 00:00:00") . "' and '" . DateTimeFormat(now(), "Y-m-d H:i:s") . "'");
        ?>
		            <td width=60px style="font-size:11px" align="center" class="corner5 text5 <?php 
        echo $classTr;
        ?>
"><div><?php 
Beispiel #17
0
	});
	</script>
	
	<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 . "");
Beispiel #18
0
		<td class="text2 td-row" style="color:<?php echo $fontVeh?>" onclick="hideVeh(<?php echo $tableRow['data']["id"] ?>)">
			<?php
				echo $tableRow['vreg'];
			?>
		</td>
		<td class="text2 td-row la" style="line-height:15px;">
			<?php
			if($tableRow['data']["emails"]!="")	echo str_replace(',', '<br>', $tableRow['data']["emails"]);
			// nema potreba od else &nbsp;
			?>
		</td>
		<?php
		if ($clienttypeid == 6) { ?>
			<td class="text2 td-row la">
			<?php echo nnull($tableRow['data']["sms"], "/")?>
			</td>
		<?php
		}
		?>
		<?php
		if ($allowedSMSvEmail == 1) { ?>
			<td class="text2 td-row la">
			<?php
				if($tableRow['data']["smsviaemail"] != null) {
					$gsse = explode('@',$tableRow['data']["smsviaemail"]);
					echo $gsse[0] . "<br>";
				echo "(<b>" . dlookup("select name from operators where email='" . $gsse[1] . "'") . "</b>)";
				} else echo "/";
			?>
			</td>
Beispiel #19
0
<?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>";
    }
Beispiel #20
0
$sql_ .= "left outer join vehicles v on v.id=hl.vehicleid ";
$sql_ .= "where hl.datetime='" . $dat . "' and hl.vehicleid=" . $vehID;
//$strLM = "select status, latitude, longitude, speed, " . $ign . " ignition, location, poinames, poiids from historylog where datetime='" . $dat . "' and vehicleid=" . $vehID;
$dsH = query($sql_);
//echo "select status, latitude, longitude, speed, " . $ign . " ignition, location, poinames, poiids from historylog where datetime='" . $dat . "' and vehicleid=" . $vehID;
//exit;
$status = pg_fetch_result($dsH, 0, "status");
$speed = pg_fetch_result($dsH, 0, "speed");
$sedista = pg_fetch_result($dsH, 0, "sedista");
$location = pg_fetch_result($dsH, 0, "location");
$poiname = pg_fetch_result($dsH, 0, "poinames");
$poiids = pg_fetch_result($dsH, 0, "poiids");
$ignition = pg_fetch_result($dsH, 0, $ign);
$sLon = pg_fetch_result($dsH, 0, "longitude");
$sLat = pg_fetch_result($dsH, 0, "latitude");
$tzone = nnull(dlookup("select timezone from users where id=" . session("user_id")), 1);
$tzone = $tzone - 1;
$DFormat1 = "dd-MM-yyyy";
//nnull(dlookup("select DateFormat from usersettings where userid=" . session("user_id")),"dd-MM-yyyy");
$TFormat1 = "24 Hour Time";
//nnull(dlookup("select TimeFormat from usersettings where userid=" . session("user_id")),"24 Hour Time");
$TFormat = "";
$DFormat = "";
if ($DFormat1 == "dd-MM-yyyy") {
    $DFormat = "d-m-Y";
} else {
    if ($DFormat1 == "yyyy-MM-dd") {
        $DFormat = "Y-m-d";
    } else {
        $DFormat = "m-d-Y";
    }
Beispiel #21
0
            ?>
</td>
                <td colspan=2><?php 
            echo $act;
            ?>
</td>
                <td colspan=2><?php 
            echo $desc;
            ?>
</td>
                <td><?php 
            echo nnull($drData["ipaddress"], "/");
            ?>
</td>
                <td colspan=6><?php 
            echo nnull($drData["notes"], "/");
            ?>
</td>
       </tr>
                    <?php 
            $cnt++;
        }
        //end while
    } else {
        ?>
                    	
                    	<tr>
                    		<td colspan=13><strong><?php 
        echo DateTimeFormat($_datumCnt, "d") . " " . dic_("Reports." . $meseci[intval(DateTimeFormat($_datumCnt, "m")) - 1] . "") . " " . DateTimeFormat($_datumCnt, "Y");
        ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php 
Beispiel #22
0
<?php 
include "../include/functions.php";
include "../include/db.php";
?>

<?php 
include "../include/params.php";
include "../include/dictionary2.php";
set_time_limit(0);
opendb();
$directionname = nnull(utf8_urldecode(getQUERY('directionname')), "");
$startgoogleaddress = nnull(utf8_urldecode(getQUERY('startgoogleaddress')), "");
$startgeocodeaddress = nnull(utf8_urldecode(getQUERY('startgeocodeaddress')), "");
$startlongitude = getQUERY("startlongitude");
$startlatitude = getQUERY("startlatitude");
$endgoogleaddress = nnull(utf8_urldecode(getQUERY('endgoogleaddress')), "");
$endgeocodeaddress = nnull(utf8_urldecode(getQUERY('endgeocodeaddress')), "");
$endlongitude = getQUERY("endlongitude");
$endlatitude = getQUERY("endlatitude");
$shortlineid = getQUERY('shortlineid');
$fastlineid = getQUERY('fastlineid');
$sqlAddDirection = "insert into directions (userid, clientid, directionname, startgoogleaddress, startgeocodeaddress, \r\n            startlongitude, startlatitude, endgoogleaddress, endgeocodeaddress, \r\n            endlongitude, endlatitude, shortlineid, fastlineid) values";
$sqlAddDirection .= "(" . session("user_id") . ", " . session("client_id") . ", '" . $directionname . "'";
$sqlAddDirection .= ",'" . $startgoogleaddress . "', '" . $startgeocodeaddress . "', " . $startlongitude;
$sqlAddDirection .= "," . $startlatitude . ", '" . $endgoogleaddress . "', '" . $endgeocodeaddress . "'";
$sqlAddDirection .= "," . $endlongitude . ", " . $endlatitude . ", " . $shortlineid . ", " . $fastlineid . ")";
//echo $sqlAddDirection;
$retID = RunSQL($sqlAddDirection);
echo $retID;
closedb();
exit;
Beispiel #23
0
}
$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;
Beispiel #24
0
<?php 
$rep = getQUERY("rep");
$veh = getQUERY("veh");
$range = getQUERY("range");
$per = getQUERY("per");
$day = getQUERY("day");
$date1 = getQUERY("date1");
$saati = getQUERY("saati");
$email = getQUERY("email");
$uid = getQUERY("uid");
$path = getQUERY("path");
$doctype = getQUERY("doctype");
$Today = DateTimeFormat(now(), "Y-m-d H:i:s");
opendb();
$vehID = nnull(dlookup("select id from vehicles where registration = '" . $veh . "'"), 0);
$dayInsert = "";
if ($per == "Weekly") {
    $dayInsert = $day;
}
if ($per == "Daily") {
    $dayInsert = "";
}
if ($per == "Monthly") {
    $dayInsert = $date1;
}
$time = $saati . ":00";
/* echo "insert into Scheduler (clientID, userID, report, vehicle, period, day, time, email, 
   subusers, range, vehID, path, CreationDate) values(" . Session("client_id") . "," . $uid . ",
   '" . $rep . "','" . $veh . "','" . $per . "','" . $dayInsert . "','" . $time . "','" . $email . "','', 
   '" . $range . "', '" . $vehID . "', '" . $path . "', '" . $Today . "');";
Beispiel #25
0
<?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;
Beispiel #26
0
 } else {
     $greenCard = "../images/stikla3.png";
     $actYN = 0;
 }
 if ($rV["visible"] == 1) {
     $activity = "../images/stikla2.png";
 } else {
     $activity = "../images/stikla3.png";
 }
 $_lastReg = explode(" ", DateTimeFormat($rV["lastregistration"], "d-m-Y"));
 $lastReg = $_lastReg[0];
 $fuelType = query("select name from fueltypes where id = (select fueltypeid from vehicles where id=" . $rV["id"] . ")");
 $row1 = pg_fetch_array($fuelType);
 $ld = query('select "DateTime" from currentposition where vehicleid=' . $rV["id"]);
 if (pg_num_rows($ld) > 0) {
     $lastDate = nnull(pg_fetch_result($ld, 0, 0), "/");
 } else {
     $lastDate = "/";
 }
 if ($lastDate != "/") {
     $lastDate = DateTimeFormat($lastDate, 'd-m-Y H:i:s');
 }
 $color = "";
 if ($lastDate != "/") {
     if (round(abs(strtotime(now()) - strtotime($lastDate)) / 60) > 1440) {
         $color = "red";
     } else {
         $color = "green";
     }
 }
 ?>
Beispiel #27
0
										<?php 
										if($row3["emails"]!="")
										{
											echo $row3["emails"];
										}
										else {
										?> &nbsp;
										<?php
										}
										?>
									</td>
									<?php
									if ($clienttypeid == 6) {
										?>
										<td align = "left" height="30px" class="text2" style="padding-left:10px; background-color:#fff; border:1px dotted #B8B8B8; ">
										<?= nnull($row3["sms"], "/")?>	
										</td>	
										<?php
									}
									?>
									 
									<td align = "center" height="30px" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; ">
										<?php echo dic_("Settings.Sound") . " " . $row3["soundid"]; ?>		
									<?php 
									$snoozeNajdi = query("select * from users where id=" . session("user_id") ."");
									$snoozot = pg_fetch_result($snoozeNajdi, 0, "snooze");
			
									if($snoozot==0)
									{
										echo dic("Settings.NoRepetition");
									}
Beispiel #28
0
                <div onmouseover="MouseOverOptions('vehOption-<?php echo $row["code"]?>','<?php echo $row["vehicleid"]?>')" id="" style="background-color: #fafafa; width:205px; padding-left:5px; padding-right:5px; padding-top:2px; padding-bottom:2px; float:left; color:#333333; font-size:10px; border-top:1px dotted #333">							
					<?php echo dic("Reports.Alias")?>: <span style="font-weight: bold" id="vh-alias-<?php echo $row["code"]?>"><?php echo $row["alias"]?></span>
				</div>
				<?php }
					if($row["allowcamera"].'' == '1')
					{
						if (dlookup("select count(*) from camera where vehicleid=".$row["vehicleid"]."") > 0) {
							$dsLastPhoto = query("select * from camera where vehicleid=".$row["vehicleid"]." order by datetime desc limit 1");
							$camImg = pg_fetch_result($dsLastPhoto, 0, "image");
							$camTime = DateTimeFormat(pg_fetch_result($dsLastPhoto, 0, "datetime"), $dtformat);
						} else {
							$camImg = ""; $camTime = "";							
						}
						
                
                		$checkCamera = nnull(dlookup("select count(*) from cameravehicle where vehicleid=".$row["vehicleid"]." and datetime between '".DateTimeFormat(now(), '"Y-m-d 00:00:00"')."'  and '".DateTimeFormat(now(), '"Y-m-d 23:59:59"')."'"), 0);
			    ?>
                <div onmouseover="MouseOverOptions('vehOption-<?php echo $row["code"]?>','<?php echo $row["vehicleid"]?>')" id="" style="background-color: #fafafa; width:205px; padding-left:5px; padding-right:5px; padding-top:1px; padding-bottom:1px; float:left; color:#333333; font-size:10px; border-top:1px dotted #333">							
					<span style="position: relative; top: 2px;" id="vh-image-<?php echo $row["code"]?>"><?= dic_("Reports.LastPhoto")?>: </span>
					<!--img style="cursor: pointer; position: relative; float: right; margin-top: -1px;" onclick="newImageFromCamera('<?=$row["gsmnumber"]?>', '<?=$row["code"]?>')" onmouseover="ShowPopup(event, 'Кликнете за нова слика')" onmouseout="HidePopup()" width="18px;" src="../images/camera2.png" /-->
					<img id="camera-<?=$row["vehicleid"]?>" style="cursor: pointer; position: relative; float: right; margin-top: -1px;" onclick="openCameraWindow('<?=$row["gsmnumber"]?>', '<?=$row["code"]?>', '<?= $camImg ?>', '<?= $camTime ?>', <?=$checkCamera?>)" onmouseover="ShowPopup(event, '<?= dic_("Reports.ClickNewPhoto")?>')" onmouseout="HidePopup()" width="18px;" src="../images/camera2.png" />
					<img id="vh-img-newimage-<?= $row["code"]?>" src="../images/smallref.gif" width="17px" style="display:none; position: relative; float: right; right: 3px;" />
				</div>
				<?php
					}
                	if($ClientTypeID != "3" && $ClientTypeID != "7") { 
        		?>
	            <div onmouseover="MouseOverOptions('vehOption-<?php echo $row["code"]?>','<?php echo $row["vehicleid"]?>')" id="" style="height: 12px; background-color: #fafafa; width:205px; padding-left:5px; padding-right:5px; padding-top:2px; padding-bottom:2px; float:left; color:#333333; font-size:10px; border-top:1px dotted #333">							
					<?php echo dic_("Tracking.Driver") ?>: <span style="font-weight: bold" id="vh-driver-<?php echo $row["code"]?>"><?php echo $strDrivName ?></span>
				</div>
				<div onmouseover="MouseOverOptions('vehOption-<?php echo $row["code"]?>','<?php echo $row["vehicleid"]?>')" id="div-driverdest-<?php echo $row["code"]?>" style="<?=$driverDestStyle?>; height: 12px; background-color: #fafafa; width:205px; padding-left:5px; padding-right:5px; padding-top:2px; padding-bottom:2px; float:left; color:#333333; font-size:10px; border-top:1px dotted #333">							
Beispiel #29
0
  
  	
</head>

  <?php 
opendb();
if (nnull(is_numeric(nnull(getQUERY("u"))), 0) > 0) {
    $uid = getQUERY("u");
    $cid = getQUERY("c");
} else {
    $uid = session("user_id");
    $cid = session("client_id");
}
$_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");
$_SESSION['role_id'] = nnull(dlookup("select roleid from users where id=" . $uid), 0);
$roleid = session("role_id");
$sqlU1 = "select id, fullname from users where clientID=" . $cid;
if ($roleid == "2") {
    $sqlU = "select id from users where clientID=" . $cid;
} else {
    $sqlU = "select id from users where id=" . $uid;
}
$cLang = getQUERY("l");
$datetimeformat = dlookup("select datetimeformat from users where id=" . $uid);
$datfor = explode(" ", $datetimeformat);
$dateformat = $datfor[0];
$timeformat = $datfor[1];
if ($timeformat == "H:i:s") {
    $e_ = " 23:59";
    $e1_ = "_23:59";
Beispiel #30
0
include "../include/functions.php";
include "../include/params.php";
include "../include/dictionary2.php";
?>

<?php 
session_start();
header("Content-type: text/html; charset=utf-8");
?>


<?php 
$id = getQUERY("id");
$reg = getQUERY("reg");
$code = getQUERY("code");
$orgUnit = nnull(getQUERY("orgUnit"), 0);
$model = getQUERY("model");
$AliasName = getQUERY("prekar");
$fuelType = getQUERY("fuelType");
$chassis = getQUERY("chassis");
$motor = getQUERY("motor");
$firstReg = DateTimeFormat(getQUERY("firstReg"), "Y-m-d");
$lastReg = DateTimeFormat(getQUERY("lastReg"), "Y-m-d");
$greenCard = getQUERY("greenCard");
$activity = getQUERY("activity");
$range = str_replace(",", ".", NNull($_GET['range'], ''));
if ($range == "") {
    $range = 0;
}
$capacity = getQUERY("capacity");
if (is_numeric($capacity) == false) {