Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 739a1e7e authored by Woraprat's avatar Woraprat
Browse files

update project

parent 6665173f
Branches
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ class Login extends Exhibition_Controller ...@@ -18,7 +18,7 @@ class Login extends Exhibition_Controller
public function show_login() public function show_login()
{ {
// $this->output('login/v_login'); $this->output('login/v_login');
} }
public function show_login_fail() public function show_login_fail()
......
...@@ -42,9 +42,9 @@ class Project extends Exhibition_Controller { ...@@ -42,9 +42,9 @@ class Project extends Exhibition_Controller {
$data['clusters'] = $this->cluster->get_all()->result(); $data['clusters'] = $this->cluster->get_all()->result();
$data['teams'] = $this->team->get_all()->result(); $data['teams'] = $this->team->get_all()->result();
$data['companies'] = $this->company->get_all()->result(); $data['companies'] = $this->company->get_all()->result();
$data['tags'] = $this->tag->get_all()->result(); $data['tags'] = $this->tag->get_all_project()->result();
$data['instructors'] = $this->instructor->get_all()->result(); $data['instructors'] = $this->instructor->get_all()->result();
$data['users'] = $this->user->get_user_project($_SESSION['email'])->result(); $data['users'] = $this->user->get_user_project_admin()->result();
$this->output_admin('project/v_project_create', $data); $this->output_admin('project/v_project_create', $data);
} }
...@@ -58,7 +58,7 @@ class Project extends Exhibition_Controller { ...@@ -58,7 +58,7 @@ class Project extends Exhibition_Controller {
$data['clusters'] = $this->cluster->get_all()->result(); $data['clusters'] = $this->cluster->get_all()->result();
$data['teams'] = $this->team->get_all()->result(); $data['teams'] = $this->team->get_all()->result();
$data['companies'] = $this->company->get_all()->result(); $data['companies'] = $this->company->get_all()->result();
$data['tags'] = $this->tag->get_all()->result(); $data['tags'] = $this->tag->get_all_project()->result();
$data['instructors'] = $this->instructor->get_all()->result(); $data['instructors'] = $this->instructor->get_all()->result();
$data['users'] = $this->user->get_user_project($_SESSION['email'])->result(); $data['users'] = $this->user->get_user_project($_SESSION['email'])->result();
$this->output_user('project/v_project_create_user', $data); $this->output_user('project/v_project_create_user', $data);
...@@ -77,7 +77,7 @@ class Project extends Exhibition_Controller { ...@@ -77,7 +77,7 @@ class Project extends Exhibition_Controller {
$data['project_tag'] = $this->project_tag->get_project_tag_by_id($id)->result(); $data['project_tag'] = $this->project_tag->get_project_tag_by_id($id)->result();
$data['teams'] = $this->team->get_all()->result(); $data['teams'] = $this->team->get_all()->result();
$data['companies'] = $this->company->get_all()->result(); $data['companies'] = $this->company->get_all()->result();
$data['tags'] = $this->tag->get_all()->result(); $data['tags'] = $this->tag->get_all_project()->result();
$data['instructors'] = $this->instructor->get_all()->result(); $data['instructors'] = $this->instructor->get_all()->result();
$this->output_admin('project/v_project_edit', $data); $this->output_admin('project/v_project_edit', $data);
} }
...@@ -95,12 +95,12 @@ class Project extends Exhibition_Controller { ...@@ -95,12 +95,12 @@ class Project extends Exhibition_Controller {
$data['project_tag'] = $this->project_tag->get_project_tag_by_id($id)->result(); $data['project_tag'] = $this->project_tag->get_project_tag_by_id($id)->result();
$data['teams'] = $this->team->get_all()->result(); $data['teams'] = $this->team->get_all()->result();
$data['companies'] = $this->company->get_all()->result(); $data['companies'] = $this->company->get_all()->result();
$data['tags'] = $this->tag->get_all()->result(); $data['tags'] = $this->tag->get_all_project()->result();
$data['instructors'] = $this->instructor->get_all()->result(); $data['instructors'] = $this->instructor->get_all()->result();
$this->output_user('project/v_project_edit_user', $data); $this->output_user('project/v_project_edit_user', $data);
} }
public function get_project_detail_member(){ public function get_project_detail_member_user(){
$id = $this->input->post('id'); $id = $this->input->post('id');
$this->load->model('detail/M_detail','detail'); $this->load->model('detail/M_detail','detail');
$this->load->model('member/M_member','member'); $this->load->model('member/M_member','member');
...@@ -111,6 +111,17 @@ class Project extends Exhibition_Controller { ...@@ -111,6 +111,17 @@ class Project extends Exhibition_Controller {
echo json_encode($data); echo json_encode($data);
} }
public function get_project_detail_member(){
$id = $this->input->post('id');
$this->load->model('detail/M_detail','detail');
$this->load->model('member/M_member','member');
$this->load->model('user/M_user','user');
$data['users'] = $this->user->get_user_project_admin()->result();
$data['detail'] = $this->detail->get_detail_by_project_id($id)->result();
$data['member'] = $this->member->get_member_by_project_id($id)->result();
echo json_encode($data);
}
public function change_status(){ public function change_status(){
$data['message'] = true ; $data['message'] = true ;
$id = $this->input->post('id'); $id = $this->input->post('id');
......
...@@ -20,6 +20,14 @@ class M_tag extends Da_tag ...@@ -20,6 +20,14 @@ class M_tag extends Da_tag
return $query; return $query;
} }
public function get_all_project()
{
$sql = "SELECT * FROM {$this->db_name}.tag
Where is_delete = 0 and status = 1";
$query = $this->db->query($sql);
return $query;
}
public function get_tag_by_id($id) public function get_tag_by_id($id)
{ {
$sql = "SELECT * FROM {$this->db_name}.tag $sql = "SELECT * FROM {$this->db_name}.tag
......
...@@ -45,12 +45,18 @@ class M_user extends Da_user ...@@ -45,12 +45,18 @@ class M_user extends Da_user
} }
public function get_user_project($email){ public function get_user_project($email){
$sql = "SELECT * FROM {$this->db_name}.user $sql = "SELECT user_id, student_id, prefix, first_name, last_name, email FROM {$this->db_name}.user
Where email like '".substr($email,0,2)."%'"; Where email like '".substr($email,0,2)."%'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query; return $query;
} }
public function get_user_project_admin(){
$sql = "SELECT user_id, student_id, prefix, first_name, last_name, email FROM {$this->db_name}.user";
$query = $this->db->query($sql);
return $query;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment