本文整理汇总了PHP中Subscription::getActiveSubscriptionInfos方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscription::getActiveSubscriptionInfos方法的具体用法?PHP Subscription::getActiveSubscriptionInfos怎么用?PHP Subscription::getActiveSubscriptionInfos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscription
的用法示例。
在下文中一共展示了Subscription::getActiveSubscriptionInfos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: liste
public function liste($month = null)
{
// if (Input::has('filtre_month') && Input::has('filtre_year')) {
// Session::put('filtre_pasttime.month', Input::get('filtre_month'));
// Session::put('filtre_pasttime.year', Input::get('filtre_year'));
// }
if (Input::has('filtre_submitted')) {
if (Input::has('filtre_user_id')) {
Session::put('filtre_pasttime.user_id', Input::get('filtre_user_id'));
}
if (Input::has('filtre_start')) {
$date_start_explode = explode('/', Input::get('filtre_start'));
Session::put('filtre_pasttime.start', $date_start_explode[2] . '-' . $date_start_explode[1] . '-' . $date_start_explode[0]);
if (!Input::has('filtre_user_id')) {
Session::forget('filtre_pasttime.user_id');
}
}
if (Input::has('filtre_end')) {
$date_end_explode = explode('/', Input::get('filtre_end'));
Session::put('filtre_pasttime.end', $date_end_explode[2] . '-' . $date_end_explode[1] . '-' . $date_end_explode[0]);
} else {
Session::put('filtre_pasttime.end', date('Y-m-d'));
}
if (Input::has('filtre_toinvoice')) {
Session::put('filtre_pasttime.filtre_toinvoice', Input::get('filtre_toinvoice'));
} else {
Session::put('filtre_pasttime.filtre_toinvoice', false);
}
}
if (Session::has('filtre_pasttime.start')) {
$date_filtre_start = Session::get('filtre_pasttime.start');
$date_filtre_end = Session::get('filtre_pasttime.end');
} else {
$date_filtre_start = date('Y-m') . '-01';
$date_filtre_end = date('Y-m') . '-' . date('t', date('m'));
}
// if (Session::has('filtre_pasttime.month')) {
// $date_filtre_start = Session::get('filtre_pasttime.year').'-'.Session::get('filtre_pasttime.month').'-01';
// $date_filtre_end = Session::get('filtre_pasttime.year').'-'.Session::get('filtre_pasttime.month').'-'.date('t', Session::get('filtre_pasttime.month'));
// } else {
// $date_filtre_start = date('Y-m').'-01';
// $date_filtre_end = date('Y-m').'-'.date('t', Session::get('filtre_pasttime.month'));
// }
$recapFilter = false;
$q = PastTime::whereBetween('date_past', array($date_filtre_start, $date_filtre_end));
$q->with('user', 'ressource');
if (Session::get('filtre_pasttime.filtre_toinvoice')) {
$q->where('invoice_id', 0);
$q->where('is_free', false);
}
if (Auth::user()->isSuperAdmin()) {
if (Session::has('filtre_pasttime.user_id')) {
$recapFilter = Session::get('filtre_pasttime.user_id');
$q->whereUserId($recapFilter);
}
} else {
$recapFilter = Auth::user()->id;
$q->whereUserId(Auth::user()->id);
}
$recap = PastTime::Recap($recapFilter, $date_filtre_start, $date_filtre_end);
$pending_invoice_amount = 0;
foreach ($recap as $recap_item) {
$pending_invoice_amount += $recap_item->amount;
}
$params = array();
$params['times'] = $q->orderBy('date_past', 'DESC')->paginate(15);
$params['recap'] = $recap;
$params['pending_invoice_amount'] = $pending_invoice_amount;
$params = array_merge($params, Subscription::getActiveSubscriptionInfos());
return View::make('pasttime.liste', $params);
}
示例2: extract
<?php
extract(Subscription::getActiveSubscriptionInfos());
?>
@if($active_subscription)
<div class="ibox">
<div class="ibox-title">
<h5>Abonnement en cours</h5>
</div>
<div class="ibox-content">
<small>
Du {{date('d/m/Y', strtotime($active_subscription->subscription_from ))}}
au {{date('d/m/Y', strtotime('-1 day', strtotime($active_subscription->subscription_to)))}}
</small>
<h1 class="no-margins">
@if($subscription_used)
@if ($subscription_used->hours)
{{ $subscription_used->hours }} h
@endif
@if ($subscription_used->minutes)
{{ $subscription_used->minutes }} min
@endif
@else
0 h
@endif
@if($active_subscription->subscription_hours_quota > 0)
/ {{$active_subscription->subscription_hours_quota}} h
@else
/ Illimité
@endif
</h1>