<?php
$db = mysqli_connect("localhost","wilay291_pc","Mascara_!#2021","wilay291_pc");
if(!$db){
die("Connection failed: " . mysqli_connect_error());
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="POST">
<select id="ncom" name="ncom" required>
<option disabled selected>-- إختر البلدية --</option>
<?php
mysqli_set_charset($db,"utf8");
$records = mysqli_query($db, "select distinct communes from pconst");
while($data = mysqli_fetch_array($records)){
echo "<option value='". $data['communes'] ."'>" .$data['communes'] ."</option>";
}
?>
</select>
<br>
<input class="form-control" type="text" id="ndos" name="ndos" placeholder="رقم الملف" dir="auto" class="effect-2" tabindex="1" required style="width:220px; height:35px;">
<br>
<input class="form-control" placeholder="تاريخ الإيداع" id="ddepot" name="ddepot" class="textbox-n" type="text" style="width:220px; height:35px;" required tabindex="3" onfocus="(this.type='date')" onblur="(this.type='text')"/>
<br>
<select id="typed" name="typed" required>
<option disabled selected>-- طبيعة الوتيقة --</option>
<?php
$records = mysqli_query($db, "select distinct TypeDecision from pconst where TypeDecision!=''");
while($data = mysqli_fetch_array($records)){
echo "<option value='". $data['TypeDecision'] ."'>" .$data['TypeDecision'] ."</option>";
}
?>
</select>
<br>
<input type="submit" name="submit" value="عرض">
<br><br>
</form>
<?php
if(isset($_POST['submit'])){
$ncom=$_POST['ncom'];
$ndos=$_POST['ndos'];
$ddepot=$_POST['ddepot'];
$typed=$_POST['typed'];
$recordss = mysqli_query($db,"select * from pconst where communes='$ncom' and ndos='$ndos' and ddepot='$ddepot' and TypeDecision='$typed' ");
if (mysqli_num_rows($recordss) == 0) {
echo '<p style="font-size:24px;color:red">Veuillez vérifier vos informations<br/></p>';
}
else
{
$datas = mysqli_fetch_assoc($recordss);
$nom=$datas['nom'];
$prenom=$datas['prenom'];
$etat=$datas['etat'];
$cause=$datas['cause'];
$datetat=$datas['datetat'];
echo '<p style="font-size:24px" dir="rtl">الإسم: '.$nom.'</p>';
echo '<p style="font-size:24px" dir="rtl">اللقب: '.$prenom.'</p>';
if ($etat=='مقبول'){
echo '<p style="font-size:24px;color:green" dir="rtl">وضعية الملف: '.$etat.'<br/></p>';
}
elseif ($etat=='قيد الدراسة'){
echo '<p style="font-size:24px;color:blue" dir="rtl">وضعية الملف: '.$etat.'<br/></p>';
}
elseif ($etat=='مؤجل'){
echo '<p style="font-size:24px;color:orange" dir="rtl">وضعية الملف: '.$etat.'<br/></p>';
}
elseif ($etat=='مرفوض'){
echo '<p style="font-size:24px;color:red" dir="rtl">وضعية الملف: '.$etat.'<br/></p>';
}
echo '<p style="font-size:24px" dir="rtl">بتاريخ: '.$datetat.'</p>';
echo '<p style="font-size:24px" dir="rtl">السبب: '.$cause.'</p>';
}
}
?>
<?php
mysqli_close($db);
?>
</body>
</html>
