Website Update: Our new website layout is now live. If you experience any issues or cannot find something, please contact us and we will be happy to assist.

{source}<?php
$form_id = 391;
$force_sign_date = "2026-01-01";


function formatOffset($offset)
{
$hours = $offset / 3600;
$remainder = $offset % 3600;
$sign = $hours > 0 ? '+' : '-';
$hour = (int) abs($hours);
$minutes = (int) abs($remainder / 60);

if ($hour == 0 and $minutes == 0) {
$sign = ' ';
}
return $sign . str_pad($hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($minutes, 2, '0');
}

$user = JFactory::getUser();
if (isset($_REQUEST['userTimeZone'])) {
$TZ = stripslashes($_REQUEST['userTimeZone']);
$user->setParam("timezone", $TZ);
$user->save(true);
}

if(! isset($conn_id)) {
require_once ('booking.php');
//$conn_id = mysqli_connect("127.0.0.1", "solymarcanada", 'Ob1e5Jh4MnUc') or die("Could not connect to server");
//mysqli_select_db($conn_id, "booking_solymargroup") or die("Could not select Elite Book database");
}


// Get a db connection.
$db = JFactory::getDbo();
if ($user->id > 0) {
echo "<h2>Welcome back " . $user->name . "</h2>";
echo '<div class="flex-container" style="display: flex; flex-wrap: wrap">';
$div = '<div style="flex: 2; border: 1px solid black; border-radius: 15px;margin: 5px; padding: 5px;">';
// ////////// ASSIGNED WORK
echo $div;
echo '<h3 style="text-align: center;">Assigned Work</h3>';
$query = "SELECT M.title, M.path FROM `assigns` A, `sbmo3_menu` M WHERE A.item=M.id AND user=" . $user->id;
$db->setQuery($query);
$articles = $db->loadAssocList();
if (count($articles) > 0) {
echo '<p style="text-align:center;">Your therapist/coach has assigned you the following items to complete before the next session:</p>';
foreach ($articles as $article) {
echo "<div><a href='/" . $article['path'] . "'>" . $article['title'] . "</a></div>";
}
} else {
echo '<p style="text-align:center;">You have no work outstanding.</p>';
}
echo '</div>';
// ////////// NEXT APPT
echo $div;
echo '<h3 style="text-align: center;">Next Appointment</h3>';
$query = "SELECT `person_id` FROM `persons` WHERE `j_user_id` = " . $user->id . " LIMIT 1";
$person_id = mysqli_fetch_row(mysqli_query($conn_id, $query))[0];
if (! ($person_id > 0)) {
$query = "SELECT person_id FROM `persons` P WHERE `email` LIKE '" . $user->email . "'";
$person_id = mysqli_fetch_row(mysqli_query($conn_id, $query))[0];
}
$limit = 5;
$query = "SELECT A.*,P.timezone FROM `appts` A, `persons` P WHERE A.person_id=$person_id AND A.person_id=P.person_id AND A.date>=CURDATE() AND status in (0,1,9) ORDER BY `date`,`starttime` LIMIT $limit";
$appts = mysqli_query($conn_id, $query);
$today = FALSE;

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = "SELECT id FROM `sbmo3_facileforms_records` WHERE `form` = $form_id AND `user_id` = " . $user->id;
$db->setQuery($query);
$signed = $db->loadResult();

if (mysqli_num_rows($appts) > 0) {
foreach ($appts as $appt) {
$query = "SELECT `timezone` FROM `clinic` WHERE id = " . $appt['clinic_id'];
$clinicTZ = mysqli_fetch_array(mysqli_query($conn_id, $query))[0];
$dt = new DateTime($appt['date'] . " " . $appt['starttime'], new DateTimeZone($clinicTZ));
$dt->setTimezone(new DateTimeZone($appt['timezone']));
$time = $dt->format("h:i a");
$query = "SELECT `firstname` FROM `practitioners_active` PA, `practitioners` P WHERE PA.`person_id`=P.`person_id` AND PA.`person_id`=" . $appt['practitioner_id'];
$pract = mysqli_fetch_assoc(mysqli_query($conn_id, $query));
if (($signed || date('Y-m-d') < $force_sign_date) && $appt['date'] == date('Y-m-d')) {
//echo '<p><a href="/index.php?option=com_breezingforms&ff_form=367&ff_page=1">Today, ' . $time . ' with ' . $pract['firstname'] . '</a></p>';
echo '<p><a href="/checkin">Today, ' . $time . ' with ' . $pract['firstname'] . '</a></p>';
$today = TRUE;
} else {
echo '<p>' . $appt['date'] . ' ' . $time . ' with ' . $pract['firstname'] . '</p>';
}
}
if ($today)
echo '<p style="font-size: x-small;">Click on one of today\'s appointments to fill in your agenda.</p>';
} else {
echo '<p style="text-align:center;">You do not have any appointments scheduled.</p>';
}
if (! $signed)
echo '<p style="text-align:center; color: red;">You must sign your <a href="/service-agreement">service agreement</a></p>';

echo '</div>';
// ////////// GROUP SESSIONS
if(FALSE) {
date_default_timezone_set("Europe/London");
$days_array = array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);
echo $div;
echo '<h3 style="text-align: center;">Group Sessions</h3>';
$midnight = strtotime('today midnight');
$now = date("Y-m-d");
$query = "SELECT *  FROM `shifts` WHERE `clinic_id` = 1 AND `practitioner_id` = 5414 AND `date_start` <= '$now' AND `date_end` >= '$now' ORDER BY `dayofweek`, `start`";
$shifts = mysqli_query($conn_id, $query);
$query2 = "SELECT holiday_descr FROM pract_daysoff WHERE start <= '" . $now . "' AND end >= '" . $now . "' AND practitioner_id = 5414 LIMIT 1";
$dayOff = mysqli_fetch_row(mysqli_query($conn_id, $query2))[0];
if ($dayOff) {
echo "<p style='color:white;background:red;'>Do to unforeseen circumstances, group sessions are cancelled today</p>";
} else {
$TZ = $user->getParam('timezone', "Europe/London");
date_default_timezone_set($TZ);
// Timezone Dropdown START
$utc = new DateTimeZone('UTC');
$dt = new DateTime('now', $utc);
echo '<div>Timezone:<form method="post"><select name="userTimeZone" style="display: inline;width: fit-content;font-size: x-small;" onchange="this.form.submit()">';
foreach (DateTimeZone::listIdentifiers() as $zone) {
$current_tz = new DateTimeZone($zone);
$offset = $current_tz->getOffset($dt);
$transition = $current_tz->getTransitions($dt->getTimestamp(), $dt->getTimestamp());
$abbr = $transition[0]['abbr'];
echo '<option value="' . $zone . '"';
if ($zone == $TZ)
echo ' selected="selected"';
echo '>
' . $zone . ' [' . $abbr . ' ' . formatOffset($offset) . ']</option>';
}
echo '</select></form></div>';
// Timezone Dropdown END
foreach ($shifts as $shift) {
echo "<p>" . $days_array[$shift['dayofweek']] . ", ";
$start = $midnight + substr($shift['start'], 0, 2) * 60 * 60;
$finish = $midnight + $shift['finish'] * 60 * 60;
$query2 = "SELECT * FROM pract_timeoff WHERE `date` = '" . $now . "' AND practitioner_id = 5414 AND to_start<='" . (substr($shift['start'], 0, 2) * 60) . "' AND to_end>='" . ($shift['finish'] * 60) . "'";
$timeOff = mysqli_query($conn_id, $query2);
if (mysqli_num_rows($timeOff) > 0) {
echo date("H:i", $start) . '-' . date("H:i", $finish) . ', <span style="color:white;background:red;">Cancelled</span>';
} else {
if ($shift['dayofweek'] == date("w", time()) && (time() < $finish)) {
echo date("H:i", $start) . '-' . date("H:i", $finish) . ', <a href="/group-session">Join Now</a>';
} else {
echo date("H:i", $start) . '-' . date("H:i", $finish) . '';
}
}
echo "</p>";
}
echo '<p  style="font-size: x-small; text-align: center;">Each session begins at the 20 minute mark.<br>You can join early, and will be admitted automatically at the beginning of the next session.</p>';
}
echo '</div>';
}
// ////////// ACCOUNT STATUS
echo $div;
echo '<h3 style="text-align: center;">Account Status</h3>';
$query = "SELECT sum(`balance`) FROM `person_accounts` WHERE `person_id` = " . $person_id;
$balance = mysqli_fetch_row(mysqli_query($conn_id, $query))[0];
$query = "SELECT sum(`charge`) - (sum(`deposit`) + sum(`paid`)) as owing FROM `appts` WHERE `person_id`=$person_id AND date=CURDATE() AND status in (0,1,9)";
$owing = mysqli_fetch_row(mysqli_query($conn_id, $query))[0];
if ($owing > $balance) {
echo '<p style="text-align:center;">Payment of £' . ($owing - $balance) . ' required.</p>';
} else {
echo '<p style="text-align:center;">Your account shows a credit of £' . ($balance) . '</p>';
}
echo '<p style="font-size: x-small;">If you have made a payment in the last 24 hours, it may not be reflected in the amount shown</p>';
echo '</div>';
echo '<div style="flex: 1; border: 1px solid black; border-radius: 15px;margin: 5px; padding: 5px;">';
echo '<h3 style="text-align: center;">Email</h3>';
echo '<p style="text-align: center;"><a class="button" title="Contact Practitioner" href="/contact-my-practitioner"  style="font-size: small;">Contact Practitioner</a></p>';
echo '</div>';
echo '</div>';
}
?>
{/source}

