<?php
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET, POST');
    header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
    include '../../../config/index.php';
    $data=array();
    $data = json_decode(file_get_contents('php://input'), true);

        $sql_two = "UPDATE  modules SET
            ModuleName='".$_GET["ModuleName"]."',
            ModuleTarget='".$_GET["ModuleTarget"]."',
            ModuleDescription='".$_GET["ModuleDescription"]."'
            WHERE module_id='".$_GET["module_id"]."'  ";
        if (mysqli_query($conn, $sql_two)) {
            $new_array = array(
                'Success' => "true",
                'Exists' => "true",
                'module_id' => $_GET["module_id"],
            );
            array_push($data, $new_array);
           
        } else {
            $new_array = array(
                'Success' => "false",
                'Exists' => "false",
                'module_id' =>"",
          
            );
            array_push($data, $new_array);
        }

    echo json_encode($data);
?>