本文整理汇总了PHP中app类的典型用法代码示例。如果您正苦于以下问题:PHP app类的具体用法?PHP app怎么用?PHP app使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了app类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* send
* 必有方法,发送时调用.
*
* config参数为getOptions取得的所有项的配置结果
*
* @param mixed $target ['email']
* @param mixed $title
* @param mixed $config
*/
public function send($target, $title, $content, $config)
{
logger::debug(__CLASS__ . var_export(func_get_args(), 1));
$new_msg = array('member_id' => $target['member_id'], 'target' => $target['email'], 'subject' => $title, 'content' => $content, 'createtime' => time(), 'msg_type' => 'email', 'status' => 'sent');
app::get('b2c')->model('member_msg')->save($new_msg);
if (!($email_to = $target['email'])) {
return false;
}
if ($config['sendway'] == 'mail') {
$this->email = vmc::singleton('desktop_email_email');
}
$this->email->Sender = $this->Sender = $config['usermail'];
$this->email->Subject = $this->Subject = $this->email->inlineCode($title);
$From = $this->email->inlineCode(app::get('site')->getConf('site_name')) . '<' . $config['usermail'] . '>';
$header = array('Return-path' => '<' . $config['usermail'] . '>', 'Date' => date('r'), 'From' => $From, 'MIME-Version' => '1.0', 'Subject' => $this->Subject, 'To' => $email_to, 'Content-Type' => 'text/html; charset=UTF-8; format=flowed', 'Content-Transfer-Encoding' => 'base64');
$body = chunk_split(base64_encode($content));
$header = $this->email->buildHeader($header);
$config['sendway'] = $config['sendway'] ? $config['sendway'] : 'smtp';
switch ($config['sendway']) {
case 'sendmail':
$result = $this->email->SendmailSend($email_to, $header, $body);
break;
case 'mail':
$result = $this->email->MailSend($email_to, $header, $body);
break;
case 'smtp':
$result = $this->email->SmtpSend($email_to, $header, $body, $config);
break;
default:
$result = false;
break;
}
return $result;
}
示例2: tujuanDes
function tujuanDes($destkota, $stat = 'provinsi', $tambah)
{
global $app;
$dbu = new db();
$appx = new app();
$urlx = new url();
if ($stat == "destinasi") {
while ($desty = $dbu->fetch($destkota)) {
$destinasi = $desty[nama];
$desty[thumb] = $appx->cekFile("/destinasi/thumb/", $desty[thumb], 'default.jpg');
$desty[thumb] = $app[data_www] . "/destinasi/thumb/" . $desty[thumb];
$outnya .= '<li>
<div class="img_box">
<img src="' . $desty[thumb] . '">
</div>
<div class="text">
<h1>' . $destinasi . '</h1>
<p>' . $dbu->lookup('deskripsi', $app[table][destinasi_bahasa], "id_reff ='" . $desty[id_reff] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>
</div>
<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='21' and id_bahasa='" . $_SESSION[bhs] . "'") . "/" . $urlx->shortLink($destinasi) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
</li>';
}
} elseif ($stat == "provinsi") {
while ($desty = $dbu->fetch($destkota)) {
$destinasi = $desty[nama];
$desty[thumb] = $appx->cekFile("/destinasi/thumb/", $desty[thumb], 'default.jpg');
$desty[thumb] = $app[data_www] . "/destinasi/thumb/" . $desty[thumb];
$outnya .= '<li>
<div class="img_box">
<img src="' . $desty[thumb] . '">
</div>
<div class="text">
<h1>' . $destinasi . '</h1>
<p>' . $dbu->lookup('deskripsi', $app[table][destinasi_bahasa], "id_reff ='" . $desty[id_reff] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>
</div>
<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='21' and id_bahasa='" . $_SESSION[bhs] . "'") . "/" . $urlx->shortLink($destinasi) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
</li>';
}
} else {
//echo "sedel";exit;
while ($dkota = $dbu->fetch($destkota)) {
$dkota[thumb] = $appx->cekFile("/kota/thumb/", $dkota[thumb], 'default.jpg');
$dkota[thumb] = $app[data_www] . "/kota/thumb/" . $dkota[thumb];
//echo "asdasdas".$dkota[thumb];
$outnya .= '<li>
<div class="img_box">
<img src="' . $dkota[thumb] . '">
</div>
<div class="text">
<h1>' . $dkota[nama] . '</h1>
<p>' . $dbu->lookup('deskripsi', $app[table][kota_bahasa], "id_kota ='" . $dkota[id] . "' AND id_bahasa='" . $_SESSION[bhs] . "'") . '</p>
</div>
<a href="' . $app[www] . "/" . $dbu->lookup('nama', 'action', "action='2' and id_bahasa='" . $_SESSION[bhs] . "'") . "/id_" . $urlx->shortLink($dkota[nama]) . "_" . $urlx->shortLink($tambah) . "/" . '"><div class="explore">EXPLORE MORE</div></a>
</li>';
}
}
return $outnya;
}
示例3: makeModel
/**
* Return Model by each class
*
* @return Model
*/
private function makeModel()
{
$this->model = $this->app->make($this->model());
if (!$this->model instanceof Model) {
throw new Exception("Class " . $this->model . " must be an instance of Illuminate\\Database\\Eloquent\\Model");
}
return $this->model;
}
示例4: feedCheckIn
function feedCheckIn($dfeed, $sBahasa, $member)
{
global $app;
$appx = new app();
$dbu = new db();
$urlx = new url();
$fcek_in = "";
$icon = $app[css_www] . "/images/ic_cat_2.png";
$avatar = $appx->cekFile('/pengguna/avatar/', $member[avatar], 'default.jpg');
$avatar = $app[data_www] . '/pengguna/avatar/' . $avatar;
$linkAva = $app["www"] . "/" . $dbu->lookup('nama', 'action', "action='8' and id_bahasa ='" . $sBahasa . "'") . "/" . $urlx->shortLink($member[username]) . "/";
$fcek_in = '<div class="con_newsfeed add_fix">
<div class="line_newsfeed">
<div class="circle_pict circle_pict_nf"><a href="' . $linkAva . '"><img src="' . $avatar . '"></a></div>
<div class="bar"></div>
<div class="ic_cat"><a href="#"><img src="' . $icon . '"></a></div>
</div>';
$dipost = $appx->time_delta('now', $dfeed[tgl_post], 0, 2, true);
if ($_SESSION[member][id] != "") {
$bolehKomen = '<li>
<div class="circle_pict circle_pict_nf"><a href="' . $linkAva . '"><img src="' . $avatar . '"></a></div>
<textarea id="cekin" placeholder="Write your comment..."></textarea>
</li>';
}
$sql = "SELECT a.nama , b.nama as kota , c.nama as provinsi, d.nama as negara FROM " . $app[table][destinasi_bahasa] . " as a LEFT JOIN " . $app[table][destinasi] . " as e ON (a.id_reff = e.id_reff) LEFT JOIN " . $app[table][kota] . " as b ON(e.id_kota = b.id) LEFT JOIN " . $app[table][provinsi] . " as c ON(b.id_provinsi = c.id) LEFT JOIN " . $app[table][negara] . " as d ON(c.id_negara = d.id) LEFT JOIN " . $app[table][cekin] . " as f ON(e.id = f.id_destinasi ) LEFT JOIN " . $app[table][pengguna_feed] . " as g ON(f.id = g.id_tabel) WHERE g.id ='" . $dfeed[id] . "' AND a.id_bahasa ='" . $sBahasa . "'";
$lokasi = $dbu->get_recordmix($sql);
$cekin_di = '<span>Check in at <a href="#"><i>' . $lokasi[nama] . '(' . $lokasi[kota] . '), ' . $lokasi[provinsi] . ', ' . $lokasi[negara] . '</i></a></span>';
$fcek_in .= '<div class="box_con_newsfeed">
<h1>' . $member[nama] . '</h1>
<span>' . $dipost . '</span>
<div class="frame_post">
' . $cekin_di . '
<div class="box_comment">
<ul class="add_fix" id="list_cekin" rel="cekin_' . $dfeed[id_tabel] . '">
' . $bolehKomen;
#komen cekin---------------------------
$sql = "SELECT a.nama , a.avatar, a.username, b.id, b.komen, b.tgl_post as tgl_komen FROM " . $app[table][pengguna] . " as a LEFT JOIN " . $app[table][cekin_komen] . " as b ON(b.id_user = a.id) WHERE b.id_cekin = '" . $dfeed[id_tabel] . "'";
$dbu->query($sql, $rkomen, $nkomen);
if ($nkomen > 0) {
while ($dkomen = $dbu->fetch($rkomen)) {
$dkomen[avatar] = $appx->cekFile("/pengguna/avatar/", $dkomen[avatar]);
$other_avatar = $app[data_www] . '/pengguna/avatar/' . $dkomen[avatar];
$other_linkAva = $app["www"] . "/" . $dbu->lookup('nama', 'action', "action='8' and id_bahasa ='" . $sBahasa . "'") . "/" . $urlx->shortLink($dkomen[username]) . "/";
$fcek_in .= '<li>
<div class="circle_pict circle_pict_nf"><a href="' . $other_linkAva . '"><img src="' . $other_avatar . '"></a></div>
<div class="text_box_c">
<h1>' . $dkomen[nama] . '</h1>
<p>' . $dkomen[komen] . '</p>
</div>
</li>';
}
}
$fcek_in .= '</ul></div></div></div></div>';
return $fcek_in;
}
示例5: setupAppFramework
function setupAppFramework()
{
/* initialize the SMT Facebook appliation class, NO Facebook library */
require_once PATH_FACEBOOK . "/classes/app.class.php";
global $app, $db, $session;
$app = new app(NULL, true);
$app->loadFacebookLibrary();
// caution: do not assign globals by reference
$db = $app->db;
$session = $app->session;
return $app;
}
示例6: run
public function run()
{
$ev = $this->make('ev');
include '../lib/config.inc.php';
header('P3P: CP=CAO PSA OUR');
header('Content-Type: text/html; charset=' . HE);
ini_set('date.timezone', 'Asia/Shanghai');
date_default_timezone_set("Etc/GMT-8");
error_reporting(0);
$app = new app($this);
$app->run();
}
示例7: deliver_featured
public function deliver_featured()
{
// send feature notifications
global $init;
require_once PATH_FACEBOOK . "/classes/app.class.php";
$app = new app(NULL, true);
$facebook =& $app->loadFacebookLibrary();
require_once PATH_CORE . '/classes/subscriptions.class.php';
$subObj = new SubscriptionsManager($db);
$subObj->loadFacebook($facebook);
$subObj->deliverFeatures();
set_flash(array('notice' => "Feature notifications sent."));
redirect(url_for($this->name, 'index'));
}
示例8: AppCentre_GetCheckQueryString
function AppCentre_GetCheckQueryString(){
global $zbp;
$check= '';
$app=new app;
if($app->LoadInfoByXml('theme', $zbp->theme)==true){
$check.=$app->id . ':' .$app->modified . ';';
}
foreach (explode('|',$zbp->option['ZC_USING_PLUGIN_LIST']) as $id) {
$app=new app;
if($app->LoadInfoByXml('plugin', $id)==true){
$check.=$app->id . ':' .$app->modified . ';';
}
}
return $check;
}
示例9: column_tag
public function column_tag(&$colList, $list)
{
//todo 如果list为空则 retunn
if (!$list) {
return;
}
$idColumnKey = $list[0]['idColumn'];
$appId = $list[0]['app_id'];
$tagType = $list[0]['tag_type'];
$list = utils::array_change_key($list, $idColumnKey);
// 获取所有当前finder主键列表
$relatedIds = array_keys(utils::array_change_key($list, $idColumnKey));
$filter = array('rel_id' => $relatedIds, 'tag_type' => $tagType, 'app_id' => $appId);
// 获取tag列表
$tagRows = app::get('desktop')->model('tag_rel')->getList('tag_id, rel_id', $filter);
/*-----start------>*/
$tagIds = array_keys(utils::array_change_key($tagRows, 'tag_id'));
if ($tagIds) {
$tagList = app::get('desktop')->model('tag')->getList('*', array('tag_id' => $tagIds));
$tagList = utils::array_change_key($tagList, 'tag_id');
}
/*<----end-------->*/
foreach ($tagRows as $row) {
$relatedRows[$row['rel_id']][] = $tagList[$row['tag_id']];
}
$i = 0;
foreach ($relatedIds as $id) {
$colList[$i] = $this->getColumnTagHtml($relatedRows[$id]);
$i++;
}
}
示例10: detail
/**
* 结算明细
* @return
*/
public function detail()
{
$this->contentHeaderTitle = app::get('topshop')->_('企业结算明细');
$filter['shop_id'] = $this->shopId;
$postSend = input::get();
if ($postSend['timearea']) {
$pagedata['timearea'] = $postSend['timearea'];
$timeArray = explode('-', $postSend['timearea']);
$filter['settlement_time|than'] = strtotime($timeArray[0]);
$filter['settlement_time|lthan'] = strtotime($timeArray[1]);
} else {
$filter['settlement_time|than'] = time() - 3600 * 24 * 7;
$filter['settlement_time|lthan'] = time();
$pagedata['timearea'] = date('Y/m/d', time() - 3600 * 24 * 7) . '-' . date('Y/m/d', time());
}
if ($postSend['settlement_type']) {
$filter['settlement_type'] = $postSend['settlement_type'];
$pagedata['settlement_type'] = $postSend['settlement_type'];
}
//处理翻页数据
$pagedata['page'] = $page = $postSend['page'] ? $postSend['page'] : 1;
$pagedata['limits'] = $pageLimit = 10;
$objMdlSettleDetail = app::get('sysclearing')->model('settlement_detail');
$pagedata['settlement_detail_list'] = $objMdlSettleDetail->getList('*', $filter, ($page - 1) * $pageLimit, $pageLimit, 'settlement_time desc');
$count = $objMdlSettleDetail->count($filter);
$postSend['token'] = time();
if ($count > 0) {
$total = ceil($count / $pageLimit);
}
$pagedata['pagers'] = array('link' => url::action('topshop_ctl_clearing_settlement@detail', $postSend), 'current' => $page, 'total' => $total, 'token' => $postSend['token']);
return $this->page('topshop/clearing/settlement_detail.html', $pagedata);
}
示例11: getPaymentId
public function getPaymentId($filter)
{
$tids = $filter['tid'];
if ($filter['tid'] && is_array($filter['tid'])) {
$tids = implode(',', $filter['tid']);
}
$tradeParams = array('user_id' => $filter['user_id'], 'tid' => $tids, 'fields' => 'tid,payment,user_id,status');
//获取需要支付的订单并检测其有效性
$tradeList = app::get('topc')->rpcCall('trade.get.list', $tradeParams);
$count = $tradeList['count'];
$tradeList = $tradeList['list'];
$countid = count($filter['tid']);
if ($countid != $count) {
throw new \LogicException(app::get('topc')->_("支付失败,提交的订单数据有误"));
return false;
}
foreach ($tradeList as $key => $value) {
if ($value['status'] != "WAIT_BUYER_PAY") {
throw new \LogicException(app::get('topc')->_($value['tid'] . " 订单已被支付,请重新选择要支付订单"));
return false;
}
$payment['money'] += $value['payment'];
$payment['user_id'] = $value['user_id'];
}
$payment['tids'] = $tids;
try {
$paymentId = app::get('topc')->rpcCall('payment.bill.create', $payment);
} catch (Exception $e) {
throw $e;
}
return $paymentId;
}
示例12: clear_by_app
function clear_by_app($app_id)
{
if (!$app_id) {
return false;
}
app::get('desktop')->model('menus')->delete(array('app_id' => $app_id, 'menu_type' => $this->content_typename()));
}
示例13: get_encrypted
/**
* 获取加密类型后的密文
* @param string $source_str 加密明文
* @return string 返回加密密文
*/
public function get_encrypted($source_str, $account_type, $userdata = null)
{
if (!$userdata) {
return md5($source_str);
}
if ($userdata['createtime']) {
return $this->extends_md5($source_str, $userdata['login_name'], $userdata['createtime']);
} else {
if ($account_type == 'member') {
$pam_members_model = app::get('pam')->model('members');
$pam_filter = array('login_account' => $userdata['login_name']);
$rows = $pam_members_model->getList('*', $pam_filter, 0, 1);
// 商家 2015/8/31
} else {
if ($account_type == 'seller') {
$pam_model = app::get('pam')->model('seller');
$pam_filter = array('login_account' => $userdata['login_name']);
$rows = $pam_model->getList('*', $pam_filter, 0, 1);
} else {
$pam_account_model = app::get('pam')->model('account');
$pam_filter = array('login_name' => $userdata['login_name'], 'account_type' => $account_type, 'disabled' => 'false');
$rows = $pam_account_model->getList('*', $pam_filter, 0, 1);
}
}
if ($rows[0]) {
if (substr($rows[0]['login_password'], 0, 1) !== 's') {
return md5($source_str);
} else {
return $this->extends_md5($source_str, $userdata['login_name'], $rows[0]['createtime']);
}
} else {
return false;
}
}
}
示例14: update
public function update($params)
{
$db = app::get('sysaftersales')->database();
$db->beginTransaction();
try {
$data['money'] = $params['money'];
$data['cur_money'] = $params['cur_money'];
$filter['payment_id'] = $params['payment_id'];
$objMdlPayment = app::get('ectools')->model('payments');
$objMdlPayBill = app::get('ectools')->model('trade_paybill');
$result = $objMdlPayment->update($data, $filter);
if (!$result) {
throw new Exception('更新支付单失败');
}
$trade_own_money = json_decode($params['trade_own_money'], true);
foreach ($trade_own_money as $key => $val) {
$billdata['payment'] = $val;
$billdata['modified_time'] = time();
$billfilter['tid'] = $key;
$billfilter['payment_id'] = $params['payment_id'];
$result = $objMdlPayBill->update($billdata, $billfilter);
if (!$result) {
throw new Exception('更新支付单失败');
}
}
$db->commit();
} catch (Exception $e) {
$db->rollback();
throw $e;
}
return true;
}
示例15: theme_widget_main_slide
/**
* ShopEx licence
*
* @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
* @license http://ecos.shopex.cn/ ShopEx License
*/
function theme_widget_main_slide(&$setting,&$render){
$setting['allimg']="";
$setting['allurl']="";
if($system->theme){
$theme_dir = kernel::get_themes_host_url().'/'.$smarty->theme;
}else{
$theme_dir = kernel::get_themes_host_url().'/'.app::get('site')->getConf('current_theme');
}
if(!$setting['pic']){
foreach($setting['img'] as $value){
$setting['allimg'].=$rvalue."|";
$setting['allurl'].=urlencode($value["url"])."|";
}
}else{
foreach($setting['pic'] as $key=>$value){
if($value['link']){
if($value["url"]){
$value["linktarget"]=$value["url"];
}
$setting['allimg'].=$rvalue."|";
$setting['allurl'].=urlencode($value["linktarget"])."|";
$setting['pic'][$key]['link'] = str_replace('%THEME%',$theme_dir,$value['link']);
}
}
}
return $setting;
}