<?php session_start();
include("connection.php");
error_reporting(E_ERROR | E_PARSE); 
if($_SESSION["user_id"]==true) {
} else {?><script> window.location.href='login/'; </script> <?php } 


 $bill_no=$_REQUEST["bill_no"];


 $bill=mysqli_query($con,"select * from onshop where `bill_no`='".$bill_no."' and `status`='active' and `bill_status`='pending' "); $billr=mysqli_fetch_array($bill,MYSQLI_ASSOC);
  $billn=mysqli_num_rows($bill);

?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- /Added by HTTrack --><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
<link type="text/css" rel="stylesheet" href="javax.faces.resource/themeab55.css?ln=primefaces-aristo" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/dist-butterfaces-bootstrap.min4e5d.css?ln=butterfaces-dist-css" />
-->
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/default.css" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/cssLayout.css" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/bootstrap.css" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/popup.css" />
<link type="text/css" rel="stylesheet" href="javax.faces.resource/css/menu.css" />
<!--
<script type="text/javascript" src="javax.faces.resource/butterfaces-all-with-jquery-and-bootstrap-bundle.min686a.js?ln=butterfaces-dist-bundle-js"></script>
<script type="text/javascript" src="javax.faces.resource/js/jquery-3.4.0.min.js"></script>
<script type="text/javascript" src="javax.faces.resource/js/bootstrap.js"></script>
<script type="text/javascript" src="javax.faces.resource/js/jquery-1.11.2.js"></script>
<script type="text/javascript" src="javax.faces.resource/js/jssor.slider-27.5.0.min.js"></script>
<script type="text/javascript" src="javax.faces.resource/jquery8490.js?ln=js"></script>
<script type="text/javascript" src="javax.faces.resource/menu8490.js?ln=js"></script>
<script type="text/javascript" src="javax.faces.resource/js/canvasjs.min.js"></script>
        
  -->     
        <script type="text/javascript">
            $(function() {
                $('ul.nav li.dropdown').hover(function() {
                    $(this).find('.dropdown-menu').stop(true, true).delay(100).fadeIn(500);
                }, function() {
                    $(this).find('.dropdown-menu').stop(true, true).delay(100).fadeOut(500);
                });
            });
        </script>
        <script type="text/javascript">
            $(function() {
                $("#notice").fadeIn("slow").append('');
                $(".dismis").click(function() {
                    $("#notice").fadeOut("slow");
                });
            });
        </script>
		
<script>
function lfn_SelectSection(p_Class)
    {
        document.getElementById('cusname').disabled=false;
		
  
        $.ajax({
		
                    type: "GET",
                    url: "ajax_location.html?classID=" + p_Class,
                    success: function(state) {
                    document.getElementById('cusname').innerHTML=state;    
					
                    }
        });
		
	 
		
		
    }

</script>
<style> 
        input.largerCheckbox { 
            width: 20px; 
            height: 20px; 
			
        } 
    </style> 
        <title>The Star Salon</title></head><body>

        <div id="top">


                    <div class="container-fluid text-center" style="margin-left: 5px"> 
                        <div class="row">
                            <div class="col-sm-1">
							<!-- Logo -->
							
							
                            </div>                           
                                       
                           
                        </div>
                    </div>

                    <!-- Menu start  -->

                    <nav class="navbar navbar-expand-lg header-m" role="navigation">
                        <div class="container-fluid">
                            <div class="navbar-header">
                                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                                    <span class="sr-only">Toggle navigation</span>
                                    <span class="icon-bar" style="background-color: #fff;"></span>
                                    <span class="icon-bar" style="background-color: #fff;"></span>
                                    <span class="icon-bar" style="background-color: #fff;"></span>
                                </button>
                                <a class="navbar-brand" href="#"></a>
                            </div>

                            <!-- Collect the nav links, forms, and other content for toggling -->
                            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                                <?php include("include/header.php"); ?>
                            </div>

                            <!-- /.navbar-collapse -->
                        </div>
                        <!-- /.container-fluid -->
                    </nav>

        </div>

        <div id="content" class="center_content" style="background-image:url(wall.jpg)" >

                    <div class="container-fluid text-center">    
                        <div class="row">
                            <div class="col-sm-2" style="padding-right: 0px;">
							
							
							
							
							
                                <?php include("include/left.php"); ?>
 
 
 
                             

                                </div>

                            </div>

                            <div class="col-sm-8" style="padding-right: 2px; padding-left:2px;">

                                <div class="row" >
                                    <div class="col-sm-12" >

                                        <div class="panel panel-primary" style="background-color: rgb(186,233,254);border: 1px solid #000; margin-bottom: 0px; background-image:url(wall.jpg) ">
                                            <div class="panel-heading" style="font-size: 20px; font-family: serif; background-color: #007de8; color:#CCFF00"> <b>Add Product</b></div>
                                            <div class="panel-body" style="text-align: justify;padding-bottom: 0px; padding-top: 6px;"><p style="font-family: Cambria;"><strong>
					 
