More work done on search filter option
这个提交包含在:
父节点
5d1c13efab
当前提交
d1b5db4ef2
共有 4 个文件被更改,包括 49 次插入 和 0 次删除
|
|
@ -39,6 +39,12 @@ class Search extends CI_Controller {
|
||||||
|
|
||||||
$this->load->library('form_validation');
|
$this->load->library('form_validation');
|
||||||
|
|
||||||
|
$this->load->model('Search_filter');
|
||||||
|
|
||||||
|
$data['get_table_names'] = $this->Search_filter->get_table_columns();
|
||||||
|
|
||||||
|
//print_r($this->Search_filter->get_table_columns());
|
||||||
|
|
||||||
if ($this->form_validation->run() == FALSE)
|
if ($this->form_validation->run() == FALSE)
|
||||||
{
|
{
|
||||||
$this->load->view('interface_assets/header', $data);
|
$this->load->view('interface_assets/header', $data);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,12 @@ class Search extends CI_Model {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_table_columns() {
|
||||||
|
$query = $this->db->query('DESCRIBE '.$this->config->item('table_name'));
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Search_filter extends CI_Model {
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_table_columns() {
|
||||||
|
$query = $this->db->query('DESCRIBE '.$this->config->item('table_name'));
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
@ -18,6 +18,25 @@
|
||||||
<h5 class="card-title">Explore & Poke the Logbook</h5>
|
<h5 class="card-title">Explore & Poke the Logbook</h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Select functions go here
|
Select functions go here
|
||||||
|
|
||||||
|
<form>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="columnName">Select Column</label>
|
||||||
|
<select class="form-control" id="columnName">
|
||||||
|
<?php foreach ($get_table_names->result() as $row) { ?>
|
||||||
|
<?php
|
||||||
|
$value_name = str_replace("COL_", "", $row->Field);
|
||||||
|
if ($value_name != "PRIMARY_KEY") { ?>
|
||||||
|
<option value="<?php echo $row->Field; ?>"><?php echo $value_name; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用