HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/company_app/include/process.php
<?php
require 'config.php';
$option = isset($_GET['option']) ? $_GET['option'] : '';

switch ($option) 
{     
    case "detail_company":
          detail_company();
          break;             
    default:
      echo "Invalid function";
}
 
function detail_company()
{
    
    $company_id = isset($_GET['company_id']) ? $_GET['company_id'] : '';     
  
    if($company_id == '')
    {
        $message = "companyid is empty";
        echo $message;
    }     
    else
    {         
        global $conn;
        $sql = "SELECT * FROM companies where company_id = '$company_id' and status = '1' order by id desc limit 0,1";
        $result = $conn->query($sql);
        $company_id = '';
        $company_name = '';
	$scheduler_time = '';
        $end_url = '';
        $status = '';
        if ($result->num_rows > 0) {
            // output data of each row
            $k=1;
            while($row = $result->fetch_assoc()) 
            {
                $company_id = $row['company_id'];
                $company_name = $row['company_name'];
		$scheduler_time = $row['scheduler_time'];
                $end_url = $row['end_url'];
                $status = $row['status'];
            }
            $response = array();
            $response['errorcode'] = '200';
            $response['errormessage'] = 'Success';
            $response['company_id'] = $company_id;
            $response['company_name'] = $company_name;
	    $response['scheduler_time'] = $scheduler_time;
            $response['end_url'] = $end_url;       
            echo json_encode($response);
        }
        else
        {
            $response = array();
            $response['errorcode'] = '204';
            $response['errormessage'] = 'Record not found';            
            echo json_encode($response);
        }
        $conn->close();        
    }    
}
?>