<?php include('function.php'); ?>
<?php
if(isset($_POST["sbmt"]))
{
$cn=makeconnection();
$s="insert into booking(Packageid,Name,Gender,Mobileno,Email,NoofDays,Child,Adults,) values('" . $_REQUEST["pid"] ."','" . $_POST["t1"] ."','" . $_POST["r1"] ."','" . $_POST["t2"] ."','" . $_POST["t3"] ."','" . $_POST["t4"] ."','" . $_POST["t5"] ."','" . $_POST["t6"] ."')";
mysqli_query($cn,$s);
echo "<script>alert('Record Save');</script>";
}
?>
<?php
$s="select * from package,category,subcategory where package.category=category.cat_id and package.subcategory=subcategory.subcatid and package.packid='" . $_GET["pid"] ."'";
$result=mysqli_query($cn,$s);
$r=mysqli_num_rows($result);
//echo $r;
$n=0;
$data=mysqli_fetch_array($result);
mysqli_close($cn);
?>
<form method="post" enctype="multipart/form-data">
<p>Package Id: <?php echo $data[0];?></p>
<p>Pack Name: <?php echo $data[1];?></p>
<p>Name</p>
<input type="text" name="t1" required pattern="{3,500}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<p>Gender</p>
<input type="radio" name="r1" value="Male" checked="checked" />Male<input type="radio" name="r1" value="Female"/>Female
<p>Mobile No.</p>
<input type="text" name="t2" required pattern="[0-9]{10}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<p>Email</p>
<input type="text" name="t3" required pattern="{3,500}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<p>No.of Days</p>
<input type="number" name="t4" required pattern="[1 _]{1,20}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<p>No.of Children</p>
<input type="number" name="t5" required pattern="[1 _]{1,20}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<p>No.of Adults</p>
<input type="number" name="t6" required pattern="[1 _]{1,20}" title"Please Enter Only Characters and numbers between 1 to 50 for Name"/>
<input type="submit" value="Booking" name="sbmt">
</form>