<?PHP 
include("header.php");
//session_start();
//error_reporting(0);
include "checksession.php";
include "include/db-connect.php";
?>


  <div id="content">
  <div class="breadcrumb">
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" /> Order Product Details</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:100%; margin-left:0px;">
        <div class="dashboard-heading">Order Product Details</div>
<div class="dashboard-heading"><a href="invoice_gen.php?oid=<?PHP echo $order_id=$_REQUEST['order_id'];?>"><img src="images/inv.jpg" width="150" /></a></div>
         <div class="dashboard-heading"><a href="tot_purchase.php"><img src="images/bac.jpg" width="50" /></a></div>
        <div class="dashboard-content">
  <table class="list" cellspacing="0" > 
			<thead> 
                 <tr>
                    <td class="left">Order ID</td>
                    <td class="left">Product Id</td> 
                    <td class="left">Category</td> 
                    <td class="left">Sub-category</td> 
                    <td class="left">Sub-Sub-category</td> 
                    <td class="left">Product Name</td>  
                    <td class="left">Quantity</td> 
              </tr>
              </thead>
			<tbody> 
           <?php 
				$qur="SELECT * FROM `profit` where `order_id`='$order_id' order by `id` asc"; 
		$result = mysql_query($qur)or die('Have an error in viewing data'.mysql_error());
		while($row_section = mysql_fetch_array($result)) 
			{
				$pid=$row_section['product_id'];
				
				$qusadasdr="SELECT * FROM `products` where `serial`='$pid'"; 
				$reasdasult = mysql_query($qusadasdr);
				$row_secasdad = mysql_fetch_array($reasdasult);
				$name=$row_secasdad['name'];
				if($pid!=NULL){
			  ?>	    
			    <tr> 
    				<td class="left"><?php echo $row_section['order_id']; ?></td>
                    <td class="left"><?php echo $row_section['product_id']; ?></td>
                    <td class="left"><?php echo $row_secasdad['category']; ?></td>
                    <td class="left"><?php echo $row_secasdad['sub_category']; ?></td>
                    <td class="left"><?php echo $row_secasdad['sub_sub_cat']; ?></td>
                    <td class="left"><?php echo $name; ?></td>
                    <td class="left"><?php echo $row_section['quantity']; ?></td>
				</tr> 	 
<?php } } ?> 
			</tbody> 
			</table>
        </div>
        <div align="right"><?php echo $pagination; ?> 	</div>	
      </div>
      <!-- <div class="overview" style="width:80%; height:250px; margin-left:200px;">
        <div class="dashboard-heading">  Purchase Tax By Date</div>
        <div class="dashboard-content">
        <div><h3>total sales profit&nbsp;=&nbsp;Rs.<?php echo $row[0]; ?></h3></div>
<div style="margin-bottom:10px; margin-top:10px; margin-left:20px;"><!--<a href="javascript: history.go(-1)"><img src="images/bac.jpg"></a>--></div>
</article>
 <!--<form method="post" id="client" enctype="multipart/form-data" action="">
           	    <div class="clear"></div>
				<article class="module width_3_quarter" style="margin-left:10px; width:1000px;">
				<header>
		  		<h3 class="tabs_involved" style="margin-left:5px; color:#033;">Sales Profit By Date</h3>
				</header>
				<div class="tab_container">
                <div class="mainrow">
                <div class="maintext">Start Date<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox">
                <input type="text" required class="TextBox" name="from_date" id="f_date_b1">
				<img src="images/cal.gif" id="f_trigger_b1" >
				<script type="text/javascript">
				Calendar.setup({inputField :"f_date_b1",ifFormat:"%Y-%m-%d",showsTime:true,button:"f_trigger_b1",singleClick:true});
				</script>
                </div>
                </div>
                
                <div class="mainrow">
                <div class="maintext">End Date<font color="#FF0000"><b> * </b></font> </div>
                <div class="maintextbox">
                <input type="text" required class="TextBox" name="to_date" id="f_date_b2">
				<img src="images/cal.gif" id="f_trigger_b2" >
				<script type="text/javascript">
				Calendar.setup({inputField :"f_date_b2",ifFormat:"%Y-%m-%d",showsTime:true,button:"f_trigger_b2",singleClick:true});
				</script>
                </div>                 
                </div>
                
                <div class="mainrow">
    			<div class="maintext"><font color="#FF0000"><b></b></font> </div>
                <div class="maintextbox"><input type="submit" name="submit"value="Submit" ></div>
                </div>
                </div>
                
 				</form>
                 <script type="text/javascript">
						function formCallback(result, form) 
						{
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}
						var valid = new Validation('client', {immediate : true, onFormValidate : formCallback});
						Validation.addAllThese([
							['validate-password-confirm', 'Your confirmation password does not match your first password, please try again.', {
								equalToField : 'confirm_password'
							}]
						]);
					</script>
                  </div>
                </div>  
                </div></div>
                
                
                 <div class="overview" style="width:80%; margin-left:200px;">
        <div class="dashboard-heading">  Purchase Tax By Date</div>
        <div class="dashboard-content">
             <form method="post" id="profit_id" enctype="multipart/form-data" action="">
  				<div class="clear"></div>
				<article class="module width_3_quarter" style="margin-left:-2px; width:1000px; height:150px;">
				<header>
		  		<h3 class="tabs_involved" style="margin-left:5px; color:#033;">Sales Profit by product id</h3>
				</header>
				<div class="tab_container">
                <div class="mainrow">
                <div class="maintext">Product ID<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox"> <select  name="product_id">
                            <option value="">Select Product ID</option>
                             <?php
               					 $select="select * from ".$PRODUCT."";
								 $result=mysql_query($select);
							 	 while ($row = mysql_fetch_array($result)){ 
							?>
                            <option value="<?php echo $row['product_id']; ?>"><?php echo $row['product_id'];?> </option>
                            <?php } ?>
                            </select></div>
                </div>
                
                <div class="mainrow" style="margin-left:20px;">
    			<div class="maintext"><font color="#FF0000"><b></b></font> </div>
                <div class="maintextbox"><input type="submit" name="pid"value="Submit" ></div>
                </div>
                </div>
                </div>
                </div>
 				</form>
                 <script type="text/javascript">
						function formCallback(result, form) 
						{
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}
						var valid = new Validation('profit_id', {immediate : true, onFormValidate : formCallback});
						Validation.addAllThese([
							['validate-password-confirm', 'Your confirmation password does not match your first password, please try again.', {
								equalToField : 'confirm_password'
							}]
						]);
					</script>
      </div></div></div>-->
      
      
    </div>
  </div>
</div>
</div>
<?php include("footer.php"); ?>