コード例 #1
0
ファイル: FrontController.php プロジェクト: spetross/ugvoice
 public function __construct()
 {
     if (\Auth::check()) {
         view()->share('auth', \Auth::user());
     }
     $this->theme = \Theme::uses('ace');
 }
コード例 #2
0
 public function getDisclaimer()
 {
     $theme = Theme::uses('notebook')->layout('blue');
     $theme->setMenu('home.disclaimer');
     $params = array();
     return $theme->scope('home.disclaimer', $params)->render();
 }
コード例 #3
0
 public function viewExam($tid)
 {
     $theme = Theme::uses('site')->layout('default');
     $theme->appendTitle('- Do Exam');
     $view = ['id' => $tid];
     return $theme->scope('exam.view', $view)->render();
 }
コード例 #4
0
 public function getIndex()
 {
     $theme = Theme::uses('notebook')->layout('blue');
     $theme->setMenu('reference.index');
     $params = array();
     return $theme->scope('reference.index', $params)->render();
 }
コード例 #5
0
ファイル: GlobalController.php プロジェクト: bokbok123/ORS
 public function setUserEntityTheme($file, $dataarr)
 {
     $getpersonalcount = DB::table('tbl_bankaccounts')->leftjoin('tbl_bankbranches', 'bankaccount_branch', '=', 'branch_id')->leftjoin('tbl_banks', 'branch_bankid', '=', 'bank_id')->where('bank_isproduct', '0')->where('bankaccount_userentity', 'Personal')->where('bankaccount_createdby', Auth::user()->id)->count();
     $getbusinesscount = DB::table('tbl_bankaccounts')->leftjoin('tbl_bankbranches', 'bankaccount_branch', '=', 'branch_id')->leftjoin('tbl_banks', 'branch_bankid', '=', 'bank_id')->where('bank_isproduct', '0')->where('bankaccount_userentity', 'Business')->where('bankaccount_createdby', Auth::user()->id)->count();
     $resultbViewAcctype = DB::table('tbl_bankaccounttypes')->get();
     $resultbViewAcctypearr = array();
     foreach ($resultbViewAcctype as $data) {
         $resultbViewAcctypearr[$data->accounttype_id] = $data->accounttype_name;
     }
     $resultbViewBanks = DB::table('tbl_banks')->where('bank_isproduct', 0)->where('bank_status', '1')->orderBy('bank_name', 'ASC')->get();
     $resultbViewBanksarr = array();
     foreach ($resultbViewBanks as $data) {
         $resultbViewBanksarr[$data->bank_id] = $data->bank_name;
     }
     $resultbViewBankbranchs = DB::table('tbl_bankbranches')->where("branch_bankid", key($resultbViewBanksarr))->where("branch_status", "1")->get();
     $resultbViewBankBrancharr = array();
     foreach ($resultbViewBankbranchs as $data) {
         $resultbViewBankBrancharr[$data->branch_id] = $data->branch_name;
     }
     if ($getpersonalcount <= 0 and $getbusinesscount <= 0) {
         $data = array('bankaccttype' => $resultbViewAcctypearr, 'bankname' => $resultbViewBanksarr, 'bankbranch' => $resultbViewBankBrancharr);
         $MyTheme = Theme::uses('fonebayad')->layout('ezibills_9_0');
         return $MyTheme->of('registration.firstloginaddbankacct', $data)->render();
     } else {
         //            $MyTheme = Theme::uses('fonebayad')->layout('ezibills_9_0');
         $MyTheme = Theme::uses('fonebayad')->layout('newDefault_myBills');
         return $MyTheme->of($file, $dataarr)->render();
     }
 }