<?php $id=$_REQUEST["id"]; $q=mysqli_query($con,"select * from product where `id`='".$id."'"); $qr=mysqli_fetch_array($q,MYSQLI_ASSOC); ?>					 
<form method="post" enctype="multipart/form-data" >
<table border="0" width="100%">
<!--<tr height="40"><td width="20%" ><b>Purchase Date</b> </td><td width="30%" colspan="2">
<input type="date" name="product_date" class="form-control" style="width:95%;" autocomplete="off" required   >
</td><td ></td></tr> -->
<!--<tr height="40"><td width="20%" ><b>Category</b> </td><td width="30%" colspan="2">
<select name="cat" id="cat" style="width:95%; background-color:#99FF66" class="form-control" >
<option value="0" <?php if($_REQUEST["id"]=="0") { ?> selected="selected" <?php } else {} ?>>Select Category</option>
<option value="1"  <?php if($_REQUEST["id"]=="1") { ?> selected="selected" <?php } else {} ?>  ><font color="#0000FF">All Category</font></option>
<?php $c=mysqli_query($con,"select * from category"); while($cr=mysqli_fetch_array($c,MYSQLI_ASSOC)) {  $ct=$cr["cat_name"]; ?>
<option  <?php if($_REQUEST["id"]==$ct) { ?> selected="selected" <?php } else {} ?> value="<?php echo $cr["cat_name"]; ?>"><?php echo $cr["cat_name"]; ?></option>

<?php } ?>
</select>	
</td><td ></td></tr>-->
<tr height="40"><td width="20%" ><b>Card No</b> </td><td width="30%" colspan="2">
<input type="text" name="card" class="form-control" style="width:95%;" autocomplete="off"   >
</td><td ></td></tr>
<tr height="40" style="display: none"><td ><b>Client Name</b> </td><td colspan="2">
<input type="text" name="cus_name" id="company" class="form-control" style="width:95%;"  autocomplete="off"   >
			<!--	<datalist id="com">
<?php $cl=mysqli_query($con,"select * from product GROUP BY `company`"); while($clr=mysqli_fetch_array($cl,MYSQLI_ASSOC)) { ?>
  <option value="<?php echo $clr['company']; ?>"> <?php echo $clr['company']; ?></option>
<?php } ?>
</datalist> --> 


</td><td ></td></tr>
<tr height="40" style="display: none"><td><b>Size</b> </td><td width="15%"><input type="text" name="volume" class="form-control" style="width:90%;" autocomplete="off"   ></td><td width="25%"><b>Unit</b>   &nbsp;&nbsp;&nbsp;&nbsp;<select name="unit"  style="width:40%; height:33px" autocomplete="off"   > 
<option value="ml">ml</option><option value="piece">piece</option><option value="pack">pack</option><option value="gm">gm</option><option value="kg">kg</option><option value="ltr">ltr</option>
<option value="half_plate">Half Plate</option> <option value="full_plate">Full Plate</option>
</select></td><td ></td></tr>
<tr height="40" style="display: none"><td><b>Purchase Rate</b> </td><td><input type="text" name="mrp" class="form-control" style="width:90%;" autocomplete="off"   > 

</td><td > </td><td></td></tr>

<tr height="40"><td style="background-color:#FFFFCC"><b>Client Name</b> </td><td style="background-color:#FFFFCC"><input type="text" name="client" class="form-control" style="width:90%;background-color:#FFFFCC" autocomplete="off"   > 

</td><td style="background-color:#FFFFCC" ><!-- Parcel Rate &nbsp;<input type="text" name="parcel"  style="width:40%; height:33px; background-color:#FFFFCC" autocomplete="off"    >--></td><td></td></tr>


<tr height="40"><td style="background-color:#FFFFCC"><b>Mobile No</b> </td><td style="background-color:#FFFFCC"><input type="text" name="mobile" class="form-control" style="width:90%;background-color:#FFFFCC" autocomplete="off"   > 

</td><td style="background-color:#FFFFCC" ><!-- Parcel Rate &nbsp;<input type="text" name="parcel"  style="width:40%; height:33px; background-color:#FFFFCC" autocomplete="off"    >--></td><td></td></tr>


<tr height="40" style="display: none" >
  <td><b>Chose One </b> </td>
  <td colspan="2"><input type="text" name="quantity" class="form-control" style="width:90%;display:none" autocomplete="off" value="0"   > 
Auto Store Maintain ? 
  <input type="radio"  name="p_s"  value="yes"> Yes  <input type="radio"  name="p_s"  value="no" checked="checked"> No</td><td></td></tr>



<tr height="40" style="display: none"><td ><b>Purchase From</b> </td><td colspan="2">
<input type="text" name="purchase_from"  class="form-control" style="width:95%;" list="pur" autocomplete="off"   >
				<datalist id="pur">
