Пример #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($society, $yr, $id)
 {
     if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) {
         $data['soc'] = $society;
         $data['society'] = Society::where('society', '=', $society)->first();
         $data['goal'] = Goal::with(array('individual' => function ($query) {
             $query->wherePivot('deleted_at', null)->orderBy('surname', 'asc');
         }))->where('slug', '=', $id)->where('society_id', '=', $data['society']->id)->first();
         $data['contact'] = Individual::find($data['goal']->contact);
         $data['pagetitle'] = $data['goal']->groupname;
         $daysofweek = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
         $data['meeting'] = $daysofweek[-1 + $data['goal']->meeting];
         return View::make('goals.show', $data);
     } else {
         return View::make("shared.unauthorised");
     }
 }
Пример #2
0
<?php

include_once 'includes/main.php';
include_once 'includes/Individual.php';
$post_data = isset($_REQUEST['post_data']) ? json_decode($_REQUEST['post_data'], true) : false;
if (isset($post_data)) {
    $individual_id = $post_data['individual_id'];
    $individual = new Individual($individual_id);
    $_SESSION['logged_in'] = true;
    $_SESSION['user'] = array('name_first' => $individual->find('name_first'), 'name_last' => $individual->find('name_last'), 'individual_id' => $individual_id, 'email' => $individual->find('email'));
}
echo_bootstrap(get_html(), array('css' => 'profile'));
function get_html()
{
    return <<<HTML
\t\t<main>
\t\t\t<h2>Welcome to your profile page</h2>
\t\t\t<p>Hello {$_SESSION['user']['name_first']}!</p>
\t\t\t<p>Welcome to your login page.</p>
\t\t</main>
HTML;
}