diff --git a/README.md b/README.md deleted file mode 100644 index 352207a..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# McGansWebsite - diff --git a/application/config/config.php b/application/config/config.php index c3267ac..cafafe0 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = 'http://localhost/student/'; +$config['base_url'] = 'http://localhost/Mcgans/'; /* |-------------------------------------------------------------------------- diff --git a/application/config/database.php b/application/config/database.php index 25e75c7..3c8bffe 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -78,7 +78,7 @@ $db['default'] = array( 'hostname' => 'localhost', 'username' => 'root', 'password' => '', - 'database' => 'demo', + 'database' => 'mcgans', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/config/routes.php b/application/config/routes.php index 84556d5..3071db0 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -77,7 +77,7 @@ $route['delete_department'] = 'department/delete_department'; //Semester// $route['semester'] = 'semester/semester_list'; $route['add_semester'] = 'semester/add_semester'; -$route['edit_semester/(:num)'] = 'semester/edit_semester/$1'; +$route['edit_semester'] = 'semester/edit_semester'; $route['deleted_semester'] = 'semester/deleted_semester'; diff --git a/application/controllers/Department.php b/application/controllers/Department.php index 4c4c70c..1e54d3e 100644 --- a/application/controllers/Department.php +++ b/application/controllers/Department.php @@ -36,15 +36,19 @@ class Department extends CI_Controller { function add_department() { + + $this->load->view('department/add_department'); if($this->input->post('submit')) { $depname=$this->input->post('depname'); $depcode=$this->input->post('depcode'); + $year=$this->input->post('year'); $table="department"; $values=array('name'=>$depname, 'code'=>$depcode, + 'year'=>$year, //'created_on'=>date('Y-m-d'), 'created_by'=>1, 'status'=>1); diff --git a/application/controllers/Employee.php b/application/controllers/Employee.php index fb7f387..c4f1f5c 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'); - $number=$this->input->post('number'); + $mobile_Number=$this->input->post('mobile_Number'); $address=$this->input->post('address'); $email=$this->input->post('email'); $code=$this->input->post('code'); @@ -42,11 +42,11 @@ public function __construct() $table="employee"; $values=array('name'=>$employeename, - 'mobilenumer'=>$number, + 'mobile_Number'=>$mobile_Number, 'address'=>$address, 'email'=>$email, 'pincode'=>$code, - 'img'=>$img, + 'image'=>$img, 'username'=>$user, 'password'=>$password, 'created_on'=>date('Y-m-d'), @@ -72,7 +72,7 @@ public function __construct() if($this->input->post('submit')) { $employeename=$this->input->post('employeename'); - $number=$this->input->post('mnumber'); + $mobile_Number=$this->input->post('mobile_Number'); $address=$this->input->post('address'); $email=$this->input->post('email'); $code=$this->input->post('code'); @@ -91,11 +91,12 @@ public function __construct() $table="employee"; $where=array("id"=>$empid); $values=array('name'=>$employeename, - 'mobilenumer'=>$number, + 'mobile_Number'=>$mobile_Number, 'address'=>$address, 'email'=>$email, 'pincode'=>$code, 'username'=>$user, + 'image'=>$img, 'password'=>$newpassword, 'update_on'=>date('Y-m-d'), 'update_by'=>1, diff --git a/application/controllers/Faculty.php b/application/controllers/Faculty.php index 4609d2a..313ab63 100644 --- a/application/controllers/Faculty.php +++ b/application/controllers/Faculty.php @@ -41,15 +41,15 @@ class Faculty extends CI_Controller { if($this->input->post('submit')) { - $faculty=$this->input->post('faculty'); + $faculty=$this->input->post('code'); $name=$this->input->post('name'); $email=$this->input->post('email'); //$dob=$this->input->post('dob'); $gender=$this->input->post('gender'); - $number=$this->input->post('number'); + $number=$this->input->post('mobile'); $address=$this->input->post('address'); - $desi=$this->input->post('desigation'); - $f_img=$this->input->post('f_img'); + $desi=$this->input->post('designation'); + $f_img=$this->input->post('image'); $table="faculty"; $values=array('code'=>$faculty, @@ -59,8 +59,8 @@ class Faculty extends CI_Controller { 'gender'=>$gender, 'mobile'=>$number, 'address'=>$address, - 'desigation'=>$desi, - 'f_img'=>$f_img, + 'designation'=>$desi, + 'image'=>$f_img, 'created_on'=>date('Y-m-d'), 'created_by'=>1, 'status'=>1); @@ -89,15 +89,15 @@ class Faculty extends CI_Controller { if($this->input->post('submit')) { - $faculty=$this->input->post('faculty'); + $faculty=$this->input->post('code'); $name=$this->input->post('name'); $email=$this->input->post('email'); //$dob=$this->input->post('dob'); $gender=$this->input->post('gender'); $number=$this->input->post('number'); $address=$this->input->post('address'); - $desi=$this->input->post('desigation'); - $f_img=$this->input->post('f_img'); + $desi=$this->input->post('designation'); + $f_img=$this->input->post('image'); $table="faculty"; @@ -109,10 +109,10 @@ class Faculty extends CI_Controller { 'gender'=>$gender, 'mobile'=>$number, 'address'=>$address, - 'desigation'=>$desi, - 'f_img'=>$f_img, - 'update_on'=>date('Y-m-d'), - 'update_by'=>1, + 'designation'=>$desi, + 'image'=>$f_img, + 'updated_on'=>date('Y-m-d'), + 'updated_by'=>1, 'status'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); diff --git a/application/controllers/Role.php b/application/controllers/Role.php index 3d62bb5..aa86c64 100644 --- a/application/controllers/Role.php +++ b/application/controllers/Role.php @@ -50,7 +50,7 @@ public function __construct() $primaryid=$this->input->post('hiddenroleid'); $table="role"; - $where=array("role_id"=>$primaryid); + $where=array("id"=>$primaryid); $values=array('name'=>$rolename, 'updated_on'=>date('Y-m-d'), 'updated_by'=>1, @@ -80,7 +80,7 @@ public function __construct() $primaryid=$this->input->post('hiddengffgdtpid'); //echo $primaryid ; exit; $table="role"; - $where=array("role_id"=>$primaryid); + $where=array("id"=>$primaryid); $values=array( 'status'=>0); diff --git a/application/controllers/Semester.php b/application/controllers/Semester.php index 55e6b2b..a5228dd 100644 --- a/application/controllers/Semester.php +++ b/application/controllers/Semester.php @@ -36,18 +36,16 @@ class Semester extends CI_Controller { function add_semester() { - $this->load->view('semester/add_semester'); + //$this->load->view('semester/add_semester'); if($this->input->post('submit')) { $name=$this->input->post('name'); - $hod=$this->input->post('hod'); - $staff=$this->input->post('staff'); + $table="semester"; $values=array('name'=>$name, - 'hod'=>$hod, - 'staff'=>$staff, + 'created_on'=>date('Y-m-d'), 'created_by'=>1, 'status'=>1); @@ -68,24 +66,19 @@ class Semester extends CI_Controller { } - function edit_semester($id) + function edit_semester() { - - $data['sem']=$this->Semester_model->get_sem($id); - $this->load->view('semester/edit_semester',$data); - if($this->input->post('submit')) { $name=$this->input->post('name'); - $hod=$this->input->post('hod'); - $staff=$this->input->post('staff'); + $id=$this->input->post('hiddendepid'); + $table="semester"; $where=array("id"=>$id); $values=array('name'=>$name, - 'hod'=>$hod, - 'staff'=>$staff, + //'update_on'=>date('Y-m-d'), // 'update_by'=>1, 'status'=>1); @@ -114,7 +107,7 @@ class Semester extends CI_Controller { { if($this->input->post('submit')) { - $id=$this->input->post('hiddenpass'); + $id=$this->input->post('hiddengffgdtpid'); $table="semester"; $where=array("id"=>$id); diff --git a/application/controllers/Student.php b/application/controllers/Student.php index d169104..03606a8 100644 --- a/application/controllers/Student.php +++ b/application/controllers/Student.php @@ -45,7 +45,7 @@ class Student extends CI_Controller { $address=$this->input->post('address'); $department=$this->input->post('department'); $gender=$this->input->post('gender'); - $s_img=$this->input->post('s_img'); + $s_img=$this->input->post('image'); $table="student"; $values=array('name'=>$name, @@ -53,7 +53,7 @@ class Student extends CI_Controller { 'address'=>$address, 'department'=>$department, 'gender'=>$gender, - 's_img'=>$s_img, + 'image'=>$s_img, 'created_on'=>date('Y-m-d'), 'created_by'=>1, 'status'=>1); @@ -87,7 +87,7 @@ class Student extends CI_Controller { $address=$this->input->post('address'); $department=$this->input->post('department'); $gender=$this->input->post('gender'); - $s_img=$this->input->post('s_img'); + $s_img=$this->input->post('image'); $table="student"; @@ -97,7 +97,7 @@ class Student extends CI_Controller { 'address'=>$address, 'department'=>$department, 'gender'=>$gender, - 's_img'=>$s_img, + 'image'=>$s_img, //'update_on'=>date('Y-m-d'), // 'update_by'=>1, 'status'=>1); diff --git a/application/controllers/zSemester.php b/application/controllers/zSemester.php new file mode 100644 index 0000000..0b3d37d --- /dev/null +++ b/application/controllers/zSemester.php @@ -0,0 +1,141 @@ +load->model('Semester_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 semester_list() + { + $data['sem']=$this->Semester_model->list_sem(); + $this->load->view('semester/semester_list',$data); + } + + + function add_semester() + { + + //$this->load->view('semester/add_semester'); + + if($this->input->post('submit')) + { + $name=$this->input->post('name'); + $hod=$this->input->post('hod'); + $staff=$this->input->post('staff'); + + $table="semester"; + $values=array('name'=>$name, + 'hod'=>$hod, + 'staff'=>$staff, + 'created_on'=>date('Y-m-d'), + 'created_by'=>1, + 'status'=>1); + $result=$this->Commonsql_model->insert_table($table,$values); + if($result) + { + $this->session->set_userdata('suc','successfully added'); + redirect('semester'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('semester'); + } + + } + } + + + function edit_semester($id) + { + + $data['sem']=$this->Semester_model->get_sem($id); + $this->load->view('semester/edit_semester',$data); + + if($this->input->post('submit')) + { + $name=$this->input->post('name'); + $hod=$this->input->post('hod'); + $staff=$this->input->post('staff'); + + + $table="semester"; + $where=array("id"=>$id); + $values=array('name'=>$name, + 'hod'=>$hod, + 'staff'=>$staff, + //'update_on'=>date('Y-m-d'), + // 'update_by'=>1, + 'status'=>1); + + $result=$this->Commonsql_model->updateTable($table,$where,$values); + if($result) + { + $this->session->set_userdata('suc','successfully Updated'); + redirect('semester'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('semester'); + } + + } + //echo "sdsd";exit; + + //echo $this->db->last_query();exit; + + } + + function deleted_semester() + { + if($this->input->post('submit')) + { + $id=$this->input->post('hiddenpass'); + + $table="semester"; + $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('semester'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('semester'); + } + } + } + + + +} diff --git a/application/views/add_emplayee/add.php b/application/views/add_emplayee/add.php index ba0cc03..66c3e4e 100644 --- a/application/views/add_emplayee/add.php +++ b/application/views/add_emplayee/add.php @@ -41,14 +41,14 @@ *
-
+
- +
@@ -73,13 +73,7 @@ --> -
- -
- -
-
+
+ +
+ +
+ +
+
diff --git a/application/views/add_emplayee/edit.php b/application/views/add_emplayee/edit.php index 1b06a00..05be06b 100644 --- a/application/views/add_emplayee/edit.php +++ b/application/views/add_emplayee/edit.php @@ -48,9 +48,9 @@ $e=$emp->row(); $eid=$e->id; $name=$e->name; - $mobilenumer=$e->mobilenumer; + $mobile_Number=$e->mobile_Number; $email=$e->email; - $img=$e->img; + $image=$e->image; $address=$e->address; $pincode=$e->pincode; $username=$e->username; @@ -79,7 +79,7 @@ *
-
+
diff --git a/application/views/faculty/edit_faculty.php b/application/views/faculty/edit_faculty.php index 747a3d4..248670d 100644 --- a/application/views/faculty/edit_faculty.php +++ b/application/views/faculty/edit_faculty.php @@ -50,12 +50,12 @@ $faculty=$f->code; $name=$f->name; $email=$f->email; - $number=$f->number; + $number=$f->mobile; $dob=$f->dob; $gender=$f->gender; $address=$f->address; - $desi=$f->desi; - $f_img=$f->f_img; + $desi=$f->designation; + $f_img=$f->image; } ?>
@@ -97,20 +97,28 @@
-
+
+ +
+ +
+
- +
@@ -140,7 +148,7 @@
- +
diff --git a/application/views/faculty/faculty_list.php b/application/views/faculty/faculty_list.php index 375a1bd..e9d230a 100644 --- a/application/views/faculty/faculty_list.php +++ b/application/views/faculty/faculty_list.php @@ -61,7 +61,7 @@ //$dob=$f->dob; //$gender=$f->gender; //$address=$f->address; - $desi=$f->desigation; + $desi=$f->designation; //$f_img=$f->f_img; ?> diff --git a/application/views/includes/footer.php b/application/views/includes/footer.php index 45cd5b4..30addad 100644 --- a/application/views/includes/footer.php +++ b/application/views/includes/footer.php @@ -1,7 +1,7 @@