<?php
session_start();
include 'session_check.php';
include 'get_user_info.php';

$slt_data="select * from company_details,registration
        inner join product_purchase on registration.unique_user_id=product_purchase.purchase_user_id
        inner join product on product_purchase.purchase_product_id=product.product_id 
        where product_purchase.purchase_id='".$_REQUEST['id']."' ";
       
$con_data=mysqli_query($conn,$slt_data);
if(mysqli_num_rows($con_data)>0)
{
    while($slt_rows=mysqli_fetch_array($con_data))
    {
       
?>
<html>
	<head>
    <meta charset="UTF-8">
    <title>AdminLTE 2 | Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />    
    <!-- FontAwesome 4.3.0 -->
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Ionicons 2.0.0 -->
    <link href="https://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />    
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins 
         folder instead of downloading all of them to reduce the load. -->
    <link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <!-- Morris chart -->
    <link href="plugins/morris/morris.css" rel="stylesheet" type="text/css" />
    <!-- jvectormap -->
    <link href="plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
    <!-- Date Picker -->
    <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker -->
    <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
    <!-- bootstrap wysihtml5 - text editor -->
    <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

   <!-----		sweet alert css and js link	---->
	<link rel="stylesheet" href="dist/sweetalert.css">
	<script src="dist/sweetalert.min.js"> </script>
   
	<link rel="stylesheet" type="text/css" href="custom/custom.css">
	<!---- Ck editor-->
	 <script src="ckeditor/ckeditor.js"></script>
	 <!-----	custom css	------>
	 <link rel="stylesheet" href="css/custom_css.css">
	 
	 <!---  css for tree  ---->
	 <link href="css/main.css" rel="stylesheet" type="text/css">
	 <!----    data table css file   ---->
	  <link href="DataTables/datatables.min.css" rel="stylesheet" type="text/css">
	  <style>
	    .print_data span{
	        font-weight: normal;
	        font-size: 15px;
	    }
	    .all_show_fields{
	        border: none;
	        outline: none;
	        width: 100%;
	    }
	    .title_cls{
	        padding: 5px 10px;
	        font-weight: 500;
	        font-size: 14px;
	    }
	    .details_cls{
	         padding: 5px 10px;
	         font-size: 12px;
	         line-height: 21px;
	    }
	    .box{
	       box-shadow: inset 0 1px 20px 16px rgba(0,0,0,0.1)
	    }
	    .bottom_cls{
	        padding: 7px 20px;
	    }
	    .price_cls{
	        padding: 7px 50px;
	    }
	  </style>
  </head>
  <body style="background-color: #fff"> 
        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
              <div class="box">
                <div class="row">
                    <h4 class="text-center" style="font-weight: bold"> Invoice report </h4>
                </div>
                <div class="row">
				   <div class="col-sm-6">
				       <div class="row text-center">
				           <h4 style="font-size: 20px">Company details</h4>
				       </div>
				       <div class="row">
				           <div class="col-sm-9 col-lg-offset-3" style="padding: 10px 20px">
				               <table>
				                   <tr>
				                       <td class="title_cls">
				                          Name :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['company_name'];?>
				                       </td>
				                   </tr>
				                  <tr>
				                       <td class="title_cls">
				                          Business :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['business_name'];?>
				                       </td>
				                   </tr>
				                   <tr>
				                       <td class="title_cls">
				                          Email :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['company_email'];?>
				                       </td>
				                   </tr>
				                   <tr>
				                       <td class="title_cls">
				                          Registration number :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['registration_number'];?>
				                       </td>
				                   </tr>
				                   <tr>
				                       <td class="title_cls">
				                          GST number :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['gst_number'];?>
				                       </td>
				                   </tr>
				                   <tr>
				                       <td class="title_cls">
				                          Address :
				                       </td>
				                       <td class="details_cls">
				                          <?php echo $slt_rows['company_address'];?>
				                       </td>
				                   </tr>
				               </table>
				           </div>
				       </div>
				   </div>
				   <div class="col-sm-6 text-center">
				        <h4 style="font-size: 20px">Customer details</h4>
            			<div class="row">
    			           <div class="col-sm-9 col-lg-offset-3" style="padding: 10px 20px">
    			               <table>
    			                   <tr>
    			                       <td class="title_cls">
    			                          Name :
    			                       </td>
    			                       <td class="details_cls">
    			                          <?php echo $slt_rows['user_name'];?>
    			                       </td>
    			                   </tr>
    			                    <tr>
    			                       <td class="title_cls">
    			                          Gender :
    			                       </td>
    			                       <td class="details_cls">
    			                          <?php echo $slt_rows['gender'];?>
    			                       </td>
    			                   </tr>
    			                  <tr>
    			                       <td class="title_cls">
    			                          Email :
    			                       </td>
    			                       <td class="details_cls">
    			                          <?php echo $slt_rows['user_email'];?>
    			                       </td>
    			                   </tr>
    			                   <tr>
    			                       <td class="title_cls">
    			                          Mobile :
    			                       </td>
    			                       <td class="details_cls">
    			                          <?php echo $slt_rows['user_mobile'];?>
    			                       </td>
    			                   </tr>
    			                   <tr>
    			                       <td class="title_cls">
    			                          Address :
    			                       </td>
    			                       <td class="details_cls">
    			                          <?php echo $slt_rows['user_address'];?>
    			                       </td>
    			                   </tr>
    			               </table>
    			           </div>
            			</div>
        		   </div>
				   
                </div><!-- /.row -->
                <div class="row">
                    <div class="col-sm-4 col-sm-offset-8">
                        <hr>
                        <?php
                        $date=explode(' ',$slt_rows['purchase_date']);
                        ?>
                        <div style="font-size: 16px;padding: 5px 40px; font-weight: 800"><?php echo $slt_rows['product_name'] .'[ <span style="font-size: 13px">' .$date[0]. '</span> ]';?></div>
                        <table>
                            <tr>
                                <td class="bottom_cls">
                                    Sub total :
                                </td>
                                <td class="price_cls">
                                    <?php echo $slt_rows['purchase_product_price'];?>
                                </td>
                            </tr>
                            <tr>
                                <td class="bottom_cls">
                                    TAX amount :
                                </td>
                                <td class="price_cls">
                                    <?php echo $slt_rows['tax_amount'];?>
                                </td>
                            </tr>
                            <tr>
                                <td class="bottom_cls">
                                    Total :
                                </td>
                                <td class="price_cls">
                                    <?php echo $slt_rows['purchase_product_price']+$slt_rows['tax_amount'];?>
                                </td>
                            </tr>
                        </table>
                        <br>
                    </div>
                </div>
              </div><!-- /.box -->
              
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->


	 <!-- jQuery 2.1.3 -->
    <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
     <?php
    if($status=='Deactive')
    {
        include 'modal_show.php';
    }
    }
}
    ?>
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>    
    <!-- Morris.js charts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <!--<script src="plugins/morris/morris.min.js" type="text/javascript"></script>-->
    <!-- Sparkline -->
    <script src="plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
    <!-- jvectormap -->
    <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
    <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
    <!-- jQuery Knob Chart -->
    <script src="plugins/knob/jquery.knob.js" type="text/javascript"></script>
    <!-- daterangepicker -->
    <script src="plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
    <!-- datepicker -->
    <script src="plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
    <!-- iCheck -->
    <script src="plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <!-- Slimscroll -->
    <script src="plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='plugins/fastclick/fastclick.min.js'></script>
    <!-- AdminLTE App -->
    <script src="dist/js/app.min.js" type="text/javascript"></script>
    <!--  Data table js link   --->
    <script src="DataTables/datatables.min.js"></script>
</body>
</html>