コード例 #6
0
 public function update()
 {
     $validator = Validator::make(Input::all(), array('schoolname' => 'required|min:3|max:256', 'schoolnameabbr' => 'required|alpha|min:2|max:10', 'schooladdress' => 'required|min:4|max:512', 'logo' => 'required', 'adminsitename' => 'required|min:2|max:256', 'systemurl' => 'required|url', 'url' => 'url|required', 'cache' => "required|integer"));
     if ($validator->fails()) {
         Input::flash();
         return Redirect::to('/settings')->withErrors($validator);
     }
     $schoolname = Input::get('schoolname');
     Setting::set('system.schoolname', $schoolname);
     Setting::set('system.schoolnameabbr', Input::get('schoolnameabbr'));
     Setting::set('system.schooladdress', Input::get('schooladdress'));
     Setting::set('system.logo_src', Input::get('logo'));
     Setting::set('system.adminsitename', Input::get('adminsitename'));
     Setting::set('app.url', Input::get('url'));
     Setting::set('app.captcha', Input::get('captcha'));
     Setting::set('system.dashurl', Input::get('systemurl'));
     Setting::set('system.dashurlshort', Input::get('systemurlshort'));
     Setting::set('system.siteurlshort', Input::get('siteurlshort'));
     Setting::set('system.cache', Input::get('cache'));
     $theme = Theme::uses('dashboard')->layout('default');
     $view = array('name' => 'Dashboard Settings');
     $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Dashboard', 'url' => Setting::get('system.dashurl') . '/settings']]);
     $theme->appendTitle(' - Settings');
     return $theme->scope('settings', $view)->render();
 }
コード例 #7
0
 public function modder($dash, $id, $mode)
 {
     if (Request::getMethod() == 'GET') {
         switch ($mode) {
             case 'delete':
                 $validator = Validator::make(['id' => $id], ['id' => 'required|exists:subjects,id']);
                 if ($validator->fails()) {
                     return Redirect::to(URL::previous());
                 }
                 self::delete($id);
                 return Redirect::to(URL::previous());
             case 'update':
                 $validator = Validator::make(['id' => $id], ['id' => 'required|exists:subjects,id']);
                 if ($validator->fails()) {
                     return Redirect::to(URL::previous());
                 }
                 $theme = Theme::uses('dashboard')->layout('default');
                 $view = ['id' => $id];
                 $theme->setTitle(Setting::get('system.adminsitename') . ' Subjects');
                 $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Subjects', 'url' => Setting::get('system.dashurl') . '/subjects'], ['label' => $id, 'url' => Setting::get('system.dashurl') . '/subject/edit/' . $id . '/update']]);
                 return $theme->scope('subject.update', $view)->render();
             case 'view':
                 $validator = Validator::make(['id' => $id], ['id' => 'required|exists:subjects,id']);
                 if ($validator->fails()) {
                     return Redirect::to(URL::previous());
                 }
                 $theme = Theme::uses('dashboard')->layout('default');
                 $view = ['id' => $id];
                 $theme->setTitle(Setting::get('system.adminsitename') . ' Subjects');
                 $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Subjects', 'url' => Setting::get('system.dashurl') . '/subjects'], ['label' => $id, 'url' => Setting::get('system.dashurl') . '/subject/edit/' . $id . '/update']]);
                 return $theme->scope('subject.view', $view)->render();
             case 'create':
                 $theme = Theme::uses('dashboard')->layout('default');
                 $view = ['id' => 0];
                 $theme->setTitle(Setting::get('system.adminsitename') . ' Subjects');
                 $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Subjects', 'url' => Setting::get('system.dashurl') . '/subjects'], ['label' => $id, 'url' => Setting::get('system.dashurl') . '/subject/edit/0/update']]);
                 return $theme->scope('subject.create', $view)->render();
             default:
                 return "UNAUTHORISED METHOD";
                 break;
         }
     }
     if (Request::getMethod() == 'POST') {
         switch ($mode) {
             case 'update':
                 self::update($id);
                 return Redirect::to('/subjects');
             case 'create':
                 if ($id == 0) {
                     self::create();
                     return Redirect::to('/subjects');
                 }
                 return Redirect::to(URL::previous());
             default:
                 Log::error('UnAuthorised Access at Subjects Page.');
                 return Redirect::to('dash');
         }
     }
 }
