本文整理汇总了PHP中FetchArray函数的典型用法代码示例。如果您正苦于以下问题:PHP FetchArray函数的具体用法?PHP FetchArray怎么用?PHP FetchArray使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FetchArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckCookies
function CheckCookies($IsUserChecked)
{
global $lang, $game_config, $basic_pages;
getLang('cookies');
$UserRow = array();
include ROOT_PATH . 'config' . UNIVERSE . '.php';
if (isset($_COOKIE[$game_config['COOKIE_NAME']])) {
$TheCookie = explode("/%/", $_COOKIE[$game_config['COOKIE_NAME']]);
$UserResult = doquery("SELECT * FROM {{table}} WHERE `username` = '" . cleanstring($TheCookie[1]) . "';", 'users');
// On verifie s'il y a qu'un seul enregistrement pour ce nom
if (mysql_num_rows($UserResult) == 0) {
message(sprintf($lang['cookies']['Error1'], cleanstring($TheCookie[1])));
}
$UserRow = FetchArray($UserResult);
// On teste si on a bien le bon UserID
if ($UserRow["id"] != $TheCookie[0]) {
message($lang['cookies']['Error2']);
}
// On teste si le mot de passe est correct !
if (sha($UserRow["password"] . "--" . $dbsettings["secretword"]) !== $TheCookie[2]) {
message($lang['cookies']['Error3']);
}
$NextCookie = implode("/%/", $TheCookie);
// Au cas ou dans l'ancien cookie il etait question de se souvenir de moi
// 3600 = 1 Heure // 86400 = 1 Jour // 31536000 = 365 Jours
// on ajoute au compteur!
if ($TheCookie[3] == 1) {
$ExpireTime = time() + 31536000;
} else {
$ExpireTime = 0;
}
if ($IsUserChecked == false) {
setcookie($game_config['COOKIE_NAME'], $NextCookie, $ExpireTime, "/", "", 0);
}
if (SMALL_LOAD) {
//Just a small query
doquery("UPDATE {{table}} SET `onlinetime` = '" . time() . "' WHERE `id` = '" . $TheCookie[0] . "' LIMIT 1;", 'users');
} else {
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`onlinetime` = '" . time() . "', ";
$QryUpdateUser .= "`current_page` = '" . mysql_real_escape_string($_GET['page']) . "', ";
$QryUpdateUser .= "`user_lastip` = '" . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . "', ";
$QryUpdateUser .= "`user_agent` = '" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "' ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;";
doquery($QryUpdateUser, 'users');
}
$IsUserChecked = true;
}
unset($dbsettings);
$Return['state'] = $IsUserChecked;
$Return['record'] = $UserRow;
return $Return;
}
示例2: array
<div id="planetname[{n}]" class="planetname">{name}</div>
<div id="planet[{n}]" class="planet ">
<img src="{{skin}}/img/planets{moon}/{type}_{subtype}_7.jpg" width="156" height="156" />
</div>
<div id="coords[{n}]" class="coords">
<a href="./?page=galaxy&galaxy={gal}&system={sys}">[{gal}:{sys}:{pos}]</a>
</div>
<div id="" class="fields tips" title="|Current fields / max fields">
<span id="space[{n}]">{current_feild}/{max_feild}</span>
</div>
<div class="clearfloat"></div>
</td>';
$parse['planets'] = '';
$array = array();
$n = 0;
while ($p = FetchArray($planetsrow)) {
$n++;
$pl = PlanetType($p['image']);
$pl['n'] = $n;
$pl['gal'] = $p['galaxy'];
$pl['sys'] = $p['system'];
$pl['pos'] = $p['planet'];
$pl['current_feild'] = $p['field_current'];
$pl['max_feild'] = $p['field_max'];
$pl['name'] = $p['name'];
$pl['moon'] = '';
if ($p['planet_type'] == 3) {
$pl['moon'] = '/moon';
}
$parse['planets'] .= parsetemplate($planetsTPL, $pl);
$array['resources']['metal']['n'] = $lang['Metal'];
示例3: array
require_once ROOT_PATH . 'includes/vars.php';
//Load the variables
require_once ROOT_PATH . 'includes/db.php';
//Load the sql database
require_once ROOT_PATH . 'includes/strings.php';
//Load some strings
//We need some pages to only have a small load on the server.
$basic_pages = array('im', 'fleetajax');
if (in_array($_GET['page'], $basic_pages) && strlen($_GET['page']) > 0) {
define("SMALL_LOAD", true);
} else {
define("SMALL_LOAD", false);
}
// Lecture de la table de configuration
$query = doquery("SELECT * FROM {{table}}", 'config');
while ($row = FetchArray($query)) {
$game_config[$row['config_name']] = $row['config_value'];
}
if (!$InLogin) {
$Result = CheckTheUser($IsUserChecked);
$IsUserChecked = $Result['state'];
$user = $Result['record'];
} else {
// Jeux en mode 'clos' ???
if ($game_config['game_disable'] > 0) {
if ($user['authlevel'] < 1) {
message(stripslashes($game_config['close_reason']), $game_config['game_name']);
}
}
}
require_once ROOT_PATH . 'includes/userconstants.php';
示例4: SelectMultiTable
<?php
/*Modification History:
2008.05.08 RJC Define undefined variables and set undefined constants to text to reduce phperror.log
*/
require_once "includes/variables.php";
include_once "class/BusinessPermitClass.php";
include_once "class/BusinessEstablishmentClass.php";
$staxfee = SelectMultiTable($dbtype, $dbLink, "ebpls_buss_preference", "staxesfees,swaivetax, predcomp", "");
$prefset = FetchArray($dbtype, $staxfee);
$predcomp = $prefset['predcomp'];
$owner_id = isset($owner_id) ? $owner_id : '';
//2008.05.08
if ($owner_id == '') {
$owner_id = 0;
}
$strValues = "edit_by='',edit_locked=0";
$strWhere = "owner_id='{$owner_id}'";
$qu = mysql_query("update ebpls_owner set {$strValues} where {$strWhere}");
$business_id = isset($business_id) ? $business_id : '';
//2008.05.08
if ($business_id != '') {
$ifpaid = SelectDataWhere($dbtype, $dbLink, $permittable, "where owner_id = {$owner_id}\n and business_id = {$business_id} and active = 1");
$strValues = "edit_by='',edit_locked=0";
$strWhere = "business_id='{$business_id}'";
$qu = mysql_query("update ebpls_business_enterprise set {$strValues} where {$strWhere}");
//$ifpaid = mysql_query("select paid from $permittable where owner_id = $owner_id
// and business_id = $business_id and active = 1");
$ifpaid = FetchRow($dbtype, $ifpaid);
$ifpaid = $ifpaid[0];
if ($ifpaid > 0) {
示例5: stripslashes
$msg = stripslashes($re[msg]);
$cellnum = $re[telnum];
$pos7 = strpos($msg, " ");
if ($pos7 == "") {
$pos7 = 4;
}
$keyword = trim(strtolower(substr($msg, 0, $pos7)));
$othermsg = trim(substr($msg, $pos7 + 1, 10));
//get reply
$res = SelectDataWhere($dbtype, $dbLink, "sms_message", "where keyword='{$keyword}'");
$cnt = NumRows($dbtype, $res);
if ($cnt == 0) {
$sendthis = "Your message {$msg} is not a valid message.Please type HELP for more information";
} else {
if ($othermsg == "") {
$sendthis = FetchArray($dbtype, $res);
$sendthis = $sendthis[full_message];
$sendthis = addslashes($sendthis);
} else {
$keyword = strtolower($keyword);
$pt = substr($othermsg, 0, 1);
$pt = strtoupper($pt);
if ($pt == 'B') {
$permit_type = 'Business';
$pld = 'steps, owner_id, business_id';
$idme = 'business_permit_id';
} elseif ($pt == 'M') {
$permit_type = 'Motorized';
$pld = 'steps, owner_id';
$idme = 'motorized_operator_permit_id';
} elseif ($pt == 'F') {
示例6: round
$totfee = round($totfee, 2);
$ttax = $grandamt - $totfee;
$gid = SelectDataWhere($dbtype, $dbLink, "bus_grandamt", "where business_id={$business_id} and active = 0 and\n owner_id={$owner_id} order by gid desc limit 1");
$haveexist = NumRows($dbtype, $gid);
if ($haveexist != 0) {
$mt = FetchRow($dbtype, $gid);
$grdmt = $mt[3];
} else {
$grdmt = $grandamt + $totfee;
}
$tabs = abs($grdmt - $totalpaidtax);
if ($grdmt == '0.00') {
$grdmt = $grandamt;
}
$gettag = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", "");
$gettag = FetchArray($dbtype, $gettag);
if ($gettag[sassess] == '') {
$grdmt = $ota - $add2fee + $totfee;
$tabs = abs($grdmt - $totalpaidtax);
$grandamt = $grdmt;
}
//getpayhistory
$gethis = SelectDataWhere($dbtype, $dbLink, "ebpls_transaction_payment_or_details", "where trans_id={$owner_id} and payment_id={$business_id} and \n\t\t\t transaction='{$istat}' and payment_part='{$s}+1' and \n\t\t\t or_entry_type<>'CHECK'");
$getc = NumRows($dbtype, $gethis);
$gethis = SelectDataWhere($dbtype, $dbLink, "ebpls_transaction_payment_or_details a, \n\t\t\tebpls_transaction_payment_check b", "where a.trans_id={$owner_id} and a.payment_id={$business_id} \n\t\t\t and a.transaction='{$istat}' and a.payment_part='{$s}+1' \n\t\t\t and a.or_entry_type='CHECK' and b.check_status='CLEARED'\n and a.or_no=b.or_no");
$getch = NumRows($dbtype, $gethis);
$gethis = $getc + $getch;
if ($gethis > 0 and $pmode == 'ANNUAL') {
$grdmt = 0;
$tabs = 0;
$grandamt = 0;
示例7: SelectDataWhere
$getot = SelectDataWhere($dbtype, $dbLink, $fee, " where permit_type='{$stat}' and active=1");
$getact = SelectMultiTable($dbtype, $dbLink, "fish_activity", "sum(act_fee)", "where owner_id={$owner_id} and transaction='{$stat}' and active = 1");
$getact = FetchRow($dbtype, $getact);
$tfee1 = $getact[0];
$getboat = SelectDataWhere($dbtype, $dbLink, "fish_assess", "where owner_id={$owner_id}");
while ($getb = FetchArray($dbtype, $getboat)) {
$getfee = SelectDataWhere($dbtype, $dbLink, "culture_fee", "where culture_id='{$getb['culture_id']}' and\n\t\t transaction='{$stat}' and active = 1 ");
$getnum = FetchArray($dbtype, $getfee);
if ($getnum[fee_type] == '3') {
$getfee = SelectDataWhere($dbtype, $dbLink, "culture_range", "where culture_id='{$getb['culture_id']}' and\n\t\t range_lower<{$getb['amt']} and range_higher>={$getb['amt']} ");
$getnum = NumRows($dbtype, $getfee);
if ($getnum == 0) {
$getfee = SelectDataWhere($dbtype, $dbLink, "culture_range", "where culture_id='{$getb['culture_id']}' and\n range_lower<={$getb['amt']} and range_higher=0");
}
}
$getfee1 = FetchArray($dbtype, $getfee);
$ttfee1 = $ttfee1 + $getfee1[amt];
}
?>
<table width=60%>
<tr>
<td>Fees from Boat Registration</td><td><?php
echo number_format($ttfee, 2);
?>
</td>
</tr>
<tr>
<td>Fees from Fish Activities</td><td><?php
echo number_format($ttfee1, 2);
?>
</td>
示例8: Open
<?php
require_once "includes/variables.php";
include "lib/multidbconnection.php";
$dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname);
$wil2 = UpdateQuery($dbtype, $dbLink, "tempbusnature", "retire=1", "owner_id={$owner_id} and\n business_id={$business_id} and\n active=1 and transaction='Retire'");
$updatebusnature = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "owner_id={$owner_id} and\n business_id={$business_id} and transaction='Retire'");
$chkretire = SelectDataWhere($dbtype, $dbLink, "tempbusnature", "where owner_id={$owner_id} and\n business_id={$business_id} and active=1");
$chkretire = FetchRow($dbtype, $chkretire);
if ($chkretire == 0) {
$updateretire = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "retire=1, business_retirement_date=now()", "owner_id={$owner_id} and business_id={$business_id}");
$ubp = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterpr1ise_permit", "active = 0", "owner_id = {$owner_id} and\n business_id = {$business_id}");
} else {
//deact all permit
$ubp = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "active = 0", "owner_id = {$owner_id} and \n\t business_id = {$business_id}");
//active 1
$updatepermit = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "active=1", "owner_id={$owner_id} and business_id={$business_id}\n and transaction<>'Retire' order by business_permit_id desc limit 1");
//change pmode back to orig -- ang orig sa bicol ay baboy
$getpmode = SelectDataWhere($dbtype, $dbLink, "ebpls_business_enterprise_permit", "where owner_id={$owner_id} and business_id={$business_id}\n and pmode<>'' order by business_permit_id desc limit 1");
$pmode = FetchArray($dbtype, $getpmode);
$pmode = $pmode[pmode];
$updatepmode = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "business_payment_mode = '{$pmode}'", "owner_id={$owner_id} and business_id={$business_id}");
}
?>
<body onload="parent.location='index.php?part=4&class_type=Permits&permit_type=Business&busItem=Business&itemID_=2212&mtopsearch=SEARCH'";></body>
示例9: alert
} else {
?>
<body onload='javascript: alert("Cannot Process.
No Payment Is Made");'></body>
<?php
$nopayment = '1';
require_once "includes/payform.php";
}
} else {
$tfee = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "sum(fee_amount)* multi_by", "where owner_id = {$owner_id} and\n permit_type='{$permit_type}'");
$totalfee = FetchRow($dbtype, $tfee);
$totpay = $totalfee[0];
$totchnge = SelectMultiTable($dbtype, $dbLink, "temppayment", "sum(payamt)", "where owner_id = {$owner_id} \n\t\t\t\t and permit_type='{$permit_type}' and status=1\n and permit_status='{$stat}'");
$amtchange = FetchRow($dbtype, $totchnge);
$ort = SelectDataWhere($dbtype, $dbLink, "temppayment", "where owner_id = {$owner_id} and permit_type='{$permit_type}' \n\t\t\t\t and status=1 and permit_status='{$stat}'");
$ort = FetchArray($dbtype, $ort);
$totpaid = $amtchange[0];
$amtchange = $totpay - $amtchange[0];
$orno = $ort[or_no];
//please populate ACCOUNT CODES
$getmax = SelectDataWhere($dbtype, $dbLink, "ebpls_transaction_payment_or", "");
$or = NumRows($dbtype, $getmax);
$or = $or + 1;
$trans_id = $owner_id;
$payment_code = $orno;
$payment_id = 0;
$tax_fee_code = 'taxcode';
$account_code = 'acntcode';
$account_desc = 'acnt desc';
$insertor = InsertQuery($dbtype, $dbLink, "ebpls_transaction_payment_or", "\n (or_no, payment_code, trans_id,or_date,total_amount_due,\n total_amount_less,total_amount_paid,ts_create,payment_officer)", "'{$or}','{$payment_code}', {$trans_id}, now(), {$totpaid},\n {$amtchange}, {$totpaid}, now(),'{$usern}'");
$insertdetails = InsertQuery($dbtype, $dbLink, "ebpls_transaction_payment_or_details", "(or_no,trans_id, payment_id, tax_fee_code,\n account_code, account_nature, account_desc, \n\t\t\t\tamount_due, ts, permit_type)", "'{$or}',{$trans_id}, {$payment_id}, '{$tax_fee_code}',\n '{$account_code}','CREDIT', '{$account_desc}', {$totpaid},\n\t\t\t\tnow(), '{$permit_type}'");
示例10: MissionCaseDestroy
/**
* MissionCaseDestroy.php
*
* @version 1.0
* @copyright 2009 By MadnessRed for XNova Redesigned
*/
function MissionCaseDestroy($FleetRow, $CurrentPlanet)
{
global $resource, $lang, $CombatCaps, $pricelist;
//Get the fleet
$fleet = array();
foreach (explode(';', $FleetRow['array']) as $r) {
$r = explode(',', $r);
$fleet[$r[0]] = $r[1];
}
//Check we still have Deathstarts
if ($fleet[214] > 0) {
$destroyed = array(false, false);
//Firstly is the moon destroyed:
$chance_m = (100 - pow($moonsize, 0.5)) * pow($fleet[214], 0.5);
if ($chance_m > mt_rand(0, 100)) {
//Any fleet going to the moon should be recalled
$tomoon = doquery("SELECT `fleet_id` FROM {{table}} WHERE `target_id` = '" . $CurrentPlanet['id'] . "' AND `fleet_mess` = '0' ;", 'fleets', false);
while ($row = FetchArray($tomoon)) {
$fleetrow = doquery("SELECT *, COUNT('fleet_id') AS `count` FROM {{table}} WHERE `fleet_id` = '" . idstring($row['fleet_id']) . "' AND `fleet_mess` = '0' AND `mission` <> '0' ;", 'fleets', true);
//Check we found the fleet:
if ($fleetrow['count'] == 1) {
//Incase script takes over a second, lets keep now constant.
$now = time();
//Duration in flight
$duration = $now - $fleetrow['departure'];
//ok, lets update the fleet
doquery("UPDATE {{table}} SET `departure` = '" . $now . "', `arrival` = '" . ($now + $duration) . "', `target_id` = '" . $fleetrow['owner_id'] . "', `target_userid` = '" . $fleetrow['owner_userid'] . "', `owner_id` = '" . $fleetrow['target_id'] . "', `owner_userid` = '" . $fleetrow['target_userid'] . "', `fleet_mess` = '1', `mission` = '0' WHERE `fleet_id` = '" . $fleetrow['fleet_id'] . "' ;", 'fleets', false);
//Remove any partner fleets
doquery("DELETE FROM {{table}} WHERE `partner_fleet` = '" . $fleetrow['fleet_id'] . "' ;", 'fleets', false);
//Update menus
doquery("UPDATE {{table}} SET `menus_update` = '" . time() . "' WHERE `id` = '" . $fleetrow['owner_userid'] . "' LIMIT 1 ;", 'users', false);
}
}
//And fleets returning to the moon should go the planet
$planet = doquery("SELECT `id` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '1' LIMIT 1 ;", 'planets', true);
doquery("UPDATE {{table}} SET `target_id` = '" . $planet['id'] . "' WHERE `target_id` = '" . $CurrentPlanet['id'] . "' ;", 'fleets', false);
doquery("UPDATE {{table}} SET `owner_id` = '" . $planet['id'] . "' WHERE `owner_id` = '" . $CurrentPlanet['id'] . "' ;", 'fleets', false);
//Delete the moon
doquery("DELETE FROM {{table}} WHERE `id` = '" . $CurrentPlanet['id'] . "' LIMIT 1 ;", 'planets', false);
//Mark it as destroyed for the message
$destroyed[0] = true;
}
//Secondly are the Deathstars destroyed.
$chance_k = 0.5 * pow($moonsize, 0.5);
if ($chance_k > mt_rand(0, 100)) {
//Are there any other ships in the fleet?
if (array_sum($fleet) > $fleet[214]) {
//Remove rips from the fleet
unset($fleet[214]);
//Compile fleet array
$array = array();
foreach ($fleet as $id => $c) {
$array[] = $id . "," . $c;
}
$array = implode(";", $array);
//Update row
doquery("UPDATE {{table}} SET `array` = '" . $array . "', `count` = `count` - '" . array_sum($fleet) . "' WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' LIMIT 1 ;", 'fleets', false);
} else {
//Just remove the fleet
DeleteFleet($FleetRow['fleet_id']);
}
//Mark it as destroyed for the message
$destroyed[1] = true;
}
//Start the message
$HomePlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $row['target_id'] . "' LIMIT 1 ;", 'planets', true);
$message = '';
$message .= sprintf($lang['fleet_9_mess1'], $HomePlanet['name'] . " [" . $HomePlanet['galaxy'] . ":" . $HomePlanet['system'] . ":" . $HomePlanet['planet'] . "]", "[" . $CurrentPlanet['galaxy'] . ":" . $CurrentPlanet['system'] . ":" . $CurrentPlanet['planet'] . "]");
$message .= sprintf($lang['fleet_9_moon'], $chance_m . '%') . "<br />";
$message .= sprintf($lang['fleet_9_rips'], $chance_k . '%') . "<br />";
$message .= $lang['fleet_9_mess2'];
//So what happen (for the message?)
if ($destroyed[0] && $destroyed[1]) {
//Both moon and RIPs destroyed
$message .= $lang['fleet_9_messD'];
$message .= $lang['fleet_9_messK'];
} elseif ($destroyed[0]) {
//Moon Destroyed
$message .= $lang['fleet_9_messD'];
} elseif ($destroyed[1]) {
//RIPs destroyed
$message .= $lang['fleet_9_messK'];
} else {
//Nothing destroyed
$message .= $lang['fleet_9_messN'];
}
PM($FleetRow['owner_userid'], 0, $message, sprintf($lang['fleet_9_tit'], $CurrentPlanet['name']), $lang['fleet_control'], 2);
PM($FleetRow['target_userid'], 0, $message, sprintf($lang['fleet_9_tit'], $CurrentPlanet['name']), $lang['fleet_control'], 2);
}
}
示例11: eval
$compvalrange = $totind;
} else {
$getd[1] = $range[0];
eval("\$totind={$d}({$xv}{$range['0']};");
$compvalrange = $totind;
}
} else {
$indi = 0;
$xv = 1;
$totind = $getd[1];
$rtag = '';
}
include 'includes/minimum_compute.php';
$getd[0] = addslashes($getd[0]);
$chkiffee = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_tfo", "where tfodesc='{$getd['0']}'");
$chkiffee = FetchArray($dbtype, $chkiffee);
if ($chkiffee[taxfeetype] != 1) {
$totfee = $totfee + $totind;
}
$getd[0] = stripslashes($getd[0]);
if ($getd[4] == 2 or $getd[4] == 3) {
if ($getd[5] != 3) {
$xd = number_format($xv, 2);
print "<tr><td align=left width=25%>{$getd['0']} </td><td align=right>\r\n <input type=hidden name=x[{$varx}] size=5 value={$xv} {$lockit}>{$xd}</td>";
} else {
print "<tr><td align=left width=25%>{$getd['0']} </td><td align=right>{$getd['9']}  \r\n <input type=text name=x[{$varx}] size=5 value=0 {$lockit}></td>";
$tbut = 1;
$xv = 0;
$totind = 0;
}
} elseif ($getd[5] == 3) {
示例12: SelectDataWhere
&busItem=Occupational";'></body>
<?php
}
}
}
}
//end if occupational
/*
if ($owner_id=='') {
$owner_id=$id;
}
*/
if ($permit_type == 'Occupational' || $permit_type == 'Peddlers') {
$totalvec = 1;
}
//need to add drop command
$getcnt = SelectDataWhere($dbtype, $dbLink, $temptbl, "where owner_id={$owner_id}");
$cnts = NumRows($dbtype, $getcnt);
// $lop=1;
for ($lop = 1; $lop <= $cnts; $lop++) {
$gettemp = SelectDataWhere($dbtype, $dbLink, $temptbl, "where owner_id={$owner_id} limit 1");
$getfee = FetchArray($dbtype, $gettemp);
$slash = 'add';
require_once "includes/stripslash.php";
//insert fees to main table
$fee_desc = addslashes($getfee[fee_desc]);
$insertit = InsertQuery($dbtype, $dbLink, "ebpls_fees_paid", "(owner_id, fee_desc, fee_amount, \n\t\t\t\tmulti_by, permit_type, permit_status,\n\t\t\t\tinput_by, input_date)", "{$owner_id}, '{$fee_desc}', {$getfee['fee_amount']}, \n\t\t\t\t{$totalvec}, '{$permit_type}', '{$status}', \n\t\t\t\t'{$usern}', '{$tdate}'");
$deltemp = DeleteQuery($dbtype, $dbLink, $temptbl, "owner_id ={$owner_id} and \n\t\t\t\t\tpermit_type='{$permit_type}' limit 1");
}
}
示例13: SelectMultiTable
//$owner_id=$owner_id;
$owner_first_name = $res[0];
$owner_middle_name = $res[1];
$owner_last_name = $res[2];
if ($tag == 'Occupational' and $permit_type == 'Occupational') {
//$owner_id = $idcnt;
require_once "includes/form_add_mtoppermit.html";
//require_once "includes/form_pay_occu.html";
$getemp = SelectMultiTable($dbtype, $dbLink, "{$permittable} a, ebpls_business_enterprise b", "a.occ_permit_code,a.occ_permit_application_date, \r\n\t\t\t a.occ_position_applied , b.business_name", "where a.owner_id={$owner_id} and a.business_id=b.business_id");
$getit = FetchRow($dbtype, $getemp);
$permit_code = $getit[0];
$pos_app = $getit[2];
$permit_date = $getit[1];
$employer_name = $getit[3];
require_once "includes/form_pay_midoccu.php";
require_once "includes/paymtop.php";
} elseif ($permit_type == 'Peddlers') {
require_once "includes/form_add_mtoppermit.html";
$getemp = SelectDataWhere($dbtype, $dbLink, $permittable, "where owner_id={$owner_id}");
$getit = FetchArray($dbtype, $getemp);
$merchandise = stripslashes($getit[merchandise_sold]);
$peddler_bus = stripslashes($getit[peddlers_business_name]);
$apply = $getit[application_date];
$permid = $getit[peddlers_permit_id];
require_once "includes/form_pay_midpeddler.html";
require_once "includes/paymtop.php";
} else {
require_once "includes/form_add_mtoppermit.html";
require_once "includes/paymtop.php";
}
}
示例14: DestroyPlanet
/**
* DestroyPlanet.php
*
* @version 1.0
* @copyright 2010 By MadnessRed for XNova Redesigned
*/
function DestroyPlanet($id, $CurrentUser = false, $CurrentPlanet = false, $moon_dest = false)
{
//Do we have the current planet?
if (!$CurrentPlanet) {
$CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . idstring($id) . "' LIMIT 1 ;", "planets", true);
}
//Do we have the current user?
if (!$CurrentUser) {
$CurrentUser = doquery("SELECT * FROM {{table}} WHERE `id` = '" . idstring($CurrentPlanet['id_owner']) . "' LIMIT 1 ;", "users", true);
}
//Destroy the planet
if ($CurrentPlanet['planet_type'] == 1) {
//Destroy the planet
$destruyed = time() + 60 * 60 * 24;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= "`destruyed` = '" . $destruyed . "', ";
$QryUpdatePlanet .= "`id_owner` = '0' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '" . $CurrentPlanet['id'] . "' AND `id_owner` = '" . $CurrentUser['id'] . "' LIMIT 1;";
doquery($QryUpdatePlanet, 'planets');
//Delete the moon
$QryUpdateMoon = "SELECT `id` FROM {{table}} WHERE ";
$QryUpdateMoon .= "`galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND ";
$QryUpdateMoon .= "`system` = '" . $CurrentPlanet['system'] . "' AND ";
$QryUpdateMoon .= "`planet` = '" . $CurrentPlanet['planet'] . "' AND ";
$QryUpdateMoon .= "`planet_type` = '3' LIMIT 1 ;";
$moon = doquery($QryUpdateMoon, 'planets');
if ($moon['id'] > 0) {
DestroyPlanet($moon['id'], $CurrentUser);
}
//Delete the moon
} else {
$QryUpdatePlanet = "DELETE FROM {{table}} WHERE ";
$QryUpdatePlanet .= "`id` = '" . $CurrentUser['current_planet'] . "' AND ";
$QryUpdatePlanet .= "`id_owner` = '" . $CurrentUser['id'] . "' LIMIT 1;";
doquery($QryUpdatePlanet, 'planets');
//If this is a destroy fleet, get the orbitted planet
if ($moon_dest) {
$QryUpdateMoon = "SELECT `id` FROM {{table}} WHERE ";
$QryUpdateMoon .= "`galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND ";
$QryUpdateMoon .= "`system` = '" . $CurrentPlanet['system'] . "' AND ";
$QryUpdateMoon .= "`planet` = '" . $CurrentPlanet['planet'] . "' AND ";
$QryUpdateMoon .= "`planet_type` = '1' LIMIT 1 ;";
$planet = doquery($QryUpdateMoon, 'planets');
}
}
//Set the user to his homeworld
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`current_planet` = `id_planet`, ";
$QryUpdateUser .= "`menus_update` = '" . time() . "' ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '" . $CurrentUser['id'] . "' LIMIT 1";
doquery($QryUpdateUser, "users");
//Deal with any fleets
//Recall and fleets going to this planet
$incoming = doquery("SELECT `fleet_id` FROM {{table}} WHERE `target_id` = " . $CurrentPlanet['id'] . " AND `fleet_mess` = '0' ;", 'fleets');
while ($row = FetchArray($incoming)) {
RecallFleet($row['fleet_id']);
}
//Get all fleets returning to this planet
if ($moon_dest) {
//Divert returning fleets to the planet
$incoming = doquery("UPDATE {{table}} SET `target_id` = " . $planet['id'] . " WHERE `target_id` = " . $CurrentPlanet['id'] . " AND `fleet_mess` = '1' ;", 'fleets');
} else {
//This planet was not destroyed that way, jsut remove any ships going to it.
doquery("DELETE FROM {{table}} WHERE `target_id` = " . $CurrentPlanet['id'] . " AND `fleet_mess` = '1' ;", 'fleets', false, true);
}
}
示例15: eval
//formula
eval("\$tfee={$ft['1']}{$gf['3']};");
?>
<td><?php
echo number_format($tfee, 2);
?>
</td>
<?php
} elseif ($gf[2] == '3') {
//range
$getr = SelectDataWhere($dbtype, $dbLink, "culture_range", "where\n\t\t\tculture_id={$getengine211['culture_id']} and range_lower<={$ft['1']} and\n\t\t\trange_higher >= {$ft['1']}");
$numr = NumRows($dbtype, $getr);
if ($numr == 0) {
$getr = SelectDataWhere($dbtype, $dbLink, "culture_range", "where\n culture_id={$getengine211['culture_id']} and range_lower<={$ft['1']} and\n range_higher = '0'");
}
$getre = FetchArray($dbtype, $getr);
if (is_numeric($getre[amt])) {
?>
<td><?php
$tfee = $getre[amt];
echo number_format($getre[amt], 2);
?>
</td>
<?php
} else {
eval("\$tfee={$ft['1']}{$getre['amt']};");
?>
<td><?php
echo number_format($tfee, 2);
?>
</td>