コード例 #1
0
ファイル: AccountsController.php プロジェクト: avinash-/idtv2
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $manager_id = Session::get('manager_id');
     $accounts = Accounts::where('manager_id', '=', $manager_id)->get();
     return View::make('manager.accounts.index', ['accounts' => $accounts]);
 }
コード例 #2
0
ファイル: index.blade.php プロジェクト: Grapheme/amway
* TITLE: Главная страница
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php 
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистрация в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$created = new Carbon(Config::get('site.date_final_action'));
$now = Carbon::now();
$difference_final = $created->diff($now)->days < 1 ? 'Сегодня шоу-финал.' : 'До шоу-финала остается ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '. Зарегистрируйся на сайте и покажи свой талант всем!';
$map = array();
if (isset($page->blocks['map']['meta']['content']) && !empty($page->blocks['map']['meta']['content'])) {
    $map = json_decode($page->blocks['map']['meta']['content'], TRUE);
}
$participants = Accounts::where('group_id', 4)->where('in_main_page', 1)->with('ulogin', 'likes')->take(15)->get();
foreach ($participants as $index => $participant) {
    $participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
    $users_ids = json_decode($_COOKIE['votes_list']);
    foreach ($participants as $index => $participant) {
        if (in_array($participant->id, $users_ids)) {
            $participants[$index]['like_disabled'] = TRUE;
        }
    }
}
?>
@extends(Helper::layout())
@section('style')
@stop
コード例 #3
0
 public function profileEdit()
 {
     $page_data = array('page_title' => 'Личный кабинет', 'page_description' => '', 'page_keywords' => '', 'profile' => Accounts::where('id', Auth::user()->id)->with('ulogin')->first());
     return View::make(Helper::acclayout('profile'), $page_data);
 }
コード例 #4
0
ファイル: profile.blade.php プロジェクト: Grapheme/lipton
<?
/**
 * TEMPLATE_IS_NOT_SETTABLE
 */
?>
<?php 
$profile = Accounts::where('id', Auth::user()->id)->with('ulogin')->first();
?>
@extends(Helper::layout())
@section('style')
@stop
@section('page_class')  @stop
@section('content')
    <div class="main-content sub-page">
        <div class="block">
            <div class="content">
                <div class="participate-block">
                    <h2>Редактирование профиля</h2>
                    <div class="forms-holder full-registration-holder">
                        @include(Helper::acclayout('forms.profile'))
                    </div>
                    @include(Helper::layout('forms.valid-phone'))
                </div>
            </div>
        </div>
    </div>
@stop
@section('scripts')

@stop
コード例 #5
0
 public function participantsListsImport($params)
 {
     $filter_status = Input::get('filter_status');
     $users_list = Accounts::where('group_id', 4);
     if (Input::has('without_video')) {
         $users_list = $users_list->where('video', '');
     }
     if ($filter_status >= 0) {
         $users_list = $users_list->where('status', $filter_status);
     }
     $users_list = $users_list->orderBy('created_at', 'DESC')->get();
     $users = $fields = array();
     $output = '';
     foreach ($users_list as $user) {
         $fio = explode(' ', $user->name);
         $name = iconv("UTF-8", Input::get('coding'), @$fio[0]);
         $surname = iconv("UTF-8", Input::get('coding'), @$fio[1]);
         $glue = Input::get('glue');
         $field = Input::get('field');
         if ($field == 'all') {
             $fields = array($user->email, $user->phone, $user->photo, $name, $surname);
         } elseif ($field == 'email') {
             $fields = array($user->email, $name, $surname);
         } elseif ($field == 'phone') {
             $fields = array($user->phone, $name, $surname);
         }
         if ($params == 'all') {
             if ($glue === 'tab') {
                 $output .= implode("\t", $fields) . "\n";
             } else {
                 $output .= implode("{$glue}", $fields) . "\n";
             }
         } else {
             if ($glue === 'tab') {
                 $output .= implode("\t", $fields) . "\n";
             } else {
                 $output .= implode("{$glue}", $fields) . "\n";
             }
         }
     }
     $headers = array('Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment; filename="ExportList.csv"');
     return Response::make(rtrim($output, "\n"), 200, $headers);
 }
