Example #1
0
 public function index($id = null)
 {
     if (!$id) {
         \Core\Route::redirectTo('/absent');
     } else {
         $id = str_replace("id", "", $id);
         $user = \Models\User::findUserById($id);
         if (isset($user['id'])) {
             $user = \Models\User::getUserPersonalById($user['id']);
             $task = \Models\Load::issetUploadFile('task');
             if ($task != false) {
                 \Models\Load::uploadTask($_FILES[$task]);
             }
             $data = \Models\User::findUserById($id);
             $tasks = \Models\Task::showTask();
             echo View::make('header', ['title' => $user['l_name'] . " " . $user['f_name']]);
             if ($user['member'] == 'Mather') {
                 echo View::make('user.leftside', ['id' => $id, 'user' => $user]);
             }
             if ($user['member'] == 'Father') {
                 echo View::make('user.profileF', ['data' => $data, 'tasks' => $tasks]);
             } else {
                 echo View::make('user.profile', ['data' => $data, 'tasks' => $tasks]);
             }
             echo View::make('footer');
         } else {
             \Core\Route::redirectTo('/absent');
         }
     }
 }
Example #2
0
 public function index()
 {
     if (!isset($_GET['code'])) {
         header("Location: ../sign-in/index");
         exit;
     }
     $testActivation = \Models\User::getUsernameByActivationCode($_GET['code']);
     if (!isset($testActivation['username'])) {
         echo \Core\View::make('header', ['title' => 'Activation unsuccessful']);
         echo \Core\View::make('activation.bad');
         echo \Core\View::make('footer');
     } else {
         $date = date('Y-m-d H:i:s');
         $user = \Models\User::setUserActivatedAt($date, $_GET['code']);
         if (isset($user['id'])) {
             $subject = 'Welcome';
             $body = "Congratulations. Your account is activated.";
             $result = Mailer::send($user['email'], $subject, $body);
             if ($result == 'Message has been sent') {
                 echo \Core\View::make('header');
                 echo \Core\View::make('activation.good', ['title' => 'Activation successful']);
                 echo \Core\View::make('footer');
             }
         }
     }
 }
Example #3
0
 /**
  * Render the subpage page.
  *
  * @param  \Psr\Http\Message\ServerRequestInterface $request
  * @param  \Psr\Http\Message\ResponseInterface $response
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function subpage(Request $request, Response $response)
 {
     $translator = $this->get('translator');
     $data = ['title' => $translator->get('welcome.subpage_text'), 'welcomeMessage' => $translator->get('welcome.subpage_message')];
     $view = View::make('layouts::default', $data);
     $view->nest('body', 'welcome.subpage', $data);
     return $response->write($view);
 }
Example #4
0
 public function personal()
 {
     if (\Models\Auth::isAuth()) {
         $avatar = \Models\Images::issetUploadImages('avatar');
         if ($avatar != false) {
             \Models\Images::uploadAvatar($_FILES[$avatar]);
         }
         $personal = [];
         $personal = \Models\User::getUserPersonalById($_SESSION['auth']['id']);
         $plug = \Models\Images::isPlug($_SESSION['auth']['id'] . '.jpg');
         echo View::make('header', ['title' => 'Personal']);
         echo View::make('user.leftside', ['id' => $_SESSION['auth']['id'], 'plug' => $plug]);
         echo View::make('user.personal', ['personal' => $personal]);
         echo View::make('footer');
     } else {
         \Core\Route::redirectTo('/absent');
     }
 }
Example #5
0
 public function index()
 {
     echo View::make('header', ['title' => 'Authentication']);
     echo View::make('sign_in.sign-in', ['title' => 'Sign in']);
     echo View::make('footer');
 }
Example #6
0
 public function index()
 {
     echo View::make('header', ['title' => 'Add task']);
     echo View::make('task.add-task');
     echo View::make('footer');
 }
Example #7
0
 public function index()
 {
     echo \Core\View::make('header', ['title' => 'Registration']);
     echo \Core\View::make('sign_up.sign-up', ['title' => 'Registration']);
     echo \Core\View::make('footer');
 }
Example #8
0
 public function index()
 {
     echo View::make('header', ['title' => 'Test page']);
     echo View::make('welcome');
     echo View::make('footer');
 }
Example #9
0
 public function index()
 {
     echo View::make('header', ['title' => 'Page is not found']);
     echo View::make('404');
     echo View::make('footer');
 }
Example #10
0
 /**
  * Add a view instance to the view data.
  *
  * <code>
  *     // Add a View instance to a View's data
  *     $view = View::make('foo')->nest('footer', 'Partials/Footer');
  *
  *     // Equivalent functionality using the "with" method
  *     $view = View::make('foo')->with('footer', View::make('Partials/Footer'));
  * </code>
  *
  * @param  string  $key
  * @param  string  $view
  * @param  array   $data
  * @param  string|null  $module
  * @return View
  */
 public function nest($key, $view, array $data = array(), $module = null)
 {
     return $this->with($key, View::make($view, $data, $module));
 }
Example #11
0
 public function password()
 {
     echo \Core\View::make('header', ['title' => 'Recovery password']);
     echo \Core\View::make('forgot.email', ['title' => 'Recovery password']);
     echo \Core\View::make('footer');
 }