Example #1
0
 public function index()
 {
     $self = 'Location: ' . BASE_URL . '/' . str_replace('::', '/', strtolower(__METHOD__));
     /** Check login status **/
     (new SecureSite())->getLoginStatus(BASE_URL . "/login/index");
     /** Update a metric **/
     if (!empty($_POST['master_id'])) {
         (new UpdateMetrics())->insertNewDataRow($_POST);
         header($self);
         exit;
     }
     /** INSERT / UPDATE biometric **/
     if (!empty($_POST['metricID'])) {
         (new UpdateMetrics())->updateMetric($_POST);
         header($self);
         exit;
     }
     if (isset($_POST['addEditMetric'])) {
         (new UpdateMetrics())->insertMetric($_POST);
         header($self);
         exit;
     }
     /** Progress Bars **/
     $userID = $_SESSION['user_id'];
     $pb = new ProgressBar($userID);
     /** Call View and pass values **/
     $this->view('pages/performance', array('progressBars' => $pb->AllUncompletedProgressBars(true), 'combo' => $pb->getComboListBiometrics(array('selected' => null, 'id' => 'biometricType')), 'quicklinks' => (new QuickLinks())->quickLinkBlocks()));
 }
Example #2
0
 public function index()
 {
     /** Check login status **/
     (new SecureSite())->getLoginStatus(BASE_URL . "/login/index");
     /** Update a metric **/
     if (!empty($_POST['master_id'])) {
         (new UpdateMetrics())->insertNewDataRow($_POST);
         header('Location: ' . $_SERVER['PHP_SELF']);
         exit;
     }
     /** INSERT / UPDATE biometric **/
     if (!empty($_POST['metricID'])) {
         (new UpdateMetrics())->updateMetric($_POST);
         header('Location: ' . $_SERVER['PHP_SELF']);
         exit;
     }
     if (isset($_POST['addEditMetric'])) {
         (new UpdateMetrics())->insertMetric($_POST);
         header('Location: ' . $_SERVER['PHP_SELF']);
         exit;
     }
     /** Progress Bars **/
     $userID = $_SESSION['user_id'];
     $pb = new ProgressBar($userID);
     /** Call View and pass values **/
     $this->view('pages/home', array('progressBars' => $pb->AllUncompletedProgressBars(true), 'tiles' => (new SocialMediaBase())->getTiles(array()), 'quicklinks' => (new QuickLinks())->quickLinkBlocks()));
 }