<?php include("../../config/admin.php"); ?>
<?php 

$sql = "SELECT ID FROM wy WHERE fid=".$_GET['id']."";
if ($result=mysqli_query($conn,$sql))
{
    // 返回记录数
    $count=mysqli_num_rows($result)+1;
    // 释放结果集
    mysqli_free_result($result);
}

$sql = "INSERT INTO ".$_GET['b']." (bt,fid,px,del,r1,r2) VALUES ('".$_GET['bt']."','".$_GET['id']."','".$count."','0','".date("Y-m-d h:i:s")."','".date('Y-m-d H:i:s',strtotime('+1year'))."')";
if ($conn->query($sql) === TRUE) {
	if($_GET['b']='fl'){
	 header("Location:/a/fl.php?fid=".$_GET['fid']."&id=".$_GET['id']."");	
	}
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}
 
$conn->close();
?>