<?php

require 'db.php';

$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
if(isset($postdata) && !empty($postdata))
{
    $about_app = mysqli_real_escape_string($con, trim($request->form_value->about_app));
    $contact_us = mysqli_real_escape_string($con, trim($request->form_value->contact_us));
    $privacy_policy = mysqli_real_escape_string($con, trim($request->form_value->privacy_policy));
    $terms = mysqli_real_escape_string($con, trim($request->form_value->terms));
    
    $shop_id = mysqli_real_escape_string($con, trim($request->shop_id));
    $shop_code = mysqli_real_escape_string($con, trim($request->shop_code));
    
    include 'token_check.php';

    if($token_check)
    {
        $sql = "UPDATE shop_settings set privacy_policy = '$privacy_policy',about_us = '$about_app',contact_us = '$contact_us',terms = '$terms' 
        where shop_id='$shop_id' and shop_code='$shop_code'";
        $result = mysqli_query($con,$sql);
        if($result)
        {
            $rows = array('status'=>true,'message' => 'Overview Updated');
            echo json_encode($rows);
        }
    }
    else
    {
        $rows = array('status'=>"",'message' => 'Data Error');
        echo json_encode($rows);
    }

}

?>

