Initial commit for radiantprestation project

This commit is contained in:
2026-01-06 08:29:33 +00:00
commit 89481e47af
2578 changed files with 580558 additions and 0 deletions

220
flexcode/device.php Normal file
View File

@@ -0,0 +1,220 @@
<?php
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index') {
?>
<script type="text/javascript">
$('title').html('Device');
function device_delete(device_name, sn) {
var r = confirm("Supprimer le lecteur : "+device_name+" ( "+sn+" )?");
if (r == true) {
// push('device.php?action=delete&sn='+sn);
push('flexcode/device.php?action=delete&sn='+sn);
}
}
</script>
<div class="row">
<div class="col-md-12">
<button type="button" class="btn btn-success" onclick="load('flexcode/device.php?action=create')">Ajouter</button>
</div>
</div>
<br>
<?php
$device = getDevice();
if (count($device) > 0) {
echo "<div class='row'>"
."<div class='col-md-12'>"
."<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th class='col-md-3'>Nom </th>"
."<th class='col-md-2'>Série (SN)</th>"
."<th class='col-md-2'>Vérification (VC)</th>"
."<th class='col-md-2'>Activation (AC)</th>"
."<th class='col-md-2'>Clé (VKEY)</th>"
."<th class='col-md-1'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
foreach ($device as $row) {
echo "<tr>"
."<td>".$row['device_name']."</td>"
."<td><code>".$row['sn']."</code></td>"
."<td><code>".$row['vc']."</code></td>"
."<td><code>".$row['ac']."</code></td>"
."<td><code>".substr($row['vkey'], 0, 2)."...</code></td>"
."<td>"
."<button type='button' class='btn btn-xs btn-danger' onclick=\"device_delete('".$row['device_name']."','".$row['sn']."')\">Supprimer</button>"
."</td>"
."</tr>";
}
echo
"</tbody>"
."</table>"
."</div>"
."</div>";
} else {
echo 'Aucun lecteur!';
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'create') {
?>
<script type="text/javascript">
$('title').html('Ajouter lecteur');
function device_store() {
device_name = $('#device_name').val();
sn = $('#sn').val();
ac = $('#ac').val();
vc = $('#vc').val();
vkey = $('#vkey').val();
// push('device.php?action=store&device_name='+device_name+'&sn='+sn+'&ac='+ac+'&vc='+vc+'&vkey='+vkey);
push('flexcode/device.php?action=store&device_name='+device_name+'&sn='+sn+'&ac='+ac+'&vc='+vc+'&vkey='+vkey);
}
</script>
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="form-group">
<label for="device_name">Nom Lecteur</label>
<input type="text" id="device_name" class="form-control" placeholder="Entrer le nom">
</div>
<div class="form-group">
<label for="sn">N° Série</label>
<input type="text" id="sn" class="form-control" placeholder="Entrer SN">
</div>
<div class="form-group">
<label for="vc">Code Vérification (VC)</label>
<input type="text" id="vc" class="form-control" placeholder="Entrer VC">
</div>
<div class="form-group">
<label for="ac">Code Activation (AC)</label>
<input type="text" id="ac" class="form-control" placeholder="Entrer AC">
</div>
<div class="form-group">
<label for="vkey">Clé Vérification (VKEY)</label>
<input type="text" id="vkey" class="form-control" placeholder="Entrer VKEY">
</div>
<!-- <a class="btn btn-default" onclick="load('<?php echo $base_path?>device.php?action=index')">Retour</a> -->
<a class="btn btn-default" onclick="load('flexcode/device.php?action=index')">Retour</a>
<button type="submit" class="btn btn-success" onclick="device_store()">Enregistrer</button>
</div>
<div class="col-md-4">
</div>
</div>
<?php
} elseif (isset($_GET['action']) && $_GET['action'] == 'store') {
$res = array();
$res['result'] = false;
if ($_GET['device_name'] == '' || !isset($_GET['device_name']) || empty($_GET['device_name'])) {
$res['device_name'] = "Veuillez renseigner le nom du lecteur!";
}
if ($_GET['sn'] == '' || !isset($_GET['sn']) || empty($_GET['sn'])) {
$res['sn'] = "Veuillez renseigner le N° de série!";
} elseif (isset($_GET['sn']) && !empty($_GET['sn'])) {
$sn = deviceCheckSn($_GET['sn']);
if ($sn != 1) {
$res['sn'] = $sn;
}
}
if ($_GET['vc'] == '' || !isset($_GET['vc']) || empty($_GET['vc'])) {
$res['vc'] = "Veuillez renseigner le code de vérification!";
}
if ($_GET['ac'] == '' || !isset($_GET['ac']) || empty($_GET['ac'])) {
$res['ac'] = "Veuillez renseigner le code de d'activation!";
}
if ($_GET['vkey'] == '' || !isset($_GET['vkey']) || empty($_GET['vkey'])) {
$res['vkey'] = "Veuillez renseigner la clé de vérification!";
}
if (count($res) > 1) {
echo json_encode($res);
} else {
$result = addDevice($_GET['device_name'], $_GET['sn'], $_GET['vc'], $_GET['ac'], $_GET['vkey']);
if ($result) {
$res['result'] = true;
$res['reload'] = "flexcode/device.php?action=index";
} else {
$res['server'] = "Error insert data!";
}
echo json_encode($res);
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'delete') {
$result1 = deleteDevice($_GET['sn']);
if ($result1)
{
$res['result'] = true;
// $res['reload'] = "device.php?action=index";
$res['reload'] = "flexcode/device.php?action=index";
} else {
$res['server'] = "Error delete data!#";
}
echo json_encode($res);
} else {
echo "Parameter invalid..";
}
?>

13
flexcode/getac.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
if (isset($_GET['vc']) && !empty($_GET['vc'])) {
include 'include/global.php';
include 'include/function.php';
$data = getDeviceAcSn($_GET['vc']);
echo $data[0]['ac'].$data[0]['sn'];
}
?>

View File

@@ -0,0 +1,35 @@
<?php
abstract class Modele
{
private static $bdd;
protected function executerRequete($sql, $params = null)
{
if ($params == null) {
$resultat = self::getBdd()->query($sql); // exécution directe
}
else {
$resultat = self::getBdd()->prepare($sql); // requête préparée
$resultat->execute($params);
}
return $resultat;
}
private static function getBdd()
{
if (self::$bdd === null) {
$dsn = 'mysql:host=localhost;dbname=medicare;charset=utf8';
$login = 'medicare';
$mdp = '7198141973';
self::$bdd = new PDO($dsn, $login, $mdp,
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
}
return self::$bdd;
}
protected function dernierId()
{
return self::getBdd()->lastInsertId();
}
}

View File

@@ -0,0 +1,360 @@
<?php
require_once 'include/Modele.php';
// require_once 'include/Modele.php';
// require_once '../Framework/Modele.php';
class fingertable extends Modele
{
public function getPerifique()
{
$sql = "SELECT * FROM device ORDER BY device_name ASC";
$liste = $this->executerRequete($sql);
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getPerifiqueAcSn($vc)
{
$sql = "SELECT * FROM device WHERE (vc=?)";
$liste = $this->executerRequete($sql, array($vc));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getPerifiqueBySn($sn)
{
$sql = "SELECT * FROM device WHERE (sn=?)";
$liste = $this->executerRequete($sql, array($sn));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
public function ajouterPerifique($device_name, $sn, $vc, $ac, $vkey)
{
$sql = "insert into device (device_name, sn, vc, ac, vkey) values (?, ?, ?, ?, ?)";
$result = $this->executerRequete($sql, array($device_name, $sn, $vc, $ac, $vkey));
return $result;
}
public function supprimerPerifique($sn)
{
$sql = 'DELETE FROM device WHERE (sn=?)';
$result = $this->executerRequete($sql, array($sn));
return $result;
}
public function ajouterUtilisateur($user_name)
{
$sql = "insert into user (user_name) values (?)";
$result = $this->executerRequete($sql, array($user_name));
return $result;
}
public function supprimerUtilisateur($user_id)
{
$sql = 'DELETE FROM user WHERE (user_id=?)';
$result = $this->executerRequete($sql, array($user_id));
return $result;
}
public function supprimerEmpreinte($user_id)
{
$sql = 'DELETE FROM finger WHERE (user_id=?)';
$result = $this->executerRequete($sql, array($user_id));
return $result;
}
function getUtilisateur()
{
$sql = 'SELECT * FROM user ORDER BY user_name ASC';
$liste = $this->executerRequete($sql);
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getSubstituts($user_id)
{
$sql = "call sp_p_get_substituts_finger(?);";
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getUtilisateurId($user_id)
{
$sql = 'SELECT * FROM user WHERE (user_id=?)';
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getListeUtilisateur()
{
$sql = 'SELECT a.* FROM user AS a JOIN finger AS b ON a.user_id=b.user_id';
$liste = $this->executerRequete($sql);
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function periferiqueCheckSn($sn)
{
$sql = "SELECT count(sn) as ct FROM device WHERE (sn=?)";
$liste = $this->executerRequete($sql, array($sn));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function checkNomUser($user_name)
{
$sql = "SELECT user_name FROM user WHERE (user_name=?)";
$liste = $this->executerRequete($sql, array($user_name));
// $arr = $liste->fetchAll(PDO::FETCH_ASSOC);
// return $arr;
return $liste;
}
function getEmpreinteUtilisateur($user_id)
{
$sql = "SELECT * FROM finger WHERE (user_id=?)";
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function getNbEmpreinteUtilisateur($user_id)
{
$sql = "SELECT count(finger_id) as ct FROM finger WHERE (user_id=?)";
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function ObtenirLog()
{
$sql = 'SELECT * FROM log ORDER BY log_time DESC';
$liste = $this->executerRequete($sql);
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function creerLog($user_name, $time, $sn)
{
$sql = "insert into log (user_name, data) values (?, ?)";
$data = date('d/m/Y H:i:s', strtotime($time))." (Heure locale) | ".$sn." (SN)";
$result = $this->executerRequete($sql, array($user_name, $data));
return $result;
}
function ajouterEmpreinte($user_id, $finger_data)
{
$sql = "insert into finger (user_id, finger_data) values (?,?)";
$result = $this->executerRequete($sql, array($user_id, $finger_data));
return $result;
}
function ObtenirEmpreinteId($user_id)
{
$sql = 'SELECT MAX(finger_id) as fid FROM finger WHERE (user_id=?)';
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
function initialiserJeton($user_id)
{
// $idJeton = uniqid();
$sql = "call sp_p_init_finger(?);";
$this->executerRequete($sql, array($user_id));
}
function majJeton($user_id, $succes)
{
$sql = "call sp_p_maj_finger(?, ?);";
$this->executerRequete($sql, array($user_id, $succes));
}
function verifierFinger($user_id)
{
$sql = "call sp_p_check_finger(?);";
$liste = $this->executerRequete($sql, array($user_id));
$arr = $liste->fetchAll(PDO::FETCH_ASSOC);
return $arr;
}
} // FIN CLASS fingertable
// Début fonctions
function getDevice() {
$fingertable = new fingertable();
return $fingertable->getPerifique();
}
function getDeviceAcSn($vc) {
$fingertable = new fingertable();
return $fingertable->getPerifiqueAcSn($vc);
}
function getDeviceBySn($sn) {
$fingertable = new fingertable();
return $fingertable->getPerifiqueBySn($sn);
}
function getUser() {
$fingertable = new fingertable();
return $fingertable->getUtilisateur();
}
function getSurrogates($user_id)
{
$fingertable = new fingertable();
return $fingertable->getSubstituts($user_id);
}
function getUserId($user_id)
{
$fingertable = new fingertable();
return $fingertable->getUtilisateurId($user_id);
}
function deviceCheckSn($sn) {
$fingertable = new fingertable();
$data = $fingertable->periferiqueCheckSn($sn);
$ct=$data['0']['ct'];
if (($ct!='0') && ($ct!=''))
{
return "Ce N° de série existe déjà!";
}
else
{
return 1;
}
}
function checkUserName($user_name)
{
$fingertable = new fingertable();
$_user = $fingertable->checkNomUser($user_name);
$row = $_user->rowCount();
if ($row>0) {
return "Cet utilisateur existe déjà!";
} else {
return "1";
}
}
function getUserFinger($user_id)
{
$fingertable = new fingertable();
return $fingertable->getEmpreinteUtilisateur($user_id);
}
function getLog()
{
$fingertable = new fingertable();
return $fingertable->ObtenirLog();
}
function createLog($user_name, $time, $sn)
{
$fingertable = new fingertable();
$result1 = $fingertable->creerLog($user_name, $time, $sn);
if ($result1) {
return 1;
} else {
return "Error insert log data!";
}
}
function addDevice($device_name, $sn, $vc, $ac, $vkey)
{
$fingertable = new fingertable();
$result = $fingertable->ajouterPerifique($device_name, $sn, $vc, $ac, $vkey);
return $result;
}
function deleteDevice($sn)
{
$fingertable = new fingertable();
$result = $fingertable->supprimerPerifique($sn) ;
return $result;
}
function addUser($user_name)
{
$fingertable = new fingertable();
$result = $fingertable->ajouterUtilisateur($user_name) ;
return $result;
}
function deleteUser($user_id)
{
$fingertable = new fingertable();
$result = $fingertable->supprimerUtilisateur($user_id) ;
return $result;
}
function deleteFinger($user_id)
{
$fingertable = new fingertable();
$result = $fingertable->supprimerEmpreinte($user_id);
return $result;
}
function getListUsers()
{
$fingertable = new fingertable();
return $fingertable->getListeUtilisateur();
}
function addFinger($user_id, $finger_data)
{
$fingertable = new fingertable();
$result = $fingertable->ajouterEmpreinte($user_id, $finger_data);
return $result;
}
function getFingerId($user_id)
{
$fingertable = new fingertable();
$result = $fingertable->ObtenirEmpreinteId($user_id) ;
return $result;
}
function getFingerCountUser($user_id)
{
$fingertable = new fingertable();
$result = $fingertable->getNbEmpreinteUtilisateur($user_id);
return $result;
}
function initJeton($user_id)
{
$fingertable = new fingertable();
$fingertable->initialiserJeton($user_id);
}
function updateJeton($user_id, $succes)
{
$fingertable = new fingertable();
$fingertable->majJeton($user_id, $succes);
}
function checkFinger($user_id)
{
$fingertable = new fingertable();
$result = $fingertable->verifierFinger($user_id);
return $result;
}
?>

View File

@@ -0,0 +1,16 @@
<?php
/*ini_set("display_errors", 0);
error_reporting(0);*/
// $base_path = "flexcode/";
$long_link = "https://prestation.medicare.ovh/";
/* Modifié le 11/11/2018 pour augmenter le temp d'essai
// $time_limit_ver = "10";
$time_limit_reg = "20";
*/
$time_limit_ver = "40";
$time_limit_reg = "40";
?>

61
flexcode/index_old.php Normal file
View File

@@ -0,0 +1,61 @@
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<?php include 'include/global.php'; ?>
<?php include 'include/head.php'; ?>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Radiant FingerPrint</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<!--
<li><a href="#" onclick="load('<?php echo $base_path?>device.php?action=index')">Lecteurs</a></li>
<li><a href="#" onclick="load('<?php echo $base_path?>user.php?action=index')">Utilisateurs</a></li>
<li><a href="#" onclick="load('<?php echo $base_path?>login.php?action=index')">Vérification</a></li>
<li><a href="#" onclick="load('<?php echo $base_path?>log.php?action=index')">Traces</a></li>
-->
<li><a href="#" onclick="load('flexcode/device.php?action=index')">Lecteurs</a></li>
<li><a href="#" onclick="load('flexcode/user.php?action=index')">Utilisateurs</a></li>
<li><a href="#" onclick="load('flexcode/login.php?action=index')">Vérification</a></li>
<li><a href="#" onclick="load(flexcode/log.php?action=index')">Traces</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="content">
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function() {
console.log('Prêt pour utilisation...');
// load('<?php echo $base_path?>device.php?action=index');
load('flexcode/evice.php?action=index');
});
</script>
</body>
</html>

53
flexcode/log.php Normal file
View File

@@ -0,0 +1,53 @@
<?php
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index') {
?>
<script type="text/javascript">
$('title').html('Log');
</script>
<?php
$log = getLog();
if (count($log) > 0) {
echo "<div class='row'>"
."<div class='col-md-12'>"
."<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th class='col-md-4'>Heure Serveur</th>"
."<th class='col-md-4'>Nom</th>"
."<th class='col-md-4'>Infos</th>"
."</tr>"
."</thead>"
."<tbody>";
foreach ($log as $row) {
echo "<tr>"
."<td>".$row['log_time']."</td>"
."<td>".$row['user_name']."</td>"
."<td><code>".$row['data']."</code></td>"
."</tr>";
}
echo
"</tbody>"
."</table>"
."</div>"
."</div>";
} else {
echo 'Aucune trace';
}
}
?>

58
flexcode/login.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index') {
?>
<script type="text/javascript">
$('title').html('Login');
function login_selectuser(device_name, sn) {
alert($('#select_scan').val());
// $("#button_login").attr("href","finspot:FingerspotVer;"+$('#select_scan').val())
$("#button_login").attr("href","finspot:FingerspotVer;"+$('#select_scan').val())
}
</script>
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="form-group">
<label for="user_name">Nom</label>
<select class="form-control" onchange="login_selectuser()" id='select_scan'>
<option selected disabled="disabled"> -- Selectionner Nom -- </option>
<?php
$_users = getListUsers() ;
foreach ($_users as $row)
{
// $value = base64_encode($base_path."verification.php?user_id=".$row['user_id']);
$value = "flexcode/verification.php?user_id=".$row['user_id'];
$value = base64_encode($value);
echo "<option value=$value id='option' user_id='".$row['user_id']."' user_name='".$row['user_name']."'>$row[user_name]</option>";
}
?>
</select>
</div>
<a href="" id="button_login" type="submit" class="btn btn-success">Vérifier</a>
</div>
<div class="col-md-4">
</div>
</div>
<?php
}
?>

23
flexcode/messages.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['msg']) && !empty($_GET['msg']))
{
echo $_GET['msg'];
}
elseif (isset($_GET['user_name']) && !empty($_GET['user_name']) && isset($_GET['time']) && !empty($_GET['time']))
{
$user_name = $_GET['user_name'];
$time = date('Y-m-d H:i:s', strtotime($_GET['time']));
echo $user_name." identifié avec succès le ".date('d/m/Y H:i:s', strtotime($time));
}
else
{
$msg = "Paramètres ivalides..";
echo "$msg";
}
?>

View File

@@ -0,0 +1,47 @@
<?php
if (isset($_POST['RegTemp']) && !empty($_POST['RegTemp']))
{
include 'include/global.php';
include 'include/function.php';
$data = explode(";",$_POST['RegTemp']);
$vStamp = $data[0];
$sn = $data[1];
$user_id = $data[2];
$regTemp = $data[3];
$device = getDeviceBySn($sn);
$salt = md5($device[0]['ac'].$device[0]['vkey'].$regTemp.$sn.$user_id);
if (strtoupper($vStamp) == strtoupper($salt))
{
$data = getFingerId($user_id);
$fid=$data['0']['fid'];
if ($fid == 0)
{
$result2 = addFinger($user_id, $regTemp) ;
if ($result2)
{
$res['result'] = true;
}
else
{
$res['server'] = "Error insert registration data!";
}
}
else
{
$res['result'] = false;
$res['user_finger_'.$user_id] = "Template already exist.";
}
echo "empty";
}
else
{
$msg = "Parameter invalid..";
// echo "flexcode/messages.php?msg=$msg";
}
}
?>

View File

@@ -0,0 +1,33 @@
<?php
if (isset($_POST['VerPas']) && !empty($_POST['VerPas']))
{
include 'include/global.php';
include 'include/function.php';
$data = explode(";",$_POST['VerPas']);
$user_id = $data[0];
$vStamp = $data[1];
$time = $data[2];
$sn = $data[3];
$fingerData = getUserFinger($user_id);
$device = getDeviceBySn($sn);
$ligne = getUserId($user_id);
$user_name = $ligne[0]['user_name'];
$salt = md5($sn.$fingerData[0]['finger_data'].$device[0]['vc'].$time.$user_id.$device[0]['vkey']);
if (strtoupper($vStamp) == strtoupper($salt))
{
$succes = "1";
updateJeton($user_id, $succes);
}
else
{
$msg = "Parameter invalid..";
// echo "flexcode/messages.php?msg=$msg";
}
}
?>

19
flexcode/register.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
if (isset($_GET['user_id']) && !empty($_GET['user_id']))
{
include 'include/global.php';
include 'include/function.php';
$user_id = $_GET['user_id'];
// $long_link
// $lienServeur = $_SESSION['p_lienServeur'];
// transmettre le contenu de $_SESSION['p_lienServeur'] par paramètre GET ou POST à register.php
echo "$user_id;SecurityKey;".$time_limit_reg.";https://prestation.medicare.ovh/flexcode/process_register.php;https://prestation.medicare.ovh/flexcode/getac.php";
}
?>

472
flexcode/user.php Normal file
View File

@@ -0,0 +1,472 @@
<?php
session_start();
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index')
{
$user_id = $_GET['user_id'];
$user_name = $_GET['user_name'];
$finger = $_GET['finger'];
?>
<script type="text/javascript">
function user_register(user_id, user_name)
{
$('body').ajaxMask();
regStats = 0;
regCt = -1;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Registration timer has been init');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("'"+user_name+"' registration checking...");
user_checkregister(user_id,$("#user_finger_"+user_id).html());
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("'"+user_name+"' : Enrôlement terminé!");
if (ct>=limit && regStats==0)
{
$("#okId" ).val("-1");
$('body').ajaxMask({ stop: true });
v_msg=user_name+" => échec de l'enrôlement!";
v_msgEng=user_name+" => Enrollement failed!";
alert_ebene(v_msg, v_msgEng);
}
if (regStats==1)
{
$("#okId" ).val("1");
$('body').ajaxMask({ stop: true });
$("#user_finger_"+user_id).html(regCt);
v_msg =user_name+" : Enrôlement effectué avec succès!";
v_msgEng=user_name+" : Enrolled successfully!";
alert_ebene(v_msg, v_msgEng);
// Ajout du 21/09/2018 => enregistrer celui qui a enrôler l'assuré
save_enroleur(user_id);
afficher_beneficiaire_id();
}
}
ct++;
});
}
function user_checkregister(user_id, current)
{
$.ajax({
url : "flexcode/user.php?action=checkreg&user_id="+user_id+"&current="+current,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
if (res.result)
{
regStats = 1;
$.each(res, function(key, value)
{
if (key=='current')
{
regCt = value;
}
});
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// ajouté le 26/05/2017 pour la vérification
function user_verification(user_id)
{
/*
verifiertentativeidentitification(user_id);
nbTentative = $("#nbTentative").val();
if (nbTentative>=3)
{
v_msg="Attention, vous avez effectué plus de 3 tentatives!";
v_msgEng="Warning, you made more than 3 attempts!";
alert_ebene(v_msg, v_msgEng);
}
*/
$('body').ajaxMask();
regStats = 0;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Démarrage de la Vérification');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("Vérification en cours...");
user_checkverification(user_id);
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("Vérification terminé!");
if (ct>=limit && regStats==0)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("0");
v_msg="Echec identification!";
v_msgEng="Identification failed!";
alert_ebene(v_msg, v_msgEng);
/*
if (nbTentative==3)
{
envoyer_alert_tentative_fraude(user_id);
}
*/
}
if (regStats==1)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("1");
facturation = $("#facturation").val();
if(facturation==1)
{
codeProfil = $("#codeProfil_C" ).val();
codeTypeFacture = $("#codeTypeFacture_C" ).val();
if(codeTypeFacture=="PHAR")
{
facturer_pha();
}
else if(codeTypeFacture=="CSO")
{
facturer_cso(user_id);
}
else if(codeTypeFacture=="OPT")
{
facturer_opt();
}
else if(codeTypeFacture=="MON")
{
facturer_monture(user_id);
}
else if(codeTypeFacture=="LAB")
{
facturer_lab(user_id);
}
else if(codeTypeFacture=="LABCSO")
{
facturer_lab_cso(user_id);
}
else if(codeTypeFacture=="SEA")
{
facturer_sea(user_id);
}
else if(codeTypeFacture=="SEACSO")
{
facturer_sea_cso(user_id);
}
}
else
{
donnees_substitut = 'user_id_substitut='+user_id;
v_msg="Identification effectuée avec succès!";
v_msgEng="Identified successfully!";
alert_ebene(v_msg, v_msgEng);
$("#okId").val("1");
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextidentification/",
type : 'post',
data: donnees_substitut,
complete: function()
{
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
}
});
/*
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
*/
}
}
}
ct++;
});
}
function user_checkverification(user_id)
{
$.ajax({
url : "flexcode/user.php?action=checkver&user_id="+user_id,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
console.log("res : "+res);
if (res.result)
{
regStats = 1;
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// fin ajout du 26/05/2017 pour la vérification
</script>
<br>
<?php
$register = '';
$verification = '';
// $long_link
$url_register = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/register.php?user_id=".$user_id);
$url_verification = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/verification.php?user_id=".$user_id);
if ($finger == 0)
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "<a class='form-control btn btn-danger' style='font-size:10pt;' href='finspot:FingerspotReg;$url_register' onclick=\"user_register('".$user_id."','".$user_name."')\">Start Enrollment </a>";
}
else
{
echo "<a class='form-control btn btn-danger' style='font-size:10pt;' href='finspot:FingerspotReg;$url_register' onclick=\"user_register('".$user_id."','".$user_name."')\">Démarrer Enrôlement </a>";
}
}
// else
elseif ($finger <> -1)
{
initJeton($user_id);
if (isset($_GET['facturation']))
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
// echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Start Billing </a>";
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Billing by Fingerprint </a>";
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Facturation par Empreinte Digitale </a>";
}
}
else
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Start Identity Verification </a>";
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Démarrer Vérification Identité </a>";
}
}
}
$user = getSurrogates($user_id);
if (count($user) > 0)
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Substitution Fingerprints</th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
else
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Empreintes de substitution </th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
foreach ($user as $row)
{
$user_id_s = $row['user_id'];
$url_verification = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/verification.php?user_id=".$user_id_s);
initJeton($user_id_s);
if (isset($_GET['facturation']))
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer </a>";
}
}
else
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer </a>";
}
}
echo "<tr>"
."<td align='center'>".$row['user_name']."</td>"
."<td align='center'>"
."$verification"
."</td>"
."</tr>";
}
echo
"</tbody>";
// Fin Emprientes de subtitution
} else
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "No substitute!";
}
else
{
echo "Pas de substitut!";
}
}
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkreg')
{
$result1 = getFingerCountUser($_GET['user_id']);
$ct=$result1['0']['ct'];
if (intval($ct) > intval($_GET['current']))
{
$res['result'] = true;
$res['current'] = intval($ct);
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkver')
{
/*
Non testé => succes = "0"
Echec => succes = "9"
Reussite => succes = "1"
*/
$result1 = checkFinger($_GET['user_id']);
$succes=$result1['0']['succes'];
if (intval($succes) == 1)
{
$res['result'] = true;
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
else
{
echo "Parameter invalid..";
}
?>

416
flexcode/user_19_07_26.php Normal file
View File

@@ -0,0 +1,416 @@
<?php
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index')
{
$user_id = $_GET['user_id'];
$user_name = $_GET['user_name'];
$finger = $_GET['finger'];
?>
<script type="text/javascript">
// $('title').html('User');
function user_register(user_id, user_name)
{
$('body').ajaxMask();
regStats = 0;
regCt = -1;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Registration timer has been init');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("'"+user_name+"' registration checking...");
user_checkregister(user_id,$("#user_finger_"+user_id).html());
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("'"+user_name+"' : Enrôlement terminé!");
if (ct>=limit && regStats==0)
{
$("#okId" ).val("-1");
$('body').ajaxMask({ stop: true });
v_msg=user_name+" => échec de l'enrôlement!";
v_msgEng=user_name+" => Enrollement failed!";
alert_ebene(v_msg, v_msgEng);
}
if (regStats==1)
{
$("#okId" ).val("1");
$('body').ajaxMask({ stop: true });
$("#user_finger_"+user_id).html(regCt);
v_msg =user_name+" : Enrôlement effectué avec succès!";
v_msgEng=user_name+" : Enrolled successfully!";
alert_ebene(v_msg, v_msgEng);
// Ajout du 21/09/2018 => enregistrer celui qui a enrôler l'assuré
save_enroleur(user_id);
afficher_beneficiaire_id();
}
}
ct++;
});
}
function user_checkregister(user_id, current)
{
$.ajax({
url : "flexcode/user.php?action=checkreg&user_id="+user_id+"&current="+current,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
if (res.result)
{
regStats = 1;
$.each(res, function(key, value)
{
if (key=='current')
{
regCt = value;
}
});
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// ajouté le 26/05/2017 pour la vérification
function user_verification(user_id)
{
/*
verifiertentativeidentitification(user_id);
nbTentative = $("#nbTentative").val();
if (nbTentative>=3)
{
v_msg="Attention, vous avez effectué plus de 3 tentatives!";
v_msgEng="Warning, you made more than 3 attempts!";
alert_ebene(v_msg, v_msgEng);
}
*/
$('body').ajaxMask();
regStats = 0;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Démarrage de la Vérification');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("Vérification en cours...");
user_checkverification(user_id);
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("Vérification terminé!");
if (ct>=limit && regStats==0)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("0");
v_msg="Echec identification!";
v_msgEng="Identification failed!";
alert_ebene(v_msg, v_msgEng);
/*
if (nbTentative==3)
{
envoyer_alert_tentative_fraude(user_id);
}
*/
}
if (regStats==1)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("1");
facturation = $("#facturation").val();
if(facturation==1)
{
codeProfil = $("#codeProfil_C" ).val();
codeTypeFacture = $("#codeTypeFacture_C" ).val();
if(codeTypeFacture=="PHAR")
{
facturer_pha();
}
else if(codeTypeFacture=="CSO")
{
facturer_cso(user_id);
}
else if(codeTypeFacture=="OPT")
{
facturer_opt();
}
else if(codeTypeFacture=="MON")
{
facturer_monture(user_id);
}
else if(codeTypeFacture=="LAB")
{
facturer_lab(user_id);
}
else if(codeTypeFacture=="LABCSO")
{
facturer_lab_cso(user_id);
}
else if(codeTypeFacture=="SEA")
{
facturer_sea(user_id);
}
else if(codeTypeFacture=="SEACSO")
{
facturer_sea_cso(user_id);
}
}
else
{
donnees_substitut = 'user_id_substitut='+user_id;
v_msg="Identification effectuée avec succès!";
v_msgEng="Identified successfully!";
alert_ebene(v_msg, v_msgEng);
$("#okId").val("1");
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextidentification/",
type : 'post',
data: donnees_substitut,
complete: function()
{
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
}
});
/*
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
*/
}
}
}
ct++;
});
}
function user_checkverification(user_id)
{
$.ajax({
url : "flexcode/user.php?action=checkver&user_id="+user_id,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
console.log("res : "+res);
if (res.result)
{
regStats = 1;
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// fin ajout du 26/05/2017 pour la vérification
</script>
<br>
<?php
$register = '';
$verification = '';
// $long_link
$url_register = base64_encode("https://prestation.medicare.ovh/flexcode/register.php?user_id=".$user_id);
$url_verification = base64_encode("https://prestation.medicare.ovh/flexcode/verification.php?user_id=".$user_id);
if ($finger == 0)
{
echo "<a class='form-control btn btn-danger' style='font-size:10pt;' href='finspot:FingerspotReg;$url_register' onclick=\"user_register('".$user_id."','".$user_name."')\">Démarrer Enrôlement / Start Enrollment</a>";
}
// else
elseif ($finger <> -1)
{
initJeton($user_id);
if (isset($_GET['facturation']))
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Démarrer la facturation / Start Billing </a>";
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Démarrer Vérification Identité / Start Identity Verification </a>";
}
}
$user = getSurrogates($user_id);
if (count($user) > 0)
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Empreintes de substitution / Substitution Fingerprints</th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
foreach ($user as $row)
{
$user_id_s = $row['user_id'];
$url_verification = base64_encode("https://prestation.medicare.ovh/flexcode/verification.php?user_id=".$user_id_s);
initJeton($user_id_s);
if (isset($_GET['facturation']))
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer / Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer / Substitute </a>";
}
echo "<tr>"
."<td align='center'>".$row['user_name']."</td>"
."<td align='center'>"
."$verification"
."</td>"
."</tr>";
}
echo
"</tbody>";
// Fin Emprientes de subtitution
} else
{
echo 'Pas de substitut! / No substitute!';
}
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkreg')
{
$result1 = getFingerCountUser($_GET['user_id']);
$ct=$result1['0']['ct'];
if (intval($ct) > intval($_GET['current']))
{
$res['result'] = true;
$res['current'] = intval($ct);
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkver')
{
/*
Non testé => succes = "0"
Echec => succes = "9"
Reussite => succes = "1"
*/
$result1 = checkFinger($_GET['user_id']);
$succes=$result1['0']['succes'];
if (intval($succes) == 1)
{
$res['result'] = true;
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
else
{
echo "Parameter invalid..";
}
?>

View File

@@ -0,0 +1,456 @@
<?php
session_start();
// var_dump(array("p_faceActif" =>$_SESSION['p_faceActif']));
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index')
{
$user_id = $_GET['user_id'];
$user_name = $_GET['user_name'];
$finger = $_GET['finger'];
?>
<script type="text/javascript">
function user_register(user_id, user_name)
{
$('body').ajaxMask();
regStats = 0;
regCt = -1;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Registration timer has been init');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("'"+user_name+"' registration checking...");
user_checkregister(user_id,$("#user_finger_"+user_id).html());
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("'"+user_name+"' : Enrôlement terminé!");
if (ct>=limit && regStats==0)
{
$("#okId" ).val("-1");
$('body').ajaxMask({ stop: true });
v_msg=user_name+" => échec de l'enrôlement!";
v_msgEng=user_name+" => Enrollement failed!";
alert_ebene(v_msg, v_msgEng);
}
if (regStats==1)
{
$("#okId" ).val("1");
$('body').ajaxMask({ stop: true });
$("#user_finger_"+user_id).html(regCt);
v_msg =user_name+" : Enrôlement effectué avec succès!";
v_msgEng=user_name+" : Enrolled successfully!";
alert_ebene(v_msg, v_msgEng);
// Ajout du 21/09/2018 => enregistrer celui qui a enrôler l'assuré
save_enroleur(user_id);
afficher_beneficiaire_id();
}
}
ct++;
});
}
function user_checkregister(user_id, current)
{
$.ajax({
url : "flexcode/user.php?action=checkreg&user_id="+user_id+"&current="+current,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
if (res.result)
{
regStats = 1;
$.each(res, function(key, value)
{
if (key=='current')
{
regCt = value;
}
});
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// ajouté le 26/05/2017 pour la vérification
function user_verification(user_id)
{
/*
verifiertentativeidentitification(user_id);
nbTentative = $("#nbTentative").val();
if (nbTentative>=3)
{
v_msg="Attention, vous avez effectué plus de 3 tentatives!";
v_msgEng="Warning, you made more than 3 attempts!";
alert_ebene(v_msg, v_msgEng);
}
*/
/*
finger_id = $("#finger_id_C" ).val();
if (finger_id==0)
{
v_msg="Veuillez procéder à l\'enrôlement avant!";
v_msgEng="Please enroll before!";
alert_ebene(v_msg, v_msgEng);
return;
}
*/
$('body').ajaxMask();
regStats = 0;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Démarrage de la Vérification');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("Vérification en cours...");
user_checkverification(user_id);
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("Vérification terminé!");
if (ct>=limit && regStats==0)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("0");
v_msg="Echec identification!";
v_msgEng="Identification failed!";
alert_ebene(v_msg, v_msgEng);
/*
if (nbTentative==3)
{
envoyer_alert_tentative_fraude(user_id);
}
*/
}
if (regStats==1)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("1");
facturation = $("#facturation").val();
if(facturation==1)
{
codeProfil = $("#codeProfil_C" ).val();
codeTypeFacture = $("#codeTypeFacture_C" ).val();
if(codeTypeFacture=="PHAR")
{
facturer_pha();
}
else if(codeTypeFacture=="CSO")
{
facturer_cso(user_id);
}
else if(codeTypeFacture=="OPT")
{
facturer_opt();
}
else if(codeTypeFacture=="MON")
{
facturer_monture(user_id);
}
else if(codeTypeFacture=="LAB")
{
facturer_lab(user_id);
}
else if(codeTypeFacture=="LABCSO")
{
facturer_lab_cso(user_id);
}
else if(codeTypeFacture=="SEA")
{
facturer_sea(user_id);
}
else if(codeTypeFacture=="SEACSO")
{
facturer_sea_cso(user_id);
}
}
else
{
donnees_substitut = 'user_id_substitut='+user_id;
v_msg="Identification effectuée avec succès!";
v_msgEng="Identified successfully!";
alert_ebene(v_msg, v_msgEng);
$("#okId").val("1");
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextidentification/",
type : 'post',
data: donnees_substitut,
complete: function()
{
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
}
});
/*
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
*/
}
}
}
ct++;
});
}
function user_checkverification(user_id)
{
$.ajax({
url : "flexcode/user.php?action=checkver&user_id="+user_id,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
console.log("res : "+res);
if (res.result)
{
regStats = 1;
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// fin ajout du 26/05/2017 pour la vérification
</script>
<br>
<?php
$register = '';
$verification = '';
// $long_link
$url_register = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/register.php?user_id=".$user_id);
$url_verification = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/verification.php?user_id=".$user_id);
initJeton($user_id);
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
// echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Start Billing </a>";
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Billing by Fingerprint </a>";
if ($_SESSION['p_faceActif']=="1")
{
echo "<br> <br>";
echo "<a class='form-control btn btn-primary' style='font-size:10pt;' onclick='facturation_reconnaissance_faciale()' > Billing by Facial Recognition </a>";
}
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Facturation par Empreinte Digitale </a>";
if ($_SESSION['p_faceActif']=="1")
{
echo "<br> <br>";
echo "<a class='form-control btn btn-primary' style='font-size:10pt;' onclick='facturation_reconnaissance_faciale()' > Facturation par Reconnaissance faciale </a>";
}
}
$user = getSurrogates($user_id);
if (count($user) > 0)
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Substitution Fingerprints</th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
else
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Empreintes de substitution </th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
foreach ($user as $row)
{
$user_id_s = $row['user_id'];
$url_verification = base64_encode($_SESSION['p_lienServeur'] . "/flexcode/verification.php?user_id=".$user_id_s);
initJeton($user_id_s);
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer </a>";
}
echo "<tr>"
."<td align='center'>".$row['user_name']."</td>"
."<td align='center'>"
."$verification"
."</td>"
."</tr>";
}
echo
"</tbody>";
// Fin Emprientes de subtitution
} else
{
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
echo "No substitute!";
}
else
{
echo "Pas de substitut!";
}
}
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkreg')
{
$result1 = getFingerCountUser($_GET['user_id']);
$ct=$result1['0']['ct'];
if (intval($ct) > intval($_GET['current']))
{
$res['result'] = true;
$res['current'] = intval($ct);
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkver')
{
/*
Non testé => succes = "0"
Echec => succes = "9"
Reussite => succes = "1"
*/
$result1 = checkFinger($_GET['user_id']);
$succes=$result1['0']['succes'];
if (intval($succes) == 1)
{
$res['result'] = true;
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
else
{
echo "Parameter invalid..";
}
?>

View File

@@ -0,0 +1,473 @@
<?php
session_start();
include 'include/global.php';
include 'include/function.php';
if (isset($_GET['action']) && $_GET['action'] == 'index')
{
$user_id = $_GET['user_id'];
$user_name = $_GET['user_name'];
$finger = $_GET['finger'];
?>
<script type="text/javascript">
// $('title').html('User');
function user_register(user_id, user_name)
{
$('body').ajaxMask();
regStats = 0;
regCt = -1;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Registration timer has been init');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("'"+user_name+"' registration checking...");
user_checkregister(user_id,$("#user_finger_"+user_id).html());
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("'"+user_name+"' : Enrôlement terminé!");
if (ct>=limit && regStats==0)
{
$("#okId" ).val("-1");
$('body').ajaxMask({ stop: true });
v_msg=user_name+" => échec de l'enrôlement!";
v_msgEng=user_name+" => Enrollement failed!";
alert_ebene(v_msg, v_msgEng);
}
if (regStats==1)
{
$("#okId" ).val("1");
$('body').ajaxMask({ stop: true });
$("#user_finger_"+user_id).html(regCt);
v_msg =user_name+" : Enrôlement effectué avec succès!";
v_msgEng=user_name+" : Enrolled successfully!";
alert_ebene(v_msg, v_msgEng);
// Ajout du 21/09/2018 => enregistrer celui qui a enrôler l'assuré
save_enroleur(user_id);
afficher_beneficiaire_id();
}
}
ct++;
});
}
function user_checkregister(user_id, current)
{
$.ajax({
url : "flexcode/user.php?action=checkreg&user_id="+user_id+"&current="+current,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
if (res.result)
{
regStats = 1;
$.each(res, function(key, value)
{
if (key=='current')
{
regCt = value;
}
});
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// ajouté le 26/05/2017 pour la vérification
function user_verification(user_id)
{
/*
verifiertentativeidentitification(user_id);
nbTentative = $("#nbTentative").val();
if (nbTentative>=3)
{
v_msg="Attention, vous avez effectué plus de 3 tentatives!";
v_msgEng="Warning, you made more than 3 attempts!";
alert_ebene(v_msg, v_msgEng);
}
*/
$('body').ajaxMask();
regStats = 0;
try
{
timer_register.stop();
}
catch(err)
{
console.log('Démarrage de la Vérification');
}
/* mis en commentaire le 11/11/2018 pour augmenter le temp d'essai
var limit = 11;
*/
var limit = 21;
var ct = 1;
var timeout = 2000;
timer_register = $.timer(timeout, function()
{
console.log("Vérification en cours...");
user_checkverification(user_id);
if (ct>=limit || regStats==1)
{
timer_register.stop();
console.log("Vérification terminé!");
if (ct>=limit && regStats==0)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("0");
v_msg="Echec identification!";
v_msgEng="Identification failed!";
alert_ebene(v_msg, v_msgEng);
/*
if (nbTentative==3)
{
envoyer_alert_tentative_fraude(user_id);
}
*/
}
if (regStats==1)
{
$('body').ajaxMask({ stop: true });
$("#okId" ).val("1");
facturation = $("#facturation").val();
if(facturation==1)
{
codeProfil = $("#codeProfil_C" ).val();
codeTypeFacture = $("#codeTypeFacture_C" ).val();
if(codeTypeFacture=="PHAR")
{
facturer_pha();
}
else if(codeTypeFacture=="CSO")
{
facturer_cso(user_id);
}
else if(codeTypeFacture=="OPT")
{
facturer_opt();
}
else if(codeTypeFacture=="MON")
{
facturer_monture(user_id);
}
else if(codeTypeFacture=="LAB")
{
facturer_lab(user_id);
}
else if(codeTypeFacture=="LABCSO")
{
facturer_lab_cso(user_id);
}
else if(codeTypeFacture=="SEA")
{
facturer_sea(user_id);
}
else if(codeTypeFacture=="SEACSO")
{
facturer_sea_cso(user_id);
}
}
else
{
donnees_substitut = 'user_id_substitut='+user_id;
v_msg="Identification effectuée avec succès!";
v_msgEng="Identified successfully!";
alert_ebene(v_msg, v_msgEng);
$("#okId").val("1");
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextidentification/",
type : 'post',
data: donnees_substitut,
complete: function()
{
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
}
});
/*
remplacerordonnance = $("#remplacerordonnance").val();
if(remplacerordonnance==1)
{
fiche_remplacer_ordonnance();
}
else
{
dossiers("1");
}
*/
}
}
}
ct++;
});
}
function user_checkverification(user_id)
{
$.ajax({
url : "flexcode/user.php?action=checkver&user_id="+user_id,
type : "GET",
success : function(data)
{
try
{
var res = jQuery.parseJSON(data);
console.log("res : "+res);
if (res.result)
{
regStats = 1;
}
}
catch(err)
{
alert(err.message);
}
}
});
}
// fin ajout du 26/05/2017 pour la vérification
</script>
<br>
<?php
$register = '';
$verification = '';
// $long_link
$url_register = base64_encode("https://prestation.medicare.ovh/flexcode/register.php?user_id=".$user_id);
$url_verification = base64_encode("https://prestation.medicare.ovh/flexcode/verification.php?user_id=".$user_id);
if ($finger == 0)
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
echo "<a class='form-control btn btn-danger' style='font-size:10pt;' href='finspot:FingerspotReg;$url_register' onclick=\"user_register('".$user_id."','".$user_name."')\">Start Enrollment</a>";
}
else
{
echo "<a class='form-control btn btn-danger' style='font-size:10pt;' href='finspot:FingerspotReg;$url_register' onclick=\"user_register('".$user_id."','".$user_name."')\">Démarrer Enrôlement</a>";
}
}
// else
elseif ($finger <> -1)
{
initJeton($user_id);
if (isset($_GET['facturation']))
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Start Billing </a>";
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Démarrer la facturation </a>";
}
}
else
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Start Identity Verification </a>";
}
else
{
echo "<a id='btn_check_id' name='btn_check_id' class='form-control btn btn-primary' style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id."')\" > Démarrer Vérification Identité </a>";
}
}
}
$user = getSurrogates($user_id);
if (count($user) > 0)
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Substitution Fingerprints</th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
else
{
echo "<table class='table table-bordered table-hover'>"
."<thead>"
."<tr>"
."<th style='text-align:center' width='60%'>Empreintes de substitution </th>"
."<th style='text-align:center' class='col-md-4'>Action</th>"
."</tr>"
."</thead>"
."<tbody>";
}
foreach ($user as $row)
{
$user_id_s = $row['user_id'];
$url_verification = base64_encode("https://prestation.medicare.ovh/flexcode/verification.php?user_id=".$user_id_s);
initJeton($user_id_s);
if (isset($_GET['facturation']))
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer </a>";
}
}
else
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substitute </a>";
}
else
{
$verification = "<a style='font-size:10pt;' href='finspot:FingerspotVer;$url_verification' onclick=\"user_verification('".$user_id_s."')\" > Substituer </a>";
}
}
echo "<tr>"
."<td align='center'>".$row['user_name']."</td>"
."<td align='center'>"
."$verification"
."</td>"
."</tr>";
}
echo
"</tbody>";
// Fin Emprientes de subtitution
} else
{
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US")
{
echo "No substitute!";
}
else
{
echo "Pas de substitut!";
}
}
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkreg')
{
$result1 = getFingerCountUser($_GET['user_id']);
$ct=$result1['0']['ct'];
if (intval($ct) > intval($_GET['current']))
{
$res['result'] = true;
$res['current'] = intval($ct);
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
elseif (isset ($_GET['action']) && $_GET['action'] == 'checkver')
{
/*
Non testé => succes = "0"
Echec => succes = "9"
Reussite => succes = "1"
*/
$result1 = checkFinger($_GET['user_id']);
$succes=$result1['0']['succes'];
if (intval($succes) == 1)
{
$res['result'] = true;
}
else
{
$res['result'] = false;
}
echo json_encode($res);
}
else
{
echo "Parameter invalid..";
}
?>

21
flexcode/verification.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
if (isset($_GET['user_id']) && !empty($_GET['user_id']))
{
include 'include/global.php';
include 'include/function.php';
$user_id = $_GET['user_id'];
$finger = getUserFinger($user_id);
$succes = "9";
updateJeton($user_id, $succes);
// $lienServeur = $_SESSION['p_lienServeur'];
// transmettre le contenu de $_SESSION['p_lienServeur'] par paramètre GET ou POST à verification.php
echo "$user_id;".$finger[0]['finger_data'].";SecurityKey;".$time_limit_ver.";https://prestation.medicare.ovh/flexcode/process_verification.php;https://prestation.medicare.ovh/flexcode/getac.php".";extraParams";
}
?>