System: Windows NT WINDOWS18 10.0 build 17763 (Windows Server 2016) AMD64 | User: IWPD_3544(appclien)

Path: D:\Inetpub\vhosts\appclients.in\fruits-vegitables.nmvm.org

[Back to List]
<?php
include "includes/main-action.php";
$obj=new admin_main();
$sel_cs=$obj->select_all("menu","order by menu_id");
$sel_banner_top=$obj->select_all("adv_tbl1","order by adv_id desc limit 1");
$sel_banner_right=$obj->select_all("adv_tbl3","order by adv_id desc limit 2");
$sel_slider=$obj->select_all("adv_tbl2","order by adv_id desc");
//select order details
$result_my_order=$obj->select_all("cart","where reg_id='$_SESSION[user_id]' AND orderBy='customer' group by code_id order by id desc");
//update table cart
if(isset($_POST['CancellOrder'])){
   if(mysqli_query($con,"update cart set cancellation_sts='1',cancelled_reason='$_REQUEST[canReason]' where code_id='$_REQUEST[order_id]'")){
	?>
<script>
	alert("Status updated successfully");
	window.location.href="<?php echo $_SERVER['HTTP_REFERER'];?>";
	</script>
<?php
	}
	else{
	?>
<script type="text/javascript">
		alert("Error! Data Not Deactive");
		window.location.href="<?php echo $_SERVER['HTTP_REFERER'];?>";
		</script>
<?php 
	}
} 
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Order</title>
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="author" content="">
<meta name="robots" content="index, follow" />
<!-- Mobile specific metas
    ============================================ -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Favicon
    ============================================ -->
<link rel="shortcut icon" type="image/png" href="<?php echo $url?>image/icon/favicon.png"/>
<!-- Libs CSS
    ============================================ -->
<link rel="stylesheet" href="<?php echo $url?>css/bootstrap/css/bootstrap.min.css">
<link href="<?php echo $url?>css/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="<?php echo $url?>js/datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="<?php echo $url?>js/owl-carousel/owl.carousel.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/lib.css" rel="stylesheet">
<link href="<?php echo $url?>js/jquery-ui/jquery-ui.min.css" rel="stylesheet">
<link href="<?php echo $url?>js/minicolors/miniColors.css" rel="stylesheet">
<!-- Theme CSS
    ============================================ -->
<link href="<?php echo $url?>css/themecss/so_searchpro.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/so_megamenu.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/so-categories.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/so-listing-tabs.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/so-category-slider.css" rel="stylesheet">
<link href="<?php echo $url?>css/themecss/so-newletter-popup.css" rel="stylesheet">
<link href="<?php echo $url?>css/footer/footer2.css" rel="stylesheet">
<link href="<?php echo $url?>css/header/header2.css" rel="stylesheet">
<link id="color_scheme" href="<?php echo $url?>css/home2.css" rel="stylesheet">
<link href="<?php echo $url?>css/responsive.css" rel="stylesheet">
<!-- Google web fonts
    ============================================ -->
<link href='https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700' rel='stylesheet' type='text/css'>
<style type="text/css">
         body{font-family:'Poppins', sans-serif}
    </style>
