static function handle()
 {
     $bd = new DB();
     $gestor = new ManagerArtista($bd);
     $sesion = new Session();
     $sesion->checkSession();
     if ($sesion->checkPermissions() < 1) {
         $sesion->destroy();
         $sesion->sendRedirect();
     }
     $action = Request::req("action");
     $do = Request::req("do");
     $metodo = $action . ucfirst($do);
     if (method_exists(get_class(), $metodo)) {
         self::$metodo($gestor, $sesion);
     } else {
         self::readView($gestor, $sesion);
     }
 }
Example #2
0
<?php

require_once '../util/header.php';
require_once 'includes.php';
$session = new Session();
$session->checkSession('user');
$user = $session->get('user');
$pdo = PDOConnection::getInstance();
$typing = isset($_POST['typing']) ? (int) $_POST['typing'] : 0;
/* Envia mensagens */
if (isset($_POST['client_id'])) {
    foreach ($_POST['client_id'] as $index => $client_id) {
        $message_insert = array('client_id' => $client_id, 'user_id' => $user['user_id'], 'type' => 0, 'status' => 1, 'message' => strip_tags($_POST['message'][$index]));
        $pdo->prepare('INSERT INTO message (
                client_id, user_id, type, status, message, post_date
        ) VALUES (
                :client_id, :user_id, :type, :status, :message, NOW()
        )')->execute($message_insert);
        /* Hist├│rico */
        $pdo->prepare('INSERT INTO message_history (
                client_id, user_id, type, status, message, post_date
        ) VALUES (
                :client_id, :user_id, :type, :status, :message, NOW()
        )')->execute($message_insert);
    }
}
/* Atualiza tempo do atendente */
$stmt = $pdo->prepare('UPDATE user SET time = :time, typing = :typing WHERE user_id = :user_id LIMIT 1');
$stmt->bindValue('user_id', $user['user_id']);
$stmt->bindValue('time', $lifeTimeUser);
$stmt->bindValue('typing', $typing);
<?php

