diff --git a/application/config/routes.php b/application/config/routes.php index 3071db0..8fb530e 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -100,4 +100,11 @@ $route['deleted_faculty'] = 'faculty/deleted_faculty'; $route['student'] = 'student/student_list'; $route['add_student'] = 'student/add_student'; $route['edit_student/(:num)'] = 'student/edit_student/$1'; -$route['deleted_student'] = 'student/deleted_student'; \ No newline at end of file +$route['deleted_student'] = 'student/deleted_student'; + + +//project// +$route['project'] = 'project/project_list'; +$route['add_project'] = 'project/add_project'; +$route['edit_project/(:num)'] = 'project/edit_project/$1'; +$route['deleted_project'] = 'project/deleted_project'; \ No newline at end of file diff --git a/application/controllers/Department.php b/application/controllers/Department.php index 1e54d3e..8e5c84d 100644 --- a/application/controllers/Department.php +++ b/application/controllers/Department.php @@ -40,17 +40,17 @@ class Department extends CI_Controller { $this->load->view('department/add_department'); if($this->input->post('submit')) { - $depname=$this->input->post('depname'); - $depcode=$this->input->post('depcode'); + $name=$this->input->post('name'); + $code=$this->input->post('code'); $year=$this->input->post('year'); $table="department"; - $values=array('name'=>$depname, - 'code'=>$depcode, + $values=array('name'=>$name, + 'code'=>$code, 'year'=>$year, //'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); @@ -74,16 +74,18 @@ class Department extends CI_Controller { if($this->input->post('submit')) { - $depname=$this->input->post('depname'); - $depcode=$this->input->post('depcode'); + $name=$this->input->post('name'); + $code=$this->input->post('code'); + $year=$this->input->post('year'); $primaryid=$this->input->post('hiddendepid'); $table="department"; $where=array("dep_id"=>$primaryid); - $values=array('name'=>$depname, - 'code'=>$depcode, + $values=array('name'=>$name, + 'code'=>$code, + 'year'=>$year, //'updated_on'=>date('Y-m-d'), - 'update_by'=>1, + 'updatedBy'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Employee.php b/application/controllers/Employee.php index c4f1f5c..ea7a7c0 100644 --- a/application/controllers/Employee.php +++ b/application/controllers/Employee.php @@ -31,7 +31,7 @@ public function __construct() if($this->input->post('submit')) { $employeename=$this->input->post('employeename'); - $mobile_Number=$this->input->post('mobile_Number'); + $mobileNumber=$this->input->post('mobileNumber'); $address=$this->input->post('address'); $email=$this->input->post('email'); $code=$this->input->post('code'); @@ -42,15 +42,15 @@ public function __construct() $table="employee"; $values=array('name'=>$employeename, - 'mobile_Number'=>$mobile_Number, + 'mobileNumber'=>$mobileNumber, 'address'=>$address, 'email'=>$email, 'pincode'=>$code, 'image'=>$img, 'username'=>$user, 'password'=>$password, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); if($result) @@ -72,7 +72,7 @@ public function __construct() if($this->input->post('submit')) { $employeename=$this->input->post('employeename'); - $mobile_Number=$this->input->post('mobile_Number'); + $mobileNumber=$this->input->post('mobileNumber'); $address=$this->input->post('address'); $email=$this->input->post('email'); $code=$this->input->post('code'); @@ -91,15 +91,15 @@ public function __construct() $table="employee"; $where=array("id"=>$empid); $values=array('name'=>$employeename, - 'mobile_Number'=>$mobile_Number, + 'mobileNumber'=>$mobileNumber, 'address'=>$address, 'email'=>$email, 'pincode'=>$code, 'username'=>$user, 'image'=>$img, 'password'=>$newpassword, - 'update_on'=>date('Y-m-d'), - 'update_by'=>1, + 'updatedOn'=>date('Y-m-d'), + 'updatedBy'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Faculty.php b/application/controllers/Faculty.php index 313ab63..e607f54 100644 --- a/application/controllers/Faculty.php +++ b/application/controllers/Faculty.php @@ -61,8 +61,8 @@ class Faculty extends CI_Controller { 'address'=>$address, 'designation'=>$desi, 'image'=>$f_img, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); if($result) @@ -111,8 +111,8 @@ class Faculty extends CI_Controller { 'address'=>$address, 'designation'=>$desi, 'image'=>$f_img, - 'updated_on'=>date('Y-m-d'), - 'updated_by'=>1, + 'updatedOn'=>date('Y-m-d'), + 'updatedBy'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Project.php b/application/controllers/Project.php new file mode 100644 index 0000000..597aa7c --- /dev/null +++ b/application/controllers/Project.php @@ -0,0 +1,172 @@ +load->model('Project_model'); + $this->load->model('Commonsql_model'); + + } + + /** + * Index Page for this controller. + * + * Maps to the following URL + * http://example.com/index.php/welcome + * - or - + * http://example.com/index.php/welcome/index + * - or - + * Since this controller is set as the default controller in + * config/routes.php, it's displayed at http://example.com/ + * + * So any other public methods not prefixed with an underscore will + * map to /index.php/welcome/ + * @see https://codeigniter.com/user_guide/general/urls.html + */ + public function project_list() + { + $data['pro']=$this->Project_model->list_pro(); + $this->load->view('project/project_list',$data); + } + + + function add_project() + { + $data['dep']=$this->Project_model->get_dep(); + $data['stu']=$this->Project_model->get_stu(); + $data['fac']=$this->Project_model->get_fac(); + $this->load->view('project/add_project',$data); + + + if($this->input->post('submit')) + { + $name=$this->input->post('projectName'); + $date=$this->input->post('date'); + $student=$this->input->post('student'); + $semester=$this->input->post('semester'); + $gender=$this->input->post('gender'); + $department=$this->input->post('department'); + $designation=$this->input->post('designation'); + $faculty=$this->input->post('faculty'); + $drivelink=$this->input->post('drive'); + $vedio=$this->input->post('vedio'); + $image=$this->input->post('image'); + + $table="project"; + $values=array('projectName'=>$name, + 'date'=>$date, + 'student'=>$student, + 'semester'=>$semester, + 'department'=>$department, + 'gender'=>$gender, + 'designation'=>$designation, + 'faculty'=>$faculty, + 'drivelink'=>$drivelink, + 'vedio'=>$vedio, + 'image'=>$image, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, + 'status'=>1); + $result=$this->Commonsql_model->insert_table($table,$values); + if($result) + { + $this->session->set_userdata('suc','successfully added'); + redirect('project'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('project'); + } + + } + } + + + function edit_project($id) + { + $data['pro']=$this->Project_model->get_pro($id); + $this->load->view('project/edit_project',$data); + + if($this->input->post('submit')) + { + $name=$this->input->post('projectName'); + $date=$this->input->post('date'); + $student=$this->input->post('student'); + $semester=$this->input->post('semester'); + $gender=$this->input->post('gender'); + $department=$this->input->post('department'); + $designation=$this->input->post('designation'); + $faculty=$this->input->post('faculty'); + $drivelink=$this->input->post('drive'); + $vedio=$this->input->post('vedio'); + $image=$this->input->post('image'); + + + $table="project"; + $where=array("id"=>$id); + $values=array('projectName'=>$name, + 'date'=>$date, + 'student'=>$student, + 'semester'=>$semester, + 'department'=>$department, + 'gender'=>$gender, + 'designation'=>$designation, + 'faculty'=>$faculty, + 'drivelink'=>$drivelink, + 'vedio'=>$vedio, + 'image'=>$image, + 'updatedOn'=>date('Y-m-d'), + 'updatedBy'=>1, + 'status'=>1); + + $result=$this->Commonsql_model->updateTable($table,$where,$values); + if($result) + { + $this->session->set_userdata('suc','successfully Updated'); + redirect('project'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('project'); + } + + } + + } + + function deleted_project() + { + if($this->input->post('submit')) + { + $id=$this->input->post('hiddenpass'); + + $table="project"; + $where=array("id"=>$id); + $values=array( + 'status'=>0); + + $result=$this->Commonsql_model->updateTable($table,$where,$values); + if($result) + { + $this->session->set_userdata('suc','successfully deleted'); + redirect('project'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('project'); + } + } + } + + + +} diff --git a/application/controllers/Role.php b/application/controllers/Role.php index aa86c64..7016110 100644 --- a/application/controllers/Role.php +++ b/application/controllers/Role.php @@ -24,8 +24,8 @@ public function __construct() $table="role"; $values=array('name'=>$role, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); @@ -52,8 +52,8 @@ public function __construct() $table="role"; $where=array("id"=>$primaryid); $values=array('name'=>$rolename, - 'updated_on'=>date('Y-m-d'), - 'updated_by'=>1, + 'updatedOn'=>date('Y-m-d'), + 'updatedBy'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Semester.php b/application/controllers/Semester.php index a5228dd..c0bd604 100644 --- a/application/controllers/Semester.php +++ b/application/controllers/Semester.php @@ -46,8 +46,8 @@ class Semester extends CI_Controller { $table="semester"; $values=array('name'=>$name, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); if($result) @@ -79,8 +79,8 @@ class Semester extends CI_Controller { $where=array("id"=>$id); $values=array('name'=>$name, - //'update_on'=>date('Y-m-d'), - // 'update_by'=>1, + 'updatedOn'=>date('Y-m-d'), + 'updatedby'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Student.php b/application/controllers/Student.php index 03606a8..9fe744c 100644 --- a/application/controllers/Student.php +++ b/application/controllers/Student.php @@ -35,8 +35,9 @@ class Student extends CI_Controller { function add_student() { + $data['dep']=$this->Student_model->get_dep(); + $this->load->view('student/add_student',$data); - $this->load->view('student/add_student'); if($this->input->post('submit')) { @@ -54,8 +55,8 @@ class Student extends CI_Controller { 'department'=>$department, 'gender'=>$gender, 'image'=>$s_img, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); if($result) diff --git a/application/controllers/Subject.php b/application/controllers/Subject.php index 150eac3..710f327 100644 --- a/application/controllers/Subject.php +++ b/application/controllers/Subject.php @@ -49,8 +49,8 @@ function add_subject() 'subject'=>$sub, 'department'=>$dep, 'semester'=>$semester, - 'created_on'=>date('Y-m-d'), - 'created_by'=>1, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); if($result) @@ -91,8 +91,8 @@ function add_subject() 'subject'=>$sub, 'department'=>$dep, 'semester'=>$semester, - 'updated_on'=>date('Y-m-d'), - //'update_by'=>1, + 'updatedOn'=>date('Y-m-d'), + 'updatedBy'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/models/Project_model.php b/application/models/Project_model.php new file mode 100644 index 0000000..8d39234 --- /dev/null +++ b/application/models/Project_model.php @@ -0,0 +1,63 @@ +db->select('p.*,d.name as deptname,s.name as studentName,f.name as facultyName'); + $this->db->from('project as p'); + $this->db->join('department as d','d.id=p.department','left' ); + $this->db->join('student as s','s.id=p.student','left' ); + $this->db->join('faculty as f','f.id=p.faculty','left' ); + $this->db->where(array('p.status'=>1)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } + + function get_pro($id) + { + $this->db->select('*'); + $this->db->from('project'); + $this->db->where(array('status'=>1,'id'=>$id)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } + + function get_dep() + { + $this->db->select('*'); + $this->db->from('department'); + $this->db->where(array('status'=>1)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } + + function get_stu() + { + $this->db->select('*'); + $this->db->from('student'); + $this->db->where(array('status'=>1)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } + function get_fac() + { + $this->db->select('*'); + $this->db->from('faculty'); + $this->db->where(array('status'=>1)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } + +} diff --git a/application/models/Student_model.php b/application/models/Student_model.php index 080c0e3..ad6ebff 100644 --- a/application/models/Student_model.php +++ b/application/models/Student_model.php @@ -10,9 +10,10 @@ class Student_model extends CI_Model { function list_stu() { - $this->db->select('*'); - $this->db->from('student'); - $this->db->where(array('status'=>1)); + $this->db->select('s.*,d.name as deptname'); + $this->db->from('student as s'); + $this->db->join('department as d','d.id=s.department','left' ); + $this->db->where(array('s.status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; @@ -27,5 +28,15 @@ class Student_model extends CI_Model { //echo $this->db->last_query();exit; return $query; } + + function get_dep() + { + $this->db->select('*'); + $this->db->from('department'); + $this->db->where(array('status'=>1)); + $query = $this->db->get(); + //echo $this->db->last_query();exit; + return $query; + } } diff --git a/application/views/add_emplayee/add.php b/application/views/add_emplayee/add.php index 66c3e4e..eb27514 100644 --- a/application/views/add_emplayee/add.php +++ b/application/views/add_emplayee/add.php @@ -41,7 +41,8 @@ *
-
+ +
- +
+
diff --git a/application/views/add_emplayee/edit.php b/application/views/add_emplayee/edit.php index 05be06b..8a1e6f9 100644 --- a/application/views/add_emplayee/edit.php +++ b/application/views/add_emplayee/edit.php @@ -48,7 +48,7 @@ $e=$emp->row(); $eid=$e->id; $name=$e->name; - $mobile_Number=$e->mobile_Number; + $mobileNumber=$e->mobileNumber; $email=$e->email; $image=$e->image; $address=$e->address; @@ -79,7 +79,7 @@ *
-
+
- - - +
-
- +
+
-
-
+
+ +
- -