Files
float-gate/app/Controllers/FloatWeb.php
T
DESKTOP-GBA0BK8\Admin c1a9249426 Faq Data
2023-04-09 18:24:23 -04:00

614 lines
31 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Controllers;
use CodeIgniter\API\ResponseTrait;
class FloatWeb extends BaseController
{
use ResponseTrait;
protected $db;
public $con_name = 'float_blog';
private function apiData() {
$this->db = \Config\Database::connect($this->con_name);
$data = array();
try {
$mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 9";
$mysql = "SELECT p1.id AS id, p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1
ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' )
LEFT JOIN
wp_postmeta wm2
ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL )
WHERE
p1.post_status='publish'
AND p1.post_type='post'
ORDER BY p1.post_date DESC LIMIT 30";
//echo $mysql;
$query = $this->db->query($mysql);
// $row = $query->result_array();
// $data["blog_array"] = $row;
$data['payload']['blogdata'] = $query->getResult('array');
$data['payload']['featured'] = [];
} catch (Exception $ex) {
}
// featured
// try {
// $mysql = "SELECT id, post_title, post_content,post_date,comment_count
// FROM wp_posts WHERE post_type='post' AND post_status = 'publish' AND id = 263";
// $query = $this->db->query($mysql);
//
// $rowF = $query->result_array();
// // print_r( $rowF );
// // $r = $this->db->query($mysql);
// $data["blog_featured"] = $rowF[0];
// } catch (Exception $ex) {
//
// }
// $this->renderSitePage('blog', $data);
// return $this->response->setJson($data);
return $data;
}
private function apiData2(){
return array (
0 =>
array (
'payload' =>
array (
0 =>
array (
'id' => 57,
'ID' => 57,
'post_author' => 1,
'post_date' => '2021-02-05T00:19:28.000Z',
'post_date_gmt' => '2021-02-05T00:19:28.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>The gut is part of the digestive tract and especially the intestine or stomach.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>An unhealthy gut may lead to many health problems such as skin, weight, heart, immune system, the brain, hormone levels, ability to absorb nutrients.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>In Gut issues, Stomach disturbances like bloating, constipation, diarrhoea, and heartburn can all be signs of an unhealthy gut. Constant fatigue.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Indications for an unhealthy gut are :</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p><strong>Upset stomach</strong></p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p> A stable gut will become less strain processing food and excreting waste.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":5} -->
<h5>High-sugar diet</h5>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>A food great in processed foods and added sugars can reduce the number of healthy bacteria in your gut. The imbalance can produce enhanced sugar needs, which can harm your stomach still more. Large quantities of processed sugars, especially high-fructose corn syrup, have been connected to heightened inflammation in the body. Inflammation can be the forerunner to several diseases and even growths.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":5} -->
<h5>Erratic weight changes</h5>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Increasing or decreasing weight without making changes to your meal or exercise habits may be a sign of an unhealthy gut. An imbalanced gut can hurt your body\'s capacity to digest nutrients, control blood sugar, and store fat. Weight loss may be caused by tiny abdominal bacterial growth ( while weight gain may be driven by the urge to eat more due to decreased nutrient absorption.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":5} -->
<h5>Sleep disturbances or constant fatigue</h5>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>An unhealthy gut may add to sleep disorders such as insomnia, leading to chronic tiredness. Most of the hormone that affects mood and sleep is produced in the gut. So stomach damage can undermine your capacity to sleep well. Some sleep disorders have also linked to risk for fibromyalgia.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":5} -->
<h5>Skin irritation</h5>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Skin diseases like eczema may be linked to a damaged gut. Swelling in the gut caused by a low food intake or allergies may cause progressed "leaking" of proteins out into the body, which can sting the skin and cause eczema conditions.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":5} -->
<h5>Food intolerances</h5>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Food intolerances emerge from problem digesting certain foods (this is entirely different from a food allergy). It\'s believed that the low quality of bacteria may cause food intolerances in the gut. Thus, it can lead to trouble digesting the trigger foods and obnoxious symptoms such as bloating, diarrhoea, abdominal pain, gas and nausea. There are some research results that food allergies may also be related to gut health.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":3} -->
<h3>Things you can do to improve your gut health</h3>
<!-- /wp:heading -->
<!-- wp:list -->
<ul><li><strong>Stay hydrated</strong></li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Consuming plenty of water has been proven to help the intestines\' lining and regulate good bacteria in the gut. Drinking a lot of liquid is an easy way to support a healthy gut.</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li><strong>Sleep Plenty</strong></li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Not sleeping well-enough can impact your gut health severely. Having Try at least 78 hours of uninterrupted sleep per night is very vital.&nbsp;</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li><strong>Lower your stress levels</strong></li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>High levels of stress is a big challenge to your whole body, not exempting your gut. Lowering stress levels include walking, yoga, getting a massage, decreasing caffeine intake, meditation, spending time with friends or family, and diffusing essential oils.&nbsp;</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li><strong>Take a prebiotic or probiotic.</strong></li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Including a probiotic or prebiotic supplement to your food is one of many ways to improve your gut health. Prebiotics give "food" goal is to promote the growth of useful bacteria in the gut, while probiotics are suited to live bacteria. Have it in mind that\'s not all probiotic supplements will give a benefit.&nbsp;</p>
<!-- /wp:paragraph -->',
'post_title' => 'How To Detox Your Gut Daily',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_password' => '',
'post_name' => 'how-to-detox-your-gut-daily',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-02-05T00:19:29.000Z',
'post_modified_gmt' => '2021-02-05T00:19:29.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=57',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2021/02/Gut.jpg',
),
1 =>
array (
'id' => 52,
'ID' => 52,
'post_author' => 1,
'post_date' => '2021-01-27T00:50:15.000Z',
'post_date_gmt' => '2021-01-27T00:50:15.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>The invented vaccine to tackle the widely spread virus is effective against new variants of the coronavirus and referred to as "Moderna".The vaccine effectively immunises us to protect the entire global community from the continued peril of morbidity and death from critical acute respiratory syndrome.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Get a COVID-19 vaccine, wear a mask, stay at least 6 feet apart, avoid crowds, and wash your hands to protect against COVID-19.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Vaccinating ourselves protects us from our immediate environment, home, workplace, grocery store and against getting COVID-19.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>The vaccine is a necessity to be taken, but some people have other objections to the vaccination. Let\'s highlight the significant reasons why the vaccine is healthy and should be considered.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Thousands of employees and even inmates have received their first round of the vaccinations having inmind, precautions are taken, and it is a confined environment.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>At least 100,032,461 cases of coronavirus have been recorded across the globe, according to Johns Hopkins.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Countries with the most affected Covid-19 cases are:</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>United States</li><li>India</li><li>Brazil</li><li>Russia</li><li>United Kingdom</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>The United States makes up a quarter of all global cases, with well over 25 million coronavirus cases reported.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>After the vaccine have been taken, a two months follow-up should be considered.</p>
<!-- /wp:paragraph -->',
'post_title' => 'COVID-19 Vaccine',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_password' => '',
'post_name' => 'covid-19-vaccine',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-01-27T01:27:27.000Z',
'post_modified_gmt' => '2021-01-27T01:27:27.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=52',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2021/01/COVID-19-vaccine_002.jpg',
),
2 =>
array (
'id' => 26,
'ID' => 26,
'post_author' => 1,
'post_date' => '2020-02-04T17:32:30.000Z',
'post_date_gmt' => '2020-02-04T17:32:30.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>Coronavirus is gradually elevating itself to be a pandemic. It is highly infectious, known to have established itself in Southeast Asia-China in Wuhan, Hubei Province. It is also likely to be person-to-person spread.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>2019-nCoV is a betacoronavirus, like MERS and SARs, all of which have their origins in bats. The recent emergence of this virus was from an animal reservoir.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Beginning on, several of the patients in the brawl of respiratory sickness prompted by 2019-nCov in Wuhan, China had some connection to vast seafood and live animal market, proposing animal-to-person spread. Following, an increasing amount of patients reportedly did not have vulnerability to animal markets, indicating person-to-person spread. Chinese executives affirm that sustained person-to-person spread in the community is occurring in China. Person-to-person spread has been announced outside China, including in the United States, and other countries. An increasing, cases the asymptomatic extent of the virus have been recorded.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Obvious indications of the virus include respiratory signs, temperature, cold, brevity of breath and breathing problems. While also critical incidents, this virus can cause pneumonitis, severe acute respiratory syndrome, kidney breakdown and even death.&nbsp;</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p><strong>PRECAUTIONS</strong></p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>Thorough hands wash with soap and water or alcohol-based hand rub</li><li>Covering nostrils and mouth when coughing and sneezing with a cloth or flexed elbow.</li><li>Thoroughly meat and eggs cooking.</li><li>Avoid intimate touch with anyone with cold or flu-like symptoms.</li><li>Avoid unsafe contact with live animals.</li></ul>
<!-- /wp:list -->',
'post_title' => 'Corona Virus',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'open',
'post_password' => '',
'post_name' => 'corona-virus',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-09-06T14:04:09.000Z',
'post_modified_gmt' => '2021-09-06T14:04:09.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=26',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2020/02/coronavirus.jpg',
),
3 =>
array (
'id' => 23,
'ID' => 23,
'post_author' => 1,
'post_date' => '2019-06-19T12:38:30.000Z',
'post_date_gmt' => '2019-06-19T12:38:30.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>Many individuals dont really know that why some of them get to be
distinctly dependent on drugs by just using it for a single time or how
drugs change the mind to cultivate urgent medication mishandle. They
erroneously see the use of drug as entirely a social issue and may
portray the individuals who take tranquilizers as ethically powerless.
One extremely regular conviction is that those who use drugs ought to
have the capacity to recently quit taking them on the off chance that
they are just eager to change their behavior.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>What individuals regularly didnt think about is the many-sided
quality of drug usage as it is a kind of disease that generally affects
the mind, and hence, quitting drug intake is not just a question of
self-control. Through logical advances, we now know substantially more
about how precisely the drugs function in the brain of a person using
it.&nbsp; Using drugs can affect health in a lot of ways such as:</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>A great number of sicknesses, deaths as well as disabilities come
from the use of drugs rather than any other health issues. Nowadays, one
in the four deaths owes to illegal medication utilize. Individuals who
live with drug reliance have a higher danger of every single awful
result including inadvertent wounds, medicinal issues, accidents, and
deaths.</li><li>Drug use and its overtaking can be sweeping, influencing practically
every organ in the human body. It also makes the immune system weak
with the increased chances of several diseases.</li><li>It also results in cardiovascular conditions extending from
irregular heart rate to dangerous heart attacks. Infused medications can
likewise prompt to crumpled veins and contaminations of the veins along
with heart valves. It also causes vomiting, queasiness and stomach
torment.</li><li>Excess use of the drug can make the liver weak and make it work
harder, conceivably bringing about huge harm or failure of the liver. It
likewise causes seizures along with some damage to the brain that can
affect all parts of the body day by day, by bringing on issues related
to the memory, consideration and basic leadership, including maintained
mental disarray and lasting mind harm.</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Some other effects that are generally short term are:</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>It may result in some panic attacks which is actually the time of
extremely serious tension when the heart rate increments, with
trembling, breath shortness along with sweat and a dread of losing
control. It may likewise feel like that the surroundings are bizarre and
unbelievable, or that you are losing your own character and feeling of
reality.</li></ul>
<!-- /wp:list -->
<!-- wp:list -->
<ul><li>Psychoactive medications can result in delusions in which a person
trust things that are not in real, or visualizations on which a person
see or hear things that are not there.</li></ul>
<!-- /wp:list -->
<!-- wp:list -->
<ul><li>You may face those times when you feel discouraged such as tragic,
crabby, tired with loss of delight, or feeling of hyper. You may also
experience raised temperament, dreams, imprudent conduct, dashing
contemplations. This is called state of mind issue and might be brought
about by medications, for example, cocaine, amphetamines as well as
heroin.</li></ul>
<!-- /wp:list -->',
'post_title' => 'Use of Drug and your Health',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'open',
'post_password' => '',
'post_name' => 'use-of-drug-and-your-health',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-09-06T14:04:22.000Z',
'post_modified_gmt' => '2021-09-06T14:04:22.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=23',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2020/07/drugshealth.jpg',
),
4 =>
array (
'id' => 21,
'ID' => 21,
'post_author' => 1,
'post_date' => '2019-06-19T11:28:43.000Z',
'post_date_gmt' => '2019-06-19T11:28:43.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>It can take an ordinary youthful couple up to 12 months to get
pregnant.&nbsp; Doctors typically suggest patients in their 20s and mid 30s
attempt to get pregnant or possibly not utilize anti-conception
medication for 12 months.&nbsp; Couples look for specific pregnancy treatment
for some reasons; however there are some broad elements after
experiencing which, a couple should call a reproductive specialist.</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>A lady had a past with at least three unnatural birth cycles.</li><li>A lady under 35 has not been able get pregnant even after one year of consistent as well as unprotected intercourse.</li><li>A lady needs any treatment or some kind of microsurgery for the
endometriosis as well as a blockage or scarring of her fallopian tubes.</li><li>A past of couple filled with genital contaminations or pelvic
provocative illness, a DES mother, unpredictable periods, un-descended
gonads, and so on.</li><li>A lady who ovulates unpredictably or hasnt reacted to past medication treatment.</li><li>A mans semen investigation demonstrated a low sperm check, poor development, as well as poor structure of sperm.</li><li>A couple is thinking about helped conceptive advances, for example,
in vitro fertilization as well as gamete intrafallopian transfer.</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Men with the issues of fertility are best treated by a urologist or
by an andrologist. Urologists are prepared in the assessment and
treatment of disarranges of the kidneys, urinary tract, bladder, and
male regenerative organs, and have no less than two years of general
surgical preparing. A urologist will more often than not play out a
semen examination, search for varicoceles, check the hormone levels, and
request lab tests to beware of the nature of sperm. An andrologist is
either a medicinal specialist or lab expert who may have earned a PhD in
natural chemistry, endocrinology, or physiology. These specialists
concentrate on the physiologic, hormonal conditions that influence the
fertility of male. While if the a lady has reproductive issues that
cant be tended to by her normal doctor, she can see a regenerative
endocrinologist which is actually a specialist gaining practical
experience in the treatment of hormonal issue that influence
propagation. REs have finished no less than two years of preparing along
with their ob-gyn residency and have passed oral and composed exams.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Contingent upon the way of her issue, a lady may likewise need to see
a reproductive specialist. They all are prepared to treat anatomical
issues, for example, tubal check, endometriosis along with uterine
variations from the norm, and in addition other reproductive organ issue
that need to be treated with any surgery.</p>
<!-- /wp:paragraph -->',
'post_title' => 'Pregnancy delay, when to call a reproductive specialist.',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'open',
'post_password' => '',
'post_name' => 'pregnancy-delay-when-to-call-a-reproductive-specialist',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-09-06T14:04:33.000Z',
'post_modified_gmt' => '2021-09-06T14:04:33.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=21',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2020/07/pregnancy-delay.jpg',
),
5 =>
array (
'id' => 15,
'ID' => 15,
'post_author' => 1,
'post_date' => '2019-06-19T11:25:21.000Z',
'post_date_gmt' => '2019-06-19T11:25:21.000Z',
'post_content' => '<!-- wp:paragraph -->
<p>Tracking your health and fitness should be a pivotal part of your training. It helps you to -</p>
<!-- /wp:paragraph -->
<!-- wp:list -->
<ul><li>Measure progress</li><li>Gauge the effectiveness of your exercise regime and diet</li><li>Sustain motivation</li><li>Form healthy habits</li><li>Understand how your lifestyle choices are affecting you</li><li>Make informed decisions about what to do next</li><li>Learn about your body and focus on methods that work for you</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->',
'post_title' => 'Benefits of your Health Tracking',
'post_excerpt' => '',
'post_status' => 'publish',
'comment_status' => 'closed',
'ping_status' => 'open',
'post_password' => '',
'post_name' => 'benefits-of-your-health-tracking',
'to_ping' => '',
'pinged' => '',
'post_modified' => '2021-09-06T14:03:21.000Z',
'post_modified_gmt' => '2021-09-06T14:03:21.000Z',
'post_content_filtered' => '',
'post_parent' => 0,
'guid' => 'https://blog.mermsemr.com/?p=15',
'menu_order' => 0,
'post_type' => 'post',
'post_mime_type' => '',
'comment_count' => 0,
'meta_value' => '2020/07/health-tracking.jpg',
),
),
),
);
}
public function blogData()
{
$rawData = $this->apiData();
// $res1= $rawData[0]['payload'];
$res1= $rawData; //[0]['payload'];
$this->runCache('blogdata',$res1['payload']);
$resJson = $this->response->setJson($res1);
return $resJson;
}
public function index()
{
}
public function website()
{
//$request = service('request');
header('Access-Control-Allow-Origin: *');
//header("Access-Control-Allow-Origin: http://localhost:9057 ");
header('Access-Control-Expose-Headers: Access-Control-Allow-Origin');
//header('Access-Control-Allow-Credentials: true ');
//header("Access-Control-Allow-Headers: Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With");
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Content-type: application/json');
// what is the endpoint
$uri = urldecode(current_url(true));
$findme = '?';
$pos = strpos($uri, $findme);
if ($pos > 5) {
$uri = substr($uri, 0, $pos);
}
$pieces = explode('/', $uri);
$psc = count($pieces);
$endpoint = $psc > 0 ? $pieces[$psc - 1] : '';
log_message('critical', "Enpoint-> ".$endpoint );
$endpoints = [
'faq' => ['GET'],
'blogdata' => ['GET'],
'contact' => ['POST']
];
$res1 = [];
if (array_key_exists($endpoint, $endpoints)) {
} else {
http_response_code(404);
// tell the user product does not exist
echo json_encode([
'message' => 'Endpoint not found.',
'URI' => $uri,
]);
}
// echo "EXYTACT INPUT DATA HERE";
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
log_message('critical', "Enpoint LOC2 HERE -> ".$endpoint );
$get_param = $_GET['reqData'] ?? null;
$raw_array = ($get_param!=null) ? json_decode($get_param, true):[];
}
// $raw_array['fff'] = json_decode($this->request->getJSON(), true);
log_message('critical', "Enpoint LOC2-> ".$endpoint );
switch ($endpoint) {
case 'faq':
$res1 = (new \App\Models\faqData())->getSiteFaq([]);
break;
case 'blogdata':
// $res = $this->dummyData($raw_array);
break;
case 'contact':
$res1 = $this->dummyData($raw_array);
break;
}
return $this->response->setJson($res1);
}
//this is dummy function to establish the endpoints before real implementations
private function dummyData($raw_array)
{
return [
'msg' => 'Not implemented yet',
'raw_data' => $raw_array,
];
}
}