

       
               <table id="Winning_Numbers_Today">
                <thead>
                <tr>
                <th>Time</th>
                <th>Type</th>
                <th>User</th>
                <th>Number</th>
                <th>Amount</th>
                </tr>
                </thead>
                <tbody>
            
                </tbody>
                </table>
            







    <script>

        function GenerateBetWinningRow(Time,Type,Nickname_Mnumber,btnumber,Amount,Hashkey){
            let activecheckbox='';
           


//activecheckbox='<input class="form-control" type="checkbox" '+Active+' disabled>';
//const actionbutton =`<button class="btn btn-warning btn-block" onclick="gotoPage('UserModify','${Hashkey}')">View User</button>`;

Time=Time.replace(' ','<br>');
Type=Type.replace(' ','<br>');
Nickname_Mnumber=Nickname_Mnumber.replace(' ','<br>');


return `<tr>
      <td>${Time}</td>
      <td>${Type}</td>
      <td>${Nickname_Mnumber}</td>
      <td>${btnumber}</td>
      <td>${Amount}</td>
  </tr>`;
        }




        async function GenerateBetWinningRows(responsearray) {
 
    let newhtmltable = '';

    for (let i = 0; i < responsearray.length; i++) {
       
        newhtmltable += GenerateBetWinningRow(
            responsearray[i]['time'],
            responsearray[i]['type'],
            responsearray[i]['user'],
            responsearray[i]['bet_number'],
            responsearray[i]['amount'],
            responsearray[i]['hashkey']
        );
    }

    //$("#User_list_table").find("tbody").replaceWith(newhtmltable);
   // new DataTable('#User_list_table');


$("#Winning_Numbers_Today").find("tbody").html(newhtmltable);
//new DataTable('#Winning_Numbers_Today');

new DataTable('#Winning_Numbers_Today', {
    language: {
        emptyTable: 'No Winning Numbers'
    },
    order: [[0, 'desc']],
    "bDestroy": true
});



$('#secondary-card').fadeIn(200);


}


function GenerateWinningNumbersTodayTable(winning_numbers_today_draw_target_date='',winning_numbers_today_draw_target_parent=''){

    AjaxDo('?admin/list/winning_numbers', { target_date: winning_numbers_today_draw_target_date, target_parent: winning_numbers_today_draw_target_parent}, GenerateBetWinningRows, null, reqtype = 'POST');
}


     
GenerateWinningNumbersTodayTable(winning_numbers_today_draw_target_date,winning_numbers_today_draw_target_parent);

if (home_page_card_html_auto_load_table_content===1){
    setInterval(function () {
        if (currentPage=='Home'){
        GenerateWinningNumbersTodayTable(winning_numbers_today_draw_target_date,winning_numbers_today_draw_target_parent);
        }
          }, 300000);
}



    </script>