<?php $cl=mysqli_query($con,"select * from purchase GROUP BY `purchase_from`"); while($clr=mysqli_fetch_array($cl,MYSQLI_ASSOC)) { ?>
  <option value="<?php echo $clr['purchase_from']; ?>"> <?php echo $clr['purchase_from']; ?></option>
<?php } ?>
</datalist>  
</td><td ></td></tr>
<!--<tr height="40"><td><b>Select Photo</b> </td><td colspan="2"><input type="file" name="upload" style=" width:95"> </td><td ></td></tr> -->

<tr height="50"><td> </td><td> <input type="submit" name="save" value="Submit" style="width:70px; height:28px"></td><td></td></tr>
<tr height="50"><td><a href="card.php"><img src="back.png" width="70"></a> </td><td>  </td><td></td></tr>
</table>
</form>
<script>
function trshow() {
document.getElementById("ts").style.display = "table-row";
document.getElementById("tsx2").style.display = "table-row";
//document.getElementById("ts2").style.display = "block";
}
function trshow2() {
document.getElementById("ts").style.display = "none";
document.getElementById("tsx2").style.display = "none";
//document.getElementById("ts2").style.display = "block";
}
</script>
<hr>	
			

<?php   if(isset($_POST["save"]))
        {
		  $card=$_POST["card"];
		  $client=$_POST["client"];
		  $mobile=$_POST["mobile"];
		 $date=date('Y-m-d');
		  		
		   
		   
// mysqli_query($con,"insert into purchase (`product_name`,`company`,`mrp`,`price`,`doe`,`unit`,`volume`,`photo`,`category`,`quantity`,`purchase_from`) values('".$product_name."','".$company."','".$mrp."','".$price."','".$date."','".$unit."','".$volume."','".$path."','".$cat."','".$quantity."','".$purchase_from."')");		   
					
				
mysqli_query($con,"insert into card_detail (`card_no`,`name`,`mobile`,`date`,`status`) values('".$card."','".$client."','".$mobile."','".$date."','active')");		


?><script>
alert("Entry Success");
window.location.href="card.php";</script><?php 	
	
		}?>				 
<p>&nbsp;</p>					 
				
					 
					 
					 
	<!--				 					
											 <select name="class" id="class" class="form-control" onChange="lfn_SelectSection(this.value);">
                                            <option value="">--- Please Select Class ----</option>
                                             <option value="A">A</option>
											 <option value="B">B</option>
											 <option value="C">C</option>
                                             </select>
											Section
											 <select type="text" name="secname" id="secname" class="form-control" >
                                        	<option value="0">------select Section_o------</option>

                                        </select> -->	
										
                                                    </strong></p></div>
                                        </div>



                                    </div>
                                </div>

                            <!--   <div class="well" style="padding: 5px;background-color: rgb(186,233,254); border: 1px solid #000; margin-bottom: 1px;">
                                    <div class="row">
                                        
                                        
                                       
                                        
                                        
                                        
                                    </div> 
                                </div>-->
                                <div class="row">
                                   <!-- <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: antiquewhite;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/school-educatione0f8.png?ln=img" width="50" />  </div>
                                            <div class="panel-footer" style="padding: 1px 2px; background-color: #007de8; font-size: 13px;"><a href="../e_Pension/AdminLogin.html"> School Education Department Users</a>  </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: #7c5a5e;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/villagee0f8.png?ln=img" width="50" /></div>
                                            <div class="panel-footer" style="padding: 1px 2px;background-color: #007de8; font-size: 13px;"><a href="../e_Pension/AdminLogin.html">P &amp; R D Department Users</a>  </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: #f6f191;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/librarye0f8.png?ln=img" width="50" /></div>
                                            <div class="panel-footer" style="padding: 1px 2px;background-color: #007de8; font-size: 13px;"><a href="../e_Pension/AdminLogin.html">UD &amp; MA Department Users</a>  </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: #fff;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/images6e0f8.png?ln=img" width="50" /></div>
                                            <div class="panel-footer" style="padding: 1px 2px;background-color: #007de8; font-size: 13px;"><a href="../e_Pension/AdminLogin.html"> MEE &amp; LS Department Users</a>  </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: #ffdc6a;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/treasurye0f8.png?ln=img" width="50" /></div>
                                            <div class="panel-footer" style="padding: 10px 5px;background-color: #007de8; font-size: 13px;"><a href="../e_Pension/AdminLogin.html">Treasury Users</a>  </div>
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <div class="panel panel-primary" style="background-color: #5cfef2;">
                                            <div class="panel-body" style="border: 1px solid #000"><img src="javax.faces.resource/users-groupe0f8.png?ln=img" width="50" /></div>
                                            <div class="panel-footer" style="padding: 1px 2px;background-color: #007de8; font-size: 12px;"><a href="../e_Pension/AdminLogin.html">Other Departments Users</a>  </div>
                                        </div>
                                    </div>    -->
                                </div>
                            
                               

                            </div>
                            <div class="col-sm-2" style="padding-left:0px;">
                                
								
								
 <?php include("include/right.php"); ?>
                            </div>                     
                        </div>

                    </div>
					
					
</form>
        </div>


 <?php include("include/footer.php"); ?>
		

		
		
		</body>



</html>