<?php
if ($listitems) {
    $cnt = 0;
    $LIST_THUMB = '75x75';
    $thumbsize = explode('x', $LIST_THUMB);
    foreach ($listitems as $item) {
        $cnt++;
        if ($item['thumb']) {
            $thumb = APP_URL . '/' . $item['folder'] . $LIST_THUMB . '/' . $item['thumb'];
        } else {
            $thumb = APP_URL . '/assets/images/music.svg';
        }
         $audioname = pathinfo($item['dname'], PATHINFO_EXTENSION) ? $item['dname'] : $item['dname'] . '.' . $item['ext'];
 echo $media;
        echo '<li class="list-group-item">
   <div  class="d-flex list-m">
 <div id="top' . $item['slug'] . '" class="lazy float-start rounded"
     <!-- audio player-->
    <div class="audio-player js-audio-player">
      <button class="audio-player__control js-control">
        <div style=" background: #000260; " class="audio-player__control-icon"></div>
      </button>
      <audio preload="none">
        <source src="' . APP_URL . '/' . $item['folder'] . $audioname . '"/>
      </audio>
      <video preload="none">
      </video>
    </div>
    </div>
  <a href="' . APP_URL . '/music/' . $item['slug'] . $endRoute . '" class="d-flex list-m">
    <div class="ms-2 text-truncate align-self-center w-100">
      <h4>' . $item['name'] . '</h4>
      <p><i class="fa fa-clock-o" aria-hidden="true"></i> ' . $item['duration'] . '</p>
      <p><i class="fa fa-download" aria-hidden="true"></i> ' . $item['download'] . '+</p>
    </div>
    </a>
  </div>
</li>';

 ?>
 
 <script type="text/javascript">
$(document).ready(function(){
  var colors = [
'linear-gradient(to left bottom, #d400d6, rgb(63, 81, 181))',
'linear-gradient(to left bottom, #9e9e9e, rgb(233 212 255))',
'linear-gradient(to left bottom, #607d8b, rgb(54 55 60))',
'linear-gradient(to left bottom, #673ab7, rgb(57 70 220))',
'linear-gradient(to left bottom, #795548, #795548)',
'linear-gradient(to left bottom, #636160, #8c8684)',
'linear-gradient(to left bottom, #3c3a39, #3e3b3a)',
'linear-gradient(to left bottom, #8bc34a, #8bc34a)',
'linear-gradient(to left bottom, #ff9800, #e83f18)',
'linear-gradient(to left bottom, #796f6f, #928e8e)',
'linear-gradient(to left bottom, #795548, #928e8e)',
'linear-gradient(to left bottom, #000000, #928e8e)',
'linear-gradient(to left bottom, #1e3e48, #000000)',
'linear-gradient(to left bottom, #324844, #353434)',
'linear-gradient(to left bottom, #0e071b61, #1f1f1f)',
'linear-gradient(to left bottom, #0e071b61, #1c486d94)',
'linear-gradient(to left bottom, #3f51b57d, #3f51b5b5)',
'linear-gradient(to left bottom, #0808087d, #000000b5)',
'linear-gradient(to left bottom, rgb(96, 131, 208), rgb(58, 210, 226))',
'linear-gradient(to left bottom, rgb(193, 114, 203), rgb(114, 133, 203))',
'linear-gradient(to left bottom, rgb(236, 233, 139), rgb(243, 191, 0))',
'linear-gradient(to left bottom, rgb(203, 114, 144), #9C27B0)',
'linear-gradient(to left bottom, rgb(96, 131, 208), rgb(58, 210, 226))',
'linear-gradient(to left bottom, #e880a3, #E91E63)',
'linear-gradient(to left bottom, #F44336, #ef8f88)',
'linear-gradient(to left bottom, rgb(116, 203, 114), rgb(161, 203, 114))',
'linear-gradient(to left bottom, #7498a9, #607D8B)',
'linear-gradient(to left bottom, #52cede, #00BCD4)',
'linear-gradient(to left bottom, #0dead6, #009688)',
'linear-gradient(to left bottom, #e8ff00, #CDDC39)',
'linear-gradient(to left bottom, rgb(234, 36, 64), rgb(242, 156, 45))',
'linear-gradient(to left bottom, rgb(236, 64, 145), rgb(21, 21, 20))',
'linear-gradient(to left bottom, rgb(217, 43, 43), rgb(0, 0, 0)) ',
'linear-gradient(to left bottom, #e91e63, #673ab7)',
'linear-gradient(to left bottom, #1b9820, #ffeb3b)',
'linear-gradient(to left bottom, #03a9f4, #3f51b5)',
'linear-gradient(to left bottom, #1115c3, #ff9800)',
'linear-gradient(to left bottom, #e91e63, #ff9800) #cddc39',
'linear-gradient(to left bottom, #9c27b0, #212223a6) #795548',
'linear-gradient(to left bottom, #000000, #20ff6480) #ffeb3b',
'rgba(0, 0, 0, 0) linear-gradient(to left bottom, rgb(36, 102, 234), rgb(20, 21, 21)) '
];
  $('#top<?echo'' . $item['slug'] .''; ?>').css({'background': '' + colors[Math.floor(Math.random() *      colors.length)]});
});
</script>  
 
 
 
 <?
        if($cnt % ADVT_EACH == 0){
            echo getAds($AdsPath . '/between_listitem');
            }
    }
    unset($listitems);
    unset($thumbsize);
}
