From f34f7c5bdb00d09761b4778d0a86faf71b6667d8 Mon Sep 17 00:00:00 2001 From: dotwingssoftware Date: Wed, 25 Jan 2023 18:17:55 +0530 Subject: [PATCH] 20230125 Correction in Semester --- admin/application/controllers/Project.php | 113 +++++----- admin/application/controllers/Semester.php | 150 ++++++++++--- admin/application/controllers/Subject.php | 113 +++++----- admin/application/controllers/new 1.txt | 39 ++++ admin/application/models/Semester_model.php | 44 ++-- .../application/views/project/add_project.php | 2 +- .../views/semester/add_semester.php | 171 +++++++++----- .../views/semester/edit_semester.php | 210 +++++++++++++----- .../views/semester/semester_list.php | 32 +-- .../views/semester/view_semester.php | 37 ++- application/views/include/header.php | 11 +- mcgans.sql | 53 ++++- 12 files changed, 641 insertions(+), 334 deletions(-) create mode 100644 admin/application/controllers/new 1.txt diff --git a/admin/application/controllers/Project.php b/admin/application/controllers/Project.php index bac20db..f41ea99 100644 --- a/admin/application/controllers/Project.php +++ b/admin/application/controllers/Project.php @@ -245,64 +245,64 @@ class Project extends CI_Controller { //echo $this->db->last_query(); } - } - //Remove Existing One - $existingRow=$this->Project_model->getMultipleImage($id); - //echo $this->db->last_query(); - if($existingRow->num_rows()>0) - { - //echo "test";exit; - $primaryId=array(); - foreach($existingRow->result() as $list) + + //Remove Existing One + $existingRow=$this->Project_model->getMultipleImage($id); + //echo $this->db->last_query(); + if($existingRow->num_rows()>0) { - $primaryId[]=$list->id ; + //echo "test";exit; + $primaryId=array(); + foreach($existingRow->result() as $list) + { + $primaryId[]=$list->id ; + } + } + //Remove Row + $diff=array_diff($primaryId,$projectDetailId); + //print_r ($diff);exit; + if($diff>0) + { + //echo "sdsds";exit; + foreach($diff as $value) + { + $where=array('id'=>$value); + $tablename="projectdetail"; + $values=array('status'=>0); + if($projectDetailId[$key]!=""){ + $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} + //echo $this->db->last_query(); + } + } + //New Row Insertion + if($projectDetailId[$key]=="") + { + + if($_FILES['profileimage']['tmp_name']) + { + $tempDocument=$_FILES['profileimage']['tmp_name'][$key]; + $getImage=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]); + $extension1 = pathinfo($getImage, PATHINFO_EXTENSION); + $image=$id.'.'.$getImage; + //$document='uploads/subject/'.$business_document; + $targetPath = './uploads/project/'; + $targetFile=$targetPath.$image; + + + if(move_uploaded_file($tempDocument, $targetFile)) + { + $tablename='projectdetail'; + $data=array('projectId'=>$id, + 'title'=>$title[$key], + 'image'=>$image, + 'status'=>1); + + $result=$this->Commonsql_model->insert_table($tablename,$data); + } + } + } } - //Remove Row - $diff=array_diff($primaryId,$projectDetailId); - //print_r ($diff);exit; - if($diff>0) - { - //echo "sdsds";exit; - foreach($diff as $value) - { - $where=array('id'=>$value); - $tablename="projectdetail"; - $values=array('status'=>0); - if($projectDetailId[$key]!=""){ - $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} - //echo $this->db->last_query(); - } - } - //New Row Insertion - if($projectDetailId[$key]=="") - { - - if($_FILES['profileimage']['tmp_name']) - { - $tempDocument=$_FILES['profileimage']['tmp_name'][$key]; - $getImage=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]); - $extension1 = pathinfo($getImage, PATHINFO_EXTENSION); - $image=$id.'.'.$getImage; - //$document='uploads/subject/'.$business_document; - $targetPath = './uploads/project/'; - $targetFile=$targetPath.$image; - - - if(move_uploaded_file($tempDocument, $targetFile)) - { - $tablename='projectdetail'; - $data=array('projectId'=>$id, - 'title'=>$title[$key], - 'image'=>$image, - 'status'=>1); - - $result=$this->Commonsql_model->insert_table($tablename,$data); - } - } - - } - if($result) { @@ -329,7 +329,8 @@ class Project extends CI_Controller { $table="project"; $where=array("id"=>$projectId); $values=array('status'=>0); - + $result=$this->Commonsql_model->updateTable($table,$where,$values); + $dTable="projectdetail"; $dWhere=array("projectId"=>$projectId); $dValue=array('status'=>0); diff --git a/admin/application/controllers/Semester.php b/admin/application/controllers/Semester.php index a86f0f7..2a73ce5 100644 --- a/admin/application/controllers/Semester.php +++ b/admin/application/controllers/Semester.php @@ -53,35 +53,50 @@ class Semester extends CI_Controller { { $name=$this->input->post('name'); $year=$this->input->post('year'); - $subjectId=$this->input->post('subjectId'); - $departmentId=$this->input->post('departmentId'); - $degreeId=$this->input->post('degreeId'); - $subjectIdd = implode(",", (array)$subjectId); + //echo $subjectIdd;exit; //echo $degreeId; $table="semester"; - $values=array('name'=>$name, - 'year'=>$year, - 'subjectId'=>$subjectIdd, - 'departmentId'=>$departmentId, - 'degreeId'=>$degreeId, - 'createdOn'=>date('Y-m-d'), - 'createdBy'=>1, - 'status'=>1); + $values=array( 'name'=>$name, + 'year'=>$year, + 'createdOn'=>date('Y-m-d'), + 'createdBy'=>1, + 'status'=>1); $result=$this->Commonsql_model->insert_table($table,$values); + $semesterId=$this->db->insert_id(); //echo $this->db->last_query();exit; + + $subjectId=$this->input->post('subjectId'); + $degreeId=$this->input->post('degreeId'); + + foreach($subjectId as $key=>$value) + { + $SUBJECTID=$subjectId[$key]; + $DEGREEID=$degreeId[$key]; + $SUBID = implode(",", (array)$SUBJECTID); + + //echo $SUBID; + $tablename='semesterdetail'; + $data=array('semesterId'=>$semesterId, + 'degreeId'=>$DEGREEID, + 'subjectId'=>$SUBID, + 'status'=>1); + + $result=$this->Commonsql_model->insert_table($tablename,$data); + } + //exit; if($result) - { - $this->session->set_userdata('suc','successfully added'); - redirect('semester'); - - } - else - { - $this->session->set_userdata('err','Please try again'); - redirect('semester'); - } + { + $this->session->set_userdata('suc','successfully added'); + redirect('semester'); + + } + else + { + $this->session->set_userdata('err','Please try again'); + redirect('semester'); + } } $this->load->view('semester/add_semester',$data); @@ -90,28 +105,92 @@ class Semester extends CI_Controller { function editSemester($id) { + $data['subject']=$this->Semester_model->listSubject(); + $data['degree']=$this->Semester_model->listDegree(); + $data['getData']=$this->Semester_model->getSemester($id); + + $data['getSemesterDetail']=$this->Semester_model->getSemesterDetail($id); + //echo $this->db->last_query();exit; if($this->input->post('submit')) { $name=$this->input->post('name'); $year=$this->input->post('year'); - $subjectId=$this->input->post('subjectId'); - $departmentId=$this->input->post('departmentId'); - $degreeId=$this->input->post('degreeId'); - $subjectIdd = implode(",", (array)$subjectId); $table="semester"; $where=array("id"=>$id); $values=array( 'name'=>$name, 'year'=>$year, - 'subjectId'=>$subjectIdd, - 'departmentId'=>$departmentId, - 'degreeId'=>$degreeId, 'updatedOn'=>date('Y-m-d'), 'updatedby'=>1); $result=$this->Commonsql_model->updateTable($table,$where,$values); //echo $this->db->last_query();exit; + + //Update Old One + $degreeId=$this->input->post('degreeId'); + $subjectId=$this->input->post('subjectId'); + $semesterDetailId=$this->input->post('semesterDetailName'); + + foreach($subjectId as $key=>$value) + { + $DEGREEID=$degreeId[$key]; + $SEMESTERDETAILID=$semesterDetailId[$key]; + $SUBJECTID=$subjectId[$key]; + $SUBID = implode(",", (array)$SUBJECTID); + + //echo $SUBID; + + $tablename='semesterdetail'; + $data=array('degreeId'=>$DEGREEID, + 'subjectId'=>$SUBID); + $where=array('id'=>$SEMESTERDETAILID); + $result=$this->Commonsql_model->updateTable($tablename,$where,$data); + + //Remove Existing One + $existingRow=$this->Semester_model->getSemesterDetail($id); + + //echo $this->db->last_query();exit; + + if($existingRow->num_rows()>0) + { + //echo "test";exit; + $primaryId=array(); + foreach($existingRow->result() as $list) + { + $primaryId[]=$list->id ; + } + } + //Remove Row + $diff=array_diff($primaryId,$semesterDetailId); + //print_r ($diff);exit; + if($diff>0) + { + //echo "sdsds";exit; + foreach($diff as $value) + { + $where=array('id'=>$value); + $tablename="semesterdetail"; + $values=array('status'=>0); + if($SEMESTERDETAILID!=""){ + $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} + //echo $this->db->last_query(); + } + } + //New Row Insertion + if($SEMESTERDETAILID=="") + { + $tablename='semesterdetail'; + $data=array('semesterId'=>$id, + 'degreeId'=>$DEGREEID, + 'subjectId'=>$SUBID, + 'status'=>1); + $result=$this->Commonsql_model->insert_table($tablename,$data); + } + } + + + if($result) { $this->session->set_userdata('suc','successfully Updated'); @@ -125,10 +204,7 @@ class Semester extends CI_Controller { } } - $data['subject']=$this->Semester_model->listSubject(); - $data['department']=$this->Semester_model->listDepartment(); - $data['degree']=$this->Semester_model->listDegree(); - $data['getData']=$this->Semester_model->getSemester($id); + $this->load->view('semester/edit_semester',$data); } @@ -141,8 +217,14 @@ class Semester extends CI_Controller { $table="semester"; $where=array("id"=>$semesterId); $values=array('status'=>0); - $result=$this->Commonsql_model->updateTable($table,$where,$values); + + $table="semesterdetail"; + $where=array("semesterId"=>$semesterId); + $values=array('status'=>0); + + $result=$this->Commonsql_model->updateTable($table,$where,$values); + //echo $this->db->last_query();exit; if($result) { $this->session->set_userdata('suc','successfully deleted'); diff --git a/admin/application/controllers/Subject.php b/admin/application/controllers/Subject.php index d14afe6..e60b472 100644 --- a/admin/application/controllers/Subject.php +++ b/admin/application/controllers/Subject.php @@ -236,63 +236,65 @@ class Subject extends CI_Controller { //echo $this->db->last_query(); } - } - //Remove Existing One - $existingRow=$this->Subject_model->getMultipleImage($id); - //echo $this->db->last_query(); - if($existingRow->num_rows()>0) - { - //echo "test";exit; - $primaryId=array(); - foreach($existingRow->result() as $list) + + //Remove Existing One + $existingRow=$this->Subject_model->getMultipleImage($id); + //echo $this->db->last_query(); + if($existingRow->num_rows()>0) { - $primaryId[]=$list->id ; + //echo "test";exit; + $primaryId=array(); + foreach($existingRow->result() as $list) + { + $primaryId[]=$list->id ; + } + } + //Remove Row + $diff=array_diff($primaryId,$subjectDetailId); + //print_r ($diff);exit; + if($diff>0) + { + //echo "sdsds";exit; + foreach($diff as $value) + { + $where=array('id'=>$value); + $tablename="subjectdetail"; + $values=array('status'=>0); + if($subjectDetailId[$key]!=""){ + $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} + //echo $this->db->last_query(); + } + } + //New Row Insertion + if($subjectDetailId[$key]=="") + { + + if($_FILES['profileimage']['tmp_name']) + { + $tempDocument=$_FILES['profileimage']['tmp_name'][$key]; + $getImage=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]); + $extension1 = pathinfo($getImage, PATHINFO_EXTENSION); + $image=$id.'.'.$getImage; + //$document='uploads/subject/'.$business_document; + $targetPath = './uploads/subject/'; + $targetFile=$targetPath.$image; + + + if(move_uploaded_file($tempDocument, $targetFile)) + { + $tablename='subjectdetail'; + $data=array('subjectId'=>$id, + 'title'=>$title[$key], + 'image'=>$image, + 'status'=>1); + + $result=$this->Commonsql_model->insert_table($tablename,$data); + } + } + } } - //Remove Row - $diff=array_diff($primaryId,$subjectDetailId); - //print_r ($diff);exit; - if($diff>0) - { - //echo "sdsds";exit; - foreach($diff as $value) - { - $where=array('id'=>$value); - $tablename="subjectdetail"; - $values=array('status'=>0); - if($subjectDetailId[$key]!=""){ - $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} - //echo $this->db->last_query(); - } - } - //New Row Insertion - if($subjectDetailId[$key]=="") - { - - if($_FILES['profileimage']['tmp_name']) - { - $tempDocument=$_FILES['profileimage']['tmp_name'][$key]; - $getImage=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]); - $extension1 = pathinfo($getImage, PATHINFO_EXTENSION); - $image=$id.'.'.$getImage; - //$document='uploads/subject/'.$business_document; - $targetPath = './uploads/subject/'; - $targetFile=$targetPath.$image; - - - if(move_uploaded_file($tempDocument, $targetFile)) - { - $tablename='subjectdetail'; - $data=array('subjectId'=>$id, - 'title'=>$title[$key], - 'image'=>$image, - 'status'=>1); - - $result=$this->Commonsql_model->insert_table($tablename,$data); - } - } - - } + if($result) { $this->session->set_userdata('suc','successfully Updated'); @@ -320,7 +322,8 @@ class Subject extends CI_Controller { $table="subject"; $where=array("id"=>$subjectId); $values=array('status'=>0); - + $result=$this->Commonsql_model->updateTable($table,$where,$values); + $dTable="subjectdetail"; $dWhere=array("subjectId"=>$subjectId); $dValue=array('status'=>0); diff --git a/admin/application/controllers/new 1.txt b/admin/application/controllers/new 1.txt new file mode 100644 index 0000000..e91efda --- /dev/null +++ b/admin/application/controllers/new 1.txt @@ -0,0 +1,39 @@ +//Remove Existing One + $existingRow=$this->Semester_model->getSemesterDetail($id); + //echo $this->db->last_query(); + if($existingRow->num_rows()>0) + { + //echo "test";exit; + $primaryId=array(); + foreach($existingRow->result() as $list) + { + $primaryId[]=$list->id ; + } + } + //Remove Row + $diff=array_diff($primaryId,$semesterDetailId); + //print_r ($diff);exit; + if($diff>0) + { + //echo "sdsds";exit; + foreach($diff as $value) + { + $where=array('id'=>$value); + $tablename="semesterdetail"; + $values=array('status'=>0); + if($SEMESTERDETAILID!=""){ + $result=$this->Commonsql_model->updateTable($tablename,$where,$values);} + //echo $this->db->last_query(); + } + } + + //New Row Insertion + if($subjectDetailId[$key]=="") + { + $tablename='semesterdetail'; + $data=array('semesterId'=>$id, + 'degreeId'=>$DEGREEID, + 'subjectId'=>$SUBID, + 'status'=>1); + $result=$this->Commonsql_model->insert_table($tablename,$data); + } \ No newline at end of file diff --git a/admin/application/models/Semester_model.php b/admin/application/models/Semester_model.php index eb3524f..edaa0a0 100644 --- a/admin/application/models/Semester_model.php +++ b/admin/application/models/Semester_model.php @@ -10,72 +10,74 @@ class Semester_model extends CI_Model { function list_semester() { - $this->db->select('s.id,s.name,s.year,sub.id as subId,sub.name as subName,dep.id as depId,dep.name as depName,deg.id as degId,deg.name as degName'); + $this->db->select('s.id,s.name,s.year'); $this->db->from('semester as s'); - $this->db->join('subject as sub','sub.id=s.subjectId','INNER'); - $this->db->join('department as dep','dep.id=s.departmentId','INNER'); - $this->db->join('degree as deg','deg.id=s.degreeId','INNER'); $this->db->where(array('s.status'=>1,)); $query = $this->db->get(); - //'sub.status'=>1,'dep.status'=>1,'deg.status'=>1 - //echo $this->db->last_query();exit; + //echo $this->db->last_query();exit; return $query; } - function listSubject() + function listSubject() { $this->db->select('id,name'); $this->db->from('subject'); $this->db->where(array('status'=>1)); $query = $this->db->get(); - //echo $this->db->last_query();exit; + //echo $this->db->last_query();exit; return $query; } - function listDepartment() + + function listDepartment() { $this->db->select('id,name'); $this->db->from('department'); $this->db->where(array('status'=>1)); $query = $this->db->get(); - //echo $this->db->last_query();exit; return $query; - } function listDegree() + } + + function listDegree() { $this->db->select('id,name'); $this->db->from('degree'); $this->db->where(array('status'=>1)); $query = $this->db->get(); - //echo $this->db->last_query();exit; return $query; } + function viewSemester($id) { - $this->db->select('s.id,s.name,s.year,s.subjectId,dep.id as depId,dep.name as depName,deg.id as degId,deg.name as degName'); + $this->db->select('s.id,s.name,s.year'); $this->db->from('semester as s'); - $this->db->join('department as dep','dep.id=s.departmentId','INNER'); - $this->db->join('degree as deg','deg.id=s.degreeId','INNER'); $this->db->where(array('s.status'=>1,'s.id'=>$id)); $query = $this->db->get(); - //echo $this->db->last_query();exit; return $query; } - function getSemester($id) + + function getSemester($id) { $this->db->select('*'); $this->db->from('semester'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); - //echo $this->db->last_query();exit; return $query; } - - function get_subject($id) + function getSemesterDetail($id) + { + $this->db->select('*'); + $this->db->from('semesterdetail'); + $this->db->where(array('status'=>1,'semesterId'=>$id)); + $query = $this->db->get(); + return $query; + } + + function get_subject($id) { $this->db->select('*'); $this->db->from('subject'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); - //echo $this->db->last_query();exit; return $query; } } diff --git a/admin/application/views/project/add_project.php b/admin/application/views/project/add_project.php index d8bdcc1..81a5c9e 100644 --- a/admin/application/views/project/add_project.php +++ b/admin/application/views/project/add_project.php @@ -176,7 +176,7 @@
-
+
Add
diff --git a/admin/application/views/semester/add_semester.php b/admin/application/views/semester/add_semester.php index c3e3c25..0f91f7d 100644 --- a/admin/application/views/semester/add_semester.php +++ b/admin/application/views/semester/add_semester.php @@ -34,66 +34,24 @@
-
-
-
+
- -
- -
-
-
- -
- -
-
-
- -
- num_rows()>0) @@ -107,7 +65,69 @@
+
+ + +
+
+ +
Add
+
+ +
+
+ + +
+
+ + +
+
+ +
Remove
+
+
+ + +
@@ -133,3 +153,50 @@ + + + diff --git a/admin/application/views/semester/edit_semester.php b/admin/application/views/semester/edit_semester.php index 532ebd4..219d8a8 100644 --- a/admin/application/views/semester/edit_semester.php +++ b/admin/application/views/semester/edit_semester.php @@ -1,8 +1,11 @@ - load->view('includes/header');?> +load->view('includes/header');?> +load->model('Semester_model');?>
load->view('includes/sidebar');?> @@ -37,91 +40,131 @@ $id =$e->id; $name=$e->name; $year=$e->year; - $subjectId=$e->subjectId; - $departmentId=$e->departmentId; - $degreeId =$e->degreeId; - $subId = explode(",", $subjectId); - //print_r($subId); + } ?>
-
-
-
+
- -
- -
+
+
+
+
Add More
-
- -
- -
-
- -
- + num_rows()>0) + { + $i=0; + foreach($getSemesterDetail->result() as $d) + { + $id=$d->id; + $degreeId=$d->degreeId; + $subjectId=$d->subjectId; + + $subId = explode(",", $subjectId); + ?> +
+ +
+ +
+
+ + +
+
+ +
Remove
+
-
+ + +
+ +
+ + +
+
+ + +
+
+ +
Remove
+
+
+ + +
@@ -135,10 +178,11 @@
+
- + @@ -146,3 +190,51 @@ + \ No newline at end of file diff --git a/admin/application/views/semester/semester_list.php b/admin/application/views/semester/semester_list.php index c0ff401..367b104 100644 --- a/admin/application/views/semester/semester_list.php +++ b/admin/application/views/semester/semester_list.php @@ -22,7 +22,7 @@ load->view('includes/msg');?>
-
+

+ num_rows()>0){ + foreach($get_degree->result() as $d) + { + $id=$d->id; + $degId=$d->degId; + $degName=$d->degName; + $subjectId=$d->subjectId; + $subId = explode(",", $subjectId); + ?>
-
Department -
-

-
Degree

- -
Subject +
Subject
Semester_model->get_subject($subIdd); @@ -82,18 +81,14 @@ $CI->load->model('Semester_model');?> { $list=$getSub->row(); $subName=$list->name; - } - ?> -
- - +

.

+
- + diff --git a/application/views/include/header.php b/application/views/include/header.php index beb7a13..bdd7e85 100644 --- a/application/views/include/header.php +++ b/application/views/include/header.php @@ -68,7 +68,7 @@ $year=$list->year; $departmentId=$list->departmentId; - ?>
  • @@ -76,20 +76,19 @@
  • - Department - + + --> +
  • diff --git a/mcgans.sql b/mcgans.sql index eca13d7..898a94d 100644 --- a/mcgans.sql +++ b/mcgans.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Jan 24, 2023 at 11:03 AM +-- Generation Time: Jan 25, 2023 at 01:46 PM -- Server version: 10.4.24-MariaDB -- PHP Version: 7.4.29 @@ -43,7 +43,8 @@ CREATE TABLE `degree` ( -- INSERT INTO `degree` (`id`, `departmentId`, `name`, `createdBy`, `createdOn`, `upadatedOn`, `updatedBy`, `status`) VALUES -(1, 1, 'Bachelor’s in Architecture', 1, '2023-01-23', '0000-00-00', 0, 1); +(1, 1, 'Bachelor’s in Architecture', 1, '2023-01-23', '0000-00-00', 0, 1), +(2, 1, 'Test', 1, '2023-01-25', '0000-00-00', 0, 1); -- -------------------------------------------------------- @@ -226,9 +227,6 @@ CREATE TABLE `semester` ( `id` int(11) NOT NULL, `name` varchar(225) NOT NULL, `year` int(11) NOT NULL, - `subjectId` varchar(225) NOT NULL, - `departmentId` int(11) NOT NULL, - `degreeId` int(11) NOT NULL, `createdBy` int(11) NOT NULL, `createdOn` date NOT NULL, `updatedOn` date NOT NULL, @@ -240,8 +238,33 @@ CREATE TABLE `semester` ( -- Dumping data for table `semester` -- -INSERT INTO `semester` (`id`, `name`, `year`, `subjectId`, `departmentId`, `degreeId`, `createdBy`, `createdOn`, `updatedOn`, `updatedBy`, `status`) VALUES -(3, 'EVEN', 2023, '1,2,3,4,5', 1, 1, 1, '2023-01-23', '2023-01-23', 1, 1); +INSERT INTO `semester` (`id`, `name`, `year`, `createdBy`, `createdOn`, `updatedOn`, `updatedBy`, `status`) VALUES +(1, 'ODD', 2024, 1, '2023-01-25', '2023-01-25', 1, 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `semesterdetail` +-- + +CREATE TABLE `semesterdetail` ( + `id` int(11) NOT NULL, + `semesterId` int(11) NOT NULL, + `degreeId` int(11) NOT NULL, + `subjectId` varchar(225) NOT NULL, + `status` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- +-- Dumping data for table `semesterdetail` +-- + +INSERT INTO `semesterdetail` (`id`, `semesterId`, `degreeId`, `subjectId`, `status`) VALUES +(1, 1, 1, '1,2', 1), +(2, 1, 2, '1,2,3,4,5', 0), +(3, 1, 2, '1', 0), +(4, 1, 2, '2', 0), +(5, 1, 2, '1', 1); -- -------------------------------------------------------- @@ -383,6 +406,12 @@ ALTER TABLE `role` ALTER TABLE `semester` ADD PRIMARY KEY (`id`); +-- +-- Indexes for table `semesterdetail` +-- +ALTER TABLE `semesterdetail` + ADD PRIMARY KEY (`id`); + -- -- Indexes for table `student` -- @@ -409,7 +438,7 @@ ALTER TABLE `subjectdetail` -- AUTO_INCREMENT for table `degree` -- ALTER TABLE `degree` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `department` @@ -451,7 +480,13 @@ ALTER TABLE `role` -- AUTO_INCREMENT for table `semester` -- ALTER TABLE `semester` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + +-- +-- AUTO_INCREMENT for table `semesterdetail` +-- +ALTER TABLE `semesterdetail` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `student`