コード例 #6
0
ファイル: dashboard.blade.php プロジェクト: Grapheme/lipton
<?
/**
 * TEMPLATE_IS_NOT_SETTABLE
 */
?>
<?php 
$profile = Accounts::where('id', Auth::user()->id)->with('ulogin', 'codes', 'prizes', 'writing')->first();
$bdate = new Carbon($profile->bdate);
$now = Carbon::now();
$post['customerId'] = Auth::user()->remote_id;
$post['sessionKey'] = Auth::user()->sessionKey;
$prizes = (new ApiController())->get_prizes($post);
if (count($prizes) > 1) {
    if (isset($prizes['LinguaLeo.LotteryTicket']) && empty($prizes['LinguaLeo.LotteryTicket']['certificateCode'])) {
        Config::set('api.wonLotteryTicketId', $prizes['LinguaLeo.LotteryTicket']['customerPrize_id']);
    }
    foreach ($prizes as $systemName => $prize) {
        if ($systemName !== 'LiptonLinguaLeoForTravellers') {
            $second_prize = $prize;
        }
    }
}
?>
@extends(Helper::layout())
@section('title')
    Личный кабинет
@stop
@section('style')
@stop
@section('page_class')  @stop
@section('content')
コード例 #7
0
 public function setLike($user_id)
 {
     $json_request = array('status' => FALSE, 'count' => 0);
     if (Request::ajax()) {
         if ($user = Accounts::where('group_id', 4)->where('id', $user_id)->first()) {
             self::incrementLikePost($user);
             $json_request['status'] = TRUE;
             $json_request['count'] = ParticipantLikes::where('participant_id', $user_id)->count() + Accounts::where('id', $user_id)->pluck('guest_likes');
         }
     } else {
         return Redirect::back();
     }
     return Response::json($json_request, 200);
 }
コード例 #8
0
 public function participantsLikes()
 {
     $validator = Validator::make(Input::all(), array('begin' => 'required', 'end' => 'required'));
     if ($validator->passes()) {
         $api = new ApiController();
         $begin = (new myDateTime())->setDateString(Input::get('begin'))->format('Y-m-d 00:00:00');
         $end = (new myDateTime())->setDateString(Input::get('end'))->format('Y-m-d 23:59:59');
         foreach (Accounts::where('group_id', 4)->where('created_at', '>=', $begin)->where('created_at', '<=', $end)->with('writing')->get() as $user) {
             if (!empty($user->writing) && !empty($user->writing->writing)) {
                 $post['url'] = URL::route('show.participant.writing', $user->writing->id . '-' . BaseController::stringTranslite($user->name . '-' . $user->surname));
                 $likes = $api->social_likes($post);
                 $user->total_extend = $likes['extend'];
                 $user->total_likes = $likes['total'];
                 $user->save();
             }
         }
     }
     return Redirect::back();
 }
コード例 #9
0
ファイル: participants.blade.php プロジェクト: Grapheme/amway
<?
/**
* TITLE: Участники
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php 
$participants = Accounts::where('group_id', 4)->orderBy('created_at', 'DESC')->with('ulogin', 'likes')->paginate(25);
foreach ($participants as $index => $participant) {
    $participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
    $users_ids = json_decode($_COOKIE['votes_list']);
    foreach ($participants as $index => $participant) {
        if (in_array($participant->id, $users_ids)) {
            $participants[$index]['like_disabled'] = TRUE;
        }
    }
}
?>
@extends(Helper::layout())
@section('style')
@stop
@section('page_class')sticky participants
@stop
@section('content')
<main>
    <section class="long color-blue video"
             style="background-image: url('{{ asset(Config::get('site.theme_path')) }}/img/tmp-visual-13.jpg')">
        <iframe data-src="https://player.vimeo.com/video/136314283?autoplay=1&loop=1&color=ffffff&title=0&byline=0&portrait=0"
                frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>