<?php
include('db_con.php');
include 'methodlist.php';
session_start();


$vstatus_id = $_POST['vstatus_id'];
$refer = $_POST['refer'];

$sql = "select app_id, appstatus from applicant_table where refer_no= '$_POST[refer]'";
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result);

$last_vname=get_app_status_name($row["appstatus"], $con);
$new_vname=get_app_status_name($_POST["vstatus_id"], $con);

$sql ="UPDATE `applicant_table` SET `appstatus`='$vstatus_id'  WHERE `refer_no`='$refer'";
mysqli_query($con,$sql);

//$sql ="UPDATE `applicant_table` SET `appstatus`='$vstatus_id'  WHERE parent='$row[app_id]'";
//mysqli_query($con,$sql);


ver_update_history('Application status updated from <b>'.$last_vname.'</b> to <b>'.$new_vname.'</b> by', $row["app_id"], $con);


?>