Files
BE_IBL/application/controllers/nasacom/Downloadcheckcompany.php
2026-04-15 15:23:57 +07:00

54 lines
1.2 KiB
PHP

<?php
class Downloadcheckcompany extends MY_Controller
{
var $db_regional;
public function index()
{
echo "Doctor API";
}
public function __construct()
{
parent::__construct();
$this->db_regional = $this->load->database("onedev", true);
// $this->db_onedev = $this->load->database("onedev", true);
}
function checkcompany()
{
try {
header("Content-Type:application/json");
$data = json_decode(file_get_contents('php://input'), true);
//print_r($data);
if($data){
$sql = "SELECT COUNT(*) as xcount
FROM m_company
WHERE
M_CompanyNumber = '{$data['code']}' AND M_CompanyIsActive = 'Y'";
//echo $sql;
$rtn = $this->db_regional->query($sql)->row_array();
//echo $rtn['xcount'] ;
if($rtn['xcount'] > 0){
$result = array( "status" => true);
$this->sys_ok($result);
}else{
$result = array( "status" => false);
$this->sys_ok($result);
}
}
} catch (Exception $exc) {
$message = $exc->getMessage();
$this->sys_error($message);
}
}
}