<?php
    /**
    *
    * copyright (c) 2013-2022 Heliac Technologies
    * license http://opensource.org/licenses/gpl-license.php GNU GPL v3 
    *
    * linee guida per l'utilizzo del logo http://www.geecom.org/index.php?alias=linee-guida-per-luso-del-logo-geecom
    */

    Class GestoreAccessi {
	private $db;

        function __construct($db) {
	    $this->db = $db;
        }
        
        public function loginUtente($email, $password) {
            $query    = "SELECT * FROM geec_utenti WHERE email LIKE '$email' AND password LIKE '$password'";
            $risQuery = $this->db->eseguiQueryLettura($query);
            if($risQuery->num_rows>0) {
		$utente = $risQuery->fetch_assoc();
		return $utente["id"];
	    }
	    else {
		return 0;
	    }
        }
    }