</head>
</head>
<body class="res layout-1 layout-subpage">
<div id="wrapper" class="wrapper-fluid banners-effect-5">
<!-- Header Container  -->
<?php include "includes/topbar.php";?>
<!-- //Header Top -->
<!-- Header center -->
<?php include "includes/searchbar.php";?>
<!-- //Header center -->
<!-- Header Bottom -->
<?php include "includes/navbar.php";?>
</header>
<!-- //Header Container  -->
<!-- Main Container  -->
<div class="main-container container" style="margin-bottom:30px">
  <ul class="breadcrumb">
    <li><a href="<?php echo $url?>"><i class="fa fa-home"></i></a></li>
    <li><a>My Orders</a></li>
  </ul>
  <div class="row">
    <div class="col-sm-1"></div>
    <div id="content" class="col-sm-10">
      <div class="" style="overflow-x:scroll">
	  <style>
	  #tableHeight{height:200px; overflow-y:scroll;}
	  </style>
          <table cellpadding="0" cellspacing="0" border="0" class="display table table-bordered">
            <thead>
              <tr>
                <th>Order ID</th>
                <th>Product Info</th>
				<th>Shipping Charge</th>
				<th>Total Amount</th>
				<th>Order Date</th>
				<th>#</th>
				<th>Status</th>
              </tr>
            </thead>
            <tbody>
              <?php while($row=mysqli_fetch_array($result_my_order)){?>
              <tr class="gradeA">
				<td class="center hidden-phone"><?php echo $row['code_id'];?></td>
				<td class="center hidden-phone">
				 <table width="100%" border="1">
		  <?php
		  //select list as order ID
		  $tatalAMT = 0;
		  $result_1=$obj->select_all("cart","where reg_id='$_SESSION[user_id]' AND orderBy='customer' AND code_id='$row[code_id]' order by id desc");
		  while($row_1=mysqli_fetch_array($result_1)){
			  $sel_d=mysqli_query($con,"select * from product where id='$row_1[product_id]'") or die(mysqli_error());
			  $row_data=mysqli_fetch_array($sel_d);
			  $size = $row_1['Size'];
			  $price = $row_1['Color'];
			  $dcd_img=json_decode($row_data['img']);
			  $tatalAMT = $tatalAMT+$price*$row_1['quantity'];
		  ?>
			<tr>
			<td>&nbsp;<img src="<?php echo $url?>image/product/<?php echo $dcd_img[0]; ?>" style="height:80px; padding:5px" /></td>
			<td>
				&nbsp;<?php
			    echo $row_data['name']; 
			    if(!empty($size))echo "<br>&nbsp;".$size; 
			    if(!empty($row_1['Size']))echo "<br>&nbsp;<b>Quantity:</b>&nbsp;&nbsp;".$row_1['quantity'];?>
				<br />&nbsp;<b>Price: </b>&nbsp;&nbsp; <?php echo $price?>
			</td>
			</tr>
			<tr><td colspan="2"><hr style="1px solid #cccccc66; width:100%" /></td></tr>
		  <?php }
		  $orderDate = date('d-m-Y',$row['order_date']);
		  ?>
          </table>
				</td>
				<td><?php echo $row['tot_shipping_charge']?></td>
                <td><?php echo $tatalAMT+$row['tot_shipping_charge']?></td>
				<td class="center hidden-phone"><?php echo $orderDate ?></td>
				<td class="center hidden-phone">
    <?php
    // Assuming $orderDate is in 'd-m-Y' format
    $new_date = date('d-m-Y', strtotime($orderDate . ' +3 days'));
    $currentDate = date('d-m-Y');
    ?>
    <?php if (strtotime($currentDate) < strtotime($new_date)) { ?>
        <a data-toggle="modal" data-target="#myModal<?php echo $row['product_id'] ?>">Request for<br>Cancellation</a>
        <!-- Modal -->
        <div id="myModal<?php echo $row['product_id'] ?>" class="modal fade" role="dialog">
            <div class="modal-dialog">
                <!-- Modal content-->
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title">Reasons for cancellation of online order</h4>
                    </div>
                    <div class="modal-body">
                        <form method="post">
                            <input type="hidden" name="rowId" value="<?php echo $row['product_id'] ?>">
                            <input type="hidden" name="order_id" value="<?php echo $row['code_id'] ?>">
                            <textarea name="canReason" class="form-control"></textarea><br>
                            <input type="submit" name="CancellOrder" value="submit" class="btn btn-primary">
                        </form>
                    </div>
                </div>
            </div>
        </div>
    <?php } ?>
</td>

				<td class="center hidden-phone" style="color:red">
				<?php if($row['status']=='Cancelled')echo "<font color='#ff5c01'>".$row['status']."</font>"; else echo $row['status'];?>
				</td>
              </tr>
              <?php } ?>
            </tbody>
          </table>
        </div>
    </div>
  </div>
</div>

<!-- //Main Container -->
<!-- Footer Container -->
<?php include "includes/footer.php" ?>
<!-- Include Libs & Plugins
	============================================ -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="<?php echo $url?>js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/owl-carousel/owl.carousel.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/slick-slider/slick.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/themejs/libs.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/unveil/jquery.unveil.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/countdown/jquery.countdown.min.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/dcjqaccordion/jquery.dcjqaccordion.2.8.min.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/datetimepicker/moment.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/jquery-ui/jquery-ui.min.js"></script>
<!-- Theme files
	============================================ -->
<script type="text/javascript" src="<?php echo $url?>js/themejs/so_megamenu.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/themejs/addtocart.js"></script>
<script type="text/javascript" src="<?php echo $url?>js/themejs/application.js"></script>
</body>
</html>