コード例 #8
0
 public function GET_createGroupForm()
 {
     $theme = Theme::uses('notebook')->layout('main');
     $theme->setMenu('user.group');
     $routeCollection = Route::getRoutes();
     $params = array('routes' => $routeCollection);
     return $theme->scope('user.group-create', $params)->render();
 }
コード例 #9
0
ファイル: PublicController.php プロジェクト: bokbok123/ORS
 public function __construct()
 {
     //change theme if user is logged
     if (Auth::check()) {
         $this->theme = Theme::uses('dashboard')->layout('default');
     } else {
         $this->theme = Theme::uses('default')->layout('default');
     }
 }
コード例 #10
0
 public function view($dash, $tid)
 {
     $theme = Theme::uses('dashboard')->layout('default');
     $view = array('name' => 'Dashboard Home', 'tutorialid' => $tid);
     $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')]]);
     $theme->appendTitle(' - Dashboard');
     $theme->asset()->add('jquery', '/js/jquery-2.0.2.min.js');
     $theme->asset()->add('ckeditor', '/js/ckeditor/ckeditor.js');
     $theme->asset()->add('ckeditor-jquery', '/js/ckeditor/adapters/jquery.js');
     return $theme->scope('tutorial.presentation', $view)->render();
 }
コード例 #11
0
 public function GET_index()
 {
     $theme = Theme::uses('notebook')->layout('landing');
     $theme->setMenu('home.index');
     $theme->asset()->usePath()->add('landing', 'css/landing.css');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel1', 'js/app.plugin.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel2', 'js/scroll/smoothscroll.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel3', 'js/landing.js');
     $params = array();
     return $theme->scope('home.index', $params)->render();
 }
コード例 #12
0
ファイル: BaseController.php プロジェクト: alaluces/dncms
 /**
  * Setup the layout used by the controller.
  *
  * @return void
 
 protected function setupLayout()
 {
         if ( ! is_null($this->layout))
         {
                 $this->layout = View::make($this->layout);
         }
 }
 */
 public function initTheme()
 {
     $this->theme = Theme::uses('default')->layout('default');
     // NOTE: jquery should be loaded first
     $this->theme->asset()->add('jquery', 'js/jquery.min.js');
     $this->theme->asset()->add('bootstrap-js', 'js/bootstrap.min.js');
     $this->theme->asset()->add('core-script', 'js/scripts.js');
     $this->theme->asset()->add('bootstrap-css', 'css/bootstrap.min.css');
     $this->theme->asset()->add('bootstrap-theme', 'css/bootstrap-theme.min.css');
     $this->theme->asset()->add('core-style', 'css/style.css');
 }
コード例 #13
0
ファイル: AmenitiesController.php プロジェクト: axisssss/ORS
 public function Rooms()
 {
     $Amenities = new Amenities();
     $rooms = $Amenities->getAmenitiesGroupByName('Room');
     $am_room = array();
     foreach ($rooms as $room) {
         $data = array('am_id' => $room->am_id, 'am_name' => $room->am_name, 'am_description' => $room->am_description, 'am_quantity' => $room->am_quantity, 'am_price' => number_format($room->am_price, 2), 'am_capacity' => $room->am_capacity);
         array_push($am_room, $data);
     }
     $MyTheme = Theme::uses('dashboard')->layout('default');
     return $MyTheme->of('dashboard.amenities.rooms', array('rooms' => $am_room))->render();
 }
コード例 #14
0
 public function index()
 {
     $MyTheme = Theme::uses('admin')->layout('adminLayout');
     $Amenities = new Amenities();
     $aMe = $Amenities->getAllAmenitiesGroup();
     $allAm = array();
     $allAm[0] = 'Item Type';
     foreach ($aMe as $aM) {
         $allAm[$aM->ag_id] = $aM->ag_groupname;
     }
     $data = array('item_type' => $allAm);
     return $MyTheme->of('admin.Amenities', $data)->render();
 }
