<?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);

            $query_menu = "SELECT * FROM `wp_posts` WHERE `ID`=15";
            $res_menu = mysqli_query($con, $query_menu);
            $row_menu = mysqli_fetch_array($res_menu);
                $post_content = str_replace("\n"," ",$row_menu['post_content']);
                // $post_content2 = str_replace("<!-- wp:html -->"," ",$post_content);
                // $post_content3 = str_replace(" <!-- /wp:html -->"," ",$post_content2);

            $contentsssss.= '<html><head></head><body style="font-size:21px;" align="justify">The Lifeline, one of the most trusted names in health care domain was entrenched on April 24th 2005 by Dr. S Pappachan, an expert Obstetrician, Gynecologist and a Fertility Specialist. Our success and enduring growth attributes to the commitment towards achieving the needs of communities we serve.</p><p>As a multispecialty hospital, we are equipped with the most advanced technologies and facilities. Comprehensively adept infertility treatment, gynaecology and obstetrics, paediatrics and neonatology, genetics and bariatric plus laparoscopy, urology, radiology, general medicine and general surgery, our fineness and proficiency keep on mounting incessantly. The  Lifeline had proven that the highest quality and latest forms of treatment and management are possible even in peripheral settings. The key elements of our success are vision and dedication.';

            $contentsssss.=' The Lifeline is different from other institutions of its kind. It provides the latest technology combined with tender loving care for the patients in a clean healthy atmosphere where you get the best result. As a natural corollary,  The  Lifeline is now recognized as a leading centre in India offering competitive medical tourism packages to patients from neighbouring countries like the Middle East, African countries, as well as from USA, UK, Australia and other European countries.<p><img alt="The Lifeline Hospital" src="https://lifelinehospitalkerala.com/wp-content/uploads/2019/10/Lifeline-Front-View-crop.jpg" width="100%"></p></body></html>';

             //$contentsssss = htmlentities($post_content);
             //$content2 = html_entity_decode($contentsssss);

             $contentstag =  stripslashes($contentsssss);
            //$contentsssss =  strip_tags($post_content);

            //echo $contentsssss;
            $data = array("about_lifeline" => $contentstag );
            $response = array("status" => "true","message" => "Success", "data" => $data);



//print_r($response);
}
if(isset($response))
{
	echo json_encode($response);
}
?>