<?php include "layouts/menu.php"; ?>
        <div class="right_col" role="main">
     
      
 
            <div class="clearfix"></div>

           <?php
					
						$qry=mysqli_query($conn, "select * from opurchase ORDER BY id DESC");
					
						?>
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Enquiry <small>Details</small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                        <ul class="dropdown-menu" role="menu">
                          <li><a href="#">Settings 1</a>
                          </li>
                          <li><a href="#">Settings 2</a>
                          </li>
                        </ul>
                      </li>
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <p class="text-muted font-13 m-b-30">
                       </p>
                    <table id="datatable-buttons" id="datatable-buttons" class="table table-striped table-bordered">
                      <thead>
                        <tr>
												<th>S.no</th>
                                                <th>Name</th>
                                                
												<th>V.No</th><th>V.NAME</th>
												<th>STATUS</th>
												<th>Date</th> 
												<th>Print Purchase</th>
                                                 <th>Sale Now</th>
												 
												 <th>Colour</th>
												 <th>Model</th>
												 <th>Chesis No</th>
												 <th>Engine No</th>
												 <th>Tot Amt</th><th>PAid</th><th>bal</th>

                     
                        </tr>
                      </thead>


                      <tbody>
										<?php  $tg = 0;
					while($row2=mysqli_fetch_array($qry))
						{ $tg++;
				
					?>
                                       
                                           <tr>
                                            <td><?php echo $tg;?></td>
                                               <td><?php echo $row2['name'];?></td>
						<td><?php echo $row2['date']; ?></td><td><?php echo $row2['vno']; ?></td>
						<td><?php echo $row2['vname']; ?></td>
						<?php $dd =$row2['vno']; $qry4=mysqli_query($conn, "select * from osales where vno='$dd'");
					$nn = mysqli_num_rows($qry4);
					if($nn>0) { ?>
					<td><button class="btn btn-danger">Sold</button></td>
					<?php } else { ?> 
					<td><button class="btn btn-success">Available</button></td>
					<?php } ?>
						<td><a href="hari1.php?id=<?php echo $row2['id'];?>&mfin=<?php echo $row2['mfin'];?>">Print Purchase</a></td>

						<td><a href="osales.php?hpl=<?php echo $row2['hpl'];?>&mfin=<?php echo $row2['mfin'];?>">Sale Now</a></td>

						
						 <td><?php echo $row2['color'];?></td>
						<td><?php echo $row2['model']; ?></td>
						<td><?php echo $row2['sizzing_no']; ?></td>
						 <td><?php echo $row2['engg_no'];?></td>
						<td><?php echo $row2['totamt']; ?></td>
						<td><?php echo $row2['adv']; ?></td>
						<td><?php echo $row2['bal']; ?></td>

						</tr>
                                          
										  
                                        <?php
						} 
				
				
					?></tbody>
                    </table>
                  </div>
                </div>
              </div>

             

            </div>
          </div>
        </div>
        <!-- /page content -->



  <?php include "layouts/footer.php"; ?>

  </body>
</html>