コード例 #15
0
 public function examupdateget($dash, $id)
 {
     if (Exams::find($id)) {
         $theme = Theme::uses('dashboard')->layout('default');
         $view = array('name' => 'Dashboard Assessment Update', 'id' => $id);
         $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Exams', 'url' => Setting::get('system.dashurl') . '/exams'], ['label' => $id, 'url' => Setting::get('system.dashurl') . '/exam/' . $id]]);
         return $theme->scope('exam.update', $view)->render();
     }
     $theme = Theme::uses('dashboard')->layout('default');
     $view = array('name' => 'Dashboard Assessment Update', 'id' => $id);
     $theme->breadcrumb()->add([['label' => 'Dashboard', 'url' => Setting::get('system.dashurl')], ['label' => 'Exams', 'url' => Setting::get('system.dashurl') . '/exams'], ['label' => $id, 'url' => Setting::get('system.dashurl') . '/exam/' . $id]]);
     return $theme->scope('exam.create', $view)->render();
 }
コード例 #16
0
ファイル: LoginController.php プロジェクト: bokbok123/ORS
 public function adminLogin()
 {
     if (isset(Auth::user()->id) != NULL) {
         if (Auth::user()->id == 1) {
             return Redirect::to('admin/dashboard');
         }
     }
     if (Request::isMethod('post')) {
         $user = $this->User->getUserDetailByPassword(Input::get('user_name'), Input::get('password'));
         if ($user) {
             if ($user->user_date_banned == null) {
                 if ($user->user_type == 1) {
                     /** check whether user's account is active*/
                     if ($user->user_status == 1) {
                         Auth::login($user);
                         $this->TransLog->transLogger('Login Module', 'Logged In');
                         return Redirect::to('admin/users');
                     } else {
                         return 'User is deactivated.';
                     }
                 }
             } else {
                 $startDate = date("Y-m-d h:i:s");
                 $endDate = date("Y-m-d h:i:s", strtotime($user->user_date_banned));
                 if ($startDate > $endDate) {
                     /** check user type*/
                     if ($user->user_type == 1) {
                         /** check whether user's account is active*/
                         if ($user->user_status == 1) {
                             Auth::login($user);
                             $this->TransLog->transLogger('Login Module', 'Logged In');
                             //                            return Redirect::to('/admin/dashboard');
                             return "admin";
                         } else {
                             return 'User is deactivated.';
                         }
                     }
                 } else {
                     return 3;
                 }
             }
         } else {
             return 'Incorrect username or password';
         }
     } else {
         $MyTheme = Theme::uses('admin')->layout('default');
         return $MyTheme->of('admin.adminLogin')->render();
     }
 }
コード例 #17
0
 public function index()
 {
     $MyTheme = Theme::uses('admin')->layout('adminLayout');
     $packages = new Packages();
     $aMe = $packages->getAllPackageGroup();
     $allAm = array();
     $allAm[0] = 'Package Type';
     foreach ($aMe as $aM) {
         $allAm[$aM->package_id] = $aM->package_name;
     }
     $Amenities = new Amenities();
     $allAmenities = $Amenities->getAllAmenities();
     $data = array('packages' => $allAm, 'allAmen' => $allAmenities);
     return $MyTheme->of('admin.Packages', $data)->render();
 }
コード例 #18
0
 public function PUT_updateUser($id)
 {
     $theme = Theme::uses('notebook')->layout('main');
     $theme->setMenu('user.user');
     try {
         $user = Sentry::findUserById($id);
         $user->email = Input::get('email');
         $user->first_name = Input::get('full_name');
         if (Input::has('password')) {
             $user->password = Input::get('password');
         }
         $all_groups = Sentry::findAllGroups();
         if (is_array($all_groups)) {
             foreach ($all_groups as $key => $all_group) {
                 $findGroup = Sentry::findGroupById($all_group->id);
                 $user->removeGroup($findGroup);
             }
         }
         $groups = Input::get('groups');
         if (is_array($groups)) {
             foreach ($groups as $key => $group) {
                 $adminGroup = Sentry::findGroupById($group);
                 $user->addGroup($adminGroup);
             }
         }
         if ($user->save()) {
             $success = 'User information was updated';
         } else {
             $failed = 'User information was not updated';
         }
     } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
         $failed = 'Login field is required.';
     } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
         $failed = 'Password field is required.';
     } catch (Cartalyst\Sentry\Users\UserExistsException $e) {
         $failed = 'User with this login already exists.';
     } catch (Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
         $failed = 'Group was not found.';
     }
     if (!empty($failed)) {
         return Redirect::to(route('user.list'))->with('STATUS_FAIL', $failed);
     } else {
         if (!empty($success)) {
             return Redirect::to(route('user.list'))->with('STATUS_OK', $success);
         }
     }
 }
