
<?php
include"header.php";
?>

  <!-- Navbar -->
<?php
include"nav_style.php";
?>
  <!-- /.navbar -->
  
    <!-- /.aside start -->
	<?php
include"aside_style.php";
?>
	  <!-- /.aside end --> 
 
 
 
 <?php
			  include"config.php";
$hidden=$_POST['hidden'];

$sql="select * from expense where expense_id='$hidden'";
$result=mysqli_query($conn,$sql);

if(mysqli_num_rows($result)>0) 
{
	$row=mysqli_fetch_assoc($result);
	
	echo" 
 <div class='content-wrapper'>
    <!-- Content Header (Page header) -->
    <section class='content-header'>
      <div class='container-fluid'>
        <div class='row mb-2'>
          <div class='col-sm-6'>
            <h1>Update Product</h1>
          </div>
          <div class='col-sm-6'>
            <ol class='breadcrumb float-sm-right'>
              <li class='breadcrumb-item'><a href='#'>Home</a></li>
              <li class='breadcrumb-item active'>Update Product</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class='content'>

      <!-- Default box -->
      <div class='card'>
        <div class='card-body row'>
          <div class='col-5 text-center d-flex align-items-center justify-content-center'>
            <div class=''>
              
            </div>
          </div>
          <div class='col-7'>
		  <form action='expense_update_action.php' method='POST'>
            <div class='form-group'>
              <label for='inputName'>Expense Title</label>
              <input type='text' name='expense_title' id='inputName' class='form-control' value='".$row['expense_title']."' />
            </div>
            <div class='form-group'>
              <label for='inputName'>Expense Amount</label>
              <input type='number' name='expense_amount' id='inputName' class='form-control' value='".$row['expense_amount']."' />
            </div>
			
			 <div class='form-group'>
              <label for='inputName'>Payment Method</label>
              <input type='text' name='e_pay_method' id='inputName' class='form-control' value='".$row['e_pay_method']."' />
            </div>
			
			 <div class='form-group'>
              <label for='inputName'>Acconted to</label>
              <input type='text' name='expense_account' id='inputName' class='form-control' value='".$row['expense_account']."' />
            </div>
			
			 <div class='form-group'>
              <label for='inputName'>Issued on</label>
              <input type='date' name='expense_issed_on' id='inputName' class='form-control' value='".$row['expense_issed_on']."'/>
            </div>		

			<div class='form-group'>
              <label for='inputName'>Expense Description</label>
			   <textarea name='expense_description' id='inputName' class='form-control'>".$row['expense_description']."</textarea>
             
            </div>
			
         
		 
            <div class='form-group'>
			 <input type='submit' class='btn btn-primary' value='Save Changes'>
			 <input type='hidden' name='hidden' value='".$row['expense_id']."'>
			
			 </form>
			 <form action='expense_list.php'> <input type='submit' class='btn btn-danger' value='Cancel'> </form>
             
			  
            </div>

          </div>
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
";
	}
	?>
   <?php
include"footer.php";
?> 
  
<!-- SweetAlert2 -->
<script src="plugins/sweetalert2/sweetalert2.min.js"></script>
<!-- Toastr -->

<script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false,
      "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
      "responsive": true,
    });
  });
</script>

 <?php
include"script_style.php";
?> 


</body>
</html>

