EVOLUTION-NINJA
Edit File: employee_attendanceOLD.php
<?php $this->load->view('includes/header.php')?> <link rel="stylesheet" type="text/css" href="<?php echo base_url('dashboard_assets/css/main.css'); ?>" /> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <script type="text/javascript" src="<?php echo base_url('dashboard_assets/js/popper.min.js'); ?>" ></script> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#">HR</a></li> <li class="breadcrumb-item"><a href="#">Employee Attendence</a></li> </ol> </div> </div> </div> </div> <div class="modal fade add_group_model" id="impcustomer" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true"> <div class="modal-dialog modal-md" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="ModalLabel">Add Attendance</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form class="forms-sample add_attendance" enctype="multipart/form-data"> <div class="modal-body"> <div class="form-group"> <label>Employee</label> <select name="employee" class="form-control employee_name" required> <option value="">Select Employee</option> <?php foreach($employee_type as $key => $value) { ?> <option value="<?php echo $value->emp_id; ?>"><?php echo $value->full_name;?> </option> <?php } ?> </select> </div> <div class="form-group"> <label>Entry Status</label> <select name="entry_status" class="form-control" required> <option value="">Select</option> <option value="Logged_IN">Logged IN</option> <option value="Logged_OUT">Logged OUT</option> </select> </div> <div class="form-group"> <label>Entry Date</label> <input type="text" name="entry_date" class="form-control" required="" value="<?php echo $date;?>" readonly> </div> <div class="form-group"> <label>Entry Time</label> <input type="text" name="entry_time" class="form-control" required="" value="<?php echo $time;?>" readonly> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary submit">Submit</button> <button type="button" class="btn btn-light" data-dismiss="modal">Close</button> </div> </form> </div> </div> </div> <section class="part_main"> <button type="button" class="btn btn-primary " data-toggle="modal" data-target="#impcustomer">Add</button> <div class="container"> <h4 class="text-center py-3">ATTENDANCE DETAILS OF <input type="text" name="today" id="today" style="border: initial;" readonly /></h4> <table class="table table-bordered table-sm mt-3"> <tr> <th colspan="10" class="border-dark" style="text-align: center;">Employees Present</th> </tr> <tr> <th class="border-dark">Sl No</th> <th class="border-dark">Employee ID </th> <th class="border-dark">Employee Name</th> <th class="border-dark">Entry Date & Time</th> <th class="border-dark">Latitude-Longitude</th> <th class="border-dark">Exit Date & Time</th> <th class="border-dark">Latitude-Longitude</th> <th class="border-dark">Total Working Hours</th> <th class="border-dark">Entry Image</th> <th class="border-dark">Exit Image</th> <th class="border-dark">View Location</th> </tr> <?php $count =1;?> <?php if(!empty($attendance)) { foreach ($attendance as $value) { ?> <tr> <td class="border-dark"><?php echo $count ?></td> <td class="border-dark"><?php echo $value->employee_id; ?></td> <td class="border-dark"><?php echo $value->first_name.' '.$value->last_name; ?></td> <td class="border-dark"><?php echo $value->entry_date.' '.$value->entry_time; ?></td> <td class="border-dark"><?php echo "(".$value->entry_latitude.','.$value->entry_longitude.")"; ?></td> <td class="border-dark"><?php echo $value->exit_date.' '.$value->exit_time; ?></td> <td class="border-dark"><?php echo "(".$value->exit_latitude.','.$value->exit_longitude.")"; ?></td> <td class="border-dark"><?php echo $value->working; ?></td> <td class="border-dark"><img src="<?php echo $value->entry_image; ?>" ></td> <td class="border-dark"><img src="<?php echo $value->exit_image; ?>" ></td> <td class="border-dark"><a href="https://www.google.com/maps/" target="_blank">View</a></td> </tr> <?php $count++; } } //else { ?> </table> </div> </section> <script type="text/javascript"> $('.add_attendance').submit(function(e) { e.preventDefault(); formdata = new FormData($(this)[0]); $(".submit").text("Submitting..."); $(".submit").attr("disabled", true); $.ajax({ type : 'post', url : '<?php echo site_url("add-attendace")?>', data : formdata, contentType: false, processData: false, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { toastr["success"](response.message); $('.submit').removeAttr("disabled"); $(".submit").text("Submit"); location.reload(); } else { toastr["error"](response.message); $('.submit').removeAttr("disabled"); $(".submit").text("Submit"); } } }); }); function month_year_onload() { var currentYear = (new Date).getFullYear(); var currentMonth = (new Date).getMonth() + 1; var currentDay = (new Date).getDate(); var month; if(currentMonth == 1) { month = "January"; } else if(currentMonth == 2) { month = "February"; } else if(currentMonth == 3) { month = "March"; } else if(currentMonth == 4) { month = "April"; } else if(currentMonth == 5) { month = "May"; } else if(currentMonth == 6) { month = "June"; } else if(currentMonth == 7) { month = "July"; } else if(currentMonth == 8) { month = "August"; } else if(currentMonth == 9) { month = "September"; } else if(currentMonth == 10) { month = "October"; } else if(currentMonth == 11) { month = "November"; } else if(currentMonth == 12) { month = "December"; } var today = currentDay+' '+month+' '+currentYear; $('#today').val(today); } month_year_onload(); </script> <?php $this->load->view('includes/footer.php')?>