本文整理汇总了PHP中age函数的典型用法代码示例。如果您正苦于以下问题:PHP age函数的具体用法?PHP age怎么用?PHP age使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了age函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProfileInfoBlock
function getProfileInfoBlock($sCaption, $sContent)
{
global $site;
$iBlockID = (int) $sContent;
if (!isset($this->aPFBlocks[$iBlockID]) or empty($this->aPFBlocks[$iBlockID]['Items'])) {
return false;
}
$aItems = $this->aPFBlocks[$iBlockID]['Items'];
$aRet = array();
foreach ($aItems as $aItem) {
$sValue1 = htmlspecialchars_decode($this->oPF->getViewableValue($aItem, $this->_aProfile[$aItem['Name']]), ENT_COMPAT);
if ($aItem['Name'] == 'Age') {
$sValue1 = isset($this->_aProfile['DateOfBirth']) ? age($this->_aProfile['DateOfBirth']) : _t("_uknown");
}
if (!$sValue1) {
continue;
}
$aStruct = array();
$aStruct['Caption'] = new xmlrpcval(strip_tags(_t($aItem['Caption'])));
$aStruct['Type'] = new xmlrpcval($aItem['Type']);
$aStruct['Value1'] = new xmlrpcval(strip_tags($sValue1));
if ($this->bCouple) {
if (!in_array($aItem['Name'], $this->aCoupleMutualItems)) {
$sValue2 = htmlspecialchars_decode($this->oPF->getViewableValue($aItem, $this->_aCouple[$aItem['Name']]), ENT_COMPAT);
if ($aItem['Name'] == 'Age') {
$sValue2 = isset($this->_aCouple['DateOfBirth']) ? age($this->_aCouple['DateOfBirth']) : _t("_uknown");
}
$aStruct['Value2'] = new xmlrpcval(strip_tags($sValue2));
}
}
$aRet[] = new xmlrpcval($aStruct, "struct");
}
return new xmlrpcval(array('Info' => new xmlrpcval($aRet, "array"), 'Title' => new xmlrpcval(_t($sCaption))), "struct");
}
示例2: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
global $site;
global $prof;
$query = "\n\t\tSELECT\n\t\t\t`id_poll`,\n\t\t\t`id_profile`,\n\t\t\t`poll_question`,\n\t\t\t`Profiles`.*\n\t\tFROM `ProfilesPolls`\n\t\tLEFT JOIN `Profiles` ON\n\t\t\t`id_profile` = `Profiles`.`ID`\n\t\tWHERE\n\t\t\t`poll_status` = 'active'\n\t\t\tAND `poll_approval`\n\t\tORDER BY `id_poll` DESC\n\t\t";
//$query = "SELECT `ID`, `Question` FROM `polls_q` WHERE `Active` = 'on' ORDER BY `Question`";
$res = db_res($query);
if ($res and mysql_num_rows($res)) {
$ret = '<div class="clear_both"></div>';
while ($arr = mysql_fetch_array($res)) {
$age_str = _t("_y/o", age($arr['DateOfBirth']));
$y_o_sex = $age_str . ' ' . _t("_" . $arr['Sex']);
$poll_coutry = _t("__" . $prof['countries'][$arr['Country']]);
$ret .= '<div class="pollBody">';
$ret .= '<div class="clear_both"></div>';
$ret .= '<div class="pollInfo">';
$ret .= get_member_icon($arr['id_profile'], 'left');
$ret .= '<div class="pollInfo_nickname">';
$ret .= _t('_Submitted by', $arr['NickName']);
$ret .= '</div>';
$ret .= '<div class="pollInfo_info">';
$ret .= $y_o_sex . '<br />' . $poll_coutry;
$ret .= '</div>';
$ret .= '</div>';
$ret .= '<div class="clear_both"></div>';
$ret .= ShowPoll($arr['id_poll']);
$ret .= '<div class="clear_both"></div>';
$ret .= '</div>';
}
$ret .= '<div class="clear_both"></div>';
} else {
$ret = "<div align=center>" . _t("_No polls available") . "</div>\n";
}
return $ret;
}
示例3: printSupp
function printSupp()
{
# Set up table to display in
global $PRDMON;
$cur = date("m");
$from = getMonthName($PRDMON[1]) . " " . getYearOfFinMon($PRDMON[1]);
$to = getMonthName($cur) . " " . getYearOfFinMon($cur);
$printSupp = "\n\t\t<h3>Creditors Age Analysis</h3>\n\t\t<h4>Period: {$from} to {$to}</h4>\n\t\t<li class='err'>Please note that because age analysis is calculated and stored as is displayed below it is not\n\t\tpossible to change the period for which you wish to see the age analysis.</li>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Acc no.</th>\n\t\t\t\t<th>Suppliers</th>\n\t\t\t\t<th>Current</th>\n\t\t\t\t<th>30 days</th>\n\t\t\t\t<th>60 days</th>\n\t\t\t\t<th>90 days</th>\n\t\t\t\t<th>120 days</th>\n\t\t\t\t<th>Total Outstanding</th>\n\t\t\t</tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM suppliers WHERE div = '" . USER_DIV . "' ORDER BY supname ASC";
$suppRslt = db_exec($sql) or errDie("Unable to retrieve Suppliers from database.");
if (pg_numrows($suppRslt) < 1) {
return "<li>There are no Suppliers in Cubit.</li>";
}
# totals
$totcurr = 0;
$tot30 = 0;
$tot60 = 0;
$tot90 = 0;
$tot120 = 0;
$alltot = 0;
while ($supp = pg_fetch_array($suppRslt)) {
# Get all ages
$curr = age($supp['supid'], 29);
$age30 = age($supp['supid'], 59);
$age60 = age($supp['supid'], 89);
$age90 = age($supp['supid'], 119);
$age120 = age($supp['supid'], 149);
# Suppliers total
$supptot = sprint($curr + $age30 + $age60 + $age90 + $age120);
if ($supptot < $supp['balance']) {
$curr = sprint($curr + ($supp['balance'] - $supptot));
$supptot = sprint($supptot + $supp['balance'] - $supptot);
}
$printSupp .= "\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>{$supp['supno']}</td>\n\t\t\t\t<td>{$supp['supname']}</td>\n\t\t\t\t<td>" . CUR . " {$curr}</td>\n\t\t\t\t<td>" . CUR . " {$age30}</td>\n\t\t\t\t<td>" . CUR . " {$age60}</td>\n\t\t\t\t<td>" . CUR . " {$age90}</td>\n\t\t\t\t<td>" . CUR . " {$age120}</td>\n\t\t\t\t<td>" . CUR . " {$supptot}</td>\n\t\t\t</tr>";
# hold totals
$totcurr += $curr;
$tot30 += $age30;
$tot60 += $age60;
$tot90 += $age90;
$tot120 += $age120;
$alltot += $supptot;
$i++;
}
$totcurr = sprint($totcurr);
$tot30 = sprint($tot30);
$tot60 = sprint($tot60);
$tot90 = sprint($tot90);
$tot120 = sprint($tot120);
$alltot = sprint($alltot);
$printSupp .= "\n\t\t<tr><td><br></td></tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td colspan='2'><b>Totals</b></td>\n\t\t\t<td><b>" . CUR . " {$totcurr}</b></td>\n\t\t\t<td><b>" . CUR . " {$tot30}</b></td>\n\t\t\t<td><b>" . CUR . " {$tot60}</b></td>\n\t\t\t<td><b>" . CUR . " {$tot90}</b></td>\n\t\t\t<td><b>" . CUR . " {$tot120}</b></td>\n\t\t\t<td><b>" . CUR . " {$alltot}</b></td>\n\t\t</tr>\n\t\t<tr><td><br></td></tr>\n\t\t<tr>\n\t\t\t<td align='center' colspan='10'>\n\t\t\t\t<form action='../xls/cred-age-analysis-xls.php' method='POST' name='form'>\n\t\t\t\t\t<input type='submit' name='xls' value='Export to spreadsheet'>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<p>\n\t<table " . TMPL_tblDflts . " width='15%'>\n\t\t<tr><td><br></td></tr>\n\t\t<tr>\n\t\t\t<th>Quick Links</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='index-reports.php'>Financials</a></td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='index-reports-debtcred.php'>Debtors & Creditors Reports</a></td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='../supp-new.php'>Add Supplier</a></td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='../supp-view.php'>View Suppliers</a></td>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td><a href='../main.php'>Main Menu</a></td>\n\t\t</tr>\n\t</table>";
return $printSupp;
}
示例4: printPartnerTable
function printPartnerTable($partner_list)
{
$str = "<tr style='color:white; background-color:gray;' ><td style='width:50px'>id</td>" . "<td style='width:200px;'>name</td>" . "<td>type</td>" . "<td>url</td>" . "<td>age</td>" . "<td>views</td>" . "<td>plays</td>" . "<td>entries</td></tr>";
$i = 0;
foreach ($partner_list as $p) {
$i++;
$url = $p->getUrl1();
$str .= "<tr style='background-color: " . ($i % 2 ? "lightgray" : "lightblue") . "'>" . "<td>" . $p->getId() . "</td>" . "<td>" . substr($p->getPartnerName(), 0, 50) . "</td>" . "<td>" . partnerType($p) . "</td>" . "<td>" . "<a href='{$url}'>{$url}</a>" . "</td>" . "<td>" . age($p) . "</td>" . "<td>" . prop($p, "views") . "</td>" . "<td>" . prop($p, "plays") . "</td>" . "<td>" . prop($p, "entries") . "</td>" . "</tr>";
}
return $str;
}
示例5: printSupp
function printSupp()
{
# Set up table to display in
$printSupp = "\r\n\t\t<table>\r\n\t\t\t<tr><th colspan='3'><h3>Creditors Age Analysis</h3></th></tr>\r\n\t\t\t<tr><th></th></tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<th><u>Acc no.</u></th>\r\n\t\t\t\t<th><u>Suppliers</u></th>\r\n\t\t\t\t<th><u>Current</u></th>\r\n\t\t\t\t<th><u>30 days</u></th>\r\n\t\t\t\t<th><u>60 days</u></th>\r\n\t\t\t\t<th><u>90 days</u></th>\r\n\t\t\t\t<th><u>120 days</u></th>\r\n\t\t\t\t<th><u>Total Outstanding</u></th>\r\n\t\t\t</tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM suppliers WHERE div = '" . USER_DIV . "' ORDER BY supname ASC";
$suppRslt = db_exec($sql) or errDie("Unable to retrieve Suppliers from database.");
if (pg_numrows($suppRslt) < 1) {
return "<li>There are no Suppliers in Cubit.</li>";
}
# totals
$totcurr = 0;
$tot30 = 0;
$tot60 = 0;
$tot90 = 0;
$tot120 = 0;
$alltot = 0;
while ($supp = pg_fetch_array($suppRslt)) {
# Get all ages
$curr = age($supp['supid'], 29);
$age30 = age($supp['supid'], 59);
$age60 = age($supp['supid'], 89);
$age90 = age($supp['supid'], 119);
$age120 = age($supp['supid'], 149);
# Suppliers total
$supptot = $curr + $age30 + $age60 + $age90 + $age120;
if ($supptot < $supp['balance']) {
$curr = sprint($curr + ($supp['balance'] - $supptot));
$supptot = sprint($supptot + $supp['balance'] - $supptot);
}
$printSupp .= "\r\n\t\t\t<tr>\r\n\t\t\t\t<td>{$supp['supno']}</td>\r\n\t\t\t\t<td>{$supp['supname']}</td>\r\n\t\t\t\t<td>" . CUR . " {$curr}</td>\r\n\t\t\t\t<td>" . CUR . " {$age30}</td>\r\n\t\t\t\t<td>" . CUR . " {$age60}</td>\r\n\t\t\t\t<td>" . CUR . " {$age90}</td>\r\n\t\t\t\t<td>" . CUR . " {$age120}</td>\r\n\t\t\t\t<td>" . CUR . " {$supptot}</td>\r\n\t\t\t</tr>";
# hold totals
$totcurr += $curr;
$tot30 += $age30;
$tot60 += $age60;
$tot90 += $age90;
$tot120 += $age120;
$alltot += $supptot;
$i++;
}
$printSupp .= "\r\n\t\t\t<tr><td><br></td></tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2'><b>Totals</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$totcurr}</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$tot30}</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$tot60}</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$tot90}</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$tot120}</b></td>\r\n\t\t\t\t<td><b>" . CUR . " {$alltot}</b></td>\r\n\t\t\t</tr>\r\n\t\t</table>";
# Send the stream
include "temp.xls.php";
Stream("CredAgeAnalysis", $printSupp);
}
示例6: age_date
/**
* Returns the age of a date/time,
* or the date if it is outside of 'today'.
*
* Usage example:
* {$account.date_created|age_date} # 23 hours ago
* {$product.date_created|age_date} # Dec 25 2012
*/
function age_date($params)
{
$date = is_array($params) && $params['of'] ? $params['of'] : $params;
if (!($time = strtotime($date))) {
return '';
}
// Today.
if (date('Y-m-d') == date('Y-m-d', $time)) {
return age($date);
}
if (date('Y') == date('Y', $time)) {
return date('M j', $time);
} else {
return date('M j Y', $time);
}
}
示例7: printAgeInv
function printAgeInv()
{
# Set up table to display in
$printCust = "\n <h3>Debtors Age Analysis</h3>\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n <tr><th>Acc no.</th><th>Customer</th><th>Contact Name</th><th>Tel No.</th><th>Current</th><th>30 days</th><th>60 days</th><th>90 days</th><th>120 days</th><th>Total Outstanding</th></tr>";
# Connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM customers ORDER BY accno ASC";
$custRslt = db_exec($sql) or errDie("Unable to retrieve Customers from database.");
if (pg_numrows($custRslt) < 1) {
return "<li>There are no Customers in Cubit.";
}
# Totals
$totcurr = 0;
$tot30 = 0;
$tot60 = 0;
$tot90 = 0;
$tot120 = 0;
$alltot = 0;
while ($cust = pg_fetch_array($custRslt)) {
# Get all ages
$curr = age($cust['cusnum'], 29);
$age30 = age($cust['cusnum'], 59);
$age60 = age($cust['cusnum'], 89);
$age90 = age($cust['cusnum'], 119);
$age120 = age($cust['cusnum'], 149);
# Customer total
$custtot = $curr + $age30 + $age60 + $age90 + $age120;
# Alternate bgcolor
$printCust .= "<tr class='" . bg_class() . "'><td>{$cust['accno']}</td><td>{$cust['surname']}</td><td>{$cust['contname']}</td><td>{$cust['tel']}</td><td>" . CUR . " {$curr}</td><td>" . CUR . " {$age30}</td><td>" . CUR . " {$age60}</td><td>" . CUR . " {$age90}</td><td>" . CUR . " {$age120}</td><td>" . CUR . " {$custtot}</td></tr>";
# Hold totals
$totcurr += $curr;
$tot30 += $age30;
$tot60 += $age60;
$tot90 += $age90;
$tot120 += $age120;
$alltot += $custtot;
$i++;
}
$printCust .= "<tr><td><br></td></tr>\n\t<tr class='bg-even'><td colspan=4><b>Totals</b></td><td><b>" . CUR . " {$totcurr}</b></td><td><b>" . CUR . " {$tot30}</b></td><td><b>" . CUR . " {$tot60}</b></td><td><b>" . CUR . " {$tot90}</b></td><td><b>" . CUR . " {$tot120}</b></td><td><b>" . CUR . " {$alltot}</b></td></tr>\n\t<tr><td><br></td></tr>\n\n\t<!--\n\t<tr><td align=center colspan=10>\n\t\t<form action='../xls/debt-age-analysis-xls.php' method=post name=form>\n\t\t<input type=submit name=xls value='Export to spreadsheet'>\n\t\t</form>\n\t</td></tr>\n\t-->\n\n\t</table>\n <p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\n <tr><td><br></td></tr>\n <tr><th>Quick Links</th></tr>\n\t\t<tr class='bg-odd'><td><a href='../customers-new.php'>Add Customer</a></td></tr>\n\t\t<tr class='bg-odd'><td><a href='../customers-view.php'>View Customers</a></td></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $printCust;
}
示例8: get
/**
* Get member info
*/
public function get($aData)
{
switch ($this->_sObject) {
case 'sys_username':
return $aData['NickName'];
case 'sys_full_name':
return htmlspecialchars_adv($aData['FullName'] ? $aData['FullName'] : $aData['NickName']);
case 'sys_first_name':
return $aData['FirstName'] ? $aData['FirstName'] : $aData['NickName'];
case 'sys_first_name_last_name':
return $aData['FirstName'] || $aData['LastName'] ? $aData['FirstName'] . ' ' . $aData['LastName'] : $aData['NickName'];
case 'sys_last_name_firs_name':
return $aData['FirstName'] || $aData['LastName'] ? $aData['LastName'] . ' ' . $aData['FirstName'] : $aData['NickName'];
case 'sys_status_message':
return $aData['UserStatusMessage'];
case 'sys_age_sex':
$s = ('0000-00-00' == $aData['DateOfBirth'] ? '' : _t('_y/o', age($aData['DateOfBirth'])) . ' ') . _t('_' . $aData['Sex']);
if ($aData['Couple'] > 0) {
$aData2 = getProfileInfo($aData['Couple']);
$s .= '<br />' . ('0000-00-00' == $aData2['DateOfBirth'] ? '' : _t('_y/o', age($aData2['DateOfBirth'])) . ' ') . _t('_' . $aData2['Sex']);
}
return $s;
case 'sys_location':
return (empty($aData['City']) ? '' : htmlspecialchars_adv($aData['City']) . ', ') . _t($GLOBALS['aPreValues']['Country'][$aData['Country']]['LKey']);
case 'sys_avatar_2x':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . 'b' . BX_AVA_EXT : '';
case 'sys_avatar':
case 'sys_avatar_icon_2x':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . BX_AVA_EXT : '';
case 'sys_avatar_icon':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . 'i' . BX_AVA_EXT : '';
}
}
示例9: printSupp
function printSupp()
{
# Set up table to display in
$printSupp = "<h3>Creditors Age Analysis</h3>\n <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n <tr><th>Acc no.</th><th>Suppliers</th><th>Current</th><th>30 days</th><th>60 days</th><th>90 days</th><th>120 days</th><th>Total Outstanding</th></tr>";
# connect to database
db_connect();
# Query server
$i = 0;
$sql = "SELECT * FROM suppliers ORDER BY supname ASC";
$suppRslt = db_exec($sql) or errDie("Unable to retrieve Suppliers from database.");
if (pg_numrows($suppRslt) < 1) {
return "<li>There are no Suppliers in Cubit.";
}
# totals
$totcurr = 0;
$tot30 = 0;
$tot60 = 0;
$tot90 = 0;
$tot120 = 0;
$alltot = 0;
while ($supp = pg_fetch_array($suppRslt)) {
# Get all ages
$curr = age($supp['supid'], 29);
$age30 = age($supp['supid'], 59);
$age60 = age($supp['supid'], 89);
$age90 = age($supp['supid'], 119);
$age120 = age($supp['supid'], 149);
# Suppliers total
$supptot = $curr + $age30 + $age60 + $age90 + $age120;
$printSupp .= "<tr class='" . bg_class() . "'><td>{$supp['div']}-{$supp['supno']}</td><td>{$supp['supname']}</td><td>" . CUR . " {$curr}</td><td>" . CUR . " {$age30}</td><td>" . CUR . " {$age60}</td><td>" . CUR . " {$age90}</td><td>" . CUR . " {$age120}</td><td>" . CUR . " {$supptot}</td></tr>";
# hold totals
$totcurr += $curr;
$tot30 += $age30;
$tot60 += $age60;
$tot90 += $age90;
$tot120 += $age120;
$alltot += $supptot;
$i++;
}
$printSupp .= "<tr><td><br></td></tr>\n\t<tr class='bg-even'><td colspan=2><b>Totals</b></td><td><b>" . CUR . " {$totcurr}</b></td><td><b>" . CUR . " {$tot30}</b></td><td><b>" . CUR . " {$tot60}</b></td><td><b>" . CUR . " {$tot90}</b></td><td><b>" . CUR . " {$tot120}</b></td><td><b>" . CUR . " {$alltot}</b></td></tr>\n\t<tr><td><br></td></tr>\n\n\t<!--\n\t<tr><td align=center colspan=10>\n\t\t<form action='../xls/cred-age-analysis-xls.php' method=post name=form>\n\t\t<input type=submit name=xls value='Export to spreadsheet'>\n\t\t</form>\n\t</td></tr>\n\t-->\n\n\t</table>\n <p>\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width=15%>\n <tr><td><br></td></tr>\n <tr><th>Quick Links</th></tr>\n\t\t<tr class='bg-odd'><td><a href='../supp-new.php'>Add Supplier</a></td></tr>\n\t\t<tr class='bg-odd'><td><a href='../supp-view.php'>View Suppliers</a></td></tr>\n\t\t<script>document.write(getQuicklinkSpecial());</script>\n\t</table>";
return $printSupp;
}
示例10: save
function save()
{
db_connect();
$sql = "SELECT * FROM customers";
$custRslt = db_exec($sql) or errDie("Unable to view customer");
if (pg_numrows($custRslt) < 1) {
return "<li class=err>Invalid Customer Number.";
}
$Sl = "DELETE FROM ages";
$Ri = db_exec($Sl);
while ($cust = pg_fetch_array($custRslt)) {
if ($cust['location'] == 'int') {
$cust['balance'] = $cust['fbalance'];
}
$cust['balance'] = sprint($cust['balance']);
# Check type of age analisys
if (div_isset("DEBT_AGE", "mon")) {
$curr = ageage($cust['cusnum'], 0, $cust['fcid'], $cust['location']);
$age30 = ageage($cust['cusnum'], 1, $cust['fcid'], $cust['location']);
$age60 = ageage($cust['cusnum'], 2, $cust['fcid'], $cust['location']);
$age90 = ageage($cust['cusnum'], 3, $cust['fcid'], $cust['location']);
$age120 = ageage($cust['cusnum'], 4, $cust['fcid'], $cust['location']);
} else {
$curr = age($cust['cusnum'], 29, $cust['fcid'], $cust['location']);
$age30 = age($cust['cusnum'], 59, $cust['fcid'], $cust['location']);
$age60 = age($cust['cusnum'], 89, $cust['fcid'], $cust['location']);
$age90 = age($cust['cusnum'], 119, $cust['fcid'], $cust['location']);
$age120 = age($cust['cusnum'], 149, $cust['fcid'], $cust['location']);
}
$custtot = $curr + $age30 + $age60 + $age90 + $age120;
if (sprint($custtot) != sprint($cust['balance'])) {
$curr = sprint($curr + $cust['balance'] - $custtot);
$custtot = sprint($cust['balance']);
}
$Sl = "INSERT INTO ages(cust,curr,age30,age60,age90,age120) VALUES('{$cust['cusnum']}','{$curr}','{$age30}','{$age60}','{$age90}','{$age120}')";
$Ri = db_exec($Sl);
$age = "<table cellpadding='3' cellspacing='1' border=0 width=100% bordercolor='#000000'>\n\t\t\t<tr><th>Current</th><th>30 days</th><th>60 days</th><th>90 days</th><th>120 days +</th></tr>\n\t\t\t<tr><td align=right>{$cust['currency']} {$curr}</td><td align=right>{$cust['currency']} {$age30}</td><td align=right>{$cust['currency']} {$age60}</td>\n\t\t\t<td align=right>{$cust['currency']} {$age90}</td><td align=right>{$cust['currency']} {$age120}</td></tr>\n\t\t\t</table>";
}
$out = "<p><br><table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\n\t<tr><th>Done</th></tr>\n\t<tr class='bg-odd'><td>Age analysis saved.</td></tr>\n\t</table>";
return $out;
}
示例11: foreach
if ($displaytrackerurl == TRUE) {
// echo $item['tracker_url'];
$urlstyle = $tracker_hilite_default;
foreach ($tracker_hilite as $hilite) {
foreach ($hilite as $thisurl) {
if (stristr($item['tracker_url'], $thisurl) == TRUE) {
$urlstyle = $hilite[0];
}
}
}
echo "<div class='trackerurl' id='tracker' ><a style='color: {$urlstyle} ;' id='tracker' href='?settrackerfilter=" . $item['tracker_url'] . "&setfilterinvert=0'>" . $item['tracker_url'] . "</a> </div>";
}
// Torrent name
echo "<input type='checkbox' name='select[]' value='" . $item['hash'] . "' /> ";
echo "<a class='submodal-600-520 {$statusstyle}' href='view.php?hash=" . $item['hash'] . "'>" . htmlspecialchars($item['name'], ENT_QUOTES) . "</a> ";
echo "<span class='age' id='t" . $item['hash'] . "filemtime'>" . age($item['filemtime']) . "</span>\n";
echo "</div>\n";
// message...
echo "<div class='errorcol' id='t" . $item['hash'] . "message'>\n";
if ($eta != "") {
echo $eta . " Remaining... ";
}
if ($item['message'] != "") {
echo $item['message'] . "\n";
}
echo "</div>\n";
// Stop/start controls...
echo "<div class='datacol' style='width:89px;'>\n";
echo "<a href='control.php?hash=" . $item['hash'] . "&cmd=" . ($item['is_active'] == 1 ? "stop" : "start") . "'>" . ($item['is_active'] == 1 ? "<img alt='Stop torrent' border=0 src='images/stop.gif' width=16 height=16 />" : "<img alt='Start torrent' border=0 src='images/start.gif' width=16 height=16 />") . "</a> \n";
echo "<a href='control.php?hash=" . $item['hash'] . "&cmd=delete' onClick='return confirm(\"Delete torrent - are you sure? (This will not delete data from disk)\");'><img align='bottom' alt='Delete torrent' border=0 src='images/delete.gif' width=16 height=16 /></a> \n";
echo "<a class='submodal-600-520' href='view.php?hash=" . $item['hash'] . "'><img alt='Torrent info' src='images/view.gif' width=16 height=16 /></a><br/>\n";
示例12: local_dir_update
/**
* @brief Push local channel updates to a local directory server.
*
* This is called from include/directory.php if a profile is to be pushed to the
* directory and the local hub in this case is any kind of directory server.
*
* @param int $uid
* @param boolean $force
*/
function local_dir_update($uid, $force)
{
logger('local_dir_update: uid: ' . $uid, LOGGER_DEBUG);
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1", intval($uid));
$profile = array();
$profile['encoding'] = 'zot';
if ($p) {
$hash = $p[0]['channel_hash'];
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
if ($age = age($p[0]['dob'], $p[0]['channel_timezone'], '')) {
$profile['age'] = $age;
}
$profile['gender'] = $p[0]['gender'];
$profile['marital'] = $p[0]['marital'];
$profile['sexual'] = $p[0]['sexual'];
$profile['locale'] = $p[0]['locality'];
$profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name'];
$profile['about'] = $p[0]['about'];
$profile['homepage'] = $p[0]['homepage'];
$profile['hometown'] = $p[0]['hometown'];
if ($p[0]['keywords']) {
$tags = array();
$k = explode(' ', $p[0]['keywords']);
if ($k) {
foreach ($k as $kk) {
if (trim($kk)) {
$tags[] = trim($kk);
}
}
}
if ($tags) {
$profile['keywords'] = $tags;
}
}
$hidden = 1 - intval($p[0]['publish']);
logger('hidden: ' . $hidden);
$r = q("select xchan_hidden from xchan where xchan_hash = '%s' limit 1", dbesc($p[0]['channel_hash']));
if (intval($r[0]['xchan_hidden']) != $hidden) {
$r = q("update xchan set xchan_hidden = %d where xchan_hash = '%s'", intval($hidden), dbesc($p[0]['channel_hash']));
}
$arr = array('channel_id' => $uid, 'hash' => $hash, 'profile' => $profile);
call_hooks('local_dir_update', $arr);
$address = $p[0]['channel_address'] . '@' . App::get_hostname();
if (perm_is_allowed($uid, '', 'view_profile')) {
import_directory_profile($hash, $arr['profile'], $address, 0);
} else {
// they may have made it private
$r = q("delete from xprof where xprof_hash = '%s'", dbesc($hash));
$r = q("delete from xtag where xtag_hash = '%s'", dbesc($hash));
}
}
$ud_hash = random_string() . '@' . App::get_hostname();
update_modtime($hash, $ud_hash, $p[0]['channel_address'] . '@' . App::get_hostname(), $force ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED);
}
示例13: getProcessingRows
/**
* Function will generate received rows ;
*
* @return : Html presentation data ;
*/
function getProcessingRows($bShowEmpty = true)
{
global $oSysTemplate, $site, $oFunctions;
// ** init some needed variables ;
$sPageContent = $sActionsList = $sSettings = '';
$bShowSettings = false;
$aRows = array();
$sEmptyMessage = '_Empty';
$sRowsTemplName = $this->aUsedTemplates['communicator_page'];
$sJsObject = $this->_getJsObject();
// define the member's nickname;
$sMemberNickName = getNickName($this->aCommunicatorSettings['member_id']);
// all primary language's keys ;
$aLanguageKeys = array('author' => _t('_Author'), 'type' => _t('_Type'), 'date' => _t('_Date'), 'click_sort' => _t('_Click to sort'), 'from_me' => _t('_From') . ' ' . $sMemberNickName, 'to_me' => _t('_To') . ' ' . $sMemberNickName, 'accept' => _t('_sys_cnts_btn_fr_accept'), 'reject' => _t('_sys_cnts_btn_fr_reject'), 'delete' => _t('_Delete'), 'back_invite' => _t('_Back Invite'), 'fave' => _t('_sys_cnts_btn_fave'), 'visitor' => _t('_Visitor'), 'unblock' => _t('_Unblock'), 'block' => _t('_Block'), 'select' => _t('_Select'), 'all' => _t('_All'), 'none' => _t('_None'), 'read' => _t('_Read'), 'unread' => _t('_Unread'));
// get all requests from DB ;
switch ($this->aCommunicatorSettings['communicator_mode']) {
case 'friends_requests':
$sEmptyMessage = '_sys_cnts_msg_fr_empty';
$sRowsTemplName = $this->aUsedTemplates['communicator_page_fr'];
$aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST'));
$aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 ');
break;
case 'hotlist_requests':
$aTypes = array('from' => _t('_MEMBERS_YOU_HOTLISTED'), 'to' => _t('_MEMBERS_YOU_HOTLISTED_BY'));
$aRows = $this->getRequests('sys_fave_list', $aTypes);
break;
case 'greeting_requests':
$aTypes = array('from' => _t('_MEMBERS_YOU_KISSED'), 'to' => _t('_MEMBERS_YOU_KISSED_BY'), 'specific_key' => '_N times');
$aRows = $this->getRequests('sys_greetings', $aTypes, null, 'Number');
break;
case 'blocks_requests':
$aTypes = array('from' => _t('_MEMBERS_YOU_BLOCKLISTED'), 'to' => _t('_MEMBERS_YOU_BLOCKLISTED_BY'));
$aRows = $this->getRequests('sys_block_list', $aTypes);
break;
case 'friends_list':
$aTypes = array('from' => _t('_Friend list'), 'to' => _t('_Friend list'));
$aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 1 OR ( `sys_friend_list`.`ID` = ' . $this->aCommunicatorSettings['member_id'] . ' AND `sys_friend_list`.`Check` = 1 )');
break;
default:
$aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST'));
$aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 ');
}
if (empty($aRows) && !$bShowEmpty) {
return '';
}
// ** Generate the page's pagination ;
// fill array with all necessary `get` parameters ;
$aNeededParameters = array('communicator_mode', 'person_switcher', 'sorting');
// collect the page's URL ;
$sRequest = BX_DOL_URL_ROOT . 'communicator.php?action=get_page';
// add additional parameters ;
foreach ($aNeededParameters as $sKey) {
$sRequest .= (array_key_exists($sKey, $this->aCommunicatorSettings) and $this->aCommunicatorSettings[$sKey]) ? '&' . $sKey . '=' . $this->aCommunicatorSettings[$sKey] : null;
}
$sCuttedUrl = $sRequest;
$sRequest .= '&page={page}&per_page={per_page}';
// create the pagination object ;
$oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $this->iTotalRequestsCount, 'per_page' => $this->aCommunicatorSettings['per_page'], 'sorting' => $this->aCommunicatorSettings['sorting'], 'page' => $this->aCommunicatorSettings['page'], 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".getPaginatePage('{$sRequest}')", 'on_change_per_page' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".getPage(this.value, '{$sCuttedUrl}')"));
$sPagination = $oPaginate->getPaginate();
// process received requests;
if ($aRows) {
$iIndex = 1;
foreach ($aRows as $iKey => $aItems) {
// if member not a visitor ;
if ($aItems['member_id']) {
// ** some member's information ;
$aProfileInfo = getProfileInfo($aItems['member_id']);
// member's Icon ;
$sMemberIcon = get_member_thumbnail($aProfileInfo['ID'], 'left', $this->aCommunicatorSettings['communicator_mode'] != 'friends_requests');
// member's profile location ;
$sMemberLocation = getProfileLink($aProfileInfo['ID']);
// member's nickname ;
$sMemberNickName = getNickName($aProfileInfo['ID']);
// define the member's age ;
$sMemberAge = $aProfileInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aProfileInfo['DateOfBirth'])) : null;
// define the member's country, sex, etc ... ;
$sMemberCountry = $aProfileInfo['Country'];
$sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension;
$sMemberSexImg = $oFunctions->genSexIcon($aProfileInfo['Sex']);
if ($sMemberCountry) {
$sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
}
$iMemberMutualFriends = getMutualFriendsCount($aItems['member_id'], getLoggedId());
} else {
// ** if it's a visitor
// member's Icon ;
$sMemberIcon = $aLanguageKeys['visitor'];
// member's profile location ;
$sMemberLocation = null;
$sMemberSexImg = null;
$sMemberAge = null;
$sMemberCountryFlag = null;
$sMemberCountry = null;
}
$aProcessedRows[] = array('js_object' => $sJsObject, 'row_value' => $aItems['member_id'], 'member_icon' => $sMemberIcon, 'member_nick_name' => $sMemberNickName, 'member_location' => $sMemberLocation ? '<a href="' . $sMemberLocation . '">' . $sMemberNickName . '</a>' : '', 'member_sex_img' => $sMemberSexImg ? ' <img src="' . $sMemberSexImg . '" alt="' . $aProfileInfo['Sex'] . '" />' : '', 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'member_country' => $sMemberCountry, 'member_mutual_friends' => _t('_sys_cnts_txt_mutual_friends', $iMemberMutualFriends > 0 ? $iMemberMutualFriends : _t('_sys_cnts_txt_mf_no')), 'type' => $aItems['type'], 'message_date' => $aItems['date']);
//.........这里部分代码省略.........
示例14: age
include 'core/function.php';
?>
<!-- content -->
<section id="content">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4 wow fadeInDown visibility">
<div class="testimonial">
<!-- <center><h2>Welkom</h2></center> -->
<div class="media testimonial-inner">
<div class="pull-left">
<img src="images/Adriel.jpg" class="img-responsive img-circle index_img " alt="Responsive image" align="left">
</div>
<div class="container">
<p class="text-muted">Ik ben Adriel Walter en ik ben <?php
echo age();
?>
.
ik studeer informatica aan de Hogeschool Rotterdam. Oorspronkelijk kom ik uit
Curaçao maar sinds 27 juli 2011 woon ik in Nederland.</p>
<p class="text-muted">Ik ben een jonge, sociale jongen met ambities op gebied
van website development. Ik heb voornamelijk ervaring met PHP, HTML, JAVA, JAVAScript en CSS.
</p>
<p class="text-muted">Verder kan je lezen in de "About Me" page meer over mij .</p>
<p class="text-muted"> Kijk gerust eens rond!</p>
</div>
</div>
</div>
</div>
示例15: trim
</div>
<div class="infoProfil">
<div>Compte Xbox live</div>
<?php
echo trim($infos['idXboxlive']) != '' ? $infos['idXboxlive'] : '-';
?>
</div>
<div class="infoProfil">
<div>Date de naissance</div>
<?php
echo $infos['birth'] != '0000-00-00' ? date('d/m/Y', date2timestamp($infos['birth'])) : '-';
?>
- <?php
echo $infos['birth'] != '0000-00-00' ? age($infos['birth']) . ' ans' : '';
?>
</div>
<div class="infoProfil">
<div>Messages postés</div>
<?php
echo $infos['nbPost'];
?>
</div>
<div class="infoProfil">
<div>Messages chatbox</div>
<?php
echo $infos['nbPostChatbox'];
?>