<?php
include "config.php";
header('Content-Type: application/json');
$valid_passwords = array("LifeLCT" => "LifLinCnslt");
$valid_users = array_keys($valid_passwords);

$user = $_SERVER['PHP_AUTH_USER'];
$pass = $_SERVER['PHP_AUTH_PW'];

$validated = (in_array($user, $valid_users)) && ($pass == $valid_passwords[$user]);

if (!$validated) {
    header('WWW-Authenticate: Basic realm="My Realm"');
    header('HTTP/1.0 401 Unauthorized');
    $responsefull = array('error_message' => 'Unathorized: please provide a valid password!', 'data' => []);
} else {


    $datas = json_decode(file_get_contents('php://input'), true);
    $post_id = $datas['id'];
    $deviceType = $datas['device_type'];

        if(!empty($post_id)){

            $lifeline_clinics_details = array();

            if($deviceType=='Android'){
                $html_content.= "<html><head></head><body style='font-size:18px;' align='left'>";
            }else if($deviceType=='iOS'){
                $html_content.= "<html><head></head><body style='font-size:37px;' align='left'>";
            }

            if($post_id=="1930"){
                $post_name="Wellness Clinic";
                $html_content.= "<b>Antenatal classes prepare the mothers physically and emotionally for the birth of the baby. Mothers are taught the following:</b><ul><li>Classes by dietician on nutrition, diet regulation in case of diabetes in pregnancy and maintaining optimum weight during and after pregnancy.</li><li>Classes by physiotherapists on antenatal exercise, maintaining correct postures, exercises to prevent Deep vein thrombosis and Uterine prolapse, exercises to cope in labour including breathing exercises, as well as post natal exercises to get back to shape.</li><li>Classes by Psychologist on stress prevention, emotional coping with pregnant state as well as after birth, and relaxation techniques to adopt during labour pain.</li><li>Class by lactation consultant: training for new mothers in breastfeeding postures, correct ways to hold the baby, importance of breastfeeding, prevention and treatment of cracked nipples as well as inverted nipples and on how to initiate complimentary feeds later.</li><li>Yoga Training: We have a professional yoga instructor who trains antenatal (pregnancy yoga) and post natal mothers in yoga.</li></ul>";
            }else if($post_id=="1933"){
                $post_name="Breast Clinic";
                $html_content.= "Studies suggest that 1 in 8 women are diagnosed with breast cancer in their lifespan. Diagnosing the condition early helps to save a life. The Breast Clinic focuses on spreading proper awareness of breast cancer. Breast cancer awareness not just relies on breast self-examination. It also aims at improving women’s know-how about their normal state of breasts. We have advanced facilities for comfortable screening and treatments. We also offer counselling sessions to support women with breast cancer and cancer symptoms. We look forward to helping them in confidently facing the different stages of cancer and the treatments, including surgery. At our breast clinic patients receive personalized care in a supportive environment with the most effective options for diagnosis. Comprehensive check up including mammography, tumour markers, all types of genetic testing (eg: BRCAchek), as well as consultations of surgeon, gynaecologist and physician, are provided at the clinic.";
            }else if($post_id=="1944"){
                $post_name="Lactation Clinic";
                $html_content.= "Mother’s milk the most digestible food for the baby which fulfils all the nutritional needs as well as gives immunity-boosting antibodies. Breastfed babies are less likely to get diseases like diarrhoea, infections, allergies or asthmatic problems. Also breastfeeding may even protect the baby from obesity or diabetes in future. It encourages the bonding between mother and baby. In our lactation clinic mothers are trained on breastfeeding postures, how to hold the baby while breastfeeding, issues related to breastfeeding like prevention and treatment of cracked nipples or inverted nipples, initiation of complimentary feeds etc.";
            }else if($post_id=="1945"){
                $post_name="Development and Early Child Intervention Clinic";
                $html_content.= "Developmental milestones may be delayed in some babies and toddlers. Early intervention can help them catch up in their development. Early intervention focuses on physical skills (gross motor, fine motor), cognition(thinking, learning, solving problems), communication, Self-help or adaptive skills (eating, dressing) and social or emotional skills (playing, interacting with others).";
            }else if($post_id=="1946"){
                $post_name="Immunisation Clinic";
                $html_content.= "Immunization clinic is open from Monday to Saturday 9 am to 5 pm. Vaccination is done for all age groups using appropriate schedules. The clinic provides routine vaccines for infants, children, teens, and adults. The clinic also provides vaccines for international travellers, travellers to places endemic for vaccine preventable diseases, those with occupational risk, medical indications, and for post-exposure disease control.";
            }else if($post_id=="1947"){
                $post_name="PCOD Clinic";
                $html_content.= "PCOD is one of the most common causes of treatable female infertility. It is characterized by weight gain, irregular periods, acne, increased facial hair and often appearance of polycystic lesions in ovaries. COD clinic offers an integrated approach to treating polycystic ovarian syndrome. Patients are cared by specialists in gynaecology, nutrition, psychology and physiotherapy. We team up with each patient to create an individualized treatment plan that will work for her.";
            }else if($post_id=="1948"){
                $post_name="Endometriosis Clinic";
                $html_content.= "Endometriosis Clinic provides women with pelvic pain and endometriosis access to a comprehensive treatment by experts who provide the best care possible. Our minimally invasive surgery techniques help to remove endometrial lesions while maintaining fertility.";
            }else if($post_id=="1950"){
                $post_name="Menopausal Clinic";
                $html_content.= "The symptoms of menopause are caused by the changes in the hormonal levels. Symptoms include: hot flashes, night sweats, changes in sleep patterns, fatigue, headaches, muscle and joint pain, vaginal dryness, depression, mood swings or anxiety. The changes in hormonal levels can also cause additional health problems including osteoporosis (thinning and weakening of bones), coronary artery disease, urinary incontinence and weight gain. Our Menopause Clinic specializes in management of severe menopause symptoms and menopause complicated by other medical conditions.";
            }else if($post_id=="1951"){
                $post_name="Sexual Dysfunction Clinic";
                $html_content.= "Our clinic has a team of experts in fertility who assess the cause of sexual dysfunction and treat the cause in a multidisciplinary approach. The clinic has been a beacon of hope for thousands of couples who have successfully completed the treatment.";
            }else if($post_id=="1952"){
                $post_name="Obesity Clinic";
                $html_content.= "Obesity is major cause of lifestyle diseases as well as infertility. Body mass index (BMI) is assessed and treatment is determined at our obesity clinic. Diet regulation and exercise training are given at the clinic. Bariatric surgery is done for motivated patients whose BMI is more than 40 or BMI is more than 35 with comorbid illnesses like diabetes or hypertension.";
            }else if($post_id=="1953"){
                $post_name="Adolescent Clinic";
                $html_content.= "<b>Our comprehensive team attends to the physical, emotional and social wellbeing of adolescents from puberty till young adulthood</b><ul><li>Our expert team of gynaecologists detect and treat gynaecological issues at early age itself, so that a healthy adulthood can be attained by the teens. Also, early detection of gynaecological issues helps prevent fertility problems in future.</li><li>We provide psychological support to adolescents with anxiety, stress, body image issues( feeling they are too fat or thin), as well as academic problems.</li><li>Also service of dietician is available for nutritional assessment and formulation of a healthy diet plan to achieve optimum weight.</li></ul>";
            }

            $html_content.="</body></html>";

                $lifeline_clinics_details[] = array(
                    'id' => $post_id,
                    'name' => $post_name,
                    'content' => $html_content
                );

            $data = array("lifeline_clinics_details" => $lifeline_clinics_details );
            $response = array("status" => "true","message" => "Success", "data" => $data);

        }else{

            $lifeline_clinics_details[] = array(
                'id' => '',
                'name' => '',
                'content' => ''
            );

            $data = array("lifeline_clinics_details" => $lifeline_clinics_details );
            $response = array("status" => "false","message" => "parameter missing", "data" => $data);

        }




}
if(isset($response))
{
	echo json_encode($response, JSON_UNESCAPED_SLASHES);
}
?>