コード例 #19
0
 public function GET_index()
 {
     $theme = Theme::uses('notebook')->layout('main');
     $theme->setMenu('admin.index');
     $theme->asset()->usePath()->add('bootstrap-calendar', 'js/calendar/bootstrap_calendar.css');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel1', 'js/app.plugin.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel2', 'js/charts/easypiechart/jquery.easy-pie-chart.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel3', 'js/charts/sparkline/jquery.sparkline.min.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel4', 'js/charts/flot/jquery.flot.min.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel5', 'js/charts/flot/jquery.flot.tooltip.min.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel6', 'js/charts/flot/jquery.flot.resize.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel7', 'js/charts/flot/jquery.flot.grow.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel8', 'js/charts/flot/demo.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel9', 'js/calendar/bootstrap_calendar.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel10', 'js/calendar/demo.js');
     $theme->asset()->container('post-scripts')->usePath()->add('laravel11', 'js/sortable/jquery.sortable.js');
     $params = array();
     return $theme->scope('admin.index', $params)->render();
 }
コード例 #20
0
ファイル: PackagesController.php プロジェクト: axisssss/ORS
 public function Accommodation()
 {
     $Amenities = new Amenities();
     $rooms = $Amenities->getAmenitiesGroupByName('Room');
     $am_room = array();
     foreach ($rooms as $room) {
         $data = array('am_id' => $room->am_id, 'am_name' => $room->am_name, 'am_description' => $room->am_description, 'am_quantity' => $room->am_quantity, 'am_price' => number_format($room->am_price, 2), 'am_capacity' => $room->am_capacity);
         array_push($am_room, $data);
     }
     $AmenityGroup = $Amenities->getAllAmenitiesGroup();
     $ameniti = array();
     foreach ($AmenityGroup as $aMgroup) {
         $Amenity = $Amenities->getAmenitiesGroupByID($aMgroup->ag_id);
         foreach ($Amenity as $aM) {
             $data = array('am_id' => $aM->am_id, 'am_name' => $aM->am_name, 'am_description' => $aM->am_description, 'am_quantity' => $aM->am_quantity, 'am_price' => number_format($aM->am_price, 2), 'am_price2' => $aM->am_price, 'am_capacity' => $aM->am_capacity, 'am_group' => $aMgroup->ag_groupname);
             array_push($ameniti, $data);
         }
     }
     $MyTheme = Theme::uses('dashboard')->layout('default');
     return $MyTheme->of('dashboard.packages.accommodation', array('rooms' => $am_room, 'amen' => $ameniti))->render();
 }
コード例 #21
0
 public function changePasswordComplete($url_hash_email, $email)
 {
     $newPassword = Input::get('newInput');
     $encrypt_id = RegistrationController::encryptPassword($email);
     $encrypt_id = str_replace('/', '', $encrypt_id);
     if ($encrypt_id == $url_hash_email) {
         $resultSet = $this->GlobalModel->getModelRowListByColumnName('tbl_users', 'id', $email, null);
         $_userEmail = null;
         $input_fname = null;
         $input_lname = null;
         foreach ($resultSet as $var) {
             $_userEmail = $var->user_email;
             $input_fname = $var->user_fname;
             $input_lname = $var->user_lname;
         }
         /** peform password encryption*/
         $hash_password = RegistrationController::encryptPassword($newPassword);
         $updateArr = array('user_password' => $hash_password, 'user_changepass' => 'changed');
         $whereArr = array('id' => $email);
         $data = $this->GlobalModel->updateModel('tbl_users', $whereArr, $updateArr);
         //bokbok
         $theme = Theme::uses('homepage')->layout('default');
         return $theme->of('home.PasswordChangeSuccess')->render();
     }
 }
