/
home
/
sjslayjy
/
public_html
/
assets
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Omc Type'); ?> <?php $__env->startPush('plugin-styles'); ?> <?php echo Html::style('//cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css'); ?> <?php echo Html::style('//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.css'); ?> <style type="text/css"> .table th, .table td { white-space: break-spaces !important; } </style> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a> </li> <li class="active">/OMC Type</li> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-12"> <h3 class="header smaller lighter blue">OMC Type</h3> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> Results for "Latest Registered OMC Types" <div class="widget-toolbar no-border"> <a class="btn btn-xs bigger btn-warning dropdown-toggle" data-toggle="modal" href='#addOmcTypeModal'> Add <i class="ace-icon fa fa-plus icon-on-right"></i> </a> </div> </div> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table id="module_table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Id</th> <th>Name</th> <th></th> </tr> </thead> <tbody> <?php $__currentLoopData = $omc_types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$omc_type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($omc_type->id); ?></td> <td><?php echo e($omc_type->omc_names == 'pt' ? 'PT' : ($omc_type->omc_names == 'ame' ? 'AME' : ($omc_type->omc_names == 'ime' ? 'IME' : $omc_type->omc_names))); ?></td> <td> <div class="hidden-sm hidden-xs btn-group"> <a class="btn btn-xs btn-primary" onclick="getEdit(<?php echo e($omc_type->id); ?>)" > <i class="ace-icon fa fa-pencil bigger-120"></i> </a> <button class="btn btn-xs btn-warning" onclick="deleteOmc(<?php echo e($omc_type->id); ?>)" > <i class="ace-icon fa fa-trash-o bigger-120"></i> </button> </div> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <!-- Add Module Modal --> <div class="modal fade" id="addOmcTypeModal"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add New OMC Type</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <form action="" role="form" id="addOmcTypeForm"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label for="omc_type">OMC Type</label> <input type="text" class="form-control" name="omc_type" id="omc_type" placeholder="Omc Type"> <span class="text text-danger" id="add_omc_type_error" style="display: none;"></span> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" id="addOmcTypeBtn" class="btn btn-primary">Submit</button> </div> </form> </div> </div> </div> </div> <!-- Add Module Modal --> <!-- Edit Module Modal --> <!-- Edit Role Modal --> <div class="modal fade" id="editOmcModal"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Update OMC Type</h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body" id="EditBody"> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startPush('custom-scripts'); ?> <?php echo Html::script('/assets/js/dashboard.js'); ?> <?php echo Html::script('js/app.js'); ?> <?php echo Html::script('//cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js'); ?> <script type="text/javascript"> jQuery(function($) { var myTable = $('#gst_table').DataTable( { bAutoWidth: false, "aaSorting": [], }); }) </script> <script> $(document).ready(function(){ $('#addOmcTypeBtn').click(function(e){ e.preventDefault(); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); $.ajax({ url: $('#addOmcTypeForm').attr('action'), method: 'POST', data: $('#addOmcTypeForm').serialize(), success: function(data){ if(!data.flag && data.status == 1){ showError('add_omc_name_error',data.errors.rate); }else{ if(data.flag) { swal({ title: "Success!", text: data.message, type: "success" }).then(function() { window.location.reload(); }); } else { swal({ title: "Error!", text: data.message, type: "error" }); } } } }); }); }); function showError(id,error){ if(typeof(error) === "undefined"){ $('#'+id).hide(); }else{ $('#'+id).show(); $('#'+id).text(error); } } function getEdit(id){ if(id == ""){ swal('Error','Omc id is missing','warning'); }else{ $.ajax({ url: "<?php echo e(url('/admin/edit-omc/')); ?>"+"/"+id, type: 'GET', success:function(data){ $('#EditBody').html(data); $('#editOmcModal').modal('toggle'); } }); } } function updateOmc(){ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); $.ajax({ url: $('#editOmcForm').attr('action'), method: 'POST', data: $('#editOmcForm').serialize(), success: function(data){ if(!data.flag){ if(data.status == 1) { showError('add_omc_name_error',data.errors.omc_name); } else { swal({ title: "Error!", text: data.error, type: "error" }).then(function() { window.location.reload(); }); } }else{ swal({ title: "Success!", text: data.msg, type: "success" }).then(function() { window.location.reload(); }); } } }); } function deleteOmc(id){ if(id == ""){ swal('Error','Omc id is missing','warning'); }else{ swal({ title: "Are you sure?", text: "You will not be able to recover this Omc!", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', cancelButtonColor: '#DD6B55', confirmButtonText: 'Yes, I am sure!', cancelButtonText: "No, cancel it!", closeOnConfirm: false, closeOnCancel: false }).then(function(isConfirm){ if (isConfirm){ $.ajax({ url: "<?php echo e(url('/admin/delete-omc/')); ?>"+"/"+id, type: 'GET', success:function(data){ if(data.flag){ $('#tr_'+id).remove(); swal("Success", "Omc Deleted Successfully", "success"); }else{ swal("Error", data.message, "error"); } } }); } else { swal("Cancelled", "Your Omc is safe :)", "error"); } }); } } </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/assets/resources/views/master/omc-types.blade.php ENDPATH**/ ?>