public function signup() { require 'models/Login_model.php'; $model = new Login_model(); $model->signup(); header('location:' . URL); }
public function loadProfileCode() { Session::init(); $employeeName = $_SESSION['loggedIn']; require 'models/Login_model.php'; $model = new Login_model(); $data = $model->getEmployeeCode($employeeName); //print_r($data); $empCode = $data[0][0]; $data = $model->loadProfileDetails($empCode); return $data; //echo json_encode($model->loadProfileDetails($employeeCode)); // echo json_encode($employeeCode); }
/** * Sauvegarde des modifications */ public function save() { // Mise a jour des donnees en base $model = new Login_model(); $model->lgnidlgn = $this->input->post('lgnidlgn'); $model->lgnidusr = $this->input->post('utilisateur'); $model->lgnlblgn = $this->input->post('login'); $model->lgnlbpwd = $this->input->post('password'); $model->lgncdprf = $this->input->post('profil'); $model->lgnfgarc = $this->input->post('flagArchive'); $model->update($this->db); $this->session->set_userdata('message', formatInfo('Login mis a jour')); redirect('listlogins/index'); }
<div id="profile-card-custom"> <div class="profile-card-wrap"> <input id="check" type="checkbox" class="check"><label for="check" class="toggle"> + </label> <div class="content" data-text=""> <p><?php Session::init(); //echo $_SESSION['loggedIn'] ?> </p> <?php //Session::init(); $employeeName = $_SESSION['loggedIn']; require 'models/Login_model.php'; $model = new Login_model(); $data = $model->getEmployeeCode($employeeName); //print_r($data); //echo $data[0][0]; $empCode = $data[0][0]; //echo $empCode; $data = $model->loadProfileDetails($empCode); echo "<h3>" . $data[0][1] . " " . $data[0][2] . "</h3>"; echo "<b> Type : " . $data[0][8] . "</b><br/>"; echo "<b> NIC : " . $data[0][4] . "</b><br/>"; echo "<b> Birthday : " . $data[0][6] . "</b><br/>"; //print_r($data); // echo $data[0][1]; ?> </div> <div class="link-info"> <div class="social">
} if (userEmail === null || userEmail === "") { alert("Email must be filled out."); return false; } } </script> </head> <body> <?php include 'header.php'; $user = __DIR__ . '/../../controllers/User_Controller.php'; require_once $user; require_once '../../models/Login_model.php'; $db = new Login_model(); // $flag = $_GET['checkUsername']; // if (isset($_GET['checkUsername']) && !empty($_GET['checkUsername'])) { if ($_POST) { $user_controller = new User_controller(); $user_controller->registerUser(); } $existingUsernames = $db->getAllUsernames(); ?> <div class="container"> <h1 class="well">User Registration Form</h1> <div class="col-lg-12 well"> <div class="row"> <form name="myForm" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);
public function login() { $data['message'] = ""; $this->form_validation->set_rules('username', 'Username', 'trim|required|valid_email|max_length[60]|xxs_clean'); $this->form_validation->set_rules('password', 'Password', 'trim|required|max_length[16]|min_length[8]|md5'); if ($this->form_validation->run() == TRUE) { $l = new Login_model(); $l->username = $this->input->post('username'); $l->password = $this->input->post('password'); if ($l->authenticate()) { $data['message'] = "Success"; redirect('user', 'Location'); } else { $data['message'] = 'Username password not matched.'; } } else { $data['some error occured'] = ""; } $this->load->view('header/header_without', $data); $this->load->view('login', $data); $this->load->view('sidebar/right_sidebar', $data); $this->load->view('footer/footer', $data); }
/** * Recupere l'enregistrement a partir de son id * @param $db database * @param $lgnidlgn identifiant de l'enregistrement a recuperer */ static function getLogin($db, $lgnidlgn) { $row = getLoginRow($db, $lgnidlgn); return Login_model::Login_modelFromRow($row); }
<title>Login</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> </head> <body> <?php include 'header.php'; require_once '../../models/Login_model.php'; $db = new Login_model(); $incorrectLogin = false; $loginRole; if (isset($_POST['username']) && isset($_POST['password'])) { $username = $_POST['username']; $password = $_POST['password']; $loginRole = $db->validateLogin($username, $password); if (!$loginRole) { $incorrectLogin = true; } else { if (!isset($_SESSION)) { session_start(); } $_SESSION['username'] = $username; switch ($loginRole['role']) { case "user":
$ownerInfo = $ownerDb->getOwnerInfo($username); $resId = intval($ownerInfo['restaurant_id']); $restaurantDb = new Restaurant_model(); $restaurantInfo = $restaurantDb->findRestaurantById($resId); $restaurantImages = $restaurantDb->getRestaurantImages($resId); $imageCount = count($restaurantImages) >= 4 ? 4 : count($restaurantImages); //total number of images for the restaurant in multimedia table $foodCategory = $restaurantDb->getFoodCategories(); $reviewArray = $restaurantDb->getRestaurantReviews($resId); $oprDb = new OperationHours_model(); $oprHours = $oprDb->getOperatingHoursByRestaurantId($resId); $eventDb = new Event_model(); $eventArray = $eventDb->getEventsByRestaurantId($resId); $hostessDb = new Hostess_model(); $hostessArray = $hostessDb->getHostessByRestaurantId($resId); $loginDb = new Login_model(); $existingUsernames = $loginDb->getAllUsernames(); if (!empty($oprHours)) { $oprHours = $oprHours[0]; } if ($_POST) { /* * For uploading images */ if (isset($_POST['image_type'])) { switch ($_POST['image_type']) { case 'profile': if (is_uploaded_file($_FILES['profile-image']['tmp_name'])) { $thumbnail = file_get_contents($_FILES["profile-image"]["tmp_name"]); } if ($restaurantDb->updateRestaurantThumbnail($resId, $thumbnail)) {
/** * Suppression d'un Login * @param $lgnidlgn identifiant a supprimer */ function delete($lgnidlgn) { Login_model::delete($this->db, $lgnidlgn); $this->session->set_userdata('message', formatInfo('Login supprime')); redirect('listlogins/index'); }