<?php require_once "../closeup/lib/user.php"; require_once "../closeup/lib/cms.php"; $profile = new User(); $validuser = $profile->userprofile($_SESSION['userid']); if (empty($validuser->name)) { session_destroy(); header("Location: index.php"); } $userid = $_SESSION['userid']; // My Profile $myprofile = $profile->userprofile($userid); // My Score $myscore = $profile->myscore($userid); // Team Score $totalteamscore = $profile->teamscore($myprofile->team); $_SESSION['teamid'] = $myprofile->team; // Get Questions $q = new Cms(); $userquestions = $q->getweekquestion(); include_once 'header.php'; ?> <!-- <div class="breadcrumbs"> <section class="container"> <div class="row"> <div class="col-md-12"> <h1>User Profile : <?php //echo $myprofile->name; ?>
$validator = new validator(); // Define Parameters $name = $_POST['name']; $age = $_POST['age']; $sex = $validator->sexvalid($_POST['sex']); $phone = $validator->phonevalid($_POST['phone']); $email = $validator->emailvalid($_POST['email'], "Invalid Email"); $state = $_POST['state']; $team = trim($_POST['team']); $socid = $_POST['socid']; $params = array('socid' => $socid, 'name' => $name, 'age' => $age, 'sex' => $sex, 'email' => $email, 'phone' => $phone, 'state' => $state, 'team' => $team); // Create User Object and Register User $resp = $user->register($params); if (strstr($resp, "OK")) { $_SESSION['userid'] = $_POST['socid']; $_SESSION['teamid'] = $user->userprofile($_POST['socid']); header("Location: profile.php"); } } else { if ($fb_driver->in_session()) { // Get User $fb_profile = $fb_driver->get_profile(); $APP_PROFILE['id'] = $fb_profile->getId(); $APP_PROFILE['name'] = $fb_profile->getName(); $profile = $user->userprofile($APP_PROFILE['id']); // Check if User Exists if ($profile->socid == $APP_PROFILE['id']) { $_SESSION['userid'] = $APP_PROFILE['id']; header("Location: profile.php"); } } else {