1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| <?php
session_save_path("../session/");
session_start();
header("Content-Type:text/plain; charset=utf-8");
header("Cache-Control: no-cache, private");
header("Pragma: no-cache");
$pseudo = $_SESSION["pseudo"];
$id_vol = $_GET['idVol'];
if(is_numeric($id_vol))
{
include_once("../connexion_bdd.php");
$sql = "SELECT EP.prenom, ME.points_total FROM employe_voleur EV INNER JOIN embauche EB INNER JOIN employe EP INNER JOIN membres ME WHERE EV.id_vol = :id_vol AND EV.pseudo = :pseudo AND ME.pseudo = :pseudo AND EB.id_embauche = EV.id_embauche AND EP.id_employe = EB.id_employe";
$stmt = $dbh->prepare($sql);
$stmt->BindValue(':id_vol', $id_vol);
$stmt->BindValue(':pseudo', $pseudo);
$stmt->execute();
$nbre = $stmt->rowCount();
if($nbre >= 1)
{
while($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
//$prenom = $row['prenom'];
//$points_total = $row['points_total'];
}
$prenom = "laura";
$points_total = "15000";
if($points_total > 250)
{
if(rand(0,4) == '0')
{
print("{\"resultat\":{\"message\":\"L'employé ayant commis un fait délictuel est $prenom\"}}");
}
else
{
print("{\"resultat\":{\"message\":\"L'auteur de l'infraction n'a pas été retrouvé\"}}");
}
}
else
{
print("{\"resultat\":{\"message\":\"Trésorerie insuffisante pour lancer une enquête\"}}");
}
}
else
{
print("{\"resultat\":{\"message\":\"Vol inconnu\"}}");
}
}
else
{
print("N'est pas numerique !");
}
?> |
Partager