JezK
Edit File: monthlyUpdate.php
<?php $currentPage="monthlyReports"; include("header.php"); include("app/bdcMonthlyReportApp.php"); if(isset($_SESSION['reportSaveFailed'])) { echo "<script>alert('Error!!! Unable to save report status. Internal server error.');</script>"; unset($_SESSION['reportSaveFailed']); } if(isset($_SESSION['reportDetailsSaveFailed'])) { echo "<script>alert('Error!!! Unable to save report details. Internal server error.');</script>"; unset($_SESSION['reportDetailsSaveFailed']); } if(isset($_SESSION['saveSuccess'])) { echo "<script>alert('Report submitted successfully.');</script>"; unset($_SESSION['saveSuccess']); } ?> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> <small>Report for the Month of <?php echo Date('F - Y'); ?></small> </h1> </div> </div> <!-- /.row --> <div class="row text-right"> <a href="oldReports.php" class="btn btn-default ">Old Reports</a> </div> <?php echo $reportStatus; ?> <div style="<?php echo $display; ?>"> <form method="post" onsubmit="return validate()" action="app/bdcReportApp.php"> <div class="row table-responsive" > <div class="col-md-12"> <table id="" class="table table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>S.No</th> <th>Name</th> <th>Staff Status</th> </tr> </thead> <tbody> <?php echo $staff; ?> </tbody> </table> </div> </div> <div class="text-center"> <input type="submit" value="Submit" class="btn btn-primary"> </div> </form> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </div> <!-- /#page-wrapper --> <script> function updateStaffStatus(i,status) { document.getElementById('staffStatus'+i).value = status; } function validate() { var staffStatus = document.getElementsByName('staffStatus[]'); for(i=0;i<staffStatus.length;i++) { if(staffStatus[i].value == "") { var staffLeft = document.getElementById('staffLeft'+i); alert("Please update staff status"); staffLeft.focus(); return false; } } if(confirm('Note: Once submitted report cannot be modified. Are you sure you want to submit?')) { return true; } else { return false; } } </script> <?php include("footer.php");?>