54 lines
1.2 KiB
PHP
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);
|
|
}
|
|
}
|
|
|
|
}
|