コード例 #22
0
<?php

$theme = Theme::uses(Session::get("theme"));
$title = Session::get("portal-title");
?>

@section ('page-header')
@include("layout/fixed-header", array(
                            "title" => $title
                        ))
@show
<style>
/*z index of sidebar is 100.*/
.theme-header{
    position: relative;
    z-index:101;
}
</style>
<div class="theme-header">
<!-- Header from theme -->
@if( isset($theme) )
{{ $theme->partial("header") }}
@endif
</div>

<body>

<!-- Getting user info -->
@if(Session::has("user-profile"))
<script>
var email =  "{{ Session::get("user-profile")["email"] }}";
コード例 #23
0
ファイル: LoginController.php プロジェクト: axisssss/ORS
 /**
  * Performs a Login event
  *
  *
  */
 public function loginHome()
 {
     $MyTheme = Theme::uses('homepage')->layout('default');
     return $MyTheme->of('home.login')->render();
 }
コード例 #24
0
ファイル: HomePageController.php プロジェクト: axisssss/ORS
 public function homeUser()
 {
     $MyTheme = Theme::uses('users')->layout('default');
     return $MyTheme->of('users.home')->render();
 }
コード例 #25
0
ファイル: AdminController.php プロジェクト: bokbok123/ORS
 public function __construct()
 {
     $this->theme = Theme::uses('admin')->layout('default');
 }
コード例 #26
0
 public function GET_loginForm()
 {
     $theme = Theme::uses('notebook')->layout('auth');
     $params = array();
     return $theme->scope('auth.login', $params)->render();
 }
コード例 #27
0
ファイル: DashboardController.php プロジェクト: axisssss/ORS
 public function dashboard()
 {
     $MyTheme = Theme::uses('dashboard')->layout('default');
     return $MyTheme->of('dashboard.dashboard')->render();
 }