Break patterns. Build clarity. Create lasting change.

Professional support to help you think, respond, and live differently.

Get Started

Click play to have this article read aloud

{source}<?php
use Joomla\CMS\Factory;
$app = Factory::getApplication();

function createAudio( $text, $filename ) {
$params = [   "audioConfig" => [     "audioEncoding" => "MP3",     "pitch" => "1",     "speakingRate" => "1",     "effectsProfileId" => [       "medium-bluetooth-speaker-class-device"      ]   ],   "input" => [     "text" => $text   ],   "voice" => [     "languageCode" => "en-US",     "name" => "en-US-Wavenet-F",     'ssmlGender' => 'FEMALE'   ] ];
$data_string = json_encode( $params );
$speech_api_key = "AIzaSyCGZil1LxNtwj3WZC-tIF6DeHRRcnXriy8";
$url = 'https://texttospeech.googleapis.com/v1/text:synthesize?fields=audioContent&key=' . $speech_api_key;
$handle = curl_init( $url );

curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, "POST" ); 
curl_setopt( $handle, CURLOPT_POSTFIELDS, $data_string ); 
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $handle, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Content-Length: ' . strlen( $data_string )   ]  );
$response = curl_exec( $handle );
$responseDecoded = json_decode( $response, true ); 
curl_close( $handle );
if ( $responseDecoded[ 'audioContent' ] ) {  
//return $responseDecoded[ 'audioContent' ];        
$decoded = base64_decode( $responseDecoded[ 'audioContent' ] );
$stream = fopen( $filename, 'wb' );
fwrite( $stream, $decoded );
fclose( $stream );
return TRUE;
}

}

