<?php
	// Inialize session
	session_start(0);
	error_reporting(0);
	include("config.php");
	$user=$_SESSION['username'];

	 include("include/functions.php");
	 if(isset($_REQUEST['submit']))
	 {
	 $payno=$_REQUEST['payno'];
	 $oid=$_REQUEST['oid'];

	 $query_select2=mysql_query("select * from  orders where order_id='$oid'");
	 $run_query2=mysql_fetch_array($query_select2);
	 $date=$run_query2['date'];
	 $amount=$run_query2['tot_amount'];
	  
	  
	 $query_select=mysql_query("select * from  bank1 order by id desc ");
	 $run_query=mysql_fetch_array($query_select);
	 $collection=$run_query['collection'];
	 $collection2=$collection+$amount;
	
	 $close=$run_query['closecash'];
	 $clos=$close+$amount;
	 $update=mysql_query("update bank1 set closecash='$clos',collection='$collection2' where cashdate='$date'");   
  
	 $update3=mysql_query("update orders set paymentno='$payno' where order_id='$oid'");
	 header("Location:lastpage.php?pay=add");
	 }
?>
<!DOCTYPE HTML>
<html>
	<head>
		<title>Paramount Textile Mills</title>
		<link href="css/style.css" rel='stylesheet' type='text/css' />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
		</script>
		<!----webfonts---->
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
		<!----//webfonts---->
		<!----start-alert-scroller---->
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/jquery.easy-ticker.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){
			$('#demo').hide();
			$('.vticker').easyTicker();
		});
		</script>
		<!----start-alert-scroller---->
		<!-- start menu -->
		<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
		<script type="text/javascript" src="js/megamenu.js"></script>
		<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
		<script src="js/menu_jquery.js"></script>
		<!-- //End menu -->
		<!---slider---->
		<link rel="stylesheet" href="css/slippry.css">
		
		
		<!---//move-top-top---->
       </head>
	<body>
		<!---start-wrap---->
			<!---start-header---->
			<?php include("include/header.php"); ?>
<div class="main">
		<div class="container">
               <?php
        $select1="select * from user_account where username='$user'";
$result1=mysql_query($select1); 
$exc=mysql_fetch_array($result1);

?>
            <div class="center_text">
        	             
              <?php 
			  
	      $id = mysql_query("SELECT order_id FROM orders where email='$user' ORDER BY serial DESC");
		$id = mysql_fetch_array($id);
	      $order_id=$id['order_id'];
	      $inc=$order_id;
					
					
		if($_REQUEST['ad']!='su')
			{
				echo "";
			}
		else
			{
				echo "<div style='margin-left:5px;font-family:georgia; color:red'>Thank You! your order has been placed! 
				Your Ordered ID<font color='green'> '$Order_Id'</font></div>" ;     
				
			}
			
			?> 
            
     <?php

$select="select * from orders where order_id='$Order_Id'";
$result=mysql_query($select);
$row = mysql_fetch_array($result);

 $order_id=$row['order_id'];
$order_tot=$row['tot_amount'];
?>
       

<?php
if($_REQUEST['pay'] == 'add') {echo $result= '<h4 class="alert_success" style="color:#4CB034;"> Added Successfully </h4>';}
?>																																							       
    
     <form action="" method="post" enctype="multipart/form-data">
        
        
  
             
    
        Please Enter Your Payment Number
        <p><input type="text" name="payno"  value="Transaction ID" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Transaction ID';}"></p><br>
       <input type="submit" name="submit" value="Submit" style="background-color:#00679A; color:#FFF; width:150px; height:30px; margin-bottom:20px;">
            
        </div>
        
        
        </form>
        </div>
        </div>
        </div>
      
   <?php include("include/footer.php"); ?>
