function bodyTable(data) {
   let table = '';
   let nomor = 1;

   data.forEach(video => {
      table += `<tr>
                  <td class="text-center">${nomor++}</td>
                  <td class="text-justify">${video.nama_video}</td>
                  <td class="text-center"><span class="badge badge-${video.status == 'enkripsi' ? 'primary' : 'success'}">${video.status}</span></td>
                  <td class="text-center" style="width: 250px">`;

      if (video.status == 'enkripsi') table += `<button type="button" class="btn btn-sm btn-success to-dekripsi" data-id="${video.id}" data-name="${video.nama_video}" data-toggle="modal" data-target="#exampleModalCenter">
         <i class="fas fa-unlock"></i> Dekripsi</button>`;
      else table += `<button type="button" class="btn btn-sm btn-primary to-enkripsi" data-id="${video.id}" data-name="${video.nama_video}" data-toggle="modal" data-target="#exampleModalCenter">
         <i class="fas fa-lock"></i>
          Enkripsi</button>`;

      table += `<a href="video/${video.nama_video}" download class="btn btn-sm btn-danger ml-2"><i class="fas fa-download"></i><span> Download</span></a>
                  </td>
               </tr>`;
   });
   document.querySelector('.table-video').innerHTML = table;
}
/*
 * fungsi untuk memuat data kedalam datatable
 */
fungsi untuk memuat data kedalam datatable
fungsi untuk memuat data kedalam datatable
function bodyTable(data) {
   let table = '';
   let nomor = 1;
   data.forEach(video => {
      table += `<tr>
                  <td class="text-center">${nomor++}</td>
                  <td class="text-justify">${video.nama_video}</td>
                  <td class="text-center"><span class="badge badge-${video.status == 'enkripsi' ? 'primary' : 'success'}">${video.status}</span></td>
                  <td class="text-center" style="width: 250px">`;
      if (video.status == 'enkripsi') table += `<button type="button" class="btn btn-sm btn-success to-dekripsi" data-id="${video.id}" data-name="${video.nama_video}" data-toggle="modal" data-target="#exampleModalCenter">
         <i class="fas fa-unlock"></i> Dekripsi</button>`;
      else table += `<button type="button" class="btn btn-sm btn-primary to-enkripsi" data-id="${video.id}" data-name="${video.nama_video}" data-toggle="modal" data-target="#exampleModalCenter">
         <i class="fas fa-lock"></i>
          Enkripsi</button>`;
      table += `<a href="video/${video.nama_video}" download class="btn btn-sm btn-danger ml-2"><i class="fas fa-download"></i><span> Download</span></a>
                  </td>
               </tr>`;
   });
   document.querySelector('.table-video').innerHTML = table;
}
function bodyTable ( data ) { let table = '' ; let nomor = 1 ; data . forEach ( video => { table += ` ${ nomor ++ } ${ video . nama_video } ${ video . status == 'enkripsi' ? 'primary' : 'success' } ${ video . status } ` ; if ( video . status == 'enkripsi' ) table += ` ${ video . id } ${ video . nama_video } ` ; else table += ` ${ video . id } ${ video . nama_video } ` ; table += ` ${ video . nama_video } ` ; } ) ; document . querySelector ( '.table-video' ) . innerHTML = table ; }
fungsi untuk memuat data kedalam datatable
fungsi untuk memuat data kedalam datatable