<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start();
$ver2=$_SESSION['customer_id'];
$ver = $_SESSION['distributor_user_id'];
$user_role= $_SESSION['user_role'];
if(!isset($_SESSION["distributor_user_id"])){
   header('location:https://tarkashcorp.appexperts.net/index.php');
}

$id=$_GET['id'];
$cid=$_GET['cid'];

include("link_head.php");
?>
<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.7
Version: 4.7.5
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Follow: www.twitter.com/keenthemes
Dribbble: www.dribbble.com/keenthemes
Like: www.facebook.com/keenthemes
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
Renew Support: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->

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

<html lang="en">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title>Tarkashcorp | Admin Dashboard</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <meta content="Preview page of Metronic Admin Theme #6 for blank page layout" name="description" />
        <meta content="" name="author" />
        <!-- BEGIN LAYOUT FIRST STYLES -->
        <link href="//fonts.googleapis.com/css?family=Oswald:400,300,700" rel="stylesheet" type="text/css" />
        <!-- END LAYOUT FIRST STYLES -->
        <!-- BEGIN GLOBAL MANDATORY STYLES -->
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
        <!-- END GLOBAL MANDATORY STYLES -->
        <!-- BEGIN THEME GLOBAL STYLES -->
        <link href="../assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
        <link href="../assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME GLOBAL STYLES -->
        <!-- BEGIN THEME LAYOUT STYLES -->
        <link href="../assets/layouts/layout6/css/layout.min.css" rel="stylesheet" type="text/css" />
        <link href="../assets/layouts/layout6/css/custom.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME LAYOUT STYLES -->
        <link rel="shortcut icon" href="favicon.ico" />
<!--	<style>
		::-webkit-scrollbar {
			display: none;
			overflow: hidden;
		}
		</style>
		<script>
		window.onscroll = function () {
		window.scrollTo(0,0);
		}
		</script>-->
		</head>
    <!-- END HEAD -->

    <body class="">
        <!-- BEGIN HEADER -->
		<?php include("header.php");?>
        <!-- END HEADER -->

        <!-- BEGIN CONTAINER -->
        <div class="container-fluid">
            <div class="page-content page-content-popup" style="margin-top:18px; max-height:542px;">
                <div class="page-sidebar-wrapper">
                    <!-- BEGIN SIDEBAR -->
                    <?php include("menu.php");?> 
				    <!-- END SIDEBAR -->
                </div>
                <div class="page-fixed-main-content">
					<div class="row">
						<div class="col-md-12">
							<!-- BEGIN SAMPLE TABLE PORTLET-->
							<div class="portlet">
							<div class="portlet-title">
							<div class="caption">
								   <i class="fa fa-bell-o"></i>All Orders
							</div>
							<div class="actions">										
							   <div class="form-group">
									<a href="customer-orders.php?id=<?=$cid; ?>"><button type="submit" style="padding:3px 10px;" class="btn btn-outline btn-circle blue btn-sm blue" name="searchd">Back </button></a>
								</div>
                            </div>
							</div>
							<div class="portlet-body" style="padding-bottom:0; margin-bottom:0.8%; height:390px; overflow-Y:scroll; overflow-X:hidden; padding-top:0;">
								<div class="table-scrollable" style="padding-top:0; margin-bottom:0; padding-bottom:0; padding-top:0;">
									<table class="table table-striped table-bordered table-advance table-hover" style="padding-top:0; margin-bottom:0; padding-bottom:0; padding-top:0;">
										<thead>
										<tr>
											<th><b>S.No</b></th>
											<th><b>Customer Name</b></th>
											<th><b>Product Name</b></th>
											<th><b>Customer Transaction id</b></th>
											<th><b>Quantity</b></th>
											<th><b>MRP</b></th>
											<th><b>Price</b></th>
									<!--	<th><b>CGST Amount</b></th>
											<th><b>SGST Amount</b></th>-->
											<?php //if($user_role=="All") { ?>
										<!--	<th><b>Action</b></th> -->
											<?php //} ?>
										</tr>
										</thead>
										<tbody>
										<?php
										$c=1;
										$res=mysqli_query($con,"select * from tbl_master_customer,tbl_transaction,tbl_transaction_detail,tbl_master_product where tbl_transaction.transaction_id=tbl_transaction_detail.transaction_id and tbl_master_product.product_id=tbl_transaction_detail.product_id and tbl_transaction.customer_id=tbl_master_customer.customer_id and tbl_master_customer.distributor_id='$ver' and tbl_transaction.transaction_id='$id'");
										if(mysqli_num_rows($res)>0)
										{
										 while($fetch_product=mysqli_fetch_assoc($res))
										 {	extract($fetch_product);
										?>
										<tr>
											<td title="S.No."><?php echo $c++; ?></td>
											<td> <?=$customer_name; ?></td>
											<td> <?=$product_name; ?></td>
											<td> <?=$customer_transaction_id; ?></td>
											<td> <?=$quantity; ?></td>
											<td> <?=$mrp; ?></td>
											<td> <?=$price; ?></td>
									<!--	<td> <?=$cgst_amount; ?></td>
											<td> <?=$sgst_amount; ?></td>-->
											<?php // if($user_role=="Admin") { ?>
										<!--	<td>
											<a href="edit-order-detail.php?id=<?php // echo $transaction_id;?>" class="btn btn-outline btn-circle btn-sm blue" title="Order Detail"><i class="fa fa-pencil-square-o"></i></a>
											<?php // if($status=='Deactive') { ?>
											<!--  <a href="customer-status.php?id=<?php // echo $customer_id;?>" onClick="return confirm('Are you sure to edit this status')" class="btn btn-outline btn-circle red btn-sm blue">Activate</a>
											<?php // } else { ?>
											  <a href="customer-status.php?id=<?php // echo $customer_id;?>" onClick="return confirm('Are you sure to edit this status')" class="btn btn-outline btn-circle red btn-sm blue">Deactivate</a> -->
											<?php // } ?>
											</td>
											<?php // } ?>
											</tr>
											<?php } } else { echo "No Data Available"; } ?>
										</tbody>
									</table>
								</div>
							</div>
								
								<?php 
								if(!isset($_POST['searchd']))
								{ /*
									$res1  = mysqli_query($con,"select * from tbl_acc_m_bank where distributor_id='$ver' and status in ('Active','Deactive')");
									$cou = mysqli_num_rows($res1); 
									$total_pages = $cou/10;
									$total_pages =ceil($total_pages);
									echo " <ul class='pagination pagination-sm no-margin pull-right'><li><a href='user-detail.php'>".'First'."</a></li> ";
									for ($i=1; $i<=$total_pages; $i++) { 
												echo "<li><a href='user-detail.php?page=".$i."'>".$i."</a> </li>";
									}; 
									echo "<li><a href='user-detail.php?page=".$total_pages."'>".'Last'."</a></li></ul> "; */
								}
								?>
									
							</div>
							<!-- END SAMPLE TABLE PORTLET-->
						</div>   
					</div>
				</div>				
                <!-- BEGIN FOOTER 
                <p class="copyright-v2"> 2018 &copy;
                    <a target="_blank" href="http://www.belltechnology.in">Bell Technology</a>
                </p>
                <a href="#index" class="go2top">
                    <i class="icon-arrow-up"></i>
                </a>
                <!-- END FOOTER -->
            </div>
			<div class="copyright-v2" style="padding:3px; margin-top:-18px;">
		    <?=date("Y")?> &copy; Tarkashcorp Developed By <a target="_blank" href="http://www.belltechnology.in">Bell Technology</a>
           </div>
        </div>
        <!-- END CONTAINER -->
        <!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script> 
<script src="../assets/global/plugins/ie8.fix.min.js"></script> 
<![endif]-->
        <!-- BEGIN CORE PLUGINS -->
        <script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
        <script src="../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
        <!-- END CORE PLUGINS -->
        <!-- BEGIN THEME GLOBAL SCRIPTS -->
        <script src="../assets/global/scripts/app.min.js" type="text/javascript"></script>
        <!-- END THEME GLOBAL SCRIPTS -->
        <!-- BEGIN THEME LAYOUT SCRIPTS -->
        <script src="../assets/layouts/layout6/scripts/layout.min.js" type="text/javascript"></script>
        <script src="../assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
        <script src="../assets/layouts/global/scripts/quick-nav.min.js" type="text/javascript"></script>
        <!-- END THEME LAYOUT SCRIPTS -->
        <script>
            $(document).ready(function()
            {
                $('#clickmewow').click(function()
                {
                    $('#radio1003').attr('checked', 'checked');
                });
            })
        </script>
    </body>

</html>