<?php if (!empty($_POST['code'])) { require_once 'functions/VipMgr.php'; $VipMgr = new VipMgr(); $msg = $VipMgr->buy_coins($config, $player, $_POST['code']); $player = getUser($config); $player->town = getTown($config, $player); } if (!empty($_GET['type'])) { require_once 'functions/VipMgr.php'; $VipMgr = new VipMgr(); $msg = $VipMgr->use_coins($config, $player, $_GET['type']); $player = getUser($config); $player->town = getTown($config, $player); } ?> <div class="pageSubnav" id="armyNav"> <h2>Vip</h2> <ul class="buttons"> <li><a href="?action=vip">Kup monety</a></li> <li><a href="?action=vip&act=vip">Opcje</a></li> </ul> </div> <DIV id="content" class="contentNormal"> <div class='box'>
/** * function to process a town * @param: $town * @param: $country */ function processTown($town,$country) { global $datetime,$user; //a townID is usually what is submitted in the $town variable if(!getTown($town)) { $query=0; $query=mysqlquery("select distinct town from vl_countries where (lower(town)=lower('$town') or townID='$town') and lower(country)=lower('$country')"); //if no town but country exists if(!mysqlnumrows($query) && getCountryID($country)) { //process a townID $tquery=0; $tquery=mysqlquery("select max(townID) maxID from vl_countries"); $townID=0; $townID=mysqlresult($tquery,0,'maxID')+1; mysqlquery("insert into vl_countries (countryID,country,townID,town,phonecode,created,createdby) values ('".getCountryID($country)."','$country','$townID','$town','".getPhoneCode($country)."','$datetime','$user')"); return $townID; } } }
/** * function to get the towns for a given country * @param: $country */ function getCustomisedTownsInCountry($country,$default,$fieldName,$fieldID) { //get the towns first $query=0; $query=mysqlquery("select distinct townID,town from vl_countries where lower(country)=lower('$country') and published=1 order by town"); if(mysqlnumrows($query)) { $return=0; $return="<select name=\"$fieldName\" id=\"$fieldName\" class=\"search\" onChange=\"if((this.form).$fieldName.value=='Other') { loadInput('$fieldName','$fieldID','$default'); }\">"; if($default) { $return.="<option value=\"".(is_numeric($default)?$default:getTownID($default))."\" selected>".(is_numeric($default)?getTown($default):$default)."</option>"; } else { $return.="<option value=\"\" selected>- select ".removeSpecialCharacters((getTextAttributesInCountry("city",$country,0)?getTextAttributesInCountry("city",$country,0):"town"))." -</option>"; } $q=array(); while($q=mysqlfetcharray($query)) { $return.="<option value=\"$q[townID]\">".removeSpecialCharacters($q[town])."</option>"; } $return.="<option value=\"Other\">Other</option>"; $return.="</select>"; } else { $return=0; $return="<input name=\"$fieldName\" type=\"text\" class=\"search\" id=\"$fieldName\" value=\"\" size=\"25\" maxlength=\"250\">"; } return $return; }