if ( $app->input->get( 'option' ) === 'com_content' && $app->input->get( 'view' ) === 'article' )
{
// Get the article ID
$article_id = $app->input->getInt( 'id' );
$path = "images/audio/";
$rawname = "article_" . $article_id;
$filename = $path.$rawname . ".mp3";
if ( !file_exists( $filename ) )
{
$db = JFactory::getDbo();
$query = $db->getQuery( true );
$query = "SELECT concat(`title`, '! ',`introtext`, `fulltext`) as text FROM `#__content` WHERE `id` = " . $article_id;
$db->setQuery( $query );
$results = $db->loadResult();
$results = str_replace("</h","!</h",$results); // adds exclamation to all headings
$results = str_replace("'","",$results); // removes apostrophes
$results = str_replace("Solymar","Solimar",$results); // pronounce Solymar correctly
$text = addslashes(strip_tags( $results ));
$i = 0;
$limit = 4000;
while(strlen($text) > $limit)
{
// cut first $limit - last period
$sub_string = substr($text, 0, $limit);
$last_dot_position = strrpos($sub_string, ".");
if($last_dot_position && strlen($text) > $limit)
{
$partialText = substr($text, 0, $last_dot_position+1);
$text = substr($text, $last_dot_position+1);
} else {
$partialText = $text;
$text = "";
}
//echo "<h1>". $i."</h1>";
//echo "<p>$partialText</p>";

$filenames[$i] = $path."temp-".$article_id."-".$i;
createAudio( $partialText, $filenames[$i] );
$i++;
}
if(strlen($text) > 0)
{
if($i)
{
$filenames[$i] = $path."temp-".$article_id."-".$i;
} else {
$filenames[$i] = $filename;
}
createAudio( $text, $filenames[$i] );
}

if($i > 0)
{
require_once("phpmp3.php");
$mp3 = new PHPMP3($filename);
$mp3->multiJoin($filename, $filenames);
array_map( "unlink", glob( $path."temp-".$article_id."-*" ) );
}
}
echo "{mp3}$rawname{/mp3}";
}

?>
{/source}

Compassionate Mental Health Support in Whittington

Image of Whittington

Welcome to Solymar Online Therapy, where we are dedicated to providing you with compassionate and empowering mental health support right from the comfort of your own home in Whittington and throughout Ontario. Our team of experienced therapists is here to guide you through your journey toward emotional well-being.

We understand that each person's path to mental health is unique, which is why we offer a variety of therapeutic services tailored to meet the diverse needs of individuals, couples, and families. Whether you're facing challenges related to gender identity, anger management, depression, or anxiety, our team employs evidence-based techniques and a variety of therapeutic approaches to promote resilience, personal growth, and holistic development.

At Solymar Online Therapy, your comfort and privacy are our top priorities. We provide a secure, inclusive, and confidential environment where you can feel safe to explore your thoughts and feelings. Our therapy sessions are conducted via video conferencing, allowing you to connect with our qualified therapists from anywhere in Ontario, including Whittington.

To help you take the first step toward a healthier mindset, we offer a free 15-minute discovery call. This call is an opportunity for you to discuss your goals, ask any questions you may have, and learn more about how our therapists can support you. We believe in creating a strong therapeutic alliance that fosters trust and understanding, so you can embark on your journey with confidence.

Ready to start your path to healing and self-discovery? Book your free discovery call today and let us empower you to achieve your mental health goals.

About Solymar Group

Experienced professionals committed to long-term, meangingful change.

We offer a balanced approach, combining insight and practical guidance to support your mental health journey.

Learn More

Schedule Your Free Consultation

Book a 15-minute call to discuss your needs and find the right path forward.

Book a Consultation