<?php header('Content-Type: text/html; charset=utf-8');?>
<?php 


include("cnf.php");?>
<?php include("selects.php");$queries = new DatabaseFunctions($db5);?>
<?php


if(isset($_POST['p1']) && 
   isset($_POST['p2']) && 
   isset($_POST['fid']) && 
   isset($_POST['reqtype'])
  ){

$us = $_POST['p1'];
$ps = $_POST['p2'];
$ucd = "NONE";
$fid = $_POST['fid'];
$ver = ($_POST['reqtype'] == '50') ? 2 : 1;
$valdata = $queries -> chkuseval($us, $ps);  
if(!is_null($valdata) && is_array($valdata) && (sizeof($valdata) === 1)){
        
	    $ucd = $valdata[0];
	  
} 
  
$valdataCheck = $queries -> updateFactor("EXEC updatefactorflag @ucid = '$ucd', @factorid = '$fid', @sync_flag = $ver");

 
echo 8564;   

}else{

exit("Direct access not permitted.");
}
 

?>