require_once '../util/header.php';
require_once 'includes.php';
$session = new Session();
$session->checkSession('client');
$client = $session->get('client');
$pdo = PDOConnection::getInstance();
/* Atualiza tempo cliente */
$stmt = $pdo->prepare('UPDATE client SET time = :time WHERE client_id = :client_id LIMIT 1');
$stmt->bindValue('client_id', $client['client_id']);
$stmt->bindValue('time', $lifeTimeClient);
$stmt->execute();
/* Total da fila de espera */
$stmt = $pdo->prepare('SELECT COUNT(*) FROM client WHERE client_id < :client_id AND status = :status AND time > :time');
$stmt->bindValue('client_id', $client['client_id']);
$stmt->bindValue('time', $lifeTime);
$stmt->bindValue('status', 1);
$stmt->execute();
$total = $stmt->fetchColumn();
/* Busca status do cliente */
$stmt = $pdo->prepare('SELECT * FROM client WHERE client_id = :client_id');
$stmt->bindValue('client_id', $client['client_id']);
$stmt->execute();
$client_status = $stmt->fetch();
/* Inicia atendimento */
$user = NULL;
if ($client_status['status'] == 2) {
    $stmt = $pdo->prepare('SELECT * FROM user WHERE user_id = :user_id');
    $stmt->bindValue('user_id', $client_status['user_id']);
    $stmt->execute();
Example #4
0
            <meta charset="utf-8">
			<meta name="viewport" content="width=device-width, initial-scale=1"/>
            <link href="../../css-js/style.css" type="text/css" rel="stylesheet"/>
            <link rel="stylesheet" href="../../css-js/w3.css" type="text/css"/>
            <link rel="stylesheet" href="../../css-js/bootstrap.min.css" type="text/css"/>
			<script src="../../css-js/jquery.min.js" type="text/javascript"></script>
            <script src="../../css-js/bootstrap.min.js" type="text/javascript"></script>
		</head>
        
        
        <body ><br/><br/>
        
        
        
        <?php 
if ($session->checkSession("email") == true) {
    $admin = $session->getSessionInfo();
    $emailadmin = $session->getSession("email");
    ?>
        
        	<div id="jumbo2" >
        	<?php 
    echo "\n\t\t\t\t\t<div class='alert alert-success text-center'>\n\t\t\t            <h3>Bienvenue: " . $admin . "</h3>\n\t\t\t\t\t\t<strong>Vous etes connecter entant que:</strong>" . $emailadmin . ".\n\t\t\t\t\t</div>\n\t\t\t\t";
    ?>
            </div><br/>
            
            
            <div class="container-fluid " id="jumbo2" >
              <img id="logo"  class="img-responsive center-block" alt="LOGO LMPE.MA" src="../../img/logo.png" title="logo lmpe"/>
              <hr/>
              <?php 
<?php

session_start();
require_once "../../module/Connexion.php";
require_once "../../module/model/admin.php";
require_once "../../module/model/article.php";
require_once "../../module/model/commentaire.php";
require_once "../../module/model/user.php";
require_once "../../module/Session.php";
$session = new Session();
if ($session->checkSession("email") == true && isset($_GET['id'])) {
    $admin = $session->getSessionInfo();
    $emailadmin = $session->getSession("email");
    # preparation des donnees
    $article = new Article();
    $dataArticle = $article->GetAllArticle($_GET['id'])->fetch();
    $comment = new Commentaire();
    $dataComent = $comment->getAllCommentforArticle($_GET['id']);
    ?>
<!doctype html>

    <html>
    <!--Head********************************************************************************-->
         <head>
            <meta charset="utf-8">
			<meta name="viewport" content="width=device-width, initial-scale=1"/>
            <link href="../../css-js/style.css" type="text/css" rel="stylesheet"/>
            <link rel="stylesheet" href="../../css-js/w3.css" type="text/css"/>
            <link rel="stylesheet" href="../../css-js/bootstrap.min.css" type="text/css"/>
			<script src="../../css-js/jquery.min.js" type="text/javascript"></script>
            <script src="../../css-js/bootstrap.min.js" type="text/javascript"></script>
Example #6
0
<?php 
session_start();
require_once "../../module/Connexion.php";
require_once "../../module/model/user.php";
require_once "../../module/Session.php";
if (isset($_POST["email"])) {
    # preparation des donnees
    $email = isset($_POST["email"]) ? $_POST["email"] : "";
    $pwd = isset($_POST["password"]) ? $_POST["password"] : "";
    $data = array('email' => $email, 'password' => $pwd);
    # execution de l'operation
    $user = new User();
    $result = $user->checkLog($data);
    #tester le rendu
    if ($result) {
        $session = new Session();
        $dataSession = array('name' => 'email', 'value' => $email);
        $session->setSession($dataSession);
        if ($session->checkSession("email")) {
            #redirection vers l'admin
            header("location:../../../index");
        } else {
            echo "aucune session";
        }
    } else {
        header("location:../../../login?c=failed");
    }
} else {
    include_once "../../layout/Intrusion/url.inc";
}
Example #7
0
 public function __construct()
 {
     parent::__construct();
     //oturum kontrol├╝
     Session::checkSession();
 }
Example #8
0
<?php

require_once __DIR__ . '/../../includes/helpers.php';
require_once __DIR__ . '/../../loader.php';
Session::checkSession();
$a = new Auth();
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
$u = User::getUser();
?>
	<!DOCTYPE html>
	<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
		<!--<link rel="icon" href="../../favicon.ico"> -->
		<title>Photolia</title>

		<!-- Bootstrap core CSS -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
		<!-- Custom styles for this template -->
		<link href="../css/style.css" rel="stylesheet">
		<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
			<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
Example #9
0
<?php

include '../system/global.php';
include '../system/session.class.php';
include 'templates/frm_login.php';
include 'templates/frm_statistic.php';
include 'templates/frm_botlist.php';
include 'templates/frm_tasks.php';
include 'templates/frm_logout.php';
include 'templates/mod_commands.php';
$cPage = NULL;
$rPage = $_GET['q'];
$Session = new Session();
$rSession = $Session->checkSession();
if (!$rPage) {
    $cPage = new template_Statistic();
} elseif ($rPage == "statistic") {
    $cPage = new template_Statistic();
} elseif ($rPage == "bots") {
    $cPage = new template_Bots();
} elseif ($rPage == "tasks") {
    $cPage = new template_Tasks();
} elseif ($rPage == "logout") {
    $cPage = new template_Logout();
}
if ($rSession == false) {
    $cPage = new template_Login();
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">