<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{
include 'dbc.php';
$username=$_SESSION["username"];
$current_file_name = basename($_SERVER['PHP_SELF']);
$sql = "SELECT * FROM adduser where feedisc2 = '$current_file_name' and uname = '$username'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$status=$row['feedisc3'] ;

if ($status =="")
{
echo "You are not Authorized This Page <a href='maindashboard.php'>Back </a> ";
}
else
{

include 'dbc.php';
$userid=$_SESSION["userid"];
$username=$_SESSION["username"];
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		
		
		 $my=$month_name . " " . $year;
		 
		$id=$_REQUEST["id"];
$sql = "SELECT * FROM cashrec where id = '$id' and user_id='$userid'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$date=$row['date'] ;
$ven_name=$row['ven_name'] ;
$netamount=$row['netamount'] ;
$remarks=$row['remarks'] ;
$wh_tax=$row['wh_tax'] ;
$chequeno=$row['chequeno'] ;
$bankname=$row['bankname'] ;

?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

  
    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

             <?php include("includes/receipt_menu.php") ?>

        </header><!-- /header -->
        <!-- Header-->

        <div class="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">

           


          <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header"><strong> Customer Receipt</strong><small> Form</small></div>
                            <div class="card-body card-block">
							<form action="Edit_Receipt_Save.php" method="post" enctype="multipart/form-data" class="form-group">
							
							
							<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> id</label><input type="text" id="id" name="id" placeholder="ID" class="form-control" value="<? echo $id ?>" readonly></div>
								</div>
							
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> Date</label><input type="text" id="date" name="date" placeholder="Date" class="form-control" value="<? echo $today ?>"></div>
								</div>
																
								
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label">User </label><input type="text" id="username" name="username" placeholder="User Name" class="form-control" value="<? echo $username ?>" readonly></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label">Customer Name </label><input type="text" id="ven_name" name="ven_name" placeholder="User Name" class="form-control" value="<? echo $ven_name ?>" readonly></div>
								</div>
								
								
												
								
								<div class="col-12">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> Description</label><input type="text" id="remarks" name="remarks" placeholder="Description" class="form-control" value="<? echo $disc ?>"></div>
								</div>
								
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> Amount </label><input type="text" id="amount" name="amount" placeholder="Amount" class="form-control" value="<? echo $netamount ?>"></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> W.H.Tax </label><input type="text" id="wh_tax" name="wh_tax" placeholder="W.H.Tax" class="form-control" value="<? echo $wh_tax ?>"></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> Cheque No </label><input type="text" id="chequeno" name="chequeno" placeholder="Cheque No" class="form-control" value="<? echo $chequeno ?>"></div>
								</div>
								<div class="col-3">
                                <div class="form-group"><label for="feedisc1" class=" form-control-label"> Bank Name </label><input type="text" id="bankname" name="bankname" placeholder="Bank Name " class="form-control" value="<? echo $bankname ?>"></div>
								</div>
								
								
								
								
									
										
				
													
                                                    </div>
													<div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i>  Update Debit Note
                                                        </button>
                                                       
                                                    </div>
													
													</form>
                                                </div>
                                            </div>

            


        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}

}
?>