<?php
$DB_DATABASE = "";
$prefix = "iitech_";
if(isset($_POST['database'])){
	$DB_DATABASE = $prefix.$_POST['database'];
}

// include db connect class
require_once __DIR__ . '/include/new_db_connect.php';

// connecting to db
$bdd = connect("iitech_universite");

require_once 'include/user.php';

$code = "";
$login = "";


if(isset($_POST['code_verify'])){
	$code = $_POST['code_verify'];
}

if(isset($_POST['login'])){
	$login = $_POST['login'];
}


// Instance of a User class
$userObject = new User();

// User Login
if(!empty($code) && !empty($login) ){
    $json_array = $userObject->codeUsers($code, $login, $bdd);
    echo json_encode($json_array);
}

?>