<?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_facilities_details = array();

                // $lifeline_facilities_details[] = array(
                //     'id' => $post_id,
                //     'name' => 'Blood Bank',
                //     'content' => 'https://lifelinehospitalkerala.com/blood-bank/'
                // );
                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=="1969"){
                    $post_name="Pharmacy";
                    $html_content.= "The pharmacy of the Lifeline Hospital is a place where you get more than three thousand varieties of important medicines, which are carefully placed under accurate storage condition. It consists of centralized A/c OP pharmacy, pharmacy store, and walking cooler. Majority of the medicines for gynectreatment are imported, and procured in bulk.  All the narcotic medicines are labelled separately from the regular ones. The pharmacy has individual pharmacists for taking care of the particular medicines. Stock check and verification are done regularly. Arrangement for storage of drugs are as follows:  <ul><li>All the drugs are arranged in alphabetical order</li><li>Tablets, ointments, syrups, injections, IV fluids, surgical items are kept separately</li><li>Other items are kept as below:</li><li>Look alike</li><li>Sound alike</li><li>High risk and emergency medicine</li><li>Cool and cold storage drugs (kept in three refrigerators maintaining the temperature)</li></ul>";
                }else if($post_id=="1970"){
                    $post_name="Blood Bank";
                    $html_content.= "The Blood Bank of Lifeline Hospital is functional since 2014. The Blood Bank caters to the need of all the patients of the Hospital. All blood collected is split into various components like Packed cells, Fresh Frozen plasma, Cryoprecipitate, Platelets, and Single Donor Platelets on request. The Bank caters to in-patient and out patients of the Hospital. Blood in excess is given to other Blood Banks or Hospitals belonging to the hospital. The Blood Bank adheres to strict quality control measures and is very particular in issuing the right product to the patients in need after thorough testing. The Blood Bank also organises Blood Donation Drives and Camps to voluntarily collect blood to issue components to patients. There is a constant effort made to motivate, inspire, encourage and influence patient’s relatives and friends to donate blood at our Blood Bank. During difficult days and during any crisis (natural or man-made) the Blood Bank always strives to work towards helping patients not only belonging to Lifeline Hospital but also catering to the need of anyone and everyone in the city. <ul><li>Both whole blood and blood components are offered</li><li>24/7 availability of blood and blood components including apheresis services</li><li>Fully integrated facility for fast and error free transfusion services</li><li>Offers all the common and specialized blood and components, such as platelets, red blood cells, fresh frozen plasma, Cryoprecipitate, etc</li><li>Full time availability of qualified specialists in Transfusion Medicine for routine as well as difficult transfusion needs for patients admitted in the hospital</li><li>Whole Blood</li><li>Packed Red Cells</li><li>Saline washed Red Cells</li><li>Fresh frozen plasma</li><li>Random Platelet Concentrate</li><li>Cryoprecipitate</li><li>Leuco depleted single donor platelet by Plateletpheresis</li></ul><b>Therapeutic Apheresis procedures which include :</b><ul><li>Red Blood Cells Exchange</li><li>Therapeutic Plasma Exchange</li><li>The Cell reduction</li><li>White blood Cells, Platelets & Red Cells Depletion</li></ul>Blood Component Therapy is a replacement therapy wherein, blood is fractionanted into its various components and a deficient component is replaced, so that the damage due to lack of a particular component is prevented.  In an Apheresis, donors give only selected components depending on the donors blood type and needs of the community. The remaining blood is returned to the donor.";
                }else if($post_id=="1971"){
                    $post_name="Laboratory";
                    $html_content.= "Our NABL accredited Department of Diagnostic Medicine is fully automated with world class equipment and standards. Our patient friendly departments include Biochemistry, Endocrinology, Clinical Pathology, Haematology, Microbiology, Andrology etc which functions round the clock. In addition to special tests like Anti Mullerian Hormones, Anti Phosphatidylserine etc we are also doing New Born Screen and Non-invasive Pre Natal Screening tests which include Double, Triple and Quadruple screen, Preeclampsia screening etc in-house. Our Department of Diagnostic Medicine is equipped with internationally accepted equipment like Roche Cobas 6000, Sysmex, Bac Tec etc. Our Routine Andrology lab is equipped with CASA (Computer Assisted Sperm Analyser) and also maintains a sperm bank for donor insemination. We are having External Quality Assurance Scheme (EQAS) with both Bio Rad international and CMC Vellore.";
                }else if($post_id=="16"){
                    $post_name="Clinical Psychology";
                    $html_content.= "The Psychological Department of the Lifeline Hospital provides services through well trained and experienced Psychologist, who conducts counselling, performs assessments, run groups, conduct family-based behavioral interventions, and provide psychological consultations to assist in treatment planning. The Hospital offers an atmosphere of exceptional support that enriches emotional well-being and improve the quality of life our patients.
                    Services provided are Counselling and Assessment and Training for pregnant women, children and adolescents, youth, adults, and transgender.
                    <b>Counselling (Individual /Group)</b><ul><li>Child and adolescent: School denial problem, Bullying, Academic issues, Memory Improvement, Motivation building, Attention Deficit Disorders, Low self-esteem/confidence, Mental health conditions and psychological distress, Grief and the death of a loved one, pet, home, etc., Witnessing or experiencing a trauma event(s), Sexual, emotional, and/or physical abuse, Relocation issues (i.e. changing schools, homes, families, and/or cities/states), cyber and substance addiction, Family substance abuse or addiction.</li><li>Youth: Low self-esteem/confidence, Mental health conditions and psychological distress, Unemployment/ underemployment, Relationships, sex and sexual identity, Drug and alcohol abuse, Financial concerns, Work related problems, Illness / disability, Family breakdown, Legal issues.</li><li>Couple: Communication issues, Infertility, Miscarriage, Sexual disorders, Declining occurrences of sexual Intimacy and sexual preferences, Unwanted pregnancy, Infidelity, Values and beliefs, Traumatic situations, stress, Boredom, Jealousy, Financial crises, Domestic Violence, Addiction, Household duties, Illness, In-laws, Personality Differences, Mistrust, Cheating.</li>Family: Frequent arguments and disagreements, Breakdown in communication, Angry outbursts, Violence, Addiction, Stress, Financial problems, Onset of mental health problems and other health problems, Lack of trust/respect in a relationship, Parenting issues, Death of a loved one</li><li>Pre-marital: Premarital preparation and Counselling</li></ul><b>Assessment and Training</b>Assessment and training aims to clarify the factors that contribute to the patient’s or client’s presenting problems through (i) Learning Disability Assessments; (ii) Remedial classes; (iii) Personality development; (iv) Soft skill training; (v) Work stress management; and (vi) Mind power training.";
                }else if($post_id=="13"){
                    $post_name="Physiotherapy";
                    $html_content.= "Physiotherapy plays very important role during antenatal and postnatal period for healthier pregnancy, child birth and regain the shape back to normal. Similarly, paediatric physiotherapy, which is a dynamic field of clinical practice, offers the provision of habilitation and rehabilitation services to children (birth to 21 years).
                    The key role is to educate pregnant woman for pregnancy, labour and childcare advice on safe and appropriate exercises and to identify and treat musculoskeletal problems. After a normal delivery one can start exercise after two days, and in case of c-section wait for five days or more. The healthy weight range reduces the risk of infertility and improve the chance of conceiving spontaneously and through assistive reproductive technologies, like IVF and IUI.
                    Physiotherapist treats conditions related to genetic, neurological and orthopedic disorders through Chest physiotherapy, Physiotherapy for developmental delay, Limb length correction, Foot correction and management, and Muscle strengthening exercises. Antenatal exercises are conducted according the trimesters of pregnant women. Postnatal exercises are conducted for muscle strengthening, regaining the shape of the body and back strengthening exercise.";
                }else if($post_id=="35"){
                    $post_name="Developmental Therapy";
                    $html_content.= "In The Lifeline Hospital, we provide paediatric developmental therapy services for infants and children in order to assist in case of any delay in development or growth.  Developmental therapy enables stimulation to catch up the delay in motor skills, speech, feeding, swallowing, coordination etc. Therapists work with babies and their caregivers to improve the baby’s motor skills, sensory processing skills, muscle tone, strength, speech, feeding and swallowing as well as movement patterns. Services of paediatric physiotherapist, nutritionist and psychologist are available in cases where issues in those avenues have to be addressed along with developmental therapy.";
                }else if($post_id=="36"){
                    $post_name="Nutrition";
                    $html_content.= "Good nutrition means one’s body get all nutrients, vitamins, and minerals to work its best. Proper nutrition combined with regular physical activity promote your overall health by maintaining desirable body weight. The Nutrition Department of the Lifeline Hospital focuses on maintaining good nutrition for infertile couples, expectant mothers, children and others who have various health problems within their desirable body weight. We plan meals and snacks to provide with nutrient dense food that are rich in essentials and less in calorie. Our dietary services and modifications in diet proves that a lean body can become more fertile and healthy. For infertile couples dietary requirements are planned based on their needs and activities. Bariatric nutrition care is also provided for our clients at any time and regular dietary modifications are given based on their metabolism and needs. A healthy diet is essential for a wealthy family; so, Eat healthy, Be happy always.";
                }


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

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


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

        }else{

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

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

        }




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