本文整理汇总了PHP中dlookup函数的典型用法代码示例。如果您正苦于以下问题:PHP dlookup函数的具体用法?PHP dlookup怎么用?PHP dlookup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dlookup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getdate
$today = getdate();
$q = '' . $today[0];
$orgEdinica = str_replace("'", "''", NNull($_GET['orgEdinica2'], ''));
$najdiVozila = query("select * from vehicles where organisationid = " . $orgEdinica . " and clientid = " . $cid);
$brisi = query("delete from alarms where id = " . $id . " and clientid = " . $cid . "");
while ($row = pg_fetch_array($najdiVozila)) {
$data[] = $row;
}
foreach ($data as $row) {
$posledno = dlookup("select Max(id)+1 from alarms");
$ret = query("insert into alarms values('" . $posledno . "','" . $tipNaAlarm . "','" . $orgEdinica . "','" . $dostapno . "','" . $emails . "','" . $sms . "','" . $zvukot . "',1," . Session("client_id") . " , '" . $row["id"] . "',NULL,NULL,NULL,'" . $q . "', 2)");
//RunSQL("update alarms set alarmtypeid = '" . $tipNaAlarm . "',settings = ".$orgEdinica." , available ='" . $dostapno . "', emails ='" . $emails . "', sms = '" .$sms. "',soundid = '" .$zvukot. "',vehicleid = ".$row["id"].",speed = null,poiid = null,timeofpoi = null,uniqid = ".$q.",typeofgroup = 2 where id = '" . $id . "' and clientid =" .$cid);
}
}
if ($vnesiAlertZa == 3) {
$today = getdate();
$q = '' . $today[0];
$najdiVozila = query("select * from vehicles where clientid = " . $cid);
$brisi = query("delete from alarms where id = " . $id . " and clientid = " . $cid . "");
while ($row = pg_fetch_array($najdiVozila)) {
$data[] = $row;
}
foreach ($data as $row) {
$posledno = dlookup("select Max(id)+1 from alarms");
$ret = query("insert into alarms values('" . $posledno . "','" . $tipNaAlarm . "','','" . $dostapno . "','" . $emails . "','" . $sms . "','" . $zvukot . "',1," . Session("client_id") . " , '" . $row["id"] . "',NULL ,NULL ,NULL ,'" . $q . "', 3)");
//RunSQL("update alarms set alarmtypeid = '" . $tipNaAlarm . "',settings = null , available ='" . $dostapno . "', emails ='" . $emails . "', sms = '" .$sms. "',soundid = '" .$zvukot. "',vehicleid = ".$row["id"].",speed = null,poiid = null,timeofpoi = null,uniqid = ".$q.",typeofgroup = 3 where id = '" . $id . "' and clientid =" .$cid);
}
}
}
}
closedb();
示例2: combat_ticker
function combat_ticker($alliances, $users)
{
$week = dlookup("week", "timeinfo");
foreach ($users as $uid => $count) {
ticker($uid, "*lbattlereport.php?act=show_own&_minw={$week}&_maxw={$week}*You were involved in " . $count . " battles!", "a");
}
foreach ($alliances as $aid => $count) {
$members = get_alliance_members($aid);
foreach ($members as $uid => $name) {
// mop: gabs ausser den eigenen auch noch kämpfe?
if ($count - $users[$uid] > 0) {
ticker($uid, "*lbattlereport.php?act=show_alliance&_minw={$week}&_maxw={$week}*Your alliance was involved in " . ($count - $users[$uid]) . " battles!", "a");
}
}
}
}
示例3: while
<?php
while ($drData = pg_fetch_array($dsData)) {
$tmpIDA = explode(",", $idUsers);
$ifNE = true;
for ($ch = 0; $ch < sizeof($tmpIDA); $ch++) {
if ($drData["userid"] == $tmpIDA[$ch]) {
$ifNE = false;
break;
}
}
if ($ifNE) {
$idUsers .= $drData["userid"] . ",";
}
$LastDay = DatetimeFormat(addDay(-1), 'd-m-Y');
$dt = DateTimeFormat(nnull($LastDay, "01-01-1900"), "Y-m-d" . " 00:00:00");
$user = dlookup("select fullname from users where id=" . $drData["userid"]);
$desc = nnull($drData["description"], "/");
$act = "";
if (nnull($drData["activity"], "/") != "/") {
$actarr = explode("/", $drData["activity"]);
if (count($actarr) > 1) {
$actarr = array_reverse($actarr);
for ($i = 0; $i < count($actarr); $i++) {
$act .= " -> " . dic_($actarr[$i]);
}
} else {
$act .= " -> " . dic_($drData["activity"]);
}
}
$act = substr($act, 4);
?>
示例4: createXls
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;
}
}
示例5: dlookup
if ($lastNalog == '' or $lastNalog != $drActivity["orderno"]) {
$nalogname1 = dlookup("select name from rnalogheder where id = " . $drActivity["orderno"]);
$culid1 = dlookup("select culid from rnalogheder where id = " . $drActivity["orderno"]);
$culid2 = dlookup("select culid from route_defculture where id = " . $culid1);
$culname = dlookup("select name from route_culture where id = " . $culid2);
$nalogname = "<font style='font-size:16px'>Налог број: <strong>" . $drActivity["orderno"] . "</strong>";
if ($nalogname1 != "") {
$nalogname .= ' (<strong>' . $nalogname1 . '</strong>)</font>';
}
//$culture = dlookup("select coalesce((select name from route_culture where id = " . $drActivity["culid"] . "), '/')");
$nalogname .= "<font style='font-style:italic'><br>Култура: <strong>" . $culname . "</strong>";
$operation = dlookup("select coalesce((select name from route_operation where id = " . $drActivity["operid"] . "), '/')");
$nalogname .= "<font style='font-style:italic'> Операција: <strong>" . $operation . "</strong>";
$material = dlookup("select coalesce((select name from route_material where id = " . $drActivity["matid"] . "), '/')");
$nalogname .= " Материјал: <strong>" . $material . "</strong>";
$mechanisation = dlookup("select coalesce((select name from route_mechanisation where id = " . $drActivity["mechid"] . "), '/')");
$nalogname .= " Механизација: <strong>" . $mechanisation . "</strong></font>";
?>
<tr><td colspan=8 height=25px></td></tr>
<tr>
<td valign="bottom" height="29px" style="color:#fff; font-size:14px; border:1px solid #ff6633; background-color:#f7962b; padding-bottom: 5px; padding-left: 10px " class="text2" colspan="8"><?php
echo $nalogname;
?>
</td>
</tr>
<tr>
<td width="5%" height="22px" align="center" style="background-color:#E5E3E3; border:1px dotted #2f5185" class="text2"><strong><?php
dic("Reports.Rbr");
?>
</strong></td>
示例6: pg_fetch_result
$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 = "";
$lastdt = "";
$lastLon = "";
$lastLat = "";
while ($row = pg_fetch_array($ds)) {
$dtTmp = new Datetime($row["datetime"]);
$dtTmp = $dtTmp->format($timeformat . " " . $dateformat);
$str1 .= "," . $row["longitude"];
$str2 .= "," . $row["latitude"];
if ($lastLon != "") {
$dist .= "," . dlookup("select dist_lonlat(" . $row["latitude"] . ", " . $row["longitude"] . ", " . $lastLat . ", " . $lastLon . ")");
$alpha .= "," . dlookup("select getalpha(" . $row["latitude"] . ", " . $row["longitude"] . ", " . $lastLat . ", " . $lastLon . ")");
$dt .= "," . $dtTmp;
// . " - " . $lastdt;
}
$lastLon = $row["longitude"];
$lastLat = $row["latitude"];
$lastdt = $dtTmp;
}
$str = $str2 . "#" . $str1 . "#" . $dist . "#" . $dt . "#" . $alpha;
print $str;
//print base64_encode(gzencode($str));
closedb();
示例7: GetCurrentPosition
function GetCurrentPosition($RoleID, $ClientID, $UserID)
{
//if($RoleID == "2")
$sqlV = "";
if ($RoleID == "2") {
$sqlV = "select id from vehicles where clientid=" . $ClientID;
} else {
$sqlV = "select vehicleid from uservehicles where userid=" . $UserID . "";
}
$ClientTypeID = dlookup("select clienttypeid from clients where id=" . $ClientID);
$sqlStyles = "";
$sqlStyles .= "SELECT c1.name engineon, c2.name engineoff, c3.name engineoffpassengeron, c4.name satelliteoff, c5.name taximeteron, c6.name taximeteroffpassengeron, c7.name passiveon, c8.name activeoff ";
$sqlStyles .= "from users us ";
$sqlStyles .= "left outer join statuscolors c1 on c1.id=us.engineon ";
$sqlStyles .= "left outer join statuscolors c2 on c2.id=us.engineoff ";
$sqlStyles .= "left outer join statuscolors c3 on c3.id=us.engineoffpassengeron ";
$sqlStyles .= "left outer join statuscolors c4 on c4.id=us.satelliteoff ";
$sqlStyles .= "left outer join statuscolors c5 on c5.id=us.taximeteron ";
$sqlStyles .= "left outer join statuscolors c6 on c6.id=us.taximeteroffpassengeron ";
$sqlStyles .= "left outer join statuscolors c7 on c7.id=us.passiveon ";
$sqlStyles .= "left outer join statuscolors c8 on c8.id=us.activeoff ";
$sqlStyles .= "where us.id=" . $UserID;
$dsStyles = query($sqlStyles);
//$dsStyles = query("SELECT [c1].[name] [EngineON] from [UserSettings] [us] left outer join [Colors] [c1] on [c1].[id] = [us].[EngineON] where [us].[id]=506");
//echo "select * from (SELECT c1.name EngineON from UserSettings us left outer join Colors c1 on c1.id=us.EngineON where us.UserId=506) t";
//echo odbc_field_name($dsStyles, 1) ;
//exit;
$sql = "";
//$sql .= "select v.numberofvehicle, v.registration, geonet.dbo.fn_seats_goran(seats) sedista, cp.* ";
$sql .= "select cast(v.code as integer), v.registration, '1' sedista, cp.* ";
$sql .= "from currentposition cp ";
$sql .= "left outer join vehicles v on v.id=cp.vehicleid ";
$sql .= "where vehicleid in (" . $sqlV . ") order by cast(v.code as integer) asc";
$ds = query($sql);
$str = "";
if ($ClientTypeID == 2) {
//ako e taksi kompanija
while ($row = pg_fetch_array($ds)) {
$lon = $row["longitude"];
$lat = $row["latitude"];
//if($row["LongOrientation"] == "W") $lon = "-" . $lon;
//if($row["LatOrientation"] == "S") $lat = "-" . $lat;
$stil = "";
$row["sedista"] = NNull($row["sedista"], 0);
/*if($row["Ignition"]."" == "0" && $row["sedista"]."" == "0")*/
$stil = pg_fetch_result($dsStyles, 0, "EngineOFF");
//if($row["Ignition"]."" == "0" && $row["sedista"]."" <> "0") $stil = pg_fetch_result($dsStyles, 0, "EngineOFFPassengerON");
//if($row["Ignition"]."" == "1" && $row["sedista"]."" <> "0" && $row["Taximeter"]."" == "0") $stil = pg_fetch_result($dsStyles, 0, "TaximeterOFFPassengerON");
//if($row["Ignition"]."" == "1" && $row["Taximeter"]."" == "1") $stil = pg_fetch_result($dsStyles, 0, "TaximeterON");
//if($row["Ignition"]."" == "1" && $row["sedista"]."" == "0" and $row["Taximeter"]."" == "0") $stil = pg_fetch_result($dsStyles, 0, "EngineON");
//if($row["passive"]."" == "1") $stil = pg_fetch_result($dsStyles, 0, "PassiveON");
if ($row["status"] . "" == "0") {
$stil = pg_fetch_result($dsStyles, 0, "SatelliteOFF");
}
$str .= "#" . $row["code"] . "|" . $lon . "|" . $lat . "|" . "Gray" . "|" . $row["registration"];
}
} else {
// Ostanati
while ($row = pg_fetch_array($ds)) {
$lon = $row["longitude"];
$lat = $row["latitude"];
//if($row["LongOrientation"] == "W") $lon = "-" . $lon;
//if($row["LatOrientation"] == "S") $lat = "-" . $lat;
$stil = "";
/*if($row["Ignition"]."" == "0") */
$stil = pg_fetch_result($dsStyles, 0, "EngineON");
//if($row["Ignition"]."" == "1") $stil = pg_fetch_result($dsStyles, 0, "EngineOFF");
//if($row["status"] == "1") $stil = pg_fetch_result($dsStyles, 0, "SatelliteOFF");
$str .= "#" . $row["code"] . "|" . $lon . "|" . $lat . "|" . "Gray" . "|" . $row["registration"];
}
}
return $str;
}
示例8: str_replace
<?php
include "../include/functions.php";
include "../include/db.php";
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
$id = str_replace("'", "''", NNull($_GET['id'], ''));
opendb();
$kveri = query("select * from companydaysholiday where id = " . $id);
$idTO = pg_fetch_result($kveri, 0, "holidayid");
$proverka = dlookup("SELECT count(*) FROM companydays where typeofholiday = '" . $idTO . "' and clientid =" . Session("client_id"));
if ($proverka > 0) {
echo 1;
exit;
} else {
$brisi = query("Delete from companydaysholiday where id = " . $id . " and clientid =" . Session("client_id"));
}
closedb();
示例9: session_start
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
session_start();
header("Expires: Mon, 20 Jul 2000 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);
header("Pragma: no-cache");
set_time_limit(0);
opendb();
$uid = str_replace("'", "''", NNull($_GET['uid'], ''));
//echo "select getGeocode(" . $lat . "," . $lon . ") geocode";
$temp = dlookup("select menuorder from users where id=" . $uid);
echo $temp;
closedb();
示例10: str_replace
</script>
<?php
$id = str_replace("'", "''", NNull($_GET['id'], ''));
$dspoi = query("select id,name from pointsofinterest where id =" . $id . " and clientid = " . Session("client_id") . "order by name");
if (pg_num_rows($dspoi) == 0) {
echo dic("Settings.NemaPOI");
} else {
?>
<p><?php
echo dic("Settings.SelectPOI");
?>
</p>
<div id="allCheckboxes2">
<?php
while ($row = pg_fetch_array($dspoi)) {
$count = dlookup("select count(*) from pointsofinterest where id = " . $row["id"] . " and clientid =" . Session("client_id"));
if ($count == 1) {
?>
<input type="checkbox" checked="checked" id="<?php
echo $row["id"];
?>
" /><?php
echo $row["name"];
?>
<br />
<?php
} else {
?>
<input type="checkbox" id="<?php
echo $row["id"];
?>
示例11: nnull
?>
<?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>";
}
} else {
$dsCards = query("select * from clubcards where clientid= " . session("client_id") . " order by id asc");
while ($drCards = pg_fetch_array($dsCards)) {
$cardID = $drCards["id"];
$payStr .= "<option value='k-" . $cardID . "'>" . $drCards["cardname"] . "</option>";
}
}
closedb();
echo $payStr;
exit;
示例12: session_start
<?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();
示例13: nnull
}
$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;
示例14: while
</strong></td>
</tr>
<?php
while ($drData = pg_fetch_array($dsData)) {
if ($drData["checked"] == "1") {
$viewed = "../images/messageread.png";
$style = "style='position:relative; left:-2px'";
} else {
$viewed = "../images/messageunread.png";
$style = "style='height:14px'";
}
$from = dlookup("select fullname from users where id=" . $drData["fromid"]);
if ($drData["toobject"] == 'user') {
$to = dlookup("select fullname from users where id=" . $drData["toid"]);
} else {
$to = dlookup("select registration from vehicles where id=" . $drData["toid"]);
}
?>
<tr class="<?php
echo $drData["userid"];
?>
" height=22px>
<!--<td align="center" style="background-color:#fff; border:1px dotted #B8B8B8;" class="text2" ><?php
echo $cnt;
?>
</td>-->
<td align="center" style="background-color:#fff; border:1px dotted #B8B8B8;" class="text2" ><img src=<?php
echo $viewed;
?>
<?php
示例15: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
?>
<?php
$id = str_replace("'", "''", NNull($_GET['id'], ''));
$mehanizacija = str_replace("'", "''", NNull($_GET['mehanizacijaIme'], ''));
$mehanizacijaRange = str_replace(",", ".", NNull($_GET['mehanizacijaRange'], ''));
if ($mehanizacijaRange == "") {
$mehanizacijaRange = 0;
}
$mehanizacijaCheck = dlookup("SELECT count(*) FROM route_mechanisation WHERE clientid = " . Session("client_id") . " and name = '" . $mehanizacija . "' and name not in (select name from route_mechanisation where id=" . $id . ")");
if ($mehanizacijaCheck > 0) {
echo 1;
} else {
$updt = query("update route_mechanisation set name = '" . $mehanizacija . "', range = " . $mehanizacijaRange . " where id = '" . $id . "' and clientid = " . Session("client_id"));
}
closedb();