| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- @extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
- @section('page_title', 'Kompaun')
- @section('sub_page_title', '')
- @section('name', $user->StaffDetail->full_name)
- @section('img_profile', $user->StaffDetail->profile_img)
-
- @section('content')
- <style type="text/css">
- select.form-control, select.form-control:focus, select.form-control:hover {
- border: 1px solid #ccc !important;
- height: auto !important;
- }
-
- .panel-group .panel {
- margin-bottom: 0;
- overflow: hidden;
- border-radius: 4px;
- }
- .panel-default {
- border-color: #ddd;
- }
- .panel-default>.panel-heading {
- color: #333;
- background-color: #f5f5f5;
- border-color: #ddd;
- }
- .panel-title {
- margin-top: 0;
- margin-bottom: 0;
- font-size: 16px;
- color: inherit;
- }
-
- .panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
- padding: 8px 15px;
- line-height: 1.428571429;
- vertical-align: top;
- border-top: 1px solid #ddd;
- }
- .glyphicon { margin-right:10px; }
- .panel-body { padding:0px; }
- .panel-body table tr td { padding-left: 15px }
- .panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
- .panel-body .table, .panel-body div {margin-bottom: 0px; }
-
- .active { color: #d84315; }
- .active:hover { color: #d84315; }
- .r-padd { padding-right: 5%; }
- </style>
-
- <div class="inner-page">
- <div class="row">
- <div class="col-md-12">
- <div class="fluid">
- @if(count($errors) > 0)
- <div class="alert alert-danger icons-alert">
- @foreach($errors->all() as $error)
- <p>{{$error}}</p>
- @endforeach
- </div>
- @endif
-
- @if(Session::get('error_msg'))
- <div class="alert alert-danger icons-alert">
- {!! Session::get('error_msg') !!}
- </div>
- @elseif(Session::get('success_msg'))
- <div class="alert alert-success icons-alert">
- {!! Session::get('success_msg') !!}
- </div>
- @endif
- </div>
- </div>
- </div>
-
- <div class="row">
-
- <div class="col-xl-2 col-md-12">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title"> Navigasi </h4>
- </div>
-
- <div class="panel-body">
- <div>
- <a href="{{ url('/main/setting/memo/index') }}" class="active">Senarai Memo/Nota</a>
- </div>
- <div>
- <a href="{{ url('/main/setting/memo/add') }}">Tambah Memo/Nota</a>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-xl-10 col-md-12">
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <h5>Senarai Memo/Nota</h5>
- </div>
- <div class="card-block">
- <div class="dt-responsive table-responsive">
- <table id="nota" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
- <thead>
- <tr>
- <th>#</th>
- <th>ItKod</th>
- <th>Jenis Memo</th>
- <th>No.Rujukan</th>
- <th>Tarikh Mula</th>
- <th>Tarikh Akhir</th>
- <th>DiKeluarkan</th>
- <th>Disahkan</th>
- <th>Tindakan</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th>#</th>
- <th>ItKod</th>
- <th>Jenis Memo</th>
- <th>No.Rujukan</th>
- <th>Tarikh Mula</th>
- <th>Tarikh Akhir</th>
- <th>DiKeluarkan</th>
- <th>Disahkan</th>
- <th>Tindakan</th>
- </tr>
- </tfoot>
- </table>
- </div>
- <!-- End <div class="animation-modal"> -->
- </div>
- </div>
- </div>
- <div class="md-overlay"></div>
- </div>
- </div>
- </div>
- </div>
- @endsection
-
- @section('external_js')
-
- <script type="text/javascript">
- $.ajaxSetup({
- headers: {
- 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
- }
- });
-
- var roles_access = '{{ $user->roles_access }}';
- var table = $('#nota').DataTable({
- "ordering": false,
- "serverSide": true,
- "processing": true,
- "ajax": "{{ url('api/setting/memo/list') }}",
- "columns": [
- { "data": "index","name": "index"},
- { "data": "itkod","name": "itkod"},
- { "data": "jenis","name": "jenis"},
- { "data": "no_rujukan", "name": "no_rujukan" },
- { "data": "mula", "name": "mula"},
- { "data": "akhir", "name": "akhir"},
- { "data": "dikeluakan", "name": "dikeluakan"},
- { "data": "disahkan", "name": "disahkan"},
- { "data": "tindakan","name": "tindakan"}
- ],
- "columnDefs": [
- {
- "render": function ( data, type, row ) {
- if (data.indexOf("Baru/") >= 0) {
- var split = data.split('/');
- return '<label class="label label-success">'+split[0]+'</label> '+split[1];
- }else {
- return data;
- }
- },
- "targets": 0,
- },
- {
- "render": function ( data, type, row ) {
- var currentLogin = '{{ $user->_id }}';
- if(data != ''){
- return data;
- }else{
- return '<a onclick="confirmMemo(\''+row.tindakan+'\',\'' + row.no_rujukan + '\',\'' + currentLogin + '\')" class="tabledit-edit-button btn btn-sm btn-warning waves-effect waves-light" style="float: none;color:#333" data-toggle="tooltip" data-placement="top" title="Mengesahkan">Minta Pengesahan</a>';
- }
- },
- "targets": 7,
- },
- {
- "render": function ( data, type, row ) {
- var editLink = "{{ url('/main/setting/memo') }}"+"/"+data+"/edit/detail";
- var pdfLink = "{{ url('/main/setting/memo') }}"+"/"+data+"/view/detail";
- var staff = "{{ $user->_id }}";
- return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Memo"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a href="'+editLink+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Memo"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.no_rujukan + '\',\'' + staff + '\')" data-toggle="tooltip" data-placement="top" title="Buang Memo" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>';
- },
- "targets": 8,
- },
- ],
- "language": {
- "paginate": {
- "previous": "Sebelum",
- "next": "Selepas"
- },
- "sLengthMenu": "Tunjukkan _MENU_ entri",
- "zeroRecords": "Tiada Data Ditemui",
- "infoEmpty": "Tiada Rekod Yang Wujud",
- "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
- "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
- "sSearch": "Cari:",
- }
- });
-
- function confirmMemo(cid,rujukan,currentLogin) {
- var mid = cid;
- var rujukan = rujukan;
-
- swal({
- title: "",
- text: "Mengesahkan Memo ( " + rujukan + " ) ?",
- html: true,
- type: "warning",
- showCancelButton: true,
- confirmButtonClass: "btn-danger",
- confirmButtonText: "Ya!",
- cancelButtonText: "Batal!",
- closeOnConfirm: false
- },
- function(isConfirm){
- if (!isConfirm) return;
- $.ajax({
- type: "POST",
- url: "{{ url('api/setting/memo/confirm') }}",
- data: { "_token": "{{ csrf_token() }}", id: mid, confirm_id: currentLogin, kpd: "null"},
- success:function(data){
- if(data['status'] == "true"){
- swal({
- title: "Berjaya",
- text: data['desc'],
- type: "success",
- showCancelButton: false,
- confirmButtonText: "OK!",
- closeOnConfirm: true
- },
- function(){
- table.ajax.url("{{ url('api/setting/memo/list') }}").load();
- });
- }else if(data['status'] == "false"){
- swal({
- title: "Tidak Berjaya",
- text: data['desc'],
- type: "error",
- showCancelButton: false,
- confirmButtonText: "OK!",
- closeOnConfirm: true
- },
- function(){
- table.ajax.url("{{ url('api/setting/memo/list') }}").load();
- });
- }
- },
- error: function (xhr, ajaxOptions, thrownError) {
- swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
- }
- });
- });
- };
-
- function deleteA(cid,rujukan,staff) {
- var cid = cid;
- var rujukan = rujukan;
-
- swal({
- title: "Adakah anda pasti?",
- text: "Anda tidak akan dapat memulihkan rekod memo ini ( " + rujukan + " )",
- html: true,
- type: "warning",
- showCancelButton: true,
- confirmButtonClass: "btn-danger",
- confirmButtonText: "Ya!",
- cancelButtonText: "Batal!",
- closeOnConfirm: false
- },
- function(isConfirm){
- if (!isConfirm) return;
- $.ajax({
- type: "POST",
- url: "{{ url('api/setting/delete/memo') }}",
- data: { "_token": "{{ csrf_token() }}", id: cid, staff:staff },
- success:function(data){
- if(data['status'] == "true"){
- swal({
- title: "Berjaya",
- text: data['desc'],
- type: "success",
- showCancelButton: false,
- confirmButtonText: "OK!",
- closeOnConfirm: true
- },
- function(){
- table.ajax.url("{{ url('api/setting/memo/list') }}").load();
- });
- }else if(data['status'] == "false"){
- swal({
- title: "Tidak Berjaya",
- text: data['desc'],
- type: "error",
- showCancelButton: false,
- confirmButtonText: "OK!",
- closeOnConfirm: true
- },
- function(){
- table.ajax.url("{{ url('api/setting/memo/list') }}").load();
- });
- }
- },
- error: function (xhr, ajaxOptions, thrownError) {
- swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
- }
- });
- });
- };
-
- $(document).ready(function() {
- var origin = window.location.origin;
-
- // <!-- Theme Loader -->
- $(".theme-loader").animate({
- opacity: "0"
- },1000);
- setTimeout(function() {
- $(".theme-loader").remove();
- }, 800);
-
- /*** Tooltip ***/
- $('#nota').on('draw.dt', function () {
- $('[data-toggle="tooltip"]').tooltip();
- });
- });
- </script>
- @endsection
|