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; } }
public function __construct($AdminID = '') { $this->Connect(); $this->AdminID = $AdminID == '' ? $_SESSION['admin_id'] : $AdminID; $this->AdminData = $this->fetchAssoc('admin_user', '*', "admin_id = '" . $this->AdminID . "'"); $this->AdminData = $this->AdminData[0]; $this->FirstName = $this->AdminData['first_name']; $this->LastName = $this->AdminData['last_name']; $this->User = $this->AdminData['user']; $this->ProfileID = $this->AdminData['profile_id']; $this->Img = file_exists($this->AdminData['img']) ? $this->AdminData['img'] : $this->DefaultImg; $this->FullName = $this->FirstName . " " . $this->LastName; $this->FullUserName = $this->FirstName . " " . $this->LastName . " (" . $this->User . ")"; $this->LastAccess = "Último acceso: " . DateTimeFormat($this->AdminData['last_access']); $ProfileData = $this->fetchAssoc('admin_profile', '*', " profile_id = " . $this->ProfileID); $this->ProfileName = $ProfileData[0]['title']; }
%; 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"]; ?> " onmousemove="ShowPopup(event, '<span class=\'text5\'><?php echo dic("Reports.TotalToursDay"); ?> </span>')" onmouseout="HidePopup()"><?php
* 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 { $proverka = query("select * from companydays"); if (pg_num_rows($proverka) == 0) { $vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor) values(1," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "'); "); } else { $posledno = dlookup("select Max(id)+1 from companydays"); $vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor) values('" . $posledno . "'," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "'); "); } } closedb();
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="../js/share.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="fm.js"></script> <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">
echo $img; ?> " style=""> </td> <td width=65%><strong id="sent-name-<?php echo $cc; ?> "><?php echo $to; ?> </strong></td> <td width=35% id="sent-datetime-<?php echo $cc; ?> "><?php echo DateTimeFormat($drMessInbox["datetime"], $dateformat); ?> </td> </tr> <!--<tr style="color:#8c8c8c"><td id="sent-subject-<?php echo $cc; ?> " colspan=3 ><?php echo $drMessInbox["subject"]; ?> </td></tr>--> <tr style="color:#8c8c8c"><td id="sent-body-<?php echo $cc; ?> " colspan=3 style="font-style:italic;"><?php echo substr($drMessInbox["body"], 0, 70);
} else { //vikend if ($dayType == 9) { if (DateTimeFormat($f, 'w') == 6 or 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 . "')"); } } } else { //delnik if ($dayType == 10) { if (DateTimeFormat($f, 'w') >= 1 and DateTimeFormat($f, 'w') <= 5) { $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 . "')"); } } } } } $f = addToDate($f, 1, "days"); } } } closedb(); ?>
<img id="act<?php echo $cnt; ?> " width= "11px" height = "11px" src="<?php echo $greenCard; ?> " /> </td> <td id="td-6-<?php echo $cnt; ?> " align="center" class="td-row text2" style="color:<?php echo $color; ?> "><?php echo DateTimeFormat($lastDate, $datetimeformat); ?> </td> <td id="td-9-<?php echo $cnt; ?> " align="center" class="td-row text2 <?php echo $paren; ?> "> <img id="act<?php echo $cnt; ?> " width= "11px" height = "11px" src="<?php echo $activity;
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; $gsm = getQUERY("gsm"); opendb(); $vehicleid = dlookup("select id from vehicles where gsmnumber='" . $gsm . "'"); $r = runSQL("insert into cameravehicle (vehicleid, datetime) values(" . $vehicleid . ", '" . now() . "')"); echo dlookup("select count(*) from cameravehicle where vehicleid=" . $vehicleid . " and datetime between '" . DateTimeFormat(now(), '"Y-m-d 00:00:00"') . "' and '" . DateTimeFormat(now(), '"Y-m-d 23:59:59"') . "'"); closedb();
$activity = "../images/stikla3.png"; } $_lastReg = explode(" ", DateTimeFormat($drOV["lastregistration"], "d-m-Y")); $lastReg = $_lastReg[0]; $fuelType1 = query("select name from fueltypes where id = (select fueltypeid from vehicles where id=" . $drOV["id"] . ")"); $row2 = pg_fetch_array($fuelType1); //$lastDate = nnull(dlookup('select "DateTime" from currentposition where vehicleid=' . $drOV["id"]), "/"); $ld = query('select "DateTime" from currentposition where vehicleid=' . $drOV["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"; } ?> <tr id="veh<?php echo $cnt_1 ?>" style="" onmouseover="over(<?php echo $cnt_ ?>, 1, <?php echo $actYN ?>)" onmouseout="out(<?php echo $cnt_ ?>, 1, <?php echo $actYN ?>)"> <td id="_td-1-<?php echo $cnt_ ?>" width="6%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; "><?php echo $drOV["code"] ?></td> <td id="_td-2-<?php echo $cnt_ ?>" width="13%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><strong><?php echo $drOV["registration"] ?></strong><br> <?php if($zaAlias>0){ ?><font style="font-size:10px">(<?php echo $drOV["alias"];?>)</font><?php }else{ echo "";}?></td> <td id="_td-3-<?php echo $cnt_ ?>" width="16%" height="30px" align="center" class="text2 <?php echo $paren?>" style="background-color:#fff; border:1px dotted #B8B8B8;"> <b><?php echo $drOV["model"]?></b><br> <?php if($row2["name"]=="Бензин") { ?>
?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p><?php echo $User['password']; ?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p><?php echo $User['email']; ?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p><?php echo $User['site_status']; ?> </p></div> <div class="col-md-3 col-sm-3 col-xs-12"><p><?php echo DateTimeFormat($User['creation_date']); ?> </p></div> <div class="col-md-1 col-sm-1 col-xs-12"><p><?php echo $User['id']; ?> </p></div> </div> <?php } ?> <!-- /User (List) --> </div><!-- /User List View --> <?php foreach ($Users as $User) { $User = new AdminData($User['admin_id']);
<?php include "../include/functions.php"; include "../include/db.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php opendb(); $t = getQUERY("t"); $cntCompanyHoliday = dlookup("select count(*) from companydaysholiday where clientid=" . session("client_id") . " and holidayid=1"); if ($cntCompanyHoliday == 0) { $ret = RunSQL("insert into companydaysholiday (clientid, nameholiday, holidayid) values (" . session("client_id") . ", 'Државен', 1)"); } if ($t == 1) { $sqlCompanyDays = "insert into companydays (clientid, dayname, typeofday, datum, companyholiday, cellcolor, typeofholiday)\n\t\tselect " . session("client_id") . ", description, (select getdayofweek(cast(datetime as date))), datetime1, 8, '#ff9933', 1 \n\t\tfrom nonworkingdays where description not in (select dayname from companydays where clientid=" . session("client_id") . " and datum >= '" . DateTimeFormat(now(), 'Y') . '-01-01' . "' and datum <= '" . DateTimeFormat(now(), 'Y') . '-12-31' . "')\n\t\tand active='1'"; $ret1 = RunSQL($sqlCompanyDays); } else { $sqlCompanyDays1 = "delete from companydays where clientid=" . session("client_id") . " and datum >= '" . DateTimeFormat(now(), 'Y') . '-01-01' . "' and datum <= '" . DateTimeFormat(now(), 'Y') . '-12-31' . "' and companyholiday = 8"; $ret2 = RunSQL($sqlCompanyDays1); } closedb();
{ ?> (<font style="font-size:10px"><?php echo dic_("Diesel")?></font>) <?php } if($row2["name"]=="LPG") { ?> (<font style="font-size:10px"><?php echo dic_("LPG")?></font>) <?php } ?> </div> <td id="_td-4-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php echo DateTimeFormat($drOV["lastregistration"], $dateformat) ?></td> <td id="_td-5-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><img id="_act<?php echo $cnt_?>" src=<?php echo $greenCard ?> width = "11px" height = "11px"/></td> <td id="_td-6-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; color:<?php echo $color?>"><?php echo DateTimeFormat($lastDate, $datetimeformat)?></td> <!-- <?php $fm = dlookup("select allowedfm from clients where id=" . session("client_id")); if ($fm == '1' and session("role_id") == 2) { ?> <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="_costBtn-<?php echo $cnt_?>" onclick="costVehicle(<?php echo $cnt_1 ?>, <?php echo $id ?>, '<?php echo $drOV["registration"] ?> (<?php echo $drOV["code"] ?>) <?php echo $drOV["alias"] ?>')" style="height:22px; width:30px"></button> </td> <? } ?> --> <td id="_td-9-<?php echo $cnt_ ?>" height="30px" align="center" class="text2 <?php echo $paren ?>" style="background-color:#fff; border:1px dotted #B8B8B8;"> <img id="_act<?php echo $cnt_?>" src=<?php echo $activity?> width = "11px" height = "11px"/> <!--<button id="_delBtn-<?php echo $cnt_ ?>" onclick="del(<?php echo $drOV["id"] ?>, '<?php echo $cLang ?>', 'vehicles')" style="height:22px; width:30px"></button>-->
If ($greenCard == false) { $greenCard = 0; } else{ $greenCard = 1; } If ($activity == false) { $activity = 0; } else{ $activity = 1; } $chassis = nnull(dlookup("select chassisnumber from vehicles where id=" . $id), ""); $motor = nnull(dlookup("select motornumber from vehicles where id=" . $id), ""); $capacity = nnull(dlookup("select fuelcapacity from vehicles where id=" . $id), "0"); $firstReg = DateTimeFormat(nnull(dlookup("select firstregistration from vehicles where id=" . $id), now()), $dateformat); $kmPerYear = nnull(dlookup("select kmperyear from vehicles where id=" . $id), "0"); //godisno dozvoleni km $springT = nnull(dlookup("select springtires from vehicles where id=" . $id), "30000"); //predvideni km za letni gumi $winterT = nnull(dlookup("select wintertires from vehicles where id=" . $id), "30000"); //predvideni km za zimski gumi $nextService= nnull(dlookup("select nextservice from vehicles where id=" . $id), "10000"); //na kolku km se vrsi servis if ($metric == 'mi') { $nextService = $nextService / 1.609344498; } $nextServiceMonths= nnull(dlookup("select nextservicemonths from vehicles where id=" . $id), "12"); //na kolku meseci se vrsi servis $gorivo = nnull(dlookup("select fueltypeid from vehicles where id=" . $id), ""); $range = 0; if($clienttypeid == 4) {
" 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_; ?> " onclick="modifyDriver(<?php echo $cnt_1; ?> , <?php echo $id; ?>
header("Content-type: text/html; charset=utf-8"); ?> <?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 . ",
<?php include "../include/db.php"; include "../include/functions.php"; include "../include/params.php"; include "../include/dictionary2.php"; session_start(); header("Content-type: text/html; charset=utf-8"); $pocetok = DateTimeFormat(getQUERY("pocetok"), 'Y-m-d'); $kraj = DateTimeFormat(getQUERY("kraj"), 'Y-m-d'); $kopce = str_replace("'", "''", NNull($_GET['input'], '')); $cid = Session("client_id"); opendb(); $zaId = dlookup("select Max(id)+1 from drivers"); $proverka = query("select * from vehicleslicense"); $LicenseCheck = dlookup("SELECT count(*) FROM vehicleslicense WHERE vehicleid = '" . $kopce . "' and userid = " . $zaId . ""); if ($LicenseCheck > 0) { echo 1; } else { if (pg_num_rows($proverka) == 0) { $posledno = 1; RunSQL("INSERT INTO vehicleslicense(id, vehicleid, clientid, begining, ending, userid) VALUES(" . $posledno . ", " . $kopce . "," . $cid . ",\n \t\t'" . DateTimeFormat($pocetok, "Y-m-d") . "',\n \t\t'" . DateTimeFormat($kraj, "Y-m-d") . "' , " . $zaId . ")"); } else { $posledno = dlookup("select Max(id)+1 from vehicleslicense"); RunSQL("INSERT INTO vehicleslicense(id, vehicleid, clientid, begining, ending, userid) VALUES(" . $posledno . ", " . $kopce . "," . $cid . ",\n \t\t'" . DateTimeFormat($pocetok, "Y-m-d") . "',\n \t\t'" . DateTimeFormat($kraj, "Y-m-d") . "' , " . $zaId . ")"); } } closedb();
//born date $gender = getQUERY("gender"); $rfId = getQUERY("rfId"); $contract = getQUERY("contract"); if (is_numeric($contract) == false) { $contract = 0; } $sc = DateTimeFormat(getQUERY("startCom"), 'Y-m-d'); //start date in company $categories = getQUERY("categories"); $fl = DateTimeFormat(getQUERY("firstLic"), 'Y-m-d'); //first license $le = DateTimeFormat(getQUERY("licExp"), 'Y-m-d'); //license expire $interLic = getQUERY("interLic"); $ie = DateTimeFormat(getQUERY("IntLicExp"), 'Y-m-d'); //international license expire opendb(); $removed = getQUERY("removed"); if ($removed != "") { $remArr = explode(";", $removed); for ($i = 0; $i < count($remArr) - 1; $i++) { RunSQL("delete from vehicledriver where id=" . $remArr[$i]); } } $CheckCode = dlookup("SELECT count(*) FROM drivers WHERE code = '" . $code . "' and clientid = " . Session("client_id") . " and code not in (select code from drivers where id=" . $id . ")"); if ($CheckCode > 0) { echo 1; exit; } else { RunSQL("UPDATE drivers set fullname='" . $name . "', code='" . $code . "', borndate='" . $bd . "', \r\n gender='" . $gender . "', startincompany='" . $sc . "', jobcontract=" . $contract . ", \r\n rfid= '" . $rfId . "', licensetype='" . $categories . "', firstlicense='" . $fl . "', \r\n licenseexp= '" . $le . "', interlicense=B'" . $interLic . "', interlicenseexp='" . $ie . "', \r\n organisationid = " . $orgUnit . " where id=" . $id);
<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">
<?php include "../include/functions.php"; include "../include/db.php"; include "../include/params.php"; include "../include/dictionary2.php"; ?> <?php opendb(); $vehicleid = str_replace("'", "''", NNull($_GET['id'], '')); $datum = DateTimeFormat(getQUERY("datumce"), 'Y-m-d H:i:s'); $km = str_replace("'", "''", NNull($_GET['odometarVrednost'], '')); $informacii = query("select * from currkm WHERE vehicleid = " . $vehicleid); $datumVnesenVeke = pg_fetch_result($informacii, 0, "datetime"); $datumVnesenRacno = DateTimeFormat($datum, "Y-m-d 23:59:59"); $datumVnesenRacnoSPOREDBA = DateTimeFormat($datum, "Y-m-d"); $denesSporedba = strstr(now("Y-m-d H:i:s"), ' ', true); $DENES = now("Y-m-d H:i:s"); if ($denesSporedba == $datumVnesenRacnoSPOREDBA) { $updateCurrKm = query("update currkm set km=" . $km . ", datetime = '" . $DENES . "' where vehicleid=" . $vehicleid); $updateOdometer = query("update odometer set datetime = '" . $DENES . "', km=cast((select calculatecurrkm('" . $vehicleid . "', cast(now() as timestamp))) as numeric(19,6)) where vehicleid=" . $vehicleid); } else { $updateCurrKm = query("update currkm set km=" . $km . ", datetime = '" . $datum . "' where vehicleid=" . $vehicleid); $updateOdometer = query("update odometer set km=cast((select calculatecurrkm('" . $vehicleid . "', cast(now() as timestamp))) as numeric(19,6)) where vehicleid=" . $vehicleid); } closedb();
echo $imeruta; ?> )</strong><strong style="float:right"><?php echo dic_("Routes.OrderNumber"); ?> : <?php echo $row["tourid"]; ?> </strong> <table style="font-size:11px;" border="0" width="100%"> <tr> <td width="220px" style="padding-left: 10px;"><?php echo dic_("Tracking.BeginningOrder"); ?> : <strong style="color:#800"><?php echo DateTimeFormat($datum, $tf . " " . $dateformat); ?> </strong></td> <td style="padding-left: 10px;"><?php echo dic_("Routes.CreatedBy"); ?> : <strong style="color:#800"><?php echo $row["korisnik"]; ?> </strong></td> <td style="padding-left: 10px;"><?php echo dic_("Reports.Total"); ?> <?php if ($clientUnit == "mi") { echo dic("Route.Miles");
<img style="float:left" src="../images/infocircle.png" onmousemove="ShowPopup(event, '<?php echo dic("Settings.WorkDaysInfoAdmin"); ?> ')" onmouseout="HidePopup()" style=""></img> <?php $countryName = dlookup("select name from countries where id = (select countryid from cities where id = (select cityid from clients where id = " . session("client_id") . "))"); $firstDayCurrentYear = DateTimeFormat(now(), 'Y') . '-01-01'; if ($countryName == 'Македонија') { $cntCompanyDays = dlookup("select count(*) from companydays where clientid=" . session("client_id") . " and companyholiday=8 and typeofholiday=1 and datum >= '" . $firstDayCurrentYear . "'"); $cntNonWorkingDays = dlookup("select count(*) from nonworkingdays where active='1'"); if ($cntCompanyDays < $cntNonWorkingDays) { ?> <button id="downloadHolidays" onclick="downloadHolidays(1)" style="float:right"><?php echo dic_("Settings.DownloadHolidays"); ?> </button> <!--button id="listaNerab" onclick="listaNerabotni()" style="margin-left:1px"><?php echo dic("Settigns.DaysAddedAdmin"); ?> </button> --> <!--<button id="nerab" onclick="NerabotniDenovi()" style="margin-left:1px"><?php echo dic("Settings.ListOfNonWorkingDays");
</td> <td height="22px" align="center" style="background-color:#fff; border:1px dotted #B8B8B8" class="text2"> <img width="24" height="24" border="0" src="../images/zoom.png" style="cursor:pointer" title="<?php echo dic_("Reports.ViewOnMap"); ?> " onClick="OpenMapActivity('<?php echo session("user_id"); ?> ', '<?php echo session("client_id"); ?> ', '<?php echo DateTimeFormat($drActivity["startdate"], "d-m-Y H:i:s"); ?> ', '<?php echo DateTimeFormat($drActivity["enddate"], "d-m-Y H:i:s"); ?> ', '<?php echo $reg; ?> ', '<?php echo $vehid; ?> ', <?php echo $drActivity["zoneid"]; ?> )"> </td> </tr> <?php $cnt++;
$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"; } else { $type = "Regular"; } opendb(); $checkCnt = dlookup("select count(*) from service where clientid=" . Session("client_id") . " and datetime='" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "' \r\n\tand vehicleid=" . $veh . " and location='" . $loc . "' and userid=" . Session("user_id") . " and type='" . $type . "' and description='" . $desc . "' \r\n\tand components='" . $comp . "' and price=" . intval($price) . " and km=" . intval($km) . " and pay='" . $pay . "' and driverid=" . $driver); if ($checkCnt == 0) { if ($driver == "") { RunSQL("INSERT INTO service (clientid, datetime, vehicleid, location, userid, type, description, components, price, km, pay) \r\n\t\t VALUES (" . Session("client_id") . ", '" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "', " . $veh . ", '" . $loc . "', " . Session("user_id") . ", \r\n\t\t '" . $type . "', '" . $desc . "', '" . $comp . "', " . intval($price) . ", " . intval($km) . ", '" . $pay . "')"); } else { RunSQL("INSERT INTO service (clientid, datetime, driverid, vehicleid, location, userid, type, description, components, price, km, pay) \r\n\t\t VALUES (" . Session("client_id") . ", '" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "', " . $driver . ", " . $veh . ", '" . $loc . "', " . Session("user_id") . ", \r\n\t\t '" . $type . "', '" . $desc . "', '" . $comp . "', " . intval($price) . ", " . intval($km) . ", '" . $pay . "')"); } echo 1; } else { echo 0; } closedb();
function DateFormat($format, $datestr) { $str = "{$datestr} 00:00:00"; return DateTimeFormat($format, $str); }
</div> <div class="col-md-1 col-sm-1 col-xs-12"><p><?php echo $User->User; ?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p><?php echo $User->FullName; ?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p><?php echo $User->ProfileName; ?> </p></div> <div class="col-md-2 col-sm-2 col-xs-12"><p>Admin</p></div> <div class="col-md-3 col-sm-3 col-xs-12"><p><?php echo DateTimeFormat($User->AdminData['last_access']); ?> </p></div> <div class="col-md-1 col-sm-1 col-xs-12 japi"> <a href="edit.php?id=<?php echo $User->AdminID; ?> "><button type="button" name="button" class="btn mainbtn modBtnList"><i class="fa fa-pencil"></i></button></a> <a href="#"><button type="button" name="button" class="btn mainbtn mainbtnred delBtnList deleteElement" deleteElement="<?php echo $User->AdminID; ?> " deleteParent="itemGrid<?php echo $User->AdminID; ?> /itemList<?php echo $User->AdminID;
<?php echo dic_("Reports.To"); ?> : <strong><?php echo $to; ?> </strong> <?php } ?> <br> <?php echo dic_("Reports.DateTime"); ?> : <strong><?php echo DateTimeFormat(pg_fetch_result($mess, 0, "datetime"), $datetimeformat); ?> </strong> </td> </tr> <tr> <td colspan=2 style="padding-top:25px"> <?php echo pg_fetch_result($mess, 0, "body"); ?> </td> </tr> </table> <?php
$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;
<td align="left" style="background-color:#fff; border:1px dotted #B8B8B8; padding-left:7px" class="text2"><?php echo $drData["body"]; ?> </td> </tr> <?php $cnt++; } //end while } else { ?> <tr> <td valign="bottom" height="31px" style="color:#fff; font-size:14px; border:1px solid #ff6633; background-color:#f7962b;padding-bottom: 6px; padding-left: 10px " class="text2" colspan=6><strong><?php echo DateTimeFormat($_datumCnt, "d") . " " . dic_("Reports." . $meseci[intval(DateTimeFormat($_datumCnt, "m")) - 1] . "") . " " . DateTimeFormat($_datumCnt, "Y"); ?> <span class="text2" style="font-style:italic; color:#153B75; font-size:12px"><?php echo dic_("Reports.NoDataDay"); ?> </span></strong></td> </tr> <?php } ?> </table> <?php $_datumCnt = addToDate($_datumCnt, 1, "days"); }
?> <?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;