| Server IP : 162.214.74.102 / Your IP : 216.73.216.139 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/hering/application/plugins/module_teammanagement/ |
Upload File : |
<?php
include_once "Controller.php";
include_once __DIR__ . "/../models/DiaryModel.php";
include_once __DIR__ . "/../models/DoctorModel.php";
include_once __DIR__ . "/../models/ProcedureModel.php";
include_once __DIR__ . "/../models/AgreementModel.php";
class AjaxController extends Controller {
/**
* @var ID Business
*/
protected $id;
/**
* @var DiaryModel
*/
protected $model_diary;
/**
* @var DoctorModel
*/
protected $model_doctor;
/**
* @var ProcedureModel
*/
protected $model_procedure;
/**
* @var AgreementModel
*/
protected $model_agreement;
/**
* @param $ui
* @param array $_L
* @param array $config
* @param $_pd
*/
public function __construct($ui, $_L, $config, $_pd) {
parent::__construct($ui, $_L, $config, $_pd);
$this->model_diary = new DiaryModel();
$this->model_doctor = new DoctorModel();
$this->model_procedure = new ProcedureModel();
$this->model_agreement = new AgreementModel();
$this->id = $this->routes[3];
}
public function salesman() {
$d = ORM::for_table('crm_accounts')
->table_alias('c')
->select('c.*')
->join('crm_accounts_contacts', array('c.id', '=', 'cac.crm_accounts_id'), 'cac')
->join('crm_groups', array('g.id', '=', 'ag.crm_accounts_id_contact'), 'g');
$term = _post('term');
$d->where_any_is(array(array("c.account" => '%' . $term . '%')
), 'like');
$crms = $d->find_many();
$data = array();
foreach ($crms as $c) {
$data[] = array(
'id' => $c->id,
'name' => $c->account,
'text' => $c->account,
'cpf_cnpj' => $c->cpf_cnpj,
'account' => $c->account,
'company' => $c->company,
'kinf_of_person' => $c->kind_of_person,
'foreign_doc_identification' => $c->foreign_doc_identification,
);
}
echo json_encode($data);
}
}