| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- class admin_autocomplete_model extends Model {
-
- public function get_partner_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT partner_id as id, partner_name as label, partner_name as value FROM sc_partners WHERE partner_name LIKE '%".$term."%' AND partner_status='1' ORDER BY partner_name ASC;");
- return $result;
- }
-
- public function get_client_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT client_id as id, client_name as label, client_name as value FROM sc_clients WHERE client_name LIKE '%".$term."%' AND client_status='1' ORDER BY client_name ASC;");
- return $result;
- }
-
-
- public function get_bill_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT bill_id as id, bill_number as label, bill_number as value FROM sc_bills WHERE bill_number LIKE '%".$term."%' AND bill_status<>'0' ORDER BY bill_number ASC;");
- return $result;
- }
-
- public function get_cikkszam_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT rajz_id as id, rajz_cikkszam as label, rajz_cikkszam as value FROM sc_rajzok WHERE rajz_cikkszam LIKE '%".$term."%' AND rajz_status<>'0' ORDER BY rajz_cikkszam ASC;");
- return $result;
- }
- public function get_cikknev_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT rajz_id as id, rajz_megnevezes as label, rajz_megnevezes as value FROM sc_rajzok WHERE rajz_megnevezes LIKE '%".$term."%' AND rajz_status<>'0' ORDER BY rajz_megnevezes ASC;");
- return $result;
- }
-
- public function get_comment_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT partner_id as id, partner_comment as label, partner_comment as value FROM sc_partners WHERE partner_comment LIKE '%".$term."%' AND partner_status='1' ORDER BY partner_comment ASC;");
- return $result;
- }
-
-
- public function get_termek_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT beszer_id as id, beszer_termek as label, beszer_termek as value FROM sc_beszerzes WHERE beszer_termek LIKE '%".$term."%' AND beszer_status<>'0' ORDER BY beszer_termek ASC;");
- return $result;
- }
-
-
- public function get_minoseg_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT beszer_id as id, beszer_anyagminoseg as label, beszer_anyagminoseg as value FROM sc_beszerzes WHERE beszer_anyagminoseg LIKE '%".$term."%' AND beszer_status<>'0' GROUP BY beszer_anyagminoseg ORDER BY beszer_anyagminoseg ASC;");
- return $result;
- }
-
- public function get_kategoria_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT beszer_id as id, beszer_kategoria as label, beszer_kategoria as value FROM sc_beszerzes WHERE beszer_kategoria LIKE '%".$term."%' AND beszer_status<>'0' GROUP BY beszer_kategoria ORDER BY beszer_kategoria ASC;");
- return $result;
- }
-
- public function get_egyseg_list($term='') {
- $term = $this->escapeArray($term);
- $result = $this->query("SELECT variant_id as id, variant_name as label, variant_name as value FROM sc_variants WHERE variant_group='egyseg' AND variant_name LIKE '%".$term."%' AND variant_status<>'0' GROUP BY variant_name ORDER BY variant_name ASC;");
- return $result;
- }
-
-
- public function get_cikknev($val='') {
- $val = $this->escapeString($val);
- $res = $this->query("SELECT * FROM sc_rajzok WHERE rajz_cikkszam='".$val."' AND rajz_status='1';");
- return $res[0]->rajz_megnevezes;
- }
-
- public function get_cikkszam($val='') {
- $val = $this->escapeString($val);
- $res = $this->query("SELECT * FROM sc_rajzok WHERE rajz_megnevezes='".$val."' AND rajz_status='1';");
- return $res[0]->rajz_cikkszam;
- }
- }
|