Advertisement
Bedhoel

Untitled

Jul 9th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.09 KB | None | 0 0
  1. <?php
  2. use yii\helpers\Html;
  3.  
  4. /* @var $this \yii\web\View */
  5. /* @var $content string */
  6.  
  7.  
  8. if (Yii::$app->controller->action->id === 'login') {
  9. /**
  10.  * Do not use this code in your template. Remove it.
  11.  * Instead, use the code  $this->layout = '//main-login'; in your controller.
  12.  */
  13.     echo $this->render(
  14.         'main-login',
  15.         ['content' => $content]
  16.     );
  17. } else {
  18.  
  19.     if (class_exists('backend\assets\AppAsset')) {
  20.         backend\assets\AppAsset::register($this);
  21.     } else {
  22.         app\assets\AppAsset::register($this);
  23.     }
  24.  
  25.     dmstr\web\AdminLteAsset::register($this);
  26.  
  27.     $directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
  28.     ?>
  29.     <?php $this->beginPage() ?>
  30.     <!DOCTYPE html>
  31.     <html lang="<?= Yii::$app->language ?>">
  32.     <head>
  33.         <meta charset="<?= Yii::$app->charset ?>"/>
  34.         <meta name="viewport" content="width=device-width, initial-scale=1">
  35.         <?= Html::csrfMetaTags() ?>
  36.         <title><?= Html::encode($this->title) ?></title>
  37.         <?php $this->head() ?>
  38.         <script src="/my_antrian/web/assets/c53855e1/jquery.js"></script>
  39.         <script src="/my_antrian/web/js/jquery.dataTables.min.js"></script>
  40.         <script src="/my_antrian/web/js/dataTables.bootstrap.min.js"></script>
  41.  
  42.         <?php $this->endBody() ?>
  43.    
  44.     <body class="hold-transition skin-blue sidebar-mini">
  45.     <?php $this->beginBody() ?>
  46.     <div class="wrapper">
  47.  
  48.         <?= $this->render(
  49.             'header.php',
  50.             ['directoryAsset' => $directoryAsset]
  51.         ) ?>
  52.  
  53.         <?= $this->render(
  54.             'left.php',
  55.             ['directoryAsset' => $directoryAsset]
  56.         )
  57.         ?>
  58.  
  59.         <?= $this->render(
  60.             'content.php',
  61.             ['content' => $content, 'directoryAsset' => $directoryAsset]
  62.         ) ?>
  63.     </div>
  64.  
  65.     </body>
  66.  
  67.     <script type="text/javascript">
  68.         $(".report_date").datepicker({
  69.              format: 'dd/mm/yyyy'
  70.         });
  71.        
  72.  
  73.  
  74.     </script>
  75.     </html>
  76.     <?php $this->endPage() ?>
  77.  
  78.  
  79.      <script type="text/javascript">
  80.     function getDataTables(url,id_table,coldef){
  81.     //Tables
  82.         var dTable;
  83.             $.noConflict();
  84.             dTable = $('#'+id_table).DataTable( {
  85.                 "bProcessing": true,
  86.                 "bServerSide": true,
  87.                 "bJQueryUI": false,
  88.                 "responsive": false,
  89.                 "sAjaxSource": url,
  90.                 "sServerMethod": "POST",
  91.                 "scrollX": true,
  92.                 "columnDefs": coldef
  93.             });
  94.  
  95.             $('#'+id_table).removeClass( 'display' ).addClass('table table-striped table-bordered');
  96.                 var i = 0;
  97.                 $('.table').find( 'tfoot tr th' ).each( function () {
  98.                     //Agar kolom Action Tidak Ada Tombol Pencarian
  99.                      if( $(this).text() == "Tanggal"  ){
  100.                         var width = $(".sorting_1").width();
  101.                         var title = $('.table thead th').eq( $(this).index() ).text();
  102.                         $(this).html( '<input type="text" placeholder="Search '+title+'" class="form-control datepicker"  style="background-color:white;width:'+width+'" />' );
  103.                     }
  104.                     else if( $(this).text() != "Action" ){
  105.                         var width = $(".sorting_1").width();
  106.                         var title = $('.table thead th').eq( $(this).index() ).text();
  107.                         $(this).html( '<input type="text" placeholder="Search '+title+'" class="form-control" style="width:'+width+'" />' );
  108.                     }
  109.                     i++;
  110.                 } );
  111.                
  112.                 dTable.columns().every( function () {
  113.                     var that = this;
  114.                    
  115.                     $( 'input', this.footer() ).on( 'keyup change', function () {
  116.                         that
  117.                         .search( this.value )
  118.                         .draw();
  119.                     } );
  120.                 } );
  121.  
  122.                
  123.  
  124.         }
  125.  
  126.      </script>
  127. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement