| Server IP : 74.208.236.18 / Your IP : 216.73.216.45 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/ |
Upload File : |
<?php
session_start();
if(!isset($_SESSION['loggedin']) && @$_SESSION['loggedin'] != '1'):
header("Location:index.php");
endif;
//print_r($_SESSION);exit;
include("includes/db_con_get.php");
$userID=$_SESSION['CURRENT_THERIPIST']['id'];
?>
<!DOCTYPE html>
<html lang="en">
<?php include("includes/header.php"); ?>
<body class="sb-nav-fixed">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.css" integrity="sha512-DD6Lm09YDHzhW3K4eLJ9Y7sFrBwtCF+KuSWOLYFqKsZ6RX4ifCu9vWqM4R+Uy++aBWe6wD4csgQRzGKp5vP6tg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
input[type="number"]{ width: 100%; padding:10px; }
.left-btn { float: left; }
.right-btn { float: right; }
.mpopup {display: none; position: fixed; z-index: 9999;padding-top: 100px;left: 0;top: 0;width: 100%;height: 100%;overflow: auto;background-color: rgb(0,0,0);background-color: rgba(0,0,0,0.4);}
.md-modal-content {position: relative;background-color: #fff;margin: auto;padding: 0;width: 450px;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation-name: animatetop;-webkit-animation-duration: 0.4s;animation-name: animatetop;animation-duration: 0.4s;border-radius: 0.3rem;}
.md-modal-header {padding: 2px 12px;background-color: #ffffff;color: #333;
border-bottom: 1px solid #e9ecef;border-top-left-radius: 0.3rem;border-top-right-radius: 0.3rem;}
.md-modal-header h2{font-size: 1.25rem;margin-top: 14px;margin-bottom: 14px;}
.md-modal-body {padding: 2px 12px;}
.md-modal-footer {padding: 1rem;background-color: #ffffff;color: #333;
border-top: 1px solid #e9ecef;border-bottom-left-radius: 0.3rem;border-bottom-right-radius: 0.3rem;text-align: right;}
.close {color: #888;float: right;font-size: 28px;font-weight: bold;}
.close:hover, .close:focus {color: #000;text-decoration: none;cursor: pointer;}
.blncCell {display: flex;
justify-content: space-around;}
.btnInc { display: none }
.btnDec { display: none }
/* add animation effects */
@-webkit-keyframes animatetop {from {top:-300px; opacity:0}to {top:0; opacity:1}}
@keyframes animatetop {from {top:-300px; opacity:0}to {top:0; opacity:1}}
/* Absolute Center Spinner */
.loading {
position: fixed;
display:none;
z-index: 999;
height: 2em;
width: 2em;
overflow: show;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
/* Transparent Overlay */
.loading:before {
content: '';
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0, .8));
background: -webkit-radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0,.8));
}
/* :not(:required) hides these rules from IE9 and below */
.loading:not(:required) {
/* hide "loading..." text */
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.loading:not(:required):after {
content: '';
display: block;
font-size: 10px;
width: 1em;
height: 1em;
margin-top: -0.5em;
-webkit-animation: spinner 150ms infinite linear;
-moz-animation: spinner 150ms infinite linear;
-ms-animation: spinner 150ms infinite linear;
-o-animation: spinner 150ms infinite linear;
animation: spinner 150ms infinite linear;
border-radius: 0.5em;
-webkit-box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
}
/* Animation */
@-webkit-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-o-keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spinner {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.clChk, .empChk {
visibility: hidden;
}
.amd-content {
width:800px;
}
</style>
<?php include("includes/topnavbar.php"); ?>
<div id="layoutSidenav">
<?php include("includes/sidenavbar.php"); ?>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
</br>
<div class="row">
<div class="col-xl-3 col-md-12 text-center">
<!-- <a href="#" data-toggle="tooltip" data-placement="right" id="tooltip" title="Content of tooltip"><i class="fa fa-question-circle-o" aria-hidden="true"></i></a> Indicates a hover-over tooltip -->
</div>
<div class="col-xl-6 col-md-12">
<h2 class="mb-3 text-center">Therapist/Counselor/Coach Dashboard</h2>
<!-- <div class="checkbox text-center"><label class="form-checkbox form-icon"><input id="s_fac" type="checkbox" class="sev_check">
Click to hide all tooltips</label></div>--></br>
<div class="card mb-4">
<div class="card-header text-center" style="background-color: #ffffff; font-weight: bold;">RevealMyWay Tool Usages and Allocations</div>
<div class="card-header text-center" style="background-color: #ffffff; font-weight: bold;">Usage Balance of Active Clients</div>
<div class="card-body">
<!-- <p style="padding: 15px;background: aliceblue;font-size: 13px; display: inline-block;width:100%;text-align:left">
<i class="fa fa-lightbulb-o" style="font-size:30px;color:orange;float: left;margin-right: 10px;"></i>
<span style="display: -webkit-box;">Add New Client to an empty row. If there are no empty rows, a current client must be removed to create an empty row
for the new client. In order remove a client, click the row of the client you want to remove and click the remove select client on the right.</span>
</p> -->
<table class="table table-bordered" style="table-layout: fixed;">
<thead>
<tr>
<th class="text-center">Clients</th>
<th class="text-center">WellBeing Profiler</th>
<th class="text-center">PMG</th>
<th class="text-center">Periodic Profiler</th>
<th class="text-center">Allow Client to View</th>
</tr>
</thead>
<tbody>
<?php if(!empty($userID)) {
$therapist_sql = "SELECT * FROM `therapist` WHERE id = '".$userID."'";
$select = $con->query($therapist_sql);
$row = $select->fetch_array(MYSQLI_ASSOC);
$Total_rows = $row['row_numbers'];
$get_users = $con->query("SELECT `UserID`, `EmailID`, `UserName`, `GuidReference`, `IsActive`, `Profiler`, `PMG`, `PeriodicProfiler`, `CanViewReport` FROM `user` WHERE `isArchived` = '0' AND `therapist_id` = '".@$userID."' ORDER BY `CreatedOn` ASC");
$total_users = $get_users->num_rows;
//echo $total_users;
$arr = array();
if(@count($arr) > 0) {
echo "<p style='color: red; font-style: italic;'>You have a new client pending that needs unused Profiler tools to allocate. Click the <b>Buy Subscription Row</b> link from the sidebar and purchase a row. See the <b>Instructions</b> page's <b>Add a New Client section</b> for more information.</p>";
}
if($total_users > 0) {
$i=1;
while($ow = $get_users->fetch_assoc()) {
?>
<tr id="row_<?=@$i?>" style="cursor:pointer" onclick="test('row_<?=@$i?>', '<?=@$i?>')" class="clRow">
<input type="checkbox" name="clChk<?=@$i?>" class="clChk" value="<?=@$ow['UserID']?>" />
<td class="text-center" height="50 PX" width="30%">
<div><?=@base64_decode($ow['UserName'])?>
<?php if(@$ow['GuidReference'] != '') {
echo '<span style="font-size: 12px;display: block;color: blue;">(ID: '.$ow['GuidReference'].')</span>';
} else {
echo '<span style="font-size: 12px;display: block;color: brown;">No reports ready for this client</span>';
}
?>
</div>
<div style="display:none" class="extLinks">
<!-- <a href="#">Change client name</a><br /> -->
<a href="./view_reports.php?uid=<?=@$ow['UserID']?>" target="_blank">View client report</a>
</div>
</td>
<td class="text-center;" height="50 PX" width="20%">
<div class="blncCell pf">
<button onclick="increment('pf', '<?=@$ow['UserID']?>', '<?=@base64_decode($ow['EmailID'])?>')" class="btnInc">+</button>
<span data-val="<?=@$ow['Profiler']?>" id="usrPf<?=@$ow['UserID']?>"><?=@$ow['Profiler']?></span>
<button onclick="decrement('pf', '<?=@$ow['UserID']?>', '<?=@$ow['EmailID']?>')" class="btnDec">-</button>
</div>
</td>
<td class="text-center;" height="50 PX" width="20%">
<div class="blncCell pmg">
<button onclick="increment('pmg', '<?=@$ow['UserID']?>', '<?=@base64_decode($ow['EmailID'])?>')" class="btnInc">+</button>
<span data-val="<?=@$ow['PMG']?>" id="usrPmg<?=@$ow['UserID']?>"><?=@$ow['PMG']?></span>
<button onclick="decrement('pmg', '<?=@$ow['UserID']?>', '<?=@base64_decode($ow['EmailID'])?>')" class="btnDec">-</button>
</div>
</td>
<td class="text-center;" height="50 PX" width="20%">
<div class="blncCell pp">
<button onclick="increment('pp', '<?=@$ow['UserID']?>', '<?=@base64_decode($ow['EmailID'])?>')" class="btnInc">+</button>
<span data-val="<?=@$ow['PeriodicProfiler']?>" id="usrPp<?=@$ow['UserID']?>"><?=@$ow['PeriodicProfiler']?></span>
<button onclick="decrement('pp', '<?=@$ow['UserID']?>', '<?=@base64_decode($ow['EmailID'])?>')" class="btnDec">-</button>
</div>
</td>
<td class="text-center" width="20%">
<input
type="radio"
name="CanViewReport<?=@$ow['UserID']?>"
value="1"
<?=@$ow['CanViewReport'] == 1 ? "checked":""?>
onchange="allowReport('yes', <?=@$ow['UserID']?>)"/>Yes
<input
type="radio"
name="CanViewReport<?=@$ow['UserID']?>"
value="0"
<?=@$ow['CanViewReport'] == 0 ? "checked":""?>
onchange="allowReport('no', <?=@$ow['UserID']?>)"/>No
</td>
</tr>
<?php
$i++;
}
} else { ?>
<tr>
<td colspan="4" style="text-align:center;">No Clients Available</td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
</div>
<table class="table table-bordered">
<tbody>
<?php if(!empty($userID)){
$therapist_sql="SELECT * FROM therapist where id = {$userID}";
$select = $con->query($therapist_sql);
$row = $select->fetch_array(MYSQLI_ASSOC);
?>
<tr>
<td class="text-center" width="22%">Unused Tool Balances</td>
<td class="text-center;" style="text-align: center;" width="19%" id="thProf" data-val="<?=@$row['profiler']?>"><?= $row['profiler'] ?></td>
<td class="text-center;" style="text-align: center;" width="19%" id="thPMG" data-val="<?=@$row['PMG']?>"><?= $row['PMG'] ?></td>
<td class="text-center;" style="text-align: center;" width="19%" id="thPP" data-val="<?=@$row['Periodic_profiler']?>"><?= $row['Periodic_profiler'] ?></td>
<td class="text-center;" style="text-align: center;" width="25%"> </td>
</tr>
<?php } else { ?>
<tr>
<td class="text-center" width="30%">Unused Tool Balances</td>
<td colspan="3" class="text-center;" width="70%">No Data Available</td>
</tr>
<?php } ?>
</tbody>
</table>
<div id="plwait" style="float: left;margin-left: 20px;"></div>
<div class="right-btn"></div></br></br>
<!-- <a href="#" data-toggle="tooltip1" data-html="true" id="tooltip" title="Click to add a new client"><i class="fa fa-question-circle-o" aria-hidden="true"></i></a> -->
</div>
<div class="col-xl-3 col-md-12 text-center">
<!-- <a href="#" data-toggle="tooltip" id="tbd" title="Introduction"><i class="fa fa-question-circle-o" aria-hidden="true"></i></a> -->
</br></br>
<!-- <a href="#" data-toggle="tooltip" data-html="true" id="tool-balance" title="Click the Instructions link from the sidebar for directions."><i class="fa fa-question-circle-o" aria-hidden="true"></i></a> -->
</br>
<!-- <a href="#" data-toggle="tooltip" data-html="true" id="tool-balance" title='
<div>The <strong>RevealMyWay Tool Usages and Allocations</strong> grid displays rows of active clients and the remaining allocated (assigned) "tool usages." It also shows the number of tool usages not yet allocated to any client in the <strong>Unused Tool Balances</strong> row.</div>
<div>You can purchase tool usages and add them to either clients rows or the <strong>Unused Tool Balances</strong> row for later allocation to clients.</div>
'><i class="fa fa-question-circle-o" aria-hidden="true"></i></a></br></br></br></br></br></br></br></br></br></br> -->
<?php //print_r($arr); ?>
<div class="custom-control custom-radio" style="padding-bottom: 5px;">
<button class="btn btn-success" id="mpopupLink">Add New Client</button>
</div>
<div class="custom-control custom-radio" style="padding-bottom: 20px;">
<button class="btn btn-success" onClick="resendInvite()">Resend invite to selected client</button>
</div>
<div class="custom-control custom-radio" style="padding-bottom: 30px;">
<button class="btn btn-danger" onClick="removeClt()">Archive Selected Client</button>
</div>
<div class="custom-control custom-radio" style="padding-bottom: 40px;">
<button style="background:#f19c00; border:#f19c00" class="btn btn-secondary" id="ampopupLink">View Archived Clients</button>
</div>
<!-- <div class="custom-control custom-radio" style="padding-bottom: 10px;">
<button style="font-size : 14px;" class="btn btn-secondary" onClick="removeEmptyRow()">Remove Selected Row</button>
</div> -->
<!-- <div class="custom-control custom-radio" style="padding-bottom: 5px;">
<button style="font-size : 14px;" class="btn btn-secondary">Undo Unused Tool Balances Changes</button>
</div> -->
<!-- <div class="custom-control custom-radio" style="padding-bottom: 5px;">
<button style="font-size : 14px;" class="btn btn-danger" id="bmpopupLink">View Pending Clients</button>
</div> -->
</div>
</div>
<div class="row">
<div class="col-xl-3 col-md-12"></div>
<div class="col-xl-6 col-md-12"></div>
</div>
</br>
<div class="row">
<div class="col-xl-3 col-md-12"></div>
<div class="col-xl-6 col-md-12"></div>
<!-- <div class="col-xl-3 col-md-12 text-center"> <a href="/spf.php" style="font-size : 14px;" class="btn btn-secondary">Purchase additional tool Usages and Rows</a></div> -->
</div>
<!-- </br> -->
<div class="row">
<div class="col-xl-3 col-md-12"></div>
<div class="col-xl-6 col-md-12"></div>
</div>
<div class="row">
<div class="col-xl-3 col-md-12">
<!-- <a href="#" >Contact us with any questions</a> -->
</div>
<div class="col-xl-6 col-md-12">
</div>
<div class="col-xl-3 col-md-12">
</div>
</div>
</br></br>
</div>
</main>
<?php include("includes/footer.php"); ?>
</div>
</div>
<?php include("includes/footer_js.php"); ?>
<!-- Modal popup box -->
<div id="mpopupBox" class="mpopup">
<!-- Modal content -->
<div class="md-modal-content">
<div class="md-modal-header">
<span class="close">×</span>
<h2>Add New Client</h2>
</div>
<div class="md-modal-body">
<div class="col-xs-12 col-md-12" style="padding: 0 0 30px 10px;">
<?php //if(@$row['profiler'] == '0') {?>
<!-- <p style="color:red;font-style: italic;">
Before you can add a new client, click the <b>Buy Subscription Row</b> link from the sidebar and purchase a row. See the <b>Instructions</b> page's <b>Add a New Client section</b> for more information.
</p> -->
<?php //} else {?>
<p style="color:red;font-style: italic;font-size: 14px;">
<strong>Step 1:</strong> Enter your client's Name and Email address in the boxes below. That information will be hidden to protect your client's privacy.<br>
<strong>Step 2:</strong> Click the blue button at the bottom to email your client an invitation to use the RevealMyWay tools.<br>
<!-- <strong>Step 3:</strong> The Purchase a Subscription for New Client window will appear for you to submit payment.<br>
<strong>Step 4:</strong> You will then be returned to the Dashboard where the new client has been added.<br> -->
</p>
<hr>
<form method="POST" id="send_client_invitation">
<div class="form-group row">
<label for="name" class="control-label col-sm-3">Client's Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="name" id="fname" placeholder="Client's name">
<span style="font-size: 13px; color: red;font-style: italic;" id="cltName"></span>
</div>
</div>
</br>
<div class="form-group row">
<label for="email" class="control-label col-sm-3">Client's Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="email" name="email" placeholder="Client's email">
<span style="font-size: 13px; color: red;font-style: italic;" id="cltEmail"></span>
</div>
</div>
</br>
<div class="form-group ">
<input type="submit" name="submit" value="Send email invite to client" class="btn btn-primary">
<!-- <button type="submit" class="btn btn-secondary isclose">ok</button> -->
</div>
</form>
<p id="clientMsg"></p>
<?php //} ?>
</div>
</div>
<div class="md-modal-footer">
<button type="button" class="btn btn-primary isclose">Close</button>
</div>
</div>
</div>
<div id="ampopupBox" class="mpopup">
<!-- Modal content -->
<div class="md-modal-content amd-content">
<div class="md-modal-header">
<span class="close aclose">×</span>
<h2>View Archived Clients</h2>
</div>
<div class="md-modal-body" style="min-height:300px">
<div class="col-xs-12 col-md-12" style="padding: 10px 0px;">
<div class="card-body" style="padding:0px">
<table class="table table-bordered text-center">
<thead>
<tr>
<th>Client</th>
<th>Client Email</th>
<th>Reports</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$get_Ausers = $con->query("SELECT `UserID`, `UserName`, `EmailId` FROM `user` WHERE `isArchived` = '1' AND `therapist_id` = '".@$userID."' ORDER BY `CreatedOn` ASC");
$total_Ausers = $get_Ausers->num_rows;
if($total_Ausers > 0) {
while($ow = $get_Ausers->fetch_assoc()) {
?>
<tr>
<th><?=@base64_decode($ow['UserName'])?></th>
<td><?=@base64_decode($ow['EmailId'])?></td>
<td></td>
<td>
<button class="btn btn-success" onclick="reactivate(<?=@$ow['UserID']?>)">Reactivate</button>
<button class="btn btn-danger" onclick="delete_permanently(<?=@$ow['UserID']?>)">Permanently Delete Client >></button>
</td>
</tr>
<?php
}
} else {
?>
<tr>
<td colspan="4">No records found.</td>
</tr>
<?php
}
?>
</tbody>
</table>
<div class="loading loadingD">Loading…</div>
</div>
</div>
</div>
<div class="md-modal-footer">
<button type="button" class="btn btn-primary isclose aisclose">Close</button>
</div>
</div>
</div>
<div id="bmpopupBox" class="mpopup">
<!-- Modal content -->
<div class="md-modal-content" style="width: fit-content;">
<div class="md-modal-header">
<span class="close bclose">×</span>
<h2>View Pending Clients</h2>
</div>
<div class="md-modal-body">
<div class="col-xs-12 col-md-12" style="padding: 10px 0px;">
<div class="card-body" style="padding:0px">
<table class="table table-bordered text-center">
<thead>
<tr>
<th>Client</th>
<th>Email</th>
<th>Status</th>
<th>Has completed sign up</th>
</tr>
</thead>
<tbody>
<?php
if(@count($arr) > 0) {
foreach($arr as $cls) {
?>
<tr>
<th><?=@base64_decode($cls['UserName'])?></th>
<td><?=@base64_decode($cls['EmailID'])?></td>
<td><span style="color:red; font-style:italic">Pending</span></td>
<td><?=@$cls['IsActive'] == '0' ?
'<span style="color:red; font-style:italic">Pending</span>'
: '<span style="color:green; font-style:italic">Active</span>'?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td colspan="4">No records found.</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="md-modal-footer">
<button type="button" class="btn btn-primary isclose bisclose">Close</button>
</div>
</div>
</div>
<div class="loading">Loading…</div>
<script>
// Select modal
var mpopup = document.getElementById('mpopupBox');
var ampopup = document.getElementById('ampopupBox');
var bmpopup = document.getElementById('bmpopupBox');
// Select trigger link
var mpLink = document.getElementById("mpopupLink");
var ampLink = document.getElementById("ampopupLink");
//var bmpLink = document.getElementById("bmpopupLink");
// Select close action element
var close = document.getElementsByClassName("close")[0];
var isclose = document.getElementsByClassName("isclose")[0];
var aclose = document.getElementsByClassName("aclose")[0];
var aisclose = document.getElementsByClassName("aisclose")[0];
var bclose = document.getElementsByClassName("bclose")[0];
var bisclose = document.getElementsByClassName("bisclose")[0];
// Open modal once the link is clicked
mpLink.onclick = function() {
mpopup.style.display = "block";
};
ampLink.onclick = function() {
ampopup.style.display = "block";
};
//bmpLink.onclick = function() {
//bmpopup.style.display = "block";
//};
// Close modal once close element is clicked
close.onclick = function() {
mpopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
isclose.onclick = function() {
mpopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
// Close modal once close element is clicked
aclose.onclick = function() {
ampopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
aisclose.onclick = function() {
ampopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
bclose.onclick = function() {
bmpopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
bisclose.onclick = function() {
bmpopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
};
// Close modal when user clicks outside of the modal box
window.onclick = function(event) {
if (event.target == mpopup) {
mpopup.style.display = "none";
$('#plwait').html('<span style="color:red">Please wait...</span>')
location.reload();
}
};
</script>
<script>
function delete_permanently(idi) {
if(confirm("Are you sure you want to delete this client permanently?\nIf you click OK, all the client's data will be lost!")) {
$('.loadingD').show()
$.post('/includes/ajax-handler.php', {'task':'del_perma', user:idi}, function(res) {
console.log(res.type);
if(res.type == "success") {
alert(res.msg);
location.reload();
} else if(res == 'failed') {
alert("Sorry, but client cannot be deleted! Please try after some time.");
}
$('.loadingD').hide()
}, 'json');
}
}
function reactivate(idi) {
if(confirm("Are you sure you want to reactivate this client!")) {
$('.loadingD').show()
$.post('/includes/ajax-handler.php', {'task':'reactivate_client', user:idi}, function(res) {
console.log(res.type);
if(res.type == "success") {
alert(res.msg);
location.reload();
} else if(res == 'failed') {
alert("Sorry, but client cannot be reactivated! Please try after some time.");
}
$('.loadingD').hide()
}, 'json');
}
}
function increment(obj, usr, usr_em) {
let pf = $('#thProf').data('val');
let pmg = $('#thPMG').data('val')
let pp = $('#thPP').data('val')
if(obj === 'pf') {
if(pf == '0') { alert("Your Profiler limit exausted!"); } else {
let pfO = $(`#usrPf${usr}`).data('val');
pfO = pfO + 1;
pf = pf - 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'increment_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(res)
$('#thProf').data('val', pf);
$('#thProf').html(pf);
$(`#usrPf${usr}`).data('val', pfO)
$(`#usrPf${usr}`).html(pfO);
$('.loading').hide()
});
}
} else if(obj === 'pmg') {
if(pmg == '0') { alert("Your PMG limit exausted!"); } else {
let pmO = $(`#usrPmg${usr}`).data('val');
pmO = pmO + 1;
pmg = pmg - 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'increment_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(pmg)
$('#thPMG').data('val', pmg);
$('#thPMG').html(pmg);
$(`#usrPmg${usr}`).data('val', pmO)
$(`#usrPmg${usr}`).html(pmO);
$('.loading').hide()
});
}
} else if(obj === 'pp') {
if(pp == '0') { alert("Your Periodic Profiler limit exausted!"); } else {
let ppO = $(`#usrPp${usr}`).data('val');
ppO = ppO + 1;
pp = pp - 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'increment_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(pp)
$('#thPP').data('val', pp);
$('#thPP').html(pp);
$(`#usrPp${usr}`).data('val', ppO)
$(`#usrPp${usr}`).html(ppO);
$('.loading').hide()
});
}
}
}
function decrement(obj, usr, usr_em) {
let pf = $('#thProf').data('val');
let pmg = $('#thPMG').data('val');
let pp = $('#thPP').data('val');
if(obj === 'pf') {
let pfO = $(`#usrPf${usr}`).data('val');
pfO = pfO - 1;
if(pfO < 0) { alert("The Profiler cannot be decremented further!"); } else {
pf = pf + 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'decrement_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(res)
$('#thProf').data('val', pf);
$('#thProf').html(pf);
$(`#usrPf${usr}`).data('val', pfO)
$(`#usrPf${usr}`).html(pfO);
$('.loading').hide()
});
}
} else if(obj === 'pmg') {
let pmO = $(`#usrPmg${usr}`).data('val');
pmO = pmO - 1;
if(pmO < 0) { alert("The PMG cannot be decremented further!"); } else {
pmg = pmg + 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'decrement_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(res);
$('#thPMG').data('val', pmg);
$('#thPMG').html(pmg);
$(`#usrPmg${usr}`).data('val', pmO)
$(`#usrPmg${usr}`).html(pmO);
$('.loading').hide()
});
}
} else if(obj === 'pp') {
let ppO = $(`#usrPp${usr}`).data('val');
ppO = ppO - 1;
if(ppO < 0) { alert("The PMG cannot be decremented further!"); } else {
pp = pp + 1;
$('.loading').show()
$.post('/includes/ajax-handler.php', {'task':'decrement_balance', type: obj, user:usr, user_email: usr_em }, function(res) {
console.log(res)
$('#thPP').data('val', pp);
$('#thPP').html(pp);
$(`#usrPp${usr}`).data('val', ppO)
$(`#usrPp${usr}`).html(ppO);
$('.loading').hide()
})
}
}
}
function test(idd, ref) {
$(':checkbox').prop('checked', false);
$(`input[name=clChk${ref}]`).prop('checked', true)
$(`.btnInc, .btnDec`).css('display','none');
$(`.clRow`).css('background-color', 'white');
$(`.extLinks`).css('display', 'none');
$(`#${idd} .btnInc, #${idd} .btnDec`).css('display','block');
$(`#${idd}`).css('background-color', '#f7cf88');
$(`#${idd} .extLinks`).css('display','block');
$(`.clEmpRow`).css('background-color', 'white');
}
function selectEmpRow(idd, ref) {
$(':checkbox').prop('checked', false);
$(`input[name=empChk${ref}]`).prop('checked', true)
$(`.clEmpRow`).css('background-color', 'white');
$(`#${idd}`).css('background-color', '#b7fdfc');
$(`.btnInc, .btnDec`).css('display','none');
$(`.clRow`).css('background-color', 'white');
$(`.extLinks`).css('display', 'none');
}
function removeClt() {
clt = $('.clChk:checkbox:checked').val();
console.log(clt);
if(clt) {
if(confirm('Archiving removes the client\'s row, makes it Inactive, and any remaining tool uses are added to the Unused Tool Balances row. Are you sure you want to archive the client?')) {
$.post('/includes/ajax-handler.php', {'task':'delete_selected_client', user:clt }, function(res) {
console.log(res)
if(res == 'success') {
alert('Client archived successfully!')
location.reload();
} else {
alert('Problem deleting client! please try after sometime');
}
}, 'json')
}
} else {
alert("Please select the client!");
}
}
function removeEmptyRow() {
clt = $('.empChk:checkbox:checked').val();
if(clt) {
if(confirm('Please make sure that once the row deleted cannot be recoverd! Are you sure you want to proceed?')) {
$.post('/includes/ajax-handler.php', {'task':'delete_empty_row', row:clt }, function(res) {
console.log(res)
if(res == 'success') {
alert('Row deleted successfully!')
location.reload();
} else {
alert('Problem deleting row! please try after sometime');
}
}, 'json')
}
} else {
alert("Please select the row!");
}
}
function resendInvite() {
clt = $('.clChk:checkbox:checked').val();
if(clt) {
if(confirm('Are you sure you want to sent an invite to this client?')) {
$.post('/includes/ajax-handler.php', {'task':'resend_client_invite', user:clt }, function(res) {
//console.log(res)
if(res.msg) {
alert(`${res.msg}`)
//location.reload();
} else {
alert('Problem sending invite! please try after sometime');
}
}, 'json')
}
} else {
alert("Please select the client!");
}
}
function allowReport(va, cl) {
$('.loading').show();
$.post('/includes/ajax-handler.php', {'task':'can_view_report', user:cl, val:va }, function(res) {
$('.loading').hide();
if(res === 'success') {
alert("Client is now allowed to view the reports.");
} else {
alert("Client is not allowed to view reports.");
}
}, 'json');
}
</script>
<script>
$(function () {
$('#tbd,#tooltip,#tooltip1').tooltip({placement: 'bottom'});
$('#tool-balance').tooltip({html: true, placement: "bottom"});
$('a').tooltip('show');
});
$(document).ready(function(){
$("#s_fac").on("click", function(){
check = $("#s_fac").is(":checked");
if(check) {
$('a').tooltip('hide');
} else {
$('a').tooltip('show');
}
});
});
$("#send_client_invitation").on('submit', function(e) {
e.preventDefault();
var formData = $(this).serialize();
var data = {"task":"add_client_invite", formdata:formData};
$.ajax({
type: 'POST',
url: '/includes/ajax-handler.php',
data: data,
dataType: 'json',
success:function(res) {
$('div.loadinggg').hide();
if(res === "success1") {
location.href = `https://therapist.revealmyway.com/spf.php?${formData}`;
} else if(res.msg) {
$('#clientMsg').html(res.msg);
$('input[name=name]').val("");
$('input[name=email]').val("");
setTimeout(() => {
location.reload();
}, 3000);
}
if(res.errors.name) { $('#cltName').html(res.errors.name); } else { $('#cltName').html(""); }
if(res.errors.email) { $('#cltEmail').html(res.errors.email); } else { $('#cltEmail').html(""); }
console.log(res);
},
beforeSend: function(){
$('div.loadinggg').show();
}
});
});
</script>
</body>
</html>