本文整理汇总了PHP中getArea函数的典型用法代码示例。如果您正苦于以下问题:PHP getArea函数的具体用法?PHP getArea怎么用?PHP getArea使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getArea函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: entrySetReady
function entrySetReady($entry)
{
global $invoice_sendto, $systemurl, $login;
if (!count($entry)) {
echo __('No entry found.');
return FALSE;
}
/*
* Set new status
* Set new rev_num, time of edit, etc
*/
$rev_num = $entry['rev_num'] + 1;
mysql_query("UPDATE `entry` SET `invoice_status` = '2', `user_last_edit` = '" . $login['user_id'] . "', `time_last_edit` = '" . time() . "', `rev_num` = '{$rev_num}' WHERE `entry_id` = '" . $entry['entry_id'] . "' LIMIT 1 ;");
$log_data = array();
if (!newEntryLog($entry['entry_id'], 'edit', 'invoice_readyfor', $rev_num, $log_data)) {
echo __('Can\'t log the changes for the entry.');
echo '<br><br>';
return FALSE;
}
if (isset($invoice_sendto) && is_array($invoice_sendto)) {
$entry_summary = 'Bookingid: ' . $entry['entry_id'] . chr(10);
$area = getArea($entry['area_id']);
if (count($area)) {
foreach ($invoice_sendto as $email) {
emailSendDirect($email, 'Booking klar til fakturering - ' . $area['area_name'] . ', ' . date('d.m.Y', $entry['time_start']) . ' (' . $entry['entry_id'] . ')', 'Hei' . chr(10) . chr(10) . $login['user_name'] . ' har satt en ny booking, fra ' . $area['area_name'] . ', klar til fakturering. Bookingen var fra ' . date('d.m.Y', $entry['time_start']) . '.' . chr(10) . chr(10) . 'Gå inn på følgende adresse for å få tilsendt fakturagrunnlagene:' . chr(10) . $systemurl . '/invoice_tobemade_ready.php' . chr(10) . 'Hvis det er flere fakturaer som er klar til fakturering, så kan samtlige hentes ut på likt.' . chr(10) . chr(10) . 'Oppsummert booking:' . chr(10) . 'Bookingid: ' . $entry['entry_id'] . chr(10) . 'Tittel: ' . html_entity_decode($entry['entry_name']) . chr(10) . 'Anlegg: ' . $area['area_name'] . chr(10) . 'Sum eks mva: kr ' . smarty_modifier_commify($entry['eks_mva_tot'], 2, ',', ' ') . chr(10) . ' + MVA kr ' . smarty_modifier_commify($entry['faktura_belop_sum_mva'], 2, ',', ' ') . chr(10) . 'Sum ink. mva: kr ' . smarty_modifier_commify($entry['faktura_belop_sum'], 2, ',', ' ') . chr(10) . chr(10) . 'Mvh. Bookingsystemet');
}
}
}
return TRUE;
}
示例2: testScope
function testScope()
{
require_once 'func.php';
$area = getArea(20, 14);
print $scope;
print '四角形の面積' . $area;
return $scope;
}
示例3: getAreaFromEntry
function getAreaFromEntry($entry, $key)
{
$area = getArea($entry[$key . '_id']);
if (count($area)) {
return $area['area_name'];
} else {
return '';
}
}
示例4: getBorrowList
function getBorrowList($parm = array(), $countonly = false)
{
if (empty($parm['map'])) {
return;
}
$map = $parm['map'];
$orderby = $parm['orderby'];
//$map = array_merge($map,$search);
if ($countonly) {
return M('borrow_info b')->where($map)->count('b.id');
}
if ($parm['pagesize']) {
//分页处理
import("ORG.Util.Page");
$count = M('borrow_info b')->where($map)->count('b.id');
$p = new Page($count, $parm['pagesize']);
$page = $p->show();
$Lsql = "{$p->firstRow},{$p->listRows}";
//分页处理
} else {
$page = "";
$Lsql = "{$parm['limit']}";
}
$pre = C('DB_PREFIX');
$suffix = C("URL_HTML_SUFFIX");
$field = "b.id,b.borrow_name,b.borrow_type,b.reward_type,b.borrow_times,b.borrow_status,b.borrow_money,b.borrow_use,b.repayment_type,b.borrow_interest_rate,b.borrow_duration,b.collect_time,b.province,b.has_borrow,b.has_vouch,b.city,b.area,b.reward_type,b.reward_num,b.password,b.borrow_info,m.user_name,m.id as uid,m.credits,m.customer_name,b.is_tuijian,b.pro_provide,b.first_verify_time,b.schedular_time";
if ($parm['hotest']) {
$field .= ",IFNULL(b.`full_time`,0)-IFNULL(bv.`deal_time`,0) finish_time";
$list = M('borrow_info')->alias("b")->field($field)->join("{$pre}members m ON m.id=b.borrow_uid")->join("{$pre}borrow_verify bv ON b.id=bv.borrow_id")->where($map)->order($orderby)->limit($Lsql)->select();
} else {
$list = M('borrow_info')->alias("b")->field($field)->join("{$pre}members m ON m.id=b.borrow_uid")->where($map)->order($orderby)->limit($Lsql)->select();
}
$areaList = getArea();
foreach ($list as $key => $v) {
$list[$key]['location'] = $areaList[$v['province']] . $areaList[$v['city']];
$list[$key]['biao'] = $v['borrow_times'];
$list[$key]['need'] = $v['borrow_money'] - $v['has_borrow'];
$list[$key]['leftdays'] = getLeftTime($v['collect_time']);
$list[$key]['progress'] = getFloatValue($v['has_borrow'] / $v['borrow_money'] * 100, 2);
$list[$key]['vouch_progress'] = getFloatValue($v['has_vouch'] / $v['borrow_money'] * 100, 2);
$list[$key]['burl'] = MU("Home/invest", "invest", array("id" => $v['id'], "suffix" => $suffix));
$list[$key]['schedular_time'] = trans_date_format($v['schedular_time'], 'Y-m-d');
}
$row = array();
$row['list'] = $list;
$row['page'] = $page;
return $row;
}
示例5: getBorrowList
function getBorrowList($parm = array())
{
$map = $parm['map'];
$orderby = $parm['orderby'];
if ($parm['pagesize']) {
//分页处理
import("ORG.Util.Page");
$count = M('borrow_info b')->where($map)->count('b.id');
$p = new Page($count, $parm['pagesize']);
$page = $p->show();
$Lsql = "{$p->firstRow},{$p->listRows}";
$row['page']['total'] = ceil($count / $parm['pagesize']);
$row['page']['nowPage'] = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
//分页处理
} else {
$page = "";
$Lsql = "{$parm['limit']}";
}
$pre = C('DB_PREFIX');
$suffix = C("URL_HTML_SUFFIX");
$field = "b.id,b.borrow_name,b.borrow_type,b.updata,b.reward_type,b.borrow_times,b.borrow_status,b.borrow_money,b.borrow_use,b.repayment_type,b.borrow_interest_rate,b.borrow_duration,b.collect_time,b.add_time,b.province,b.has_borrow,b.has_vouch,b.city,b.area,b.reward_type,b.reward_num,b.password,m.user_name,m.id as uid,m.credits,m.customer_name,b.is_tuijian,b.deadline,b.danbao,b.borrow_info,b.risk_control";
$list = M('borrow_info b')->field($field)->join("{$pre}members m ON m.id=b.borrow_uid")->where($map)->order($orderby)->limit($Lsql)->select();
$areaList = getArea();
foreach ($list as $key => $v) {
$list[$key]['location'] = $areaList[$v['province']] . $areaList[$v['city']];
$list[$key]['biao'] = $v['borrow_times'];
$list[$key]['need'] = $v['borrow_money'] - $v['has_borrow'];
$list[$key]['leftdays'] = getLeftTime($v['collect_time']);
$list[$key]['progress'] = getFloatValue($v['has_borrow'] / $v['borrow_money'] * 100, 2);
$list[$key]['vouch_progress'] = getFloatValue($v['has_vouch'] / $v['borrow_money'] * 100, 2);
$list[$key]['burl'] = MU("M/invest", "invest", array("id" => $v['id'], "suffix" => $suffix));
$img = unserialize($v['updata']);
$list[$key]['image'] = $img['0']['img'];
}
$row['list'] = $list;
return $row;
}
示例6: getBorrowList
function getBorrowList($parm = array())
{
if (empty($parm['map'])) {
return;
}
$map = $parm['map'];
$orderby = $parm['orderby'];
if ($parm['pagesize']) {
//分页处理
import("ORG.Util.Page");
//require THINK_PATH.'Lib/Util/page.class.php';
$count = M('borrow_info b')->where($map)->count('b.id');
$p = new Page($count, $parm['pagesize']);
$page = $p->show();
$Lsql = "{$p->firstRow},{$p->listRows}";
//分页处理
} else {
$page = "";
$Lsql = "{$parm['limit']}";
}
$pre = C('DB_PREFIX');
$suffix = C("URL_HTML_SUFFIX");
//$field = "b.id,b.borrow_name,b.topic,b.borrow_type,b.reward_type,b.borrow_times,b.borrow_status,b.borrow_money,b.borrow_use,b.repayment_type,b.borrow_interest_rate,b.borrow_duration,b.collect_time,b.add_time,b.province,b.has_borrow,b.has_vouch,b.city,b.area,b.reward_type,b.reward_num,b.password,m.user_name,m.id as uid,m.credits,m.customer_name,b.is_tuijian,b.deadline,b.danbao,b.borrow_info,b.risk_control";
$field = "b.id,b.borrow_name,b.money_invest_place,b.borrow_type,b.stock_type,b.reward_type,b.borrow_times,b.borrow_status,b.borrow_money,b.borrow_use,b.repayment_type,b.stock_type,b.borrow_interest_rate,b.borrow_duration,b.collect_time,b.add_time,b.province,b.has_borrow,b.has_vouch,b.city,b.area,b.reward_type,b.reward_num,b.password,m.user_name,m.id as uid,m.credits,m.customer_name,b.is_tuijian,b.deadline,b.danbao,b.borrow_info,b.risk_control";
$list = M('borrow_info b')->field($field)->join("{$pre}members m ON m.id=b.borrow_uid")->where($map)->order($orderby)->limit($Lsql)->select();
$areaList = getArea();
foreach ($list as $key => $v) {
$list[$key]['location'] = $areaList[$v['province']] . $areaList[$v['city']];
$list[$key]['biao'] = $v['borrow_times'];
$list[$key]['need'] = $v['borrow_money'] - $v['has_borrow'];
$list[$key]['leftdays'] = getLeftTime($v['collect_time']);
$progress = $v['has_borrow'] / $v['borrow_money'] * 100;
$list[$key]['progress'] = $progress > 50 ? floor($progress) : ceil($progress);
//增加floor
//$list[$key]['progress'] = getFloatValue($v['has_borrow']/$v['borrow_money']*100,2);
$list[$key]['vouch_progress'] = getFloatValue($v['has_vouch'] / $v['borrow_money'] * 100, 2);
$list[$key]['burl'] = MU("Home/invest", "invest", array("id" => $v['id'], "suffix" => $suffix));
//新加
$list[$key]['lefttime'] = $v['collect_time'] - time();
if ($v['deadline'] == 0) {
$endTime = strtotime(date("Y-m-d", time()));
if ($v['repayment_type'] == 1) {
$list[$key]['repaytime'] = strtotime("+{$v['borrow_duration']} day", $endTime);
} else {
$list[$key]['repaytime'] = strtotime("+{$v['borrow_duration']} month", $endTime);
}
} else {
$list[$key]['repaytime'] = $v['deadline'];
//还款时间
}
$list[$key]['publishtime'] = $v['add_time'] + 60 * 60 * 24 * 3;
//预计发标时间=添加时间+1天
if ($v['danbao'] != 0) {
$danbao = M('article')->field("id,title")->where("type_id =7 and id ={$v['danbao']}")->find();
$list[$key]['danbao'] = $danbao['title'];
//担保机构
} else {
$list[$key]['danbao'] = '暂无担保机构';
//担保机构
}
}
$row = array();
$row['list'] = $list;
$row['count'] = $count;
$row['page'] = $page;
return $row;
}
示例7: time
} else {
$date = time();
}
$start = mktime(16, 0, 0, date('m', $date), date('d', $date), date('Y', $date));
$end = mktime(06, 0, 0, date('m', $date), date('d', $date) + 1, date('Y', $date));
$default_area = 6;
if (isset($_GET['area'])) {
$area2 = getArea($_GET['area']);
if (!count($area2)) {
$area = $default_area;
} else {
$area = $area['area_id'];
}
} else {
$area = $default_area;
$area2 = getArea($area);
if (!count($area2)) {
$area = 0;
}
}
echo '<html><head><title>';
if (count($area2)) {
echo $area2['area_name'] . ' - ';
}
echo date('d.m.Y', $start);
echo '</title></head>';
echo '<body background="img/infoskjerm-bg.png" style="margin: 0px; padding: 0px;">' . chr(10);
$Q_room = mysql_query("select id as room_id, room_name from `mrbs_room` where area_id = '" . $area . "' and hidden = 'false'");
$rooms = array();
while ($R_room = mysql_fetch_assoc($Q_room)) {
$rooms[$R_room['room_id']] = $R_room['room_name'];
示例8: tdetail
public function tdetail()
{
if ($_GET['type'] == 'commentlist') {
//评论
$cmap['tid'] = intval($_GET['id']);
$clist = getCommentList($cmap, 5);
$this->assign("commentlist", $clist['list']);
$this->assign("commentpagebar", $clist['page']);
$this->assign("commentcount", $clist['count']);
$data['html'] = $this->fetch('commentlist');
exit(json_encode($data));
}
$pre = C('DB_PREFIX');
$id = intval($_GET['id']);
$Bconfig = (require C("APP_ROOT") . "Conf/borrow_config.php");
//合同ID
if ($this->uid) {
$invs = M('transfer_borrow_investor')->field('id')->where("borrow_id={$id} AND (investor_uid={$this->uid} OR borrow_uid={$this->uid})")->find();
if ($invs['id'] > 0) {
$invsx = $invs['id'];
} elseif (!is_array($invs)) {
$invsx = 'no';
}
} else {
$invsx = 'login';
}
$this->assign("invid", $invsx);
//合同ID
//borrowinfo
//$borrowinfo = M("borrow_info")->field(true)->find($id);
$borrowinfo = M("transfer_borrow_info b")->join("{$pre}transfer_detail d ON d.borrow_id=b.id")->field(true)->find($id);
/*if(!is_array($borrowinfo) || $borrowinfo['is_show'] == 0){
$this->error("数据有误或此标已认购完");
}*/
$borrowinfo['progress'] = getfloatvalue($borrowinfo['transfer_out'] / $borrowinfo['transfer_total'] * 100, 2);
$borrowinfo['need'] = getfloatvalue(($borrowinfo['transfer_total'] - $borrowinfo['transfer_out']) * $borrowinfo['per_transfer'], 2);
$borrowinfo['updata'] = unserialize($borrowinfo['updata']);
$this->assign("vo", $borrowinfo);
//此标借款利息还款相关情况
//memberinfo
$memberinfo = M("members m")->field("m.id,m.customer_name,m.customer_id,m.user_name,m.reg_time,m.credits,fi.*,mi.*,mm.*")->join("{$pre}member_financial_info fi ON fi.uid = m.id")->join("{$pre}member_info mi ON mi.uid = m.id")->join("{$pre}member_money mm ON mm.uid = m.id")->where("m.id={$borrowinfo['borrow_uid']}")->find();
$areaList = getArea();
$memberinfo['location'] = $areaList[$memberinfo['province']] . $areaList[$memberinfo['city']];
$memberinfo['location_now'] = $areaList[$memberinfo['province_now']] . $areaList[$memberinfo['city_now']];
$this->assign("minfo", $memberinfo);
//memberinfo
//investinfo
$fieldx = "bi.investor_capital,bi.transfer_month,bi.transfer_num,bi.add_time,m.user_name,bi.is_auto,bi.final_interest_rate";
$investinfo = M("transfer_borrow_investor bi")->field($fieldx)->join("{$pre}members m ON bi.investor_uid = m.id")->where("bi.borrow_id={$id}")->order("bi.id DESC")->select();
$this->assign("investinfo", $investinfo);
//investinfo
$oneday = 86400;
$time_1 = time() - 30 * $oneday . "," . time();
$time_6 = time() - 180 * $oneday . "," . time();
$time_12 = time() - 365 * $oneday . "," . time();
$mapxr['borrow_id'] = $id;
$this->assign("time_all_out", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['add_time'] = array("between", "{$time_1}");
$this->assign("time_1_out", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['add_time'] = array("between", "{$time_6}");
$this->assign("time_6_out", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['add_time'] = array("between", "{$time_12}");
$this->assign("time_12_out", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr = array();
$mapxr['borrow_id'] = $id;
$mapxr['status'] = 2;
$this->assign("time_all_back", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['back_time'] = array("between", "{$time_1}");
$this->assign("time_1_back", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['back_time'] = array("between", "{$time_6}");
$this->assign("time_6_back", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$mapxr['back_time'] = array("between", "{$time_12}");
$this->assign("time_12_back", M("transfer_borrow_investor")->where($mapxr)->sum("transfer_num"));
$this->assign("Bconfig", $Bconfig);
$this->display();
}
示例9: pdoQuery
$addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId'], 'dft_a' => 1), ' limit 1');
}
if ($addrrow = $addrQuery->fetch()) {
$addr = $addrrow;
} else {
$addrrow = array('id' => -1, 'name' => '', 'phone' => '', 'address' => '点击设置收货地址', 'province' => ' ', 'city' => ' ', 'area' => ' ');
$addr = $addrrow;
}
include 'view/order.html.php';
exit;
}
//地址页面修改已存在地址
if (isset($_GET['alterAddress'])) {
$pro = getProvince($_POST['pro']);
$city = getCity($_POST['pro'], $_POST['city']);
$area = getArea($_POST['pro'], $_POST['city'], $_POST['area']);
$value = array('pro_id' => $_POST['pro'], 'city_id' => $_POST['city'], 'area_id' => $_POST['area'], 'area' => $_POST['area'], 'province' => $pro, 'city' => $city, 'area' => $area, 'address' => $_POST['address'], 'name' => $_POST['name'], 'phone' => $_POST['phone']);
if (-1 == $_POST['address_id']) {
$value['c_id'] = $_SESSION['customerId'];
$value['dft_a'] = 0;
$addrId = pdoInsert('address_tbl', $value);
} else {
pdoUpdate('address_tbl', $value, array('id' => $_POST['address_id']));
}
$from = isset($_GET['from']) ? '&from=' . $_GET['from'] : '';
header('location:controller.php?editAddress=1' . $from);
}
if (isset($_GET['editAddress'])) {
$to = $_GET['from'];
$addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId']), ' limit 5');
$addrlist = array();
示例10: header
header('Location: admin_entry_type.php');
exit;
} else {
echo 'Error occured while performing query on database:<br>' . chr(10), exit;
}
}
}
include "include/admin_middel.php";
$editor->printEditor();
} elseif (isset($_GET['entry_type_id']) && isset($_GET['area_id'])) {
$entry_type = getEntryType($_GET['entry_type_id']);
if (!count($entry_type)) {
echo 'Finner ikke typen.';
exit;
}
$area = getArea($_GET['area_id']);
if (!count($area)) {
echo __('Can\'t find the area.');
exit;
}
$entry_type_defaultattachment = getEntryTypeDefaultAttachment($_GET['entry_type_id'], $_GET['area_id']);
$saved = false;
if (isset($_POST['attSave'])) {
if (!isset($_POST['attachment']) || !is_array($_POST['attachment'])) {
$_POST['attachment'] = array();
}
// Accept the changes in attachments
$att_new = array();
$att_deleted = $entry_type_defaultattachment;
foreach ($_POST['attachment'] as $att_id) {
$att = getAttachment($att_id);
示例11: chr
echo ' <th>Bruker</th>' . chr(10);
echo ' <th>Login</th>' . chr(10);
echo ' <th>Accesslevel</th>' . chr(10);
echo ' <th>Info</th>' . chr(10);
echo ' <th>Valg</th>' . chr(10);
echo ' <th>Grupper som brukeren er medlem av</th>' . chr(10);
echo ' </tr>' . chr(10) . chr(10);
while ($R_user = mysql_fetch_assoc($Q_users)) {
$user = getUser($R_user['user_id'], true);
echo ' <tr>' . chr(10);
echo ' <td>' . $user['user_id'] . '</td>';
echo ' <td>' . '<a href="user.php?user_id=' . $user['user_id'] . '">' . iconHTML('user') . ' ' . $user['user_name'] . '</a>' . '</td>' . chr(10);
echo ' <td>' . $user['user_name_short'] . '</td>' . chr(10);
echo ' <td>' . iconHTML('lock') . ' ' . $user['user_accesslevel'] . '</td>' . chr(10);
echo ' <td>' . '<div class="showButton" id="buttonId' . $user['user_id'] . '"><a href="javascript:void();">Vis / Ikke vis</a></div>' . '<div class="showField" id="fieldId' . $user['user_id'] . '" style="display:none;">' . 'Telefon: ' . $user['user_phone'] . '<br>' . 'E-post: ' . $user['user_email'] . '<br>' . 'Stilling: ' . $user['user_position'] . '<br>';
$area_user = getArea($user['user_area_default']);
if (!count($area_user)) {
$area_user['area_name'] = 'IKKE FUNNET';
}
echo 'Standard bygg: ' . $area_user['area_name'] . '<br>';
echo 'Fakturatilgang: ';
if ($user['user_invoice']) {
echo 'ja';
} else {
echo 'nei';
}
'</div></td>' . chr(10);
echo ' <td>' . '<a href="' . $_SERVER['PHP_SELF'] . '?editor=1&id=' . $user['user_id'] . '">' . iconHTML('user_edit') . ' ' . 'Endre</a>' . '</td>' . chr(10);
echo ' <td>';
if (count($user) && count($user['groups'])) {
echo '<ul style="margin: 0;">' . chr(10);
示例12: chr
echo '<script language="javascript" src="js/jquery-1.3.2.min.js"></script>' . chr(10);
//echo nl2br(str_replace(' ', '_ ', print_r($invoice, 1)));
echo '<form method="post" name="invoiceform" action="' . $_SERVER['PHP_SELF'] . '">' . chr(10);
if (count($invoice->invoice_idlinks)) {
$datafrom_string = 'Fakturadata hentet fra' . chr(10);
foreach ($invoice->invoice_idlinks as $link) {
list($idtype, $id) = explode('=', $link);
$datafrom_string .= '- ';
switch ($idtype) {
case 'e':
// Entry
$thisentry = getEntry($id);
if (!count($thisentry)) {
$datafrom_string .= '(BID' . $id . ') UKJENT BOOKING (ikke funnet i databasen)';
} else {
$entryarea = getArea($thisentry['area_id']);
$a = '';
if (count($entryarea)) {
$a = ' - ' . $entryarea['area_name'];
}
$datafrom_string .= 'Booking' . $a . ', ' . date('d-m-Y', $thisentry['time_start']) . ', BID' . $id . ' - ' . '<a href="entry.php?entry_id=' . $thisentry['entry_id'] . '">' . $thisentry['entry_name'] . '</a>';
//' (BID'.$id.')';
if ($thisentry['contact_person_name'] != '') {
$datafrom_string .= ', kontaktperson: ' . $thisentry['contact_person_name'];
}
}
break;
default:
$datafrom_string .= _('Unknown sourcetype');
break;
}
示例13: getAreaIds
function getAreaIds($area_id_from_default)
{
$area_ids = array();
if (isset($_GET['area'])) {
$split = explode(',', $_GET['area']);
foreach ($split as $id) {
$area_ids[] = (int) $id;
}
}
if (!count($area_ids)) {
$area_ids = array($area_id_from_default);
}
$areas = array();
foreach ($area_ids as $area_id) {
$area = getArea($area_id);
if (count($area)) {
$areas[$area['area_id']] = $area;
}
}
return $areas;
}
示例14: getBorrowerInfo
public function getBorrowerInfo($bid)
{
$db = core::db()->getConnect('CAILAI', true);
$filed = "bi.borrow_uid,mi.sex,mi.age,mi.education,mi.marry,fi.fin_monthin,m.user_email,m.customer_name,fi.fin_car,m.integral,mi.zy,mm.credit_limit,mi.province,mi.city,mm.account_money,mm.back_money,mm.money_collect,mm.money_freeze ";
$sql = sprintf("SELECT {$filed} FROM`lzh_borrow_info` bi LEFT JOIN lzh_members m ON m.id = bi.borrow_uid LEFT JOIN lzh_member_financial_info fi ON bi.borrow_uid=fi.uid LEFT JOIN `lzh_member_info` mi ON mi.uid=bi.borrow_uid LEFT JOIN `lzh_member_money` mm ON mm.uid=bi.borrow_uid WHERE bi.id=%s", $bid);
$zw = $db->query($sql, "array ");
$borrow_uid = $zw['borrow_uid'];
unset($zw['borrow_uid']);
$zw['fin_monthin'] = getMoneyFormt($zw['fin_monthin']);
$zw['integral'] = (int) $zw['integral'];
$zw['credit_limit'] = (double) $zw['credit_limit'];
if ($zw['fin_car'] == NULL) {
$zw['fin_car'] = '未填写';
}
//借款次数相关
$sql2 = sprintf("SELECT `borrow_status`, COUNT(id) AS num,SUM(borrow_money) AS money,SUM(repayment_money) AS repayment_money FROM `lzh_borrow_info` WHERE borrow_uid = %s GROUP BY borrow_status ", $borrow_uid);
$zw2 = $db->query($sql2);
while ($row = $db->fetchArray($zw2)) {
$borrowCount[$row['borrow_status']] = $row;
}
//借出情况相关
$field3 = "status,count(id) as num,sum(investor_capital) as investor_capital,sum(reward_money) as reward_money,sum(investor_interest) as investor_interest,sum(receive_capital) as receive_capital,sum(receive_interest) as receive_interest,sum(invest_fee) as invest_fee";
$sql3 = sprintf("SELECT {$field3} FROM `lzh_borrow_investor` WHERE investor_uid = %s GROUP BY STATUS ", $borrow_uid);
$zw3 = $db->query($sql3);
$_reward_money = 0;
while ($v = $db->fetchArray($zw3)) {
$investStatus[$v['status']] = $v;
$_reward_money += floatval($v['reward_money']);
}
$rowtj['jkze'] = getFloatValue(floatval($borrowCount[6]['money'] + $borrowCount[7]['money'] + $borrowCount[8]['money'] + $borrowCount[9]['money']), 2);
//借款总额
$rowtj['jcze'] = getFloatValue(floatval($investStatus[4]['investor_capital']), 2);
//借出总额
$rowtj['ysze'] = getFloatValue(floatval($investStatus[4]['receive_capital']), 2);
//应收总额
$rowtj['yhze'] = getFloatValue(floatval($borrowCount[6]['repayment_money'] + $borrowCount[7]['repayment_money'] + $borrowCount[8]['repayment_money'] + $borrowCount[9]['repayment_money']), 2);
//应还总额
$data2['yhze'] = getMoneyFormt(getFloatValue(floatval($borrowCount[6]['repayment_money'] + $borrowCount[7]['repayment_money'] + $borrowCount[8]['repayment_money'] + $borrowCount[9]['repayment_money']), 2));
//应还总额
$data2['dhze'] = getMoneyFormt(getFloatValue($rowtj['jkze'] - $rowtj['yhze'], 2));
//待还总额
$data2['jcze'] = getMoneyFormt(getFloatValue(floatval($investStatus[4]['investor_capital']), 2));
//借出总额
$data2['ysze'] = getMoneyFormt(getFloatValue(floatval($investStatus[4]['receive_capital']), 2));
//应收总额
$data2['dsze'] = getMoneyFormt(getFloatValue($rowtj['jcze'] - $rowtj['ysze'], 2));
//待收总额
$data2['fz'] = getMoneyFormt(getFloatValue($rowtj['jcze'] - $rowtj['jkze'], 2));
$data2['jkcgcs'] = (int) ($borrowCount[6]['num'] + $borrowCount[7]['num'] + $borrowCount[8]['num'] + $borrowCount[9]['num']);
//借款成功次数
$data2['zcze'] = getMoneyFormt(getFloatValue(floatval($zw['account_money'] + $zw['back_money'] + $zw['money_collect'] + $zw['money_freeze']), 2));
//资产总额
//还款情况相关
$field4 = "status,sort_order,borrow_id,sum(capital) as capital,sum(interest) as interest";
$sql4 = sprintf("SELECT {$field4} FROM `lzh_investor_detail` WHERE borrow_uid = %s GROUP BY sort_order, borrow_id ", $borrow_uid);
$zw4 = $db->query($sql4);
while ($v = $db->fetchArray($zw4)) {
// $repaymentStatus[$v['status']]['capital']+=$v['capital'];//当前状态下的数金额
// $repaymentStatus[$v['status']]['interest']+=$v['interest'];//当前状态下的数金额
$repaymentStatus[$v['status']]['num']++;
//当前状态下的总笔数
}
$data2['repayment1'] = (int) $repaymentStatus[1]['num'];
//正常还款次数:
$data2['repayment3'] = (int) $repaymentStatus[3]['num'];
//迟还次数:
$data2['repayment2'] = (int) $repaymentStatus[2]['num'];
//提前还款次数::
$data2['repayment6'] = (int) $repaymentStatus[6]['num'];
//待还款笔数:
$data2['repayment4'] = (int) $repaymentStatus[4]['num'];
//网站代还次数:::
$data2['repayment5'] = (int) $repaymentStatus[5]['num'];
//逾期还款笔数::
$areaList = getArea();
$data2['location'] = $areaList[$zw['province']] . $areaList[$zw['city']];
unset($zw['province'], $zw['city']);
$zz = array_merge($zw, $data2);
return $zz;
}
示例15: templateAssignEntry
function templateAssignEntry($var, $entry)
{
global ${$var};
if (count($entry)) {
${$var}->assign('entry_id', $entry['entry_id']);
${$var}->assign('entry_name', $entry['entry_name']);
${$var}->assign('entry_title', $entry['entry_title']);
${$var}->assign('confirm_email', $entry['confirm_email']);
if ($entry['confirm_email']) {
${$var}->assign('confirm_email2', _('yes'));
} else {
${$var}->assign('confirm_email2', _('no'));
}
${$var}->assign('entry_type_id', $entry['entry_type_id']);
if ($entry['entry_type_id'] == 0) {
$entry_type = _('Non selected');
} else {
$entry_type = getEntryType($entry['entry_type_id']);
if (count($entry_type)) {
$entry_type = $entry_type['entry_type_name'];
} else {
$entry_type = 'ERROR';
}
}
${$var}->assign('entry_type', $entry_type);
${$var}->assign('num_person_child', $entry['num_person_child']);
${$var}->assign('num_person_adult', $entry['num_person_adult']);
${$var}->assign('num_person_count', $entry['num_person_count']);
if ($entry['num_person_count']) {
${$var}->assign('num_person_count2', _('yes'));
} else {
${$var}->assign('num_person_count2', _('no'));
}
${$var}->assign('program_id', $entry['program_id']);
$program = getProgram($entry['program_id']);
if (count($program)) {
${$var}->assign('program_id_name', $program['program_name']);
${$var}->assign('program_id_desc', $program['program_desc']);
} else {
${$var}->assign('program_id_name', '');
${$var}->assign('program_id_desc', '');
}
${$var}->assign('program_description', $entry['program_description']);
${$var}->assign('service_alco', $entry['service_alco']);
if ($entry['service_alco']) {
${$var}->assign('service_alco2', _('yes'));
} else {
${$var}->assign('service_alco2', _('no'));
}
${$var}->assign('service_description', $entry['service_description']);
${$var}->assign('comment', $entry['comment']);
${$var}->assign('infoscreen_txt', $entry['infoscreen_txt']);
${$var}->assign('time_start', $entry['time_start']);
${$var}->assign('time_end', $entry['time_end']);
${$var}->assign('room_id', $entry['room_id']);
// Room
$rooms = array();
if (!count($entry['room_id'])) {
$rooms[] = _('Whole area');
} elseif (count($entry['room_id']) == '1') {
// Single room
foreach ($entry['room_id'] as $rid) {
if ($rid == '0') {
$rooms[] = _('Whole area');
} else {
$room = getRoom($rid);
if (count($room)) {
$rooms[] = $room['room_name'];
} else {
$rooms[] = 'ERROR';
}
}
}
} else {
foreach ($entry['room_id'] as $rid) {
if ($rid != '0') {
$room = getRoom($rid);
if (count($room)) {
$rooms[] = $room['room_name'];
} else {
$rooms[] = 'ERROR';
}
}
}
}
if (!count($rooms)) {
$rooms[] = _('Whole area');
}
${$var}->assign('room', implode(', ', $rooms));
${$var}->assign('rooms', $rooms);
${$var}->assign('area_id', $entry['area_id']);
// Area
$area = getArea($entry['area_id']);
if (count($area)) {
$area = $area['area_name'];
} else {
$area = 'ERROR';
}
${$var}->assign('area', $area);
${$var}->assign('user_assigned', $entry['user_assigned']);
//.........这里部分代码省略.........