<?php require view('theme/header'); ?>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
<div class="row">
   <div class="col-md-12">
       <div class="orders-btn py-3">

							<div class="col-md-12">
								<div class="services-search">
									<input type="text" id="searchService" placeholder="Ara" class="form-control">
								</div>
							</div>
				</div>
				<hr style="size:6px">
      <div class="card" style="overflow-x:scroll;">
         <table id="datable" class="table table-hover">
            <thead>
               <tr>
                  <th>#</th>
                  <th style="white-space: nowrap;">{ORDERS_DATE}</th>
                  <th style="width:30%;">{ORDERS_LINK}</th>
                  <th>{ORDERS_AMOUNT}</th>
                  <th style="white-space: nowrap;">{ORDERS_START_COUNT}</th>
                  <th>{ORDERS_QUANTITY}</th>
                  <th style="width:30%;">{ORDERS_SERVICE}</th>
                  <th>{ORDERS_STATUS}</th>
                  <th>{ORDERS_REMAINS}</th>
                  <th>İşlemler</th>
               </tr>
            </thead>
            <tbody class="servicestableclass">
                {ORDERS_LIST}
            </tbody>
         </table>
      </div>
   </div>
</div>
<?php require view('theme/footer'); ?>



<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
	$(document).ready(function() {
		$("#searchService").on("keyup", function() {
			var value = $(this).val().toLowerCase();
			$(".servicestableclass tr").filter(function() {
				$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
			});
		});
	});
</script>





<script src="//cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
	<script>
		$(document).ready( function () {
		    $('table tbody td').addClass('app-col');

    $('table tbody tr').addClass('app-block');
         ul = document.getElementsByClassName("app-block");
    for (e = 0; e < ul.length; e++) {
        li = ul[e].getElementsByTagName("td");
        for (i = 0; i < li.length; i++) {
            a = li[i];
             txtValue = a.innerHTML;
             if(i == 0){
             li[i].setAttribute('data-title', 'ID');
             }else if(i == 1){
             li[i].setAttribute('data-title', 'Tarih');
             }else if (i == 2){
             li[i].setAttribute('data-title', 'Link');
             }else if (i == 3){
             li[i].setAttribute('data-title', 'Ücret');
             }else if (i == 4){
             li[i].setAttribute('data-title', 'Başlangıç');
             }else if (i == 5){
             li[i].setAttribute('data-title', 'Miktar');
             }else if (i == 6){
             li[i].setAttribute('data-title', 'Servis');
             }else if (i == 7){
             li[i].setAttribute('data-title', 'Durum');
             }else if (i == 8){
             li[i].setAttribute('data-title', 'Kalan');
             }else if (i == 9){
             li[i].setAttribute('data-title', 'Telafi');
             }
    }
    }
    var table = $('#datable').DataTable({
          "lengthChange": false,
          "lengthMenu": [[-1], [25]],
          "bPaginate": false,
          "order": [[ 0, "desc" ]],
          "bInfo": false,
              createdRow: function (row, data, index) {

        if (data[1] == "") {
            console.dir(row);
            $(row).addClass('app-block');
        }
    }
    });
    $('#datatable_search').on( 'keyup', function () {
    table
        .search( this.value )
        .draw();
} );
    document.getElementById("datable_filter").style.display = "none";
    $('.dataTables_filter input').addClass('app-ord-input');



})




	</script>