コード例 #28
0
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/
App::before(function ($request) {
    //
});
App::after(function ($request, $response) {
    //
});
App::missing(function ($exception) {
    $theme = Theme::uses('notebook')->layout('error');
    return $theme->scope('error.404')->render();
});
/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify that the user of the current
| session is logged into this application. The "basic" filter easily
| integrates HTTP Basic authentication for quick, simple checking.
|
*/
Route::filter('auth', function () {
    if (Auth::guest()) {
        if (Request::ajax()) {
コード例 #29
0
    public function index()
    {
        $theme = Theme::uses('site')->layout('default');
        $theme->setTitle('Home');
        Cache::forget('latest_tr_slides');
        Cache::forget('tutorials');
        Cache::forget('latest_tutorials');
        Cache::forget('latest_tutes');
        Cache::forget('topstudents');
        Cache::forget('topstudentlist');
        $tutorialslides = Cache::remember('latest_tr_slides', 1, function () {
            $tutorials = Cache::remember('tutorials', 1, function () {
                return DB::select(DB::raw('SELECT tutorialid FROM assessments GROUP BY tutorialid HAVING(COUNT(*)) ORDER BY COUNT(*) DESC LIMIT 5 ;'));
            });
            $out = '';
            if ($tutorials == null) {
                return $out;
            }
            foreach ($tutorials as $tutorial_t) {
                $out .= "<div>";
                $tutorial = Tutorials::find($tutorial_t->tutorialid);
                $string = $tutorial->content;
                $string = strlen($string) > 753 ? substr($string, 0, 750) . '...' : $string;
                $string = wordwrap($string, 200, "<br>\n");
                $out .= '<h2 class="title">' . $tutorial->name . '</h2>';
                $out .= '<label class="label label-success">Subject
				</label>' . Subject::find($tutorial->subjectid)->subjectname . '&nbsp;&nbsp;&nbsp;&nbsp;
				<label class="label label-success">Grade</label> :- ' . Subject::find($tutorial->subjectid)->grade;
                $out .= "&nbsp;<br>&nbsp;<br>" . $string;
                $out .= "&nbsp;<br><a class='btn btn-large' href='/tutorial/" . $tutorial->id . "/'>Read More ...</a>&nbsp;<br>&nbsp;<br>&nbsp;<br>";
                $out .= '</div>';
            }
            return $out;
        });
        $latest_tutorials = Cache::remember('latest_tutorials', 20, function () {
            $tutorials = Cache::remember('latest_tutes', 20, function () {
                return DB::select(DB::raw('SELECT id from tutorials WHERE published= 1 ORDER BY `created_at` DESC LIMIT 5;'));
            });
            $out = '';
            if ($tutorials == null) {
                return $out;
            }
            foreach ($tutorials as $tutorial_t) {
                $tutorial = Tutorials::find($tutorial_t->id);
                $string = $tutorial->content;
                $string = preg_replace("/<img[^>]+\\>/i", "", $string);
                $images = self::getTutorialImages($tutorial->content);
                if ($images == null) {
                    // continue;
                }
                $string = strlen($string) > 753 ? substr($string, 0, 750) . '...' : $string;
                $string = wordwrap($string, 200, "<br>\n");
                $out .= "<div>";
                $out .= '<h2 class="title">' . $tutorial->name . '</h2>';
                $out .= '<p style="display:inline-block;">
		<label class="label label-success">Subject
		</label>' . Subject::find($tutorial->subjectid)->subjectname . '&nbsp;&nbsp;&nbsp;&nbsp;<label class="label label-success">Grade</label> :- ' . Subject::find($tutorial->subjectid)->grade . '</p>';
                $out .= "&nbsp;<br>&nbsp;<br>" . $string;
                $out .= "<img src='" . $images[rand(0, count($images) - 1)] . "' class='' style='height:100%;'/>";
                $out .= "&nbsp;<br><a class='btn btn-large' href='/tutorial/" . $tutorial->id . "/'>Read More ...</a>&nbsp;<br>&nbsp;<br>&nbsp;<br>";
                $out .= '</div>';
            }
            return $out;
        });
        $topstudents = Cache::remember('topstudents', 20, function () {
            $out = '';
            $topstudentlist = Cache::remember('topstudentlist', 20, function () {
                return DB::select(DB::raw('SELECT studentid as sid,AVG(marks) as average
			FROM assessments WHERE `created_at` >= CURDATE() - INTERVAL 7 DAY  GROUP BY studentid ORDER BY average DESC LIMIT 0,5;'));
            });
            if ($topstudentlist == null) {
                return $out;
            }
            foreach ($topstudentlist as $student) {
                $user = User::find($student->sid);
                $url = Gravatarer::make(['email' => $user->email, 'size' => 200, 'defaultImage' => 'mm', 'rating' => 'g'])->url();
                $out .= "<div>";
                $out .= "<img style='clear:left;' class='avatar' alt='" . $user->email . "' src='" . $url . "'/>\n\t\t<br><strong>Name:</strong>" . $user->first_name . ' ' . $user->last_name . '';
                $out .= "<br><label class='label label-success'>Average Score</label> is " . (int) $student->average . "";
                $out .= "</div>";
            }
            return $out;
        });
        $add = ['tutorialslides' => $tutorialslides, 'latesttutorialslides' => $latest_tutorials, 'topstudents' => $topstudents];
        return $theme->scope('index', $add)->content();
    }
コード例 #30
0
ファイル: AdminMainController.php プロジェクト: axisssss/ORS
 public function users()
 {
     $MyTheme = Theme::uses('admin')->layout('adminLayout');
     return $MyTheme->of('admin.index')->render();
 }