| Server IP : 74.208.236.18 / Your IP : 216.73.216.185 Web Server : Apache System : Linux infong654 4.4.400-icpu-108 #2 SMP Wed Feb 11 10:12:42 UTC 2026 x86_64 User : u39365822 ( 135825) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/7/d147067425/htdocs/administrator/ |
Upload File : |
<?php
session_start();
if(!isset($_SESSION['AdminLoggedIn']) && @$_SESSION['AdminLoggedIn'] != '1'):
header("Location:./index.php");
endif;
include("./includes/db_con_get.php");
//print_r($_SESSION['CURRENT_ADMIN']);
$getT = mysqli_query($con, "SELECT * FROM `therapist`") or die(mysqli_error($con));
?>
<!DOCTYPE html>
<html lang="en">
<?php include("./includes/header.php"); ?>
<body class="sb-nav-fixed">
<?php include("./includes/topnavbar.php"); ?>
<div id="layoutSidenav">
<?php include("./includes/sidenavbar.php"); ?>
<div id="layoutSidenav_content">
<main>
<div class="container px-4 py-3">
<div class="row">
<h3 class="mb-5">Therapists</h3>
<div class="col-12">
<div class="col-xs-12 col-md-12 mb-4" id="msgs"></div>
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Free Clicks</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<?php while($allT = mysqli_fetch_array($getT)) {?>
<tr>
<td><?=$allT['name']?></td>
<td><?=$allT['email_id']?></td>
<td id="fclicks<?=@$allT['id']?>">
<a
href="javascript:void(0);"
style="color:#4562bd;text-decoration: none;"
id="click<?=@$allT['id']?>"
onclick="edit_clicks('<?=@$allT['id']?>')"
>
<?=$allT['avFreeClicks']?>
</a>
</td>
<td><?=date('m/d/Y H:i', strtotime($allT['created_at']))?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Email</th>
<th>Free Clicks</th>
<th>Created at</th>
</tr>
</tfoot>
</table>
</div>
</div>
</main>
<?php include("./includes/footer.php"); ?>
</div>
</div>
<?php include("./includes/footer_js.php"); ?>
<div class="loading">Loading…</div>
<script>
$(document).ready(function () {
new DataTable('#example');
});
function edit_clicks(row) {
var ID = $('#fclicks'+row);
var text = $('#click'+row).html().replace(/\s/g, '');
$(ID).html(`<div style="display:flex;justify-content: space-around;"><input type="number" name="freeClicks${row}" value="${text}" style="padding-left: 5px;width: 70%;" />
<div><a href="javascript:void(0);" title="Save" onclick="save_clicks(${row})"><i class="fa fa-save"></i></a>
<a href="javascript:void(0);" title="Cancel" onclick="cancel(${text}, ${row})"><i class="fa fa-remove"></i></a></div></div>`);
}
function cancel(txt, ref) {
$('#fclicks'+ref).html('<a href="javascript:void(0);" style="color:#4562bd;text-decoration: none;" id="click'+ref+'" onclick="edit_clicks(\''+ref+'\')">'+txt+'</a>');
}
function save_clicks(ref) {
var txt = $('input[name=freeClicks'+ref+']').val();
$('div.loading').show();
$.post(
'./includes/ajax-handler.php',
{'task':'save_free_clicks', id:ref, val:txt},
function(res) {
$('div.loading').hide();
console.log(res);
if(res.error != '') { $('#msgs').html(res.error); }
if(res.success != '') { $('#msgs').html(res.success); }
if(res.out) { $('#fclicks'+ref).html(res.out); }
},
'json'
);
}
</script>
</body>
</html>