File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/modules/venue/views/venue.php
Back
<!-- BEGIN DATATABLE SCRIPTS --> <link href="<?php echo base_url(); ?>assets/custom/datatables/datatables.min.css" rel="stylesheet" > <script src="<?php echo base_url(); ?>assets/custom/datatables/datatables.min.js"></script> <script src="<?php echo base_url(); ?>assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js"></script> <script src="<?php echo base_url(); ?>assets/custom/js/camplus-datatable.js"></script> <!-- END DATATABLE SCRIPTS --> <link href="<?php echo base_url(); ?>/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" > <script src="<?php echo base_url(); ?>/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script> <div class="portlet light bordered"> <div class="portlet-title"> <div class="caption"> <i class="icon-doc font-dark"></i> <span class="bold"><?php echo $this->lang->line('venues'); ?></span> </div> <div class="actions"> <a href="#addModal" class="dt-button btn green-jungle btn-outline" data-toggle="modal"> <i class="fa fa-pencil"></i> <?php echo $this->lang->line('add'); ?> </a> <a href="#importModal" class="dt-button btn blue btn-outline importvenues" data-toggle="modal" data-action="import" data-action-title="Import"> <i class="fa fa-sign-in"></i> <?php echo $this->lang->line('import'); ?> </a> <a href="<?php echo base_url(); ?>venue/downloadFormat" class="dt-button btn yellow-casablanca btn-outline" data-toggle="modal" data-action="import" data-action-title="Import"> <i class="fa fa-download"></i> <?php echo $this->lang->line('export'); ?> </a> <a href="#addModal" class="dt-button btn green-jungle btn-outline" data-toggle="modal"> <i class="fa fa-list"></i> <?php echo $this->lang->line('manage'); ?>Manage <?php echo $this->lang->line('venue_group'); ?> </a> </div> </div> <div class="portlet-body"> <table class="table table-striped table-bordered table-hover table-checkable order-column" id="data_table"> <thead> <tr> <th> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" class="group-checkable" data-set="#data_table .checkboxes" /> <span></span> </label> </th> <th><?php echo $this->lang->line('id'); ?></th> <th><?php echo $this->lang->line('title'); ?></th> <th><?php echo $this->lang->line('group'); ?></th> <?php if(checkModule('event_booking')) {?> <th><?php echo $this->lang->line('enabled'); ?></th> <th><?php echo $this->lang->line('need_approval'); ?></th> <th><?php echo $this->lang->line('approver'); ?></th> <?php } ?> <th><?php echo $this->lang->line('order'); ?></th> <th><?php echo $this->lang->line('actions'); ?></th> </tr> </thead> <tbody> <?php foreach($venues as $key => $venue): ?> <tr class="odd gradeX"> <td> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" class="checkboxes" data-id="<?php echo $venue['id']; ?>" value="1"/> <span></span> </label> </td> <td><?php echo $venue['id']; ?></td> <td><?php echo $venue['title']; ?></td> <td><?php echo $venue['venuegroup_title']; ?></td> <?php if(checkModule('event_booking')) {?> <td> <?php echo ($venue['is_enabled'] == 1) ? '<span class="badge badge-roundless badge-success">Enabled</span>' : '<span class="badge badge-roundless badge-danger">Disabled</span>'; ?> </td> <td> <?php echo ($venue['need_approval'] == 1) ? '<span class="badge badge-roundless badge-success">Yes</span>' : '<span class="badge badge-roundless badge-danger">No</span>'; ?> </td> <td><?php echo $venue['username']; ?></td> <?php } ?> <td><?php echo $venue['order']; ?></td> <td> <a class="btn btn-xs blue editVenue" data-id="<?php echo $venue['id']; ?>" data-toggle="modal" href="javascript:void(0)" > <i class="fa fa-edit"></i> <?php echo $this->lang->line('edit'); ?> </a> <a class="btn btn-xs red actionModal" data-id="<?php echo $venue['id'];?>" data-toggle="modal" href="#actionModal" > <i class="fa fa-trash-o"></i> <?php echo $this->lang->line('delete'); ?> </a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <div id="addModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <form method="post" action="<?php echo base_url(); ?>venue/add" class="createVenueForm"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('create'); ?> <?php echo $this->lang->line('venue'); ?></h4> </div> <div class="modal-body"> <div class="scroller" style="height:350px" data-always-visible="1" data-rail-visible="1"> <div class="row"> <div class="form-group col-md-9"> <label class="control-label"><?php echo $this->lang->line('title'); ?><span class="required">*</span></label> <input type="text" name="title" class="form-control" required> </div> <div class="form-group col-md-3"> <label class="control-label"><?php echo $this->lang->line('order'); ?></label> <input type="text" name="order" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('venue_group'); ?></label> <select class="select2" name="venuegroup" required> <option value=""><?php echo $this->lang->line('select').' '.$this->lang->line('venue_group'); ?></option> <?php foreach ($venue_group as $key => $row) { ?> <option value="<?php echo $row['id']?>"><?php echo $row['title']?></option> <?php } ?> </select> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('remarks'); ?></label> <textarea name="remarks" class="form-control"></textarea> </div> <?php if(checkModule('event_booking')) {?> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" value="1" name="is_enabled" class="form-control" checked> <?php echo $this->lang->line('enabled'); ?> <span></span> </label> <div class="form-group"> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline col-md-4" style="margin-top: 6px;"> <input type="checkbox" value="1" name="need_approval" class="form-control"> <?php echo $this->lang->line('need_approval'); ?> <span></span> </label> <div class="approverUserDiv col-md-8" style="display:none"> <select class="select2" name="approver_user_id"> <option value="">Select User</option> <?php foreach ($users as $key => $user) { ?> <option value="<?php echo $user['id']?>"><?php echo allUsers($user['id'],1);?></option> <?php } ?> </select> </div> </div> <?php }?> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <input type="submit" class="btn green" value="<?php echo $this->lang->line('create'); ?>"> </div> </form> </div> </div> </div> </div> <div id="editModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <form method="post" action="" class="editVenueForm"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('edit'); ?> <?php echo $this->lang->line('venue'); ?></h4> </div> <div class="modal-body"> <div class="scroller" style="height:350px" data-always-visible="1" data-rail-visible="1"> <div class="row"> <div class="form-group col-md-9"> <label class="control-label"><?php echo $this->lang->line('title'); ?><span class="required">*</span></label> <input type="text" name="title" class="form-control" required> </div> <div class="form-group col-md-3"> <label class="control-label"><?php echo $this->lang->line('order'); ?></label> <input type="text" name="order" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('venue_group'); ?></label> <select class="select2" name="venuegroup" required> <option value=""><?php echo $this->lang->line('select').' '.$this->lang->line('venue_group'); ?></option> <?php foreach ($venue_group as $key => $row) { ?> <option value="<?php echo $row['id']?>"><?php echo $row['title']?></option> <?php } ?> </select> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('remarks'); ?></label> <textarea name="remarks" class="form-control"></textarea> </div> <?php if(checkModule('event_booking')) {?> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" value="1" name="is_enabled" class="form-control"> <?php echo $this->lang->line('enabled'); ?> <span></span> </label> <div class="form-group"> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline col-md-4" style="margin-top: 6px;"> <input type="checkbox" value="1" name="need_approval" class="form-control"> <?php echo $this->lang->line('need_approval'); ?> <span></span> </label> <div class="approverUserDiv col-md-8" style="display:none"> <select class="select2" name="approver_user_id"> <option value="">Select User</option> <?php foreach ($users as $key => $user) { ?> <option value="<?php echo $user['id']?>"><?php echo allUsers($user['id'],1);?></option> <?php } ?> </select> </div> </div> <?php }?> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <input type="submit" class="btn green" value="<?php echo $this->lang->line('edit'); ?>"> </div> </form> </div> </div> </div> </div> <div id="importModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('import'); ?> <?php echo $pagetitle; ?></h4> </div> <form method="post" action="<?php echo base_url(); ?>venue/venue/import" enctype="multipart/form-data" onsubmit="return validateform()"> <div class="modal-body"> <div class="fileinput fileinput-new" data-provides="fileinput" style="padding: 10px;"> <div class="input-group input-large"> <div class="form-control uneditable-input input-fixed input-medium" data-trigger="fileinput"> <i class="fa fa-file"></i> <span class="fileinput-filename"></span> </div> <span class="input-group-addon btn default btn-file"> <span class="fileinput-new"><?php echo $this->lang->line('select_file'); ?></span> <span class="fileinput-exists"><?php echo $this->lang->line('change'); ?></span> <input id="file" type="file" name="venues" required> </span> <a href="javascript:;" class="input-group-addon btn red fileinput-exists" data-dismiss="fileinput"><?php echo $this->lang->line('remove'); ?></a> </div> </div> <div id="previewExcel"></div> <div id="duplicaterows"></div> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <button type="button" class="btn default blue preview" data-action="hide"> <?php echo $this->lang->line('preview'); ?></button> <button type="submit" name="import" class="btn default green importbutton" data-action=""><?php echo $this->lang->line('import'); ?></button> </div> </form> </div> </div> </div> <div id="actionModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> </div> <div class="modal-body"> <h4><?php echo $this->lang->line('are_you_sure'); ?></h4> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <a href="" type="button" class="btn default green confirmAction"><?php echo $this->lang->line('yes'); ?><span class="actionEvent"></span></a> </div> </div> </div> </div> <script> $(document).ready(function(){ initTable(); <?php if(checkModule('event_booking')) {?> $('input[name=need_approval]').on('click',function(){ if ($(this).is(':checked')) { $(this).parents('.modal-body').find('.approverUserDiv').show(); $(this).parents('.modal-body').find('select[name=approver_user_id]').focus(); $(this).parents('.modal-body').find('select[name=approver_user_id]').attr('required',true); }else{ $(this).parents('.modal-body').find('.approverUserDiv').hide(); $(this).parents('.modal-body').find('select[name=approver_user_id]>option[value=""]').prop('selected',true); $(this).parents('.modal-body').find('select[name=approver_user_id]').attr('required',false); }; }) <?php }?> $('.createVenueForm').validate(); $(document).on('click','.actionModal',function(){ $('#actionModal span.actionEventTitle').html('<?php echo $this->lang->line("Delete");?>'); $('#actionModal span.actionEvent').html('<?php echo $this->lang->line("Delete");?>'); $('a.confirmAction').attr('href', BASE_URL + 'venue/delete/' + $(this).attr('data-id')); }); $(document).on('click','.editVenue',function(){ var id = $(this).attr('data-id'); $.ajax({ type: "POST", data: "id=" + id, url: BASE_URL + "venue/get/" + $(this).attr('data-id'), dataType: "json", success: function(data) { $('#editModal input[name=title]').val(data.venue['title']); $('#editModal input[name=order]').val(data.venue['order']); $('#editModal input[name=quantity]').val(data.venue['quantity']); $('#editModal textarea[name=remarks]').val(data.venue['remarks']); $('#editModal select[name=venuegroup]>option[value="'+data.venue['venuegroup']+'"]').prop('selected',true); <?php if(checkModule('event_booking')) {?> $('#editModal select[name=approver_user_id]>option[value="'+data.venue['approver_user_id']+'"]').prop('selected',true); if(data.venue['need_approval']==1){ $('#editModal input[name=need_approval]').is(':checked') $('#editModal input[name=need_approval]').parent().addClass('checked'); $('#editModal .approverUserDiv').show(); } else { $('#editModal input[name=need_approval]').attr('checked',false); $('#editModal input[name=need_approval]').parent().removeClass('checked'); $('#editModal .approverUserDiv').hide(); } if(data.venue['is_enabled']==1){ $('#editModal input[name=is_enabled]').is(':checked') $('#editModal input[name=is_enabled]').parent().addClass('checked'); } else { $('#editModal input[name=is_enabled]').attr('checked',false); $('#editModal input[name=is_enabled]').parent().removeClass('checked'); } <?php }?> $('#editModal').modal('show'); $('.editVenueForm').attr('action',BASE_URL+'venue/edit/'+id); $('.editVenueForm').validate(); } }); }); //import Card Reader $(document).on('click', '.importvenues', function() { $(".importbutton").hide(); }); // file read $("#file").change(function() { $(".preview").attr('data-action', 'hide'); $(".importbutton").hide(); $(".preview").html('Preview'); $("#duplicaterows").html(''); $("#previewExcel").hide(); var files = document.getElementById('file').files; if (!files.length) { return; } else { var formData = new FormData(); formData.append('venues', $('input[type=file]')[0].files[0]); $.ajax({ type: "POST", url: BASE_URL + "venue/venue/preview", data: formData, cache: false, contentType: false, processData: false, success: function(data) { $("#previewExcel").html(data); console.log(data); }, error: function(data) { $("#previewExcel").html(data); console.log(data); } }); } }); //preview $(".preview").click(function() { $(".importbutton").show(); var value = $(".preview").attr('data-action'); var n = value.localeCompare('hide'); if (n == 0) { $(".preview").attr('data-action', 'show'); $(".preview").html('Preview Close'); $("#previewExcel").show(); } else { $(".preview").attr('data-action', 'hide'); $(".preview").html('Preview'); $("#previewExcel").hide(); } }); }); function validateform(){ var duplicate = $("#duplicate").val(); if (parseInt(duplicate) == 1) { $("#duplicaterows").html('<h3 style="color:red">Please fix all these issues 100% then import. </h3>'); return false; } return true; } </script>
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.15 |
proxy
|
phpinfo
|
Settings