📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
22510.57 KB
0644
🗑️
⬇️
✏️
🔒
Editing: view_staff.php
<div class="main-body"> <div class="page-wrapper"> <div class="page-body"> <div class="row"> <!-- task, page, download counter start --> <?php $this->load->view('short_statics');?> <!-- task, page, download counter end --> <a data-toggle="modal" href="#large-Modal" class="btn btn-danger" style="margin:1%;"><i class="fa fa-plus"></i>Add Staff</a> <div class="col-md-12" id="slideshow"> <div class="card" id="slide_show"> <div class="card-header"> <h5>View all staff</h5> </div> <div class="card-block"> <table id="demo-foo-filtering" class="table table-striped footable footable-1 footable-paging footable-paging-center breakpoint-lg" style=""> <thead> <tr class="footable-header"> <th class="footable-sortable footable-first-visible" style="display: table-cell;"> S/N<span class="fooicon fooicon-sort"></span></th> <th data-breakpoints="xs" class="footable-sortable" style="display: table-cell;">Staff Name<span class="fooicon fooicon-sort"></span></th> <th data-breakpoints="xs" class="footable-sortable" style="display: table-cell;">Staff Email<span class="fooicon fooicon-sort"></span></th> <th data-breakpoints="xs" class="footable-sortable" style="display: table-cell;">Staff Phone No<span class="fooicon fooicon-sort"></span></th> <th data-breakpoints="xs" class="footable-sortable" style="display: table-cell;">Date Created</th> <th data-breakpoints="xs" class="footable-sortable" style="display: table-cell;"></th> </tr> </thead> <tbody> <?php $get_staff =$this->Action->get_staff(); $i=1; if(is_array($get_staff)){ foreach($get_staff as $row){ $staff_id =$row['id']; $staff_user_name =$row['user_name']; $staff_full_name =$row['full_name']; $staff_email =$row['email']; $staff_phone =$row['phone']; $date =$row['date']; ?> <tr> <td><?php echo $i++;?></td> <td> <?php echo $staff_full_name;?> <br> <small style="color:red;"><?php echo $staff_user_name;?></small> </td> <td><?php echo $staff_email;?></td> <td><?php echo $staff_phone;?></td> <td><?php echo $date;?></td> <td> <a href="javascript:;" id="delete_branch_<?php echo $staff_id;?>" data-id="<?php echo $staff_id;?>" class="label label-danger"><i class="fa fa-trash"></i> Delete</a> </td> </tr> <script type="text/javascript" src="<?php echo base_url();?>files/bower_components/jquery/dist/jquery.min.js"> </script> <script> $(document).ready(function () { $('#delete_branch_<?php echo $staff_id;?>').click(function (e) { e.preventDefault(); var id = $(this).data('id'); swal({ title: "Are you sure you want to DELETE this Staff?", icon: "warning", buttons: true, dangerMode: true, }) .then((willDelete) => { if (willDelete) { $.ajax({ type: 'POST', url: '<?php echo base_url();?>Dashboard/delete_staff/' + id, success: function (resp) { if (resp == 'ok') { swal({ title: "Success", text: "Staff has been been removed from List!", icon: "success", closeOnClickOutside: false, }); } else if (resp == 'err') { swal({ title: "Oops!", text: "Database Could not connect to server!", icon: "info", closeOnClickOutside: false, }); }else{ swal({ title: "Oops!", text: resp, icon: "info", closeOnClickOutside: false, }); } } }); } else { swal("Delete Cancelled"); } }); }); }); </script> <?php } }else{?> <div class="alert alert-warning" style="margin-top:4%;">No Staff has been added to Database yet!</div> <?php } ?> </tbody> </div> </div> </div> </div> </div> </div> </div> <div class="modal fade" id="large-Modal" tabindex="-1" role="dialog" style="z-index: 1050; display: none;" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add Staff</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form id="create_supervisor" enctype="multipart/form-data"> <div class="modal-body"> <div class="form-group row"> <label class="col-sm-2 col-form-label">Staff Full Name</label> <div class="col-sm-10"> <input type="text" id="name" name="full_name" class="form-control" required> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Staff User Name</label> <div class="col-sm-10"> <input type="text" id="name" name="name" class="form-control" required> <small style="color:red;">username must not contain space or special symbol</small> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Staff Email</label> <div class="col-sm-10"> <input type="email" id="email" name="email" class="form-control" required> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Staff Phone</label> <div class="col-sm-10"> <input type="number" id="phone" name="phone" class="form-control" required> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Staff Password</label> <div class="col-sm-10"> <input type="text" id="password" name="password" class="form-control" required> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default waves-effect " data-dismiss="modal">Close</button> <input type="submit" class="btn btn-primary waves-effect waves-light" value="Add Staff Now"> </div> </form> </div> </div> </div> <script type="text/javascript" src="<?php echo base_url();?>files/bower_components/jquery/dist/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#create_supervisor').submit(function (e) { e.preventDefault(); $.ajax({ url: '<?php echo base_url();?>Dashboard/create_staff', type: "post", data: new FormData(this), processData: false, contentType: false, cache: false, async: false, success: function (data) { $('#large-Modal').modal('hide'); if (data == 'ok') { swal({ title: "Success", text: "Staff Added to List", icon: "success", closeOnClickOutside: false, }); // setInterval(function () { // location.reload(); // }, 4000); } else if (data == 'err') { swal({ title: "Oops!", text: "Database Could not connect to server!", icon: "info", closeOnClickOutside: false, }); }else{ swal({ title: "Oops!", text: data, icon: "info", closeOnClickOutside: false, }); } } }); }); }); </script>
💾 Save Changes