本文整理汇总了PHP中curdate函数的典型用法代码示例。如果您正苦于以下问题:PHP curdate函数的具体用法?PHP curdate怎么用?PHP curdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了curdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flushCredit
public function flushCredit($login)
{
global $billing;
$login = mysql_real_escape_string($login);
$credit = 0;
$curdate = curdate();
$billing->setcredit($login, $credit);
log_register('CHANGE FIX Credit (' . $login . ') ON ' . $credit);
$billing->setcreditexpire($login, $curdate);
log_register('CHANGE FIX CreditExpire (' . $login . ') ON ' . $curdate);
}
示例2: init
public static function init()
{
self::$prefix = HOST . ':hash:';
@(self::$hash = $_COOKIE['hash']);
if (self::$hash and R::EXISTS(self::$prefix . self::$hash)) {
$pipeline = R::pipeline();
$pipeline->HSET(self::$prefix . self::$hash, 'LAST', now());
$pipeline->EXPIRE(self::$prefix . self::$hash, USER_SESSION_TIMEOUT);
$pipeline->execute();
self::setCookie();
self::$me = R::toHash(R::HGETALL(self::$prefix . self::$hash));
} else {
self::login();
}
if (USER_STAT) {
$IP = IP();
$STAMP = curdate();
$HOST = HOST;
$HASH = self::$hash;
$METHOD = IS_AJAX ? 'AJAX' : (IS_POST ? 'POST' : 'GET');
R::RPUSH("{$HOST}:stat:{$STAMP}:{$IP}:{$HASH}", implode(chr(10), array(now(), $METHOD, REF(), SITE . URI())));
}
}
示例3: renderTurboSMSQueue
/**
* Render TurboSMS server-side queue
*
* @return string
*/
public function renderTurboSMSQueue()
{
$result = '';
$tsms_host = $this->settings['TSMS_GATEWAY'];
$tsms_db = 'users';
$tsms_login = $this->settings['TSMS_LOGIN'];
$tsms_password = $this->settings['TSMS_PASSWORD'];
$tsms_table = $this->settings['TSMS_LOGIN'];
$smsArray = array();
$total = 0;
$TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
$TsmsDB->open() or die($TsmsDB->error());
$TsmsDB->query('SET NAMES utf8;');
if (wf_CheckPost(array('showdate'))) {
$date = mysql_real_escape_string($_POST['showdate']);
} else {
$date = '';
}
if (!empty($date)) {
$where = " WHERE `send_time` LIKE '" . $date . "%' ORDER BY `id` DESC;";
} else {
$where = ' ORDER BY `id` DESC LIMIT 50;';
}
$query = "SELECT * from `" . $tsms_table . "`" . $where;
$TsmsDB->query($query);
while ($row = $TsmsDB->fetchassoc()) {
$smsArray[] = $row;
}
//close old datalink
$TsmsDB->close();
//rendering result
$inputs = wf_DatePickerPreset('showdate', curdate());
$inputs .= wf_Submit(__('Show'));
$dateform = wf_Form("", 'POST', $inputs, 'glamour');
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('Msg ID'));
$cells .= wf_TableCell(__('Mobile'));
$cells .= wf_TableCell(__('Sign'));
$cells .= wf_TableCell(__('Message'));
$cells .= wf_TableCell(__('Balance'));
$cells .= wf_TableCell(__('Cost'));
$cells .= wf_TableCell(__('Send time'));
$cells .= wf_TableCell(__('Sended'));
$cells .= wf_TableCell(__('Status'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($smsArray)) {
foreach ($smsArray as $io => $each) {
$cells = wf_TableCell($each['id']);
$cells .= wf_TableCell($each['msg_id']);
$cells .= wf_TableCell($each['number']);
$cells .= wf_TableCell($each['sign']);
$msg = wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200');
$cells .= wf_TableCell($msg);
$cells .= wf_TableCell($each['balance']);
$cells .= wf_TableCell($each['cost']);
$cells .= wf_TableCell($each['send_time']);
$cells .= wf_TableCell($each['sended']);
$cells .= wf_TableCell($each['status']);
$rows .= wf_TableRow($cells, 'row5');
$total++;
}
}
$result .= wf_Link(self::URL_ME, __('Back'), true, 'ubButton');
$result .= $dateform;
$result .= wf_TableBody($rows, '100%', '0', 'sortable');
$result .= __('Total') . ': ' . $total;
return $result;
}
示例4: testCurdate
public function testCurdate()
{
$this->assertEquals(intval(curdate()) > 2010, true);
}
示例5: dateControl
/**
* show calendar contol form
*
* @return string
*/
public function dateControl()
{
if (wf_CheckPost(array('showdate'))) {
$curdate = $_POST['showdate'];
} else {
$curdate = curdate();
}
$inputs = wf_DatePickerPreset('showdate', $curdate);
$inputs .= wf_Submit(__('Show'));
$result = wf_Form('', 'POST', $inputs, 'glamour');
return $result;
}
示例6: web_TsmsDateForm
function web_TsmsDateForm()
{
$inputs = __('By date') . ' ' . wf_DatePickerPreset('showqueuedate', curdate());
$inputs .= wf_Submit(__('Show'));
$result = wf_Form("", "POST", $inputs, 'glamour');
return $result;
}
示例7: web_PayFindForm
function web_PayFindForm()
{
//try to save calendar states
if (wf_CheckPost(array('datefrom', 'dateto'))) {
$curdate = $_POST['dateto'];
$yesterday = $_POST['datefrom'];
} else {
$curdate = date("Y-m-d", time() + 60 * 60 * 24);
$yesterday = curdate();
}
$inputs = __('Date');
$inputs .= wf_DatePickerPreset('datefrom', $yesterday) . ' ' . __('From');
$inputs .= wf_DatePickerPreset('dateto', $curdate) . ' ' . __('To');
$inputs .= wf_delimiter();
$inputs .= wf_CheckInput('type_payid', '', false, false);
$inputs .= wf_TextInput('payid', __('Search by payment ID'), '', true, '10');
$inputs .= wf_CheckInput('type_contract', '', false, false);
$inputs .= wf_TextInput('contract', __('Search by users contract'), '', true, '10');
$inputs .= wf_CheckInput('type_login', '', false, false);
$inputs .= wf_TextInput('login', __('Search by users login'), '', true, '10');
$inputs .= wf_CheckInput('type_summ', '', false, false);
$inputs .= wf_TextInput('summ', __('Search by payment sum'), '', true, '10');
$inputs .= wf_CheckInput('type_cashtype', '', false, false);
$inputs .= web_CashTypeSelector() . wf_tag('label', false, '', 'for="cashtype"') . __('Search by cash type') . wf_tag('label', true) . wf_tag('br');
$inputs .= wf_CheckInput('type_cashier', '', false, false);
$inputs .= web_PayFindCashierSelector();
$inputs .= wf_CheckInput('type_tagid', '', false, false);
$inputs .= web_PayFindTagidSelector();
$inputs .= wf_CheckInput('type_paysys', '', false, false);
$inputs .= web_PaySysPercentSelector();
$inputs .= wf_Link("?module=payfind&confpaysys=true", __('Settings')) . wf_tag('br');
$inputs .= wf_CheckInput('only_positive', __('Show only positive payments'), true, false);
$inputs .= wf_CheckInput('numeric_notes', __('Show payments with numeric notes'), true, false);
$inputs .= wf_CheckInput('numericonly_notes', __('Show payments with only numeric notes'), true, false);
//ugly spacing hack
$inputs .= ' ' . web_PayFindTableSelect() . wf_delimiter();
$inputs .= wf_HiddenInput('dosearch', 'true');
$inputs .= wf_Submit(__('Search'));
$result = wf_Form('', 'POST', $inputs, 'glamour');
$result .= wf_Link("?module=report_finance", __('Back'), true, 'ubButton');
return $result;
}
示例8: mysql_real_escape_string
<?php
include 'config.inc.php';
require_once 'functions.php';
if (isset($_POST['submit']) == 'Submit') {
$fname = mysql_real_escape_string($_POST['fname']);
$lname = mysql_real_escape_string($_POST['lname']);
$email = mysql_real_escape_string($_POST['email']);
$pass = mysql_real_escape_string($_POST['pass']);
$utype = mysql_real_escape_string($_POST['utype']);
$data = array('firstname' => $fname, 'lastname' => $lname, 'email' => $email, 'password' => $pass, 'user_type' => $utype, 'status' => 1, 'date' => curdate());
InsertPDO('library_user', $data);
header("Location: index.php");
}
include 'header.php';
?>
<script language="javascript">
function validform(){
var y=document.forms["myForm"]["fname"].value;
if(y==null || y=="" || y.length<3)
{
alert('please enter your First name which is more than 3 character');
document.forms["myForm"]["fname"].focus();
return false;
}
var p=document.forms["myForm"]["lname"].value;
if(p==null || p=="" || p.length<2)
{
alert('please enter your Last name which is more than 2 character');
document.forms["myForm"]["lname"].focus();
return false;
示例9: tasksProcessing
/**
* Performs available tasks processing
*
* @return void
*/
public function tasksProcessing()
{
global $billing;
$curdate = curdate();
$rawUsers = zb_UserGetAllStargazerData();
$allUsers = array();
if (!empty($rawUsers)) {
foreach ($rawUsers as $io => $each) {
$allUsers[$each['login']] = $each;
}
}
if (!empty($this->allTasks)) {
foreach ($this->allTasks as $io => $each) {
if ($each['date'] == $curdate) {
if (isset($allUsers[$each['login']])) {
$login = $each['login'];
$param = $each['param'];
switch ($each['action']) {
case 'addcash':
zb_CashAdd($login, $param, 'add', 1, 'SCHEDULED');
break;
case 'corrcash':
zb_CashAdd($login, $param, 'correct', 1, 'SCHEDULED');
break;
case 'setcash':
zb_CashAdd($login, $param, 'set', 1, 'SCHEDULED');
break;
case 'credit':
$billing->setcredit($login, $param);
log_register('CHANGE Credit (' . $login . ') ON ' . $param);
break;
case 'creditexpire':
$billing->setcreditexpire($login, $param);
log_register('CHANGE CreditExpire (' . $login . ') ON ' . $param);
break;
case 'tariffchange':
$billing->settariff($login, $param);
log_register('CHANGE Tariff (' . $login . ') ON `' . $param . '`');
//optional user reset
if ($this->altCfg['TARIFFCHGRESET']) {
$billing->resetuser($login);
log_register('RESET User (' . $login . ')');
}
break;
case 'tagadd':
stg_add_user_tag($login, $param);
break;
case 'tagdel':
stg_del_user_tagid($login, $param);
break;
case 'freeze':
$billing->setpassive($login, 1);
log_register('CHANGE Passive (' . $login . ') ON 1');
break;
case 'unfreeze':
$billing->setpassive($login, 0);
log_register('CHANGE Passive (' . $login . ') ON 0');
break;
case 'reset':
$billing->resetuser($login);
log_register('RESET User (' . $login . ')');
break;
case 'setspeed':
zb_UserDeleteSpeedOverride($login);
zb_UserCreateSpeedOverride($login, $param);
$billing->resetuser($login);
log_register("RESET User (" . $login . ")");
break;
case 'down':
$billing->setdown($login, 1);
log_register('CHANGE Down (' . $login . ') ON 1');
break;
case 'undown':
$billing->setdown($login, 0);
log_register('CHANGE Down (' . $login . ') ON 0');
break;
case 'ao':
$billing->setao($login, 1);
log_register('CHANGE AlwaysOnline (' . $login . ') ON 1');
break;
case 'unao':
$billing->setao($login, 0);
log_register('CHANGE AlwaysOnline (' . $login . ') ON 0');
break;
}
//flush task from database
$this->setTaskIsDone($each['id']);
} else {
log_register('SCHEDULER FAIL ID [' . $taskId . '] USER (' . $each['login'] . ') NON EXISTS');
$this->deleteTask($taskId);
}
}
}
}
}
示例10: web_PaymentsByUser
/**
* Returns list of previous user payments
*
* @param string $login
* @return string
*/
function web_PaymentsByUser($login)
{
global $ubillingConfig;
$allpayments = zb_CashGetUserPayments($login);
$alter_conf = $ubillingConfig->getAlter();
$alltypes = zb_CashGetAllCashTypes();
$allservicenames = zb_VservicesGetAllNamesLabeled();
$total_payments = "0";
$curdate = curdate();
$deletingAdmins = array();
$editingAdmins = array();
$iCanDeletePayments = false;
$iCanEditPayments = false;
$currentAdminLogin = whoami();
//extract admin logins with payments delete rights
if (!empty($alter_conf['CAN_DELETE_PAYMENTS'])) {
$deletingAdmins = explode(',', $alter_conf['CAN_DELETE_PAYMENTS']);
$deletingAdmins = array_flip($deletingAdmins);
}
//extract admin logins with date edit rights
if (!empty($alter_conf['CAN_EDIT_PAYMENTS'])) {
$editingAdmins = explode(',', $alter_conf['CAN_EDIT_PAYMENTS']);
$editingAdmins = array_flip($editingAdmins);
}
//setting editing/deleting flags
$iCanDeletePayments = isset($deletingAdmins[$currentAdminLogin]) ? true : false;
$iCanEditPayments = isset($editingAdmins[$currentAdminLogin]) ? true : false;
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('IDENC'));
$cells .= wf_TableCell(__('Date'));
$cells .= wf_TableCell(__('Payment'));
$cells .= wf_TableCell(__('Balance before'));
$cells .= wf_TableCell(__('Cash type'));
$cells .= wf_TableCell(__('Payment note'));
$cells .= wf_TableCell(__('Admin'));
$cells .= wf_TableCell(__('Actions'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($allpayments)) {
foreach ($allpayments as $eachpayment) {
if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) {
$eachpayment['note'] = zb_TranslatePaymentNote($eachpayment['note'], $allservicenames);
}
//hightlight of today payments
if ($alter_conf['HIGHLIGHT_TODAY_PAYMENTS']) {
if (ispos($eachpayment['date'], $curdate)) {
$hlight = 'paytoday';
} else {
$hlight = 'row3';
}
} else {
$hlight = 'row3';
}
if (!empty($alter_conf['DOCX_SUPPORT']) && !empty($alter_conf['DOCX_CHECK'])) {
$printcheck = wf_Link('?module=printcheck&paymentid=' . $eachpayment['id'], wf_img('skins/printer_small.gif', __('Print')), false);
} else {
$printcheck = wf_tag('a', false, '', 'href="#" onClick="window.open(\'?module=printcheck&paymentid=' . $eachpayment['id'] . '\',\'checkwindow\',\'width=800,height=600\')"');
$printcheck .= wf_img('skins/printer_small.gif', __('Print'));
$printcheck .= wf_tag('a', true);
}
//payments deleting controls
if ($iCanDeletePayments) {
$deleteControls = wf_JSAlert('?module=addcash&username=' . $login . '&paymentdelete=' . $eachpayment['id'], wf_img('skins/delete_small.png', __('Delete')), __('Removing this may lead to irreparable results')) . ' ';
} else {
$deleteControls = '';
}
//payments editing form
if ($iCanEditPayments) {
$editControls = wf_modalAuto(wf_img_sized('skins/icon_edit.gif', __('Edit'), '10'), __('Edit'), web_PaymentEditForm($eachpayment), '') . ' ';
} else {
$editControls = '';
}
$cells = wf_TableCell($eachpayment['id']);
$cells .= wf_TableCell(zb_NumEncode($eachpayment['id']));
$cells .= wf_TableCell($eachpayment['date']);
$cells .= wf_TableCell($eachpayment['summ']);
$cells .= wf_TableCell($eachpayment['balance']);
$cells .= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']]));
$cells .= wf_TableCell($eachpayment['note']);
$cells .= wf_TableCell($eachpayment['admin']);
$cells .= wf_TableCell($deleteControls . $editControls . $printcheck);
$rows .= wf_TableRow($cells, $hlight);
$total_payments = $total_payments + $eachpayment['summ'];
}
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
$result .= __('Total payments') . ': ' . wf_tag('b') . abs($total_payments) . wf_tag('b') . wf_tag('br');
return $result;
}
示例11: web_SignupsShowToday
function web_SignupsShowToday()
{
$query = "SELECT COUNT(`id`) from `userreg` WHERE `date` LIKE '" . curdate() . "%'";
$sigcount = simple_query($query);
$sigcount = $sigcount['COUNT(`id`)'];
show_window(__('Today signups') . ': ' . $sigcount, '');
}
示例12: renderSubscribtionsReportDaily
/**
* Renders default subscriptions report
*
* @return string
*/
public function renderSubscribtionsReportDaily()
{
$result = '';
$defaultDateTo = strtotime(curdate()) + 86400;
$defaultDateTo = date("Y-m-d", $defaultDateTo);
$inputs = wf_DatePickerPreset('datefrom', date("Y-m") . '-01', true);
$inputs .= wf_DatePickerPreset('dateto', $defaultDateTo, true);
$inputs .= wf_Submit(__('Show'));
$result .= wf_Form('', 'POST', $inputs, 'glamour');
$dateFrom = wf_CheckPost(array('datefrom')) ? mysql_real_escape_string($_POST['datefrom']) : date("Y-m") . '-01';
$dateTo = wf_CheckPost(array('dateto')) ? mysql_real_escape_string($_POST['dateto']) : $defaultDateTo;
$query = "SELECT * from `payments` WHERE `date` BETWEEN '" . $dateFrom . "' AND '" . $dateTo . "' AND `note` LIKE 'MEGOGO:%';";
$raw = simple_queryall($query);
$totalSumm = 0;
$tmpArr = array();
if (!empty($raw)) {
foreach ($raw as $io => $each) {
$tariffId = explode(':', $each['note']);
$tariffId = $tariffId[1];
if (isset($tmpArr[$tariffId])) {
$tmpArr[$tariffId]['summ'] = $tmpArr[$tariffId]['summ'] + abs($each['summ']);
$tmpArr[$tariffId]['count']++;
//try&buy user
if ($each['summ'] == 0) {
$tmpArr[$tariffId]['freeperiod']++;
}
} else {
$tmpArr[$tariffId]['summ'] = abs($each['summ']);
$tmpArr[$tariffId]['count'] = 1;
//try&buy user
if ($each['summ'] == 0) {
$tmpArr[$tariffId]['freeperiod'] = 1;
} else {
$tmpArr[$tariffId]['freeperiod'] = 0;
}
}
}
if (!empty($tmpArr)) {
$cells = wf_TableCell(__('Tariff'));
$cells .= wf_TableCell(__('Fee') . ' / ' . __('month'));
$cells .= wf_TableCell(__('days'));
$cells .= wf_TableCell(__('Free period'));
$cells .= wf_TableCell(__('Total payments'));
$cells .= wf_TableCell(__('Profit'));
$rows = wf_TableRow($cells, 'row1');
foreach ($tmpArr as $io => $each) {
$cells = wf_TableCell(@$this->allTariffs[$io]['name']);
$cells .= wf_TableCell(@$this->allTariffs[$io]['fee']);
$cells .= wf_TableCell($each['count']);
$cells .= wf_TableCell($each['freeperiod']);
$cells .= wf_TableCell($each['summ']);
$cells .= wf_TableCell(zb_Percent($each['summ'], $this->altCfg['MG_PERCENT']));
$rows .= wf_TableRow($cells, 'row3');
$totalSumm = $totalSumm + $each['summ'];
}
$cells = wf_TableCell(wf_tag('b') . __('Total') . wf_tag('b', true));
$cells .= wf_TableCell('');
$cells .= wf_TableCell('');
$cells .= wf_TableCell('');
$cells .= wf_TableCell($totalSumm);
$cells .= wf_TableCell(zb_Percent($totalSumm, $this->altCfg['MG_PERCENT']));
$rows .= wf_TableRow($cells, 'row2');
$result .= wf_TableBody($rows, '100%', 0, '');
}
} else {
$result .= $this->messages->getStyledMessage(__('Nothing found'), 'info');
}
return $result;
}
示例13: unset
<th>Artikelnaam</th>
<th>Omschrijving</th>
<th>Verkoopprijs</th>
<th>Afbeelding</th>
<th>Aantal</th>
<th>Subtotaal</th>
<th>Verwijderen</th>
</tr>
</thead>
<tbody>
<?php
if (isset($_POST['bestel'])) {
unset($_POST['table_length']);
unset($_POST['bestel']);
$curedate = curdate();
global $db;
$sth = $db->prepare("INSERT INTO bestelling (Datum, GebruikerID, Geexporteerd) VALUES (:curdate, :GebruikerID, 0)");
$sth->bindParam(":GebruikerID", $_SESSION['GebruikerID']);
$sth->bindParam(":curdate", $curedate);
$sth->execute();
$lastInsertId = $db->lastInsertId();
foreach ($_POST as $productid => $aantal) {
$sth = $db->prepare("SELECT Verkoopprijs FROM product WHERE ProductID = :ProductID");
$sth->bindParam(":ProductID", $productid);
$sth->execute();
$VerkoopPrijs = $sth->fetchAll(PDO::FETCH_ASSOC);
$VerkoopPrijs = $VerkoopPrijs['0']['Verkoopprijs'];
$Totaal = $VerkoopPrijs * $aantal;
$sth = $db->prepare("INSERT INTO bestelling_product (BestellingID, ProductID, Aantal, Verkoopprijs, Totaalprijs) VALUES (:lastid, :ProductID, :Aantal, :Verkoopprijs, :Totaalprijs)");
$sth->bindParam(":lastid", $lastInsertId);
示例14: paymentSearchForm
/**
* returns payments search form
*
* @return string
*/
public function paymentSearchForm()
{
//try to save calendar states
if (wf_CheckPost(array('datefrom', 'dateto'))) {
$curdate = $_POST['dateto'];
$yesterday = $_POST['datefrom'];
} else {
$curdate = date("Y-m-d", time() + 60 * 60 * 24);
$yesterday = curdate();
}
//try to save cashtype selector state
if (wf_CheckPost(array('cashtypeid'))) {
$currentCashtypeId = $_POST['cashtypeid'];
} else {
//cash money by default
$currentCashtypeId = 1;
}
$allcashtypes = zb_CashGetAlltypes();
$cashTypesArr = array();
if (!empty($allcashtypes)) {
foreach ($allcashtypes as $io => $each) {
$cashTypesArr[$each['id']] = __($each['cashtype']);
}
}
$cashTypesArr['any'] = __('Any');
$inputs = __('Date');
$inputs .= wf_DatePickerPreset('datefrom', $yesterday) . ' ' . __('From');
$inputs .= wf_DatePickerPreset('dateto', $curdate) . ' ' . __('To') . ' ';
$inputs .= wf_Selector('cashtypeid', $cashTypesArr, __('Cash type'), $currentCashtypeId, false);
$inputs .= wf_HiddenInput('dosearch', 'true');
$inputs .= wf_Submit(__('Search'));
$result = wf_Form("", 'POST', $inputs, 'glamour');
return $result;
}
示例15: zb_TemplateReplace
/**
* Replaces all known macro in template with per-user values for selected user
*
* @param string $login existing user login
* @param string $template raw template
* @param array $alluserdata collected userdata
* @return string
*/
function zb_TemplateReplace($login, $template, $alluserdata)
{
$result = '';
if (!empty($alluserdata)) {
$result .= $template;
//known macro
$result = str_ireplace('{LOGIN}', $alluserdata[$login]['login'], $result);
$result = str_ireplace('{PASSWORD}', $alluserdata[$login]['password'], $result);
$result = str_ireplace('{USERHASH}', $alluserdata[$login]['userhash'], $result);
$result = str_ireplace('{TARIFF}', $alluserdata[$login]['tariff'], $result);
$result = str_ireplace('{TARIFFPRICE}', $alluserdata[$login]['tariffprice'], $result);
$result = str_ireplace('{CASH}', $alluserdata[$login]['cash'], $result);
$result = str_ireplace('{ROUNDCASH}', round($alluserdata[$login]['cash'], 2), $result);
$result = str_ireplace('{CURDATE}', curdate(), $result);
$result = str_ireplace('{CREDIT}', $alluserdata[$login]['credit'], $result);
$result = str_ireplace('{DOWN}', $alluserdata[$login]['down'], $result);
$result = str_ireplace('{PASSIVE}', $alluserdata[$login]['passive'], $result);
$result = str_ireplace('{AO}', $alluserdata[$login]['ao'], $result);
$result = str_ireplace('{CONTRACT}', $alluserdata[$login]['contract'], $result);
$result = str_ireplace('{REALNAME}', $alluserdata[$login]['realname'], $result);
$result = str_ireplace('{ADDRESS}', $alluserdata[$login]['address'], $result);
$result = str_ireplace('{EMAIL}', $alluserdata[$login]['email'], $result);
$result = str_ireplace('{PAYID}', $alluserdata[$login]['payid'], $result);
$result = str_ireplace('{TRAFFIC}', $alluserdata[$login]['traffic'], $result);
$result = str_ireplace('{TRAFFICDOWN}', $alluserdata[$login]['trafficdown'], $result);
$result = str_ireplace('{TRAFFICUP}', $alluserdata[$login]['trafficup'], $result);
$result = str_ireplace('{IP}', $alluserdata[$login]['ip'], $result);
$result = str_ireplace('{MAC}', $alluserdata[$login]['mac'], $result);
$result = str_ireplace('{NETID}', $alluserdata[$login]['netid'], $result);
$result = str_ireplace('{HOSTID}', $alluserdata[$login]['hostid'], $result);
$result = str_ireplace('{NASID}', $alluserdata[$login]['nasid'], $result);
$result = str_ireplace('{NASIP}', $alluserdata[$login]['nasip'], $result);
$result = str_ireplace('{NASNAME}', $alluserdata[$login]['nasname'], $result);
$result = str_ireplace('{NASTYPE}', $alluserdata[$login]['nastype'], $result);
$result = str_ireplace('{SPEEDDOWN}', $alluserdata[$login]['speeddown'], $result);
$result = str_ireplace('{SPEEDUP}', $alluserdata[$login]['speedup'], $result);
$result = str_ireplace('{PBIRTH}', $alluserdata[$login]['birthdate'], $result);
$result = str_ireplace('{PNUM}', $alluserdata[$login]['passportnum'], $result);
$result = str_ireplace('{PDATE}', $alluserdata[$login]['passportdate'], $result);
$result = str_ireplace('{PWHO}', $alluserdata[$login]['passportwho'], $result);
$result = str_ireplace('{PCITY}', $alluserdata[$login]['pcity'], $result);
$result = str_ireplace('{PSTREET}', $alluserdata[$login]['pstreet'], $result);
$result = str_ireplace('{PBUILD}', $alluserdata[$login]['pbuild'], $result);
$result = str_ireplace('{PAPT}', $alluserdata[$login]['papt'], $result);
//custom fields extract
if (ispos($result, '{CFIELD:')) {
$split = explode('{CFIELD:', $result);
$cfid = vf($split[1], 3);
$result = str_ireplace('{CFIELD:' . $cfid . '}', @$alluserdata[$login]['cf'][$cfid], $result);
}
//print macro
$printsub = '<script language="javascript">
window.print();
</script>';
$result = str_ireplace('{PRINTME}', $printsub, $result);
}
return $result;
}