芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/breadwinnerv2/application/controllers/Search.php
load->model('search_model', 'search'); $this->load->library("Aauth"); if (!$this->aauth->is_loggedin()) { redirect('/user/', 'refresh'); } } public function search_invoice() { $invoicenumber = $this->input->post(''); $data['search'] = $this->search->invoice($invoicenumber); $this->load->model('transactions_model'); $data['accounts'] = $this->transactions_model->acc_list(); $head['title'] = "Product Categories"; $head['usernm'] = $this->aauth->get_user()->username; $this->load->view('fixed/header', $head); $this->load->view('search/invoice', $data); $this->load->view('fixed/footer'); } public function invoice() { $result = array(); $out = array(); $tid = $this->input->get('keyword', true); if ($tid) { $query = $this->db->query("SELECT tid FROM invoices WHERE UPPER(tid) LIKE '" . $tid . "%' LIMIT 4"); $result = $query->result_array(); echo '
'; $i = 1; foreach ($result as $row) { echo "
" . $row['tid'] . "
"; $i++; } echo '
'; } } public function customer() { $name = $this->input->get('keyword', true); if ($name) { $query = $this->db->query("SELECT id,name,address,city,phone,email FROM customers WHERE UPPER(name) LIKE '" . strtoupper($name) . "%' OR UPPER(phone) LIKE '" . strtoupper($name) . "%' LIMIT 6"); $result = $query->result_array(); $i = 1; foreach ($result as $row) { echo '
' . $row['name'] . '
' . $row['address'] . ',' . $row['city'] . '
' . $row['phone'] . '
'; $i++; } } } public function user() { $name = $this->input->get('username', true); if (!$name = NULL) { $query = $this->db->query("SELECT id,username FROM aauth_users WHERE username LIKE '" . $name . "%' LIMIT 6"); $result = $query->result_array(); $i = 1; echo '
'; foreach ($result as $row) { echo '
' . $row['username'] . '
'; } echo '
'; } } public function customer_select() { $name = $this->input->post('customer', true); if ($name) { $query = $this->db->query("SELECT id,name,address,city,phone,email FROM customers WHERE UPPER(name) LIKE '" . strtoupper($name['term']) . "%' OR UPPER(phone) LIKE '" . strtoupper($name['term']) . "%' LIMIT 6"); $result = $query->result_array(); echo json_encode($result); } } public function supplier_select() { $name = $this->input->post('supplier', true); if ($name) { $query = $this->db->query("SELECT id,name,address,city,phone,email FROM supplier WHERE UPPER(name) LIKE '" . strtoupper($name['term']) . "%' OR UPPER(phone) LIKE '" . strtoupper($name['term']) . "%' LIMIT 6"); $result = $query->result_array(); echo json_encode($result); } } }