[insert_php]
if(isset($_POST[‘check’]))
{
$examno = $_POST[‘examno’];
//$pin = $_POST[‘pin’];
$pin = $_POST[‘examno’];
$set = $_POST[‘classof’];
$set2 = str_replace(“/”, “”, $set);
//connect and send reg details
$con = mysqli_connect(“localhost”, “conooorg_saly”, “{{Ssgkk4}}”);
$db = mysqli_select_db($con, “conooorg_nursing”);
//chk pin
$qp = “select * from admission_pin where pin=’$pin’ limit 1”;
$rp = mysqli_query($con, $qp);
$xp = mysqli_num_rows($rp);
if($xp!=0)
{
//pin found ,,, checkif used
$rowp = mysqli_fetch_array($rp);
$user = $rowp[‘user’];
$myset = $rowp[‘session’];
if(strlen($user)>0){
//used PIN… compare user and provided exam no
if(($examno==$user) && ($set==$myset)){
//same user
$displayletter = 1;
}else{
//different user
$displayletter = 0;
$errormsg = “This PIN has been used by another candidate for “.$myset.” academic session”;
}
//user len checker cont
}else{
//check if the examno was successful
$qc = “select * from admissionletter where examno=’$examno’ AND session=’$set’ limit 1”;
$rc = mysqli_query($con, $qc);
if($rc){
$xx = mysqli_num_rows($rc);
if($xx==1) {
//successful
$displayletter = 1;
}else{
$displayletter = 0;
$errormsg = “The applicant with this examination number (“.$examno.”) was not successful for “.$set.” academic session. “;
}
} //rc check
} //user len check
//pin check cont
}else{
//pin not found
$displayletter = 0;
$errormsg = “PIN not found”;
}
$q = “select * from admissionletter where examno=’$examno’ AND session=’$set’ AND payment_status=’PAID’ limit 1″;
$r = mysqli_query($con, $q);
if($r)
{
$xxy = mysqli_num_rows($r);
if(($xxy ==1) && ($displayletter==1))
{
//found
$row = mysqli_fetch_array($r);
$html = ”;
$html .= ‘
WELCOME ‘.$row[“firstname”].’ ‘.$row[“middlename”].’ ‘.$row[“lastname”].’.
‘;
$myid = sha1($row[“id”]);
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
$html .=’
‘;
echo $html;
//update pin record
mysqli_query($con, “update admission_pin set session=’$set’, user=’$examno’ where pin=’$pin'”);
} else {
//echo “2025/2026 Session Admission
echo “
Payment for acceptance fee not updated. Kindly make payment for acceptance fee and notify the College.
Steps to print admission letter
- Enter your Examination Number
- Select your Session
- Click ‘Login’ menu to proceed
“;
echo “
“;
}
} else { echo “…”.mysqli_error($con); }
} else {
echo “2025/2026 Session Admission
Steps to print admission letter
- Enter your Examination Number
- Select your Session
- Click ‘Login’ menu to proceed
“;
echo “
“;
}
[/insert_php]