Project and Subject Edit Completed File

24012023
This commit is contained in:
dotwingssoftware 2023-01-24 15:35:16 +05:30
parent 6515996f87
commit 745212572c
137 changed files with 2498 additions and 1384 deletions

View File

@ -84,7 +84,7 @@ $route['edit-degree/(:num)'] = 'degree/editDegree/$1';
$route['semester'] = 'semester/semester_list'; $route['semester'] = 'semester/semester_list';
$route['add-semester'] = 'semester/add_semester'; $route['add-semester'] = 'semester/add_semester';
$route['edit-semester/(:num)'] = 'semester/editSemester/$1'; $route['edit-semester/(:num)'] = 'semester/editSemester/$1';
$route['view-semester/(:num)'] = 'semester/viewSemester/$1';
//subject// //subject//
$route['subject'] = 'subject/subject_list'; $route['subject'] = 'subject/subject_list';
@ -102,7 +102,7 @@ $route['edit-faculty/(:num)'] = 'faculty/editFaculty/$1';
$route['student'] = 'student/student_list'; $route['student'] = 'student/student_list';
$route['add_student'] = 'student/add_student'; $route['add_student'] = 'student/add_student';
$route['view-student/(:num)'] = 'student/viewStudent/$1'; $route['view-student/(:num)'] = 'student/viewStudent/$1';
$route['edit_student/(:num)'] = 'student/edit_student/$1'; $route['edit-student/(:num)'] = 'student/editStudent/$1';
$route['deleted_student'] = 'student/deleted_student'; $route['deleted_student'] = 'student/deleted_student';
@ -110,5 +110,5 @@ $route['deleted_student'] = 'student/deleted_student';
$route['project'] = 'project/project_list'; $route['project'] = 'project/project_list';
$route['add_project'] = 'project/add_project'; $route['add_project'] = 'project/add_project';
$route['view-project/(:num)'] = 'project/viewProject/$1'; $route['view-project/(:num)'] = 'project/viewProject/$1';
$route['edit_project/(:num)'] = 'project/edit_project/$1'; $route['edit-project/(:num)'] = 'project/editProject/$1';
$route['deleted_project'] = 'project/deleted_project'; $route['deleted_project'] = 'project/deleted_project';

View File

@ -148,46 +148,162 @@ class Project extends CI_Controller {
} }
function edit_project($id) function editProject($id)
{ {
$data['dep']=$this->Project_model->get_dep();
$data['stu']=$this->Project_model->get_stu();
$data['sub']=$this->Project_model->get_sub();
$data['semester']=$this->Project_model->get_semester();
$data['pro']=$this->Project_model->get_pro($id); $data['pro']=$this->Project_model->get_pro($id);
$this->load->view('project/edit_project',$data);
$data['getMultipleImage']=$this->Project_model->getMultipleImage($id);
if($this->input->post('submit')) if($this->input->post('submit'))
{ {
$name=$this->input->post('projectName');
$date=$this->input->post('date'); $date=$this->input->post('date');
$student=$this->input->post('student'); $projectName=$this->input->post('projectName');
$semester=$this->input->post('semester'); $code=$this->input->post('code');
$subject=$this->input->post('subject'); $studentId=$this->input->post('student');
//$gender=$this->input->post('gender'); $semesterId=$this->input->post('semesterId');
$department=$this->input->post('department'); $subjectId=$this->input->post('subjectId');
$departmentId=$this->input->post('departmentId');
$titleImage=$this->input->post('titleImage');
$oldImage=$this->input->post('oldImage');
$description=$this->input->post('description'); $description=$this->input->post('description');
//$faculty=$this->input->post('faculty');
$drivelink=$this->input->post('drivelink'); $drivelink=$this->input->post('drivelink');
$video=$this->input->post('vedio'); $video=$this->input->post('video');
$image=$this->input->post('image');
if($titleImage=="" ){$newImage=$oldImage;}
if(file_exists($_FILES['titleImage']['tmp_name']))
{
$temp_user_img=$_FILES['titleImage']['tmp_name'];
$newImage=str_replace(' ', '_', $_FILES["titleImage"]["name"]);
$allowed = array('png,jpeg,jpg');
$extension1 = pathinfo($newImage, PATHINFO_EXTENSION);
$newImage='title'.date('ymdhis').'.'.$extension1;
$targetPath='./uploads/project/';
$targetFile=$targetPath.$newImage;
move_uploaded_file($temp_user_img, $targetFile);
}
$table="project"; $table="project";
$where=array("id"=>$id); $where=array("id"=>$id);
$values=array('projectName'=>$name, $values=array('projectName'=>$projectName,
'date'=>$date, 'date'=>$date,
'studentId'=>$student, 'code'=>$code,
'semesterId'=>$semester, 'studentId'=>$studentId,
'subjectId'=>$subject, 'semesterId'=>$semesterId,
'departmentId'=>$department, 'subjectId'=>$subjectId,
// 'gender'=>$gender, 'departmentId'=>$departmentId,
'image'=>$newImage,
'description'=>$description, 'description'=>$description,
//'faculty'=>$faculty,
'drivelink'=>$drivelink, 'drivelink'=>$drivelink,
'vedio'=>$video, 'vedio'=>$video,
'image'=>$image,
'updatedOn'=>date('Y-m-d'), 'updatedOn'=>date('Y-m-d'),
'updatedBy'=>1, 'updatedBy'=>1);
'status'=>1);
$result=$this->Commonsql_model->updateTable($table,$where,$values); $result=$this->Commonsql_model->updateTable($table,$where,$values);
//Image Multiple
$title = $this->input->post('title');
$profileimage = $this->input->post('profileimage');
$projectDetailId = $this->input->post('projectDetailName');
$oldImage = $this->input->post('profileimageOld');
//print_r ($projectDetailId);exit;
//Update old datas
foreach($title as $key=>$value)
{
if($projectDetailId[$key]!="")
{
if($_FILES['profileimage']['name'][$key])
{
$temp_file=$_FILES['profileimage']['tmp_name'][$key];
$business_doc=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]);
$extension1 = pathinfo($business_doc, PATHINFO_EXTENSION);
$newImage=$id.'.'.$business_doc;
$document='uploads/project/'.$newImage;
$targetPath = './uploads/project/';
$targetFile=$targetPath.$newImage;
if(move_uploaded_file($temp_file, $targetFile))
{ }
}
else{
$newImage=$oldImage[$key];
}
$tablename='projectdetail';
$data=array('title'=>$title[$key],
'image'=>$newImage);
$where=array('id'=>$projectDetailId[$key]);
$result=$this->Commonsql_model->updateTable($tablename,$where,$data);
//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)
{
$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);
}
}
}
if($result) if($result)
{ {
$this->session->set_userdata('suc','successfully Updated'); $this->session->set_userdata('suc','successfully Updated');
@ -201,7 +317,7 @@ class Project extends CI_Controller {
} }
} }
$this->load->view('project/edit_project',$data);
} }
function deleteProject() function deleteProject()

View File

@ -32,6 +32,14 @@ class Semester extends CI_Controller {
$this->load->view('semester/semester_list',$data); $this->load->view('semester/semester_list',$data);
} }
public function viewSemester($id)
{
if($this->session->userdata('id')==""){redirect('');}
$data['viewSemester']=$this->Semester_model->viewSemester($id);
//echo $this->db->last_query();exit;
$this->load->view('semester/view_semester',$data);
}
function add_semester() function add_semester()
{ {
@ -48,12 +56,14 @@ class Semester extends CI_Controller {
$subjectId=$this->input->post('subjectId'); $subjectId=$this->input->post('subjectId');
$departmentId=$this->input->post('departmentId'); $departmentId=$this->input->post('departmentId');
$degreeId=$this->input->post('degreeId'); $degreeId=$this->input->post('degreeId');
///echo $departmentId;
$subjectIdd = implode(",", (array)$subjectId);
//echo $subjectIdd;exit;
//echo $degreeId; //echo $degreeId;
$table="semester"; $table="semester";
$values=array('name'=>$name, $values=array('name'=>$name,
'year'=>$year, 'year'=>$year,
'subjectId'=>$subjectId, 'subjectId'=>$subjectIdd,
'departmentId'=>$departmentId, 'departmentId'=>$departmentId,
'degreeId'=>$degreeId, 'degreeId'=>$degreeId,
'createdOn'=>date('Y-m-d'), 'createdOn'=>date('Y-m-d'),
@ -88,11 +98,13 @@ class Semester extends CI_Controller {
$departmentId=$this->input->post('departmentId'); $departmentId=$this->input->post('departmentId');
$degreeId=$this->input->post('degreeId'); $degreeId=$this->input->post('degreeId');
$subjectIdd = implode(",", (array)$subjectId);
$table="semester"; $table="semester";
$where=array("id"=>$id); $where=array("id"=>$id);
$values=array( 'name'=>$name, $values=array( 'name'=>$name,
'year'=>$year, 'year'=>$year,
'subjectId'=>$subjectId, 'subjectId'=>$subjectIdd,
'departmentId'=>$departmentId, 'departmentId'=>$departmentId,
'degreeId'=>$degreeId, 'degreeId'=>$degreeId,
'updatedOn'=>date('Y-m-d'), 'updatedOn'=>date('Y-m-d'),

View File

@ -105,11 +105,10 @@ class Student extends CI_Controller {
} }
function edit_student($id) function editStudent($id)
{ {
$data['dep']=$this->Student_model->get_dep();
$data['stu']=$this->Student_model->get_stu($id); $data['stu']=$this->Student_model->get_stu($id);
$this->load->view('student/edit_student',$data);
if($this->input->post('submit')) if($this->input->post('submit'))
{ {
@ -117,10 +116,25 @@ class Student extends CI_Controller {
$number=$this->input->post('mobileNumber'); $number=$this->input->post('mobileNumber');
$address=$this->input->post('address'); $address=$this->input->post('address');
$department=$this->input->post('department'); $department=$this->input->post('department');
$date=$this->input->post('date');
$student=$this->input->post('student'); $student=$this->input->post('student');
$gender=$this->input->post('gender'); $gender=$this->input->post('gender');
$s_img=$this->input->post('image'); $s_img=$this->input->post('image');
$hiddenImage=$this->input->post('hiddenImage');
if (!is_dir('uploads/student')) {
mkdir('./uploads/student', 0777, TRUE);
}
if(file_exists($_FILES['image']['tmp_name']))
{
$temp_user_img=$_FILES['image']['tmp_name'];
$s_img=str_replace(' ', '_', $_FILES["image"]["name"]);
$allowed = array('png,jpeg,jpg');
$extension1 = pathinfo($s_img, PATHINFO_EXTENSION);
$s_img=date('ymdhi').'.'.$extension1;
$targetPath='./uploads/student/';
$targetFile=$targetPath.$s_img;
move_uploaded_file($temp_user_img, $targetFile);
}
$table="student"; $table="student";
$where=array("id"=>$id); $where=array("id"=>$id);
@ -129,6 +143,7 @@ class Student extends CI_Controller {
'studentId'=>$student, 'studentId'=>$student,
'address'=>$address, 'address'=>$address,
'department'=>$department, 'department'=>$department,
'dob'=>$date,
'gender'=>$gender, 'gender'=>$gender,
'image'=>$s_img, 'image'=>$s_img,
//'update_on'=>date('Y-m-d'), //'update_on'=>date('Y-m-d'),
@ -136,6 +151,7 @@ class Student extends CI_Controller {
'status'=>1); 'status'=>1);
$result=$this->Commonsql_model->updateTable($table,$where,$values); $result=$this->Commonsql_model->updateTable($table,$where,$values);
//echo $this->db->last_query();exit;
if($result) if($result)
{ {
$this->session->set_userdata('suc','successfully Updated'); $this->session->set_userdata('suc','successfully Updated');
@ -149,10 +165,7 @@ class Student extends CI_Controller {
} }
} }
//echo "sdsd";exit; $this->load->view('student/edit_student',$data);
//echo $this->db->last_query();exit;
} }
function deleteStudent() function deleteStudent()

View File

@ -86,7 +86,45 @@ class Subject extends CI_Controller {
'createdBy'=>1, 'createdBy'=>1,
'status'=>1); 'status'=>1);
$result=$this->Commonsql_model->insert_table($table,$values); $result=$this->Commonsql_model->insert_table($table,$values);
if($result)
$subjectId=$this->db->insert_id();
//Image table insert
$title = $this->input->post('title');
foreach($title as $key=>$value)
{
if($_FILES['profileimage']['tmp_name'])
{
if (!is_dir('uploads/subject')) {
mkdir('./uploads/subject', 0777, TRUE);
}
$temp_vehicle_doc=$_FILES['profileimage']['tmp_name'][$key];
$projectImage=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]);
$extension1 = pathinfo($projectImage, PATHINFO_EXTENSION);
$pImage=$subjectId.'.'.$projectImage;
$document='uploads/subject/'.$pImage;
$targetPath = './uploads/subject/';
$targetFile=$targetPath.$pImage;
if(move_uploaded_file($temp_vehicle_doc, $targetFile))
{
$tablename='subjectdetail';
$data=array('subjectId'=>$subjectId,
'title'=>$title[$key],
'image'=>$pImage,
'status'=>1);
$subject=$this->Commonsql_model->insert_table($tablename,$data);
//echo $this->db->last_query();
}
}
}
//exit;
if($result & $subject)
{ {
$this->session->set_userdata('suc','successfully added'); $this->session->set_userdata('suc','successfully added');
redirect('subject'); redirect('subject');
@ -110,6 +148,8 @@ class Subject extends CI_Controller {
$data['degree']=$this->Subject_model->degreeList(); $data['degree']=$this->Subject_model->degreeList();
$data['faculty']=$this->Subject_model->facultyList(); $data['faculty']=$this->Subject_model->facultyList();
$data['getMultipleImage']=$this->Subject_model->getMultipleImage($id);
///echo $this->db->last_query();exit;
if($this->input->post('submit')) if($this->input->post('submit'))
{ {
@ -155,8 +195,105 @@ class Subject extends CI_Controller {
$result=$this->Commonsql_model->updateTable($table,$where,$values); $result=$this->Commonsql_model->updateTable($table,$where,$values);
//echo $this->db->last_query();exit; //echo $this->db->last_query();exit;
if($result)
//Image Multiple
$title = $this->input->post('title');
$profileimage = $this->input->post('profileimage');
$subjectDetailId = $this->input->post('subjectDetailName');
$oldImage = $this->input->post('profileimageOld');
//print_r ($subjectDetailId);exit;
//Update old datas
foreach($title as $key=>$value)
{
if($subjectDetailId[$key]!="")
{
if($_FILES['profileimage']['name'][$key])
{
$temp_file=$_FILES['profileimage']['tmp_name'][$key];
$business_doc=str_replace(' ', '_', $_FILES["profileimage"]["name"][$key]);
$extension1 = pathinfo($business_doc, PATHINFO_EXTENSION);
$newImage=$id.'.'.$business_doc;
$document='uploads/subject/'.$newImage;
$targetPath = './uploads/subject/';
$targetFile=$targetPath.$newImage;
if(move_uploaded_file($temp_file, $targetFile))
{ }
}
else{
$newImage=$oldImage[$key];
}
$tablename='subjectdetail';
$data=array('title'=>$title[$key],
'image'=>$newImage);
$where=array('id'=>$subjectDetailId[$key]);
$result=$this->Commonsql_model->updateTable($tablename,$where,$data);
//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)
{
$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);
}
}
}
if($result)
{ {
$this->session->set_userdata('suc','successfully Updated'); $this->session->set_userdata('suc','successfully Updated');
redirect('subject'); redirect('subject');
@ -166,7 +303,6 @@ class Subject extends CI_Controller {
$this->session->set_userdata('err','Please try again'); $this->session->set_userdata('err','Please try again');
redirect('subject'); redirect('subject');
} }
} }
$this->load->view('subject/edit_subject',$data); $this->load->view('subject/edit_subject',$data);
@ -185,6 +321,10 @@ class Subject extends CI_Controller {
$where=array("id"=>$subjectId); $where=array("id"=>$subjectId);
$values=array('status'=>0); $values=array('status'=>0);
$dTable="subjectdetail";
$dWhere=array("subjectId"=>$subjectId);
$dValue=array('status'=>0);
$result=$this->Commonsql_model->updateTable($table,$where,$values); $result=$this->Commonsql_model->updateTable($table,$where,$values);
if($result) if($result)
{ {

View File

@ -146,4 +146,13 @@ class Project_model extends CI_Model {
//echo $this->db->last_query(); exit; //echo $this->db->last_query(); exit;
return $result; return $result;
} }
function getMultipleImage($id)
{
$this->db->select('id,title,image,projectId');
$this->db->from('projectdetail');
$this->db->where(array('status'=>1,'projectId'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();
return $query;
}
} }

View File

@ -11,7 +11,7 @@ class Semester_model extends CI_Model {
function list_semester() 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,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->from('Semester as s'); $this->db->from('semester as s');
$this->db->join('subject as sub','sub.id=s.subjectId','INNER'); $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('department as dep','dep.id=s.departmentId','INNER');
$this->db->join('degree as deg','deg.id=s.degreeId','INNER'); $this->db->join('degree as deg','deg.id=s.degreeId','INNER');
@ -47,6 +47,17 @@ class Semester_model extends CI_Model {
$query = $this->db->get(); $query = $this->db->get();
//echo $this->db->last_query();exit; //echo $this->db->last_query();exit;
return $query; 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->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)
{ {
@ -58,4 +69,13 @@ class Semester_model extends CI_Model {
return $query; 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;
}
} }

View File

@ -64,4 +64,13 @@ class Subject_model extends CI_Model {
//echo $this->db->last_query(); //echo $this->db->last_query();
return $query; return $query;
} }
function getMultipleImage($id)
{
$this->db->select('id,title,image,subjectId');
$this->db->from('subjectdetail');
$this->db->where(array('status'=>1,'subjectId'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();
return $query;
}
} }

View File

@ -25,14 +25,14 @@
$date=$p->date; $date=$p->date;
$name=$p->projectName; $name=$p->projectName;
//$code=$p->faculty; //$code=$p->faculty;
$student=$p->studentId; $studentId=$p->studentId;
$semester=$p->semesterId; $semesterId=$p->semesterId;
$subject=$p->subjectId; $subjectId=$p->subjectId;
$code=$p->code; $code=$p->code;
$department=$p->departmentId; $departmentId=$p->departmentId;
$description=$p->description; $description=$p->description;
$video=$p->vedio; $video=$p->vedio;
//$drivelink=$p->drivelink; $driveLink=$p->driveLink;
$image=$p->image; $image=$p->image;
} ?> } ?>
@ -43,7 +43,7 @@
<header>Edit Project</header> <header>Edit Project</header>
</div> </div>
<div class="card-body" id="bar-parent"> <div class="card-body" id="bar-parent">
<form action="<?=base_url();?>edit_project/<?=$id;?>" method="post" class="form-horizontal" > <form action="<?=base_url();?>edit-project/<?=$id;?>" method="post" enctype="multipart/form-data" >
<div class="form-body"> <div class="form-body">
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Project Date <label class="control-label col-md-3">Project Date
@ -69,12 +69,25 @@
<input type="code" value="<?=$code;?>" name="code" data-required="1" placeholder="Enter Faculty" class="form-control input-height"> <input type="code" value="<?=$code;?>" name="code" data-required="1" placeholder="Enter Faculty" class="form-control input-height">
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Student <label class="control-label col-md-3">Student
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="student" value="<?=$student;?>" type="text" placeholder="Enter Student" class="form-control error" /> <select class="form-control select2" id="sudent_id" name="student" data-validation="required">
<option value="" selected="selected">Select</option>
<?php
if(isset($stu) && $stu->num_rows()>0)
{
foreach($stu->result() as $student)
{
?> <option value="<?=$student->id;?>" <?php if($student->id==$studentId){ echo "selected"; } ?>><?=$student->name;?></option><?php
}
}
?>
</select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
@ -82,7 +95,19 @@
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="semester" value="<?=$semester;?>" type="text" placeholder="Enter Semester" class="form-control error" /> <select class="form-control select2" name="semesterId" data-validation="required">
<option value="" selected="selected">Select</option>
<?php
if(isset($semester) && $semester->num_rows()>0)
{
foreach($semester->result() as $sem)
{
?> <option value="<?=$sem->id;?>" <?php if($sem->id==$semesterId){ echo "selected"; } ?>><?=$sem->name;?></option><?php
}
}
?>
</select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
@ -90,39 +115,142 @@
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="semester" value="<?=$subject;?>" type="text" placeholder="Enter Subject" class="form-control error" /> <select class="form-control select2" name="subjectId" data-validation="required">
<option value="" selected="selected">Select</option>
<?php
if(isset($sub) && $sub->num_rows()>0)
{
foreach($sub->result() as $subject)
{
?> <option value="<?=$subject->id;?>" <?php if($subject->id==$subjectId){ echo "selected"; } ?>><?=$subject->name;?></option><?php
}
}
?>
</select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Department <label class="control-label col-md-3">Department.
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="department" value="<?=$department;?>" type="text" placeholder="Enter Department" class="form-control input-height" /> </div> <select class="form-control select2" id="departmentId" name="departmentId" data-validation="required">
<option value="" selected="selected">Select</option>
<?php
if(isset($dep) && $dep->num_rows()>0)
{
foreach($dep->result() as $depart)
{
?> <option value="<?=$depart->id;?>" <?php if($depart->id==$departmentId){ echo "selected"; } ?>><?=$depart->name;?></option><?php
}
}
?>
</select>
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Title Image
<span class="required"> * </span>
</label>
<div class="col-md-5">
<input name="titleImage" type="file" data-validation="required" class="form-control input-height" />
<img src="<?=base_url();?>uploads/project/<?=$image;?>" style="width:75px;height:75px;"/>
<input name="oldImage" type="hidden" value="<?=$image;?>" class="form-control" />
</div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Description <label class="control-label col-md-3">Description
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="description" value="<?=$description;?>" type="text" placeholder="Enter Description" class="form-control input-height" /> </div> <textarea name="description" placeholder=" Enter Designation" data-validation="required" class="form-control" rows="5"><?=$description;?></textarea>
</div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Video <label class="control-label col-md-3">Video
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="vedio" value="<?=$video;?>" type="text" placeholder="Enter Drive Link" class="form-control input-height" /> </div> <input name="video" value="<?=$video;?>" type="text" placeholder="Enter Video Link" class="form-control input-height" /> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Project Image <label class="control-label col-md-3">Drive Link
<span class="required"> * </span>
</label> </label>
<div class="compose-editor"> <div class="col-md-5">
<input name="image" value="<?=$image;?>" type="file" class="form-control" > <input name="drivelink" value="<?=$driveLink;?>" type="text" placeholder="Enter Drive Link" class="form-control" /> </div>
</div>
<!--Multiple Add ---->
<?php
if(isset($getMultipleImage) && $getMultipleImage->num_rows()>0)
{
$totalCount=$getMultipleImage->num_rows();
}
?>
<input type="hidden" value="<?=$totalCount;?>" id="hiddenCount"/>
<hr>
<div class="form-group row">
<div class="col-md-3"></div>
<div class="col-md-4"></div>
<div class="col-md-1">
<div class="add-new-button-blue addMore"><span style="padding-top:3px;" class="btn btn-primary">Add More<i class="fa fa-plus"></i></span></div>
</div>
</div>
<?php
if(isset($getMultipleImage) && $getMultipleImage->num_rows()>0)
{
$i=0;
foreach($getMultipleImage->result() as $list)
{
$id =$list->id ;
$title=$list->title;
$image=$list->image;
$projectId=$list->projectId;
?>
<div class="form-group row duplicate1">
<input type="hidden" value="<?=$id;?>" id="projectDetailId_<?=$i;?>" name="projectDetailName[<?=$i;?>]"/>
<label class="control-label col-md-3">Title & Image
</label>
<div class="col-md-2 compose-editor">
<input value="<?=$title;?>" data-validation="required" name="title[<?=$i;?>]" id="projectTitle_<?=$i;?>" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimage[]" id="projectImage_<?=$i;?>" type="file" class="form-control default">
<img src="<?=base_url();?>uploads/project/<?=$image;?>" style="width:75px;height:75px;"/>
<input value="<?=$image;?>" name="profileimageOld[<?=$i;?>]" id="projectImageOld_<?=$i;?>" type="hidden" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue removeButton"><span style="padding-top:3px;" class="btn btn-danger">Remove <i class="fa fa-minus"></i></span></div>
</div>
</div>
<?php
$i++;
}
}
?>
<!---Duplicate ---->
<div class="form-group duplicate1 row hide" id="imageTemplate" >
<input type="hidden" value="" id="projectDetailId" name="projectDetailNames[]"/>
<label class="control-label col-md-3">
</label>
<div class="col-md-2 compose-editor">
<input name="titles[]" data-validation="required" id="projectTitle" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimages[]" data-validation="required" id="projectImage" type="file" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue removeButton" id="cat_add_id"><span class="btn btn-danger">Remove <i class="fa fa-minus"></i></span></div>
</div> </div>
</div> </div>
<!---Duplicate ---->
<!--End Multiple Add ---->
<div class="form-actions"> <div class="form-actions">
<div class="row"> <div class="row">
<div class="offset-md-3 col-md-9"> <div class="offset-md-3 col-md-9">
@ -143,3 +271,37 @@
</div> </div>
</div> </div>
<?php $this->load->view('includes/footer');?> <?php $this->load->view('includes/footer');?>
<script>
//multiple add more
invIndex = $('#hiddenCount').val();
$('body').on('click','.addMore', function() {
invIndex++;
var $template = $('#imageTemplate'),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index', invIndex)
.insertBefore($template);
// Update the name attributes
$clone
.find('[id="projectTitle"]').attr('id', 'projectTitle_'+invIndex).end()
.find('[id="projectImage"]').attr('id', 'projectImage_'+invIndex).end()
.find('[id="projectDetailId"]').attr('id', 'projectDetailId_'+invIndex).end()
.find('[name="titles[]"]').attr('name', 'title['+invIndex+']').end()
.find('[name="profileimages[]"]').attr('name', 'profileimage['+invIndex+']').end()
.find('[name="projectDetailNames[]"]').attr('name', 'projectDetailName['+invIndex+']').end()
})
.on('click', '.removeButton', function(){
var $row = $(this).parents('.duplicate1'),
index = $row.attr('data-book-index');
$row.remove();
});
</script>

View File

@ -82,7 +82,7 @@
<a href="<?=base_url();?>view-project/<?=$id;?>" class="btn btn-success btn-xs"> <a href="<?=base_url();?>view-project/<?=$id;?>" class="btn btn-success btn-xs">
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
</a> </a>
<a href="<?=base_url();?>edit_project/<?=$id;?>" class="btn btn-primary btn-xs"> <a href="<?=base_url();?>edit-project/<?=$id;?>" class="btn btn-primary btn-xs">
<i class="fa fa-pencil"></i> <i class="fa fa-pencil"></i>
</a> </a>
<a data-id="<?=$id;?>" class="editsemesterclass btn btn-danger btn-xs"> <a data-id="<?=$id;?>" class="editsemesterclass btn btn-danger btn-xs">

View File

@ -53,8 +53,8 @@
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<select class="form-control select2" name="subjectId" data-validation="required"> <select id="multiple" multiple class="form-control select2" name="subjectId[]" data-validation="required">
<option value="" selected="selected" id="subjectId" >Select</option> <option value="">Select..</option>
<?php <?php
if(isset($subject) && $subject->num_rows()>0) if(isset($subject) && $subject->num_rows()>0)
{ {

View File

@ -40,7 +40,8 @@
$subjectId=$e->subjectId; $subjectId=$e->subjectId;
$departmentId=$e->departmentId; $departmentId=$e->departmentId;
$degreeId =$e->degreeId; $degreeId =$e->degreeId;
$subId = explode(",", $subjectId);
//print_r($subId);
} ?> } ?>
<div class="card-body" id="bar-parent"> <div class="card-body" id="bar-parent">
<form class="form-horizontal" action="<?=base_url();?>edit-semester/<?=$id;?>" method="post"> <form class="form-horizontal" action="<?=base_url();?>edit-semester/<?=$id;?>" method="post">
@ -65,14 +66,14 @@
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<select class="form-control select2" name="subjectId" data-validation="required"> <select id="multiple" multiple class="form-control select2" name="subjectId[]" data-validation="required">
<option value="" selected="selected" id="subjectId" >Select</option> <option value="" id="subjectId" >Select</option>
<?php <?php
if(isset($subject) && $subject->num_rows()>0) if(isset($subject) && $subject->num_rows()>0)
{ {
foreach($subject->result() as $list) foreach($subject->result() as $list)
{ {
?> <option value="<?=$list->id;?>" <?php if($list->id==$subjectId){ echo "selected";}?>><?=$list->name;?></option><?php ?> <option value="<?=$list->id;?>" <?php if (in_array($list->id,$subId)){ echo "selected";}?>><?=$list->name;?></option><?php
} }
} }
?> ?>

View File

@ -42,7 +42,6 @@
<th> S.No</th> <th> S.No</th>
<th> Name</th> <th> Name</th>
<th> Year </th> <th> Year </th>
<th> Subject </th>
<th> Department </th> <th> Department </th>
<th> Degree </th> <th> Degree </th>
<th> Action </th> <th> Action </th>
@ -70,10 +69,11 @@
<td><?=$name;?></td> <td><?=$name;?></td>
<td><?=$year;?></td> <td><?=$year;?></td>
<td><?=$depName;?></td> <td><?=$depName;?></td>
<td><?=$subName;?></td>
<td><?=$degName;?></td> <td><?=$degName;?></td>
<td> <td>
<a href="<?=base_url();?>view-semester/<?=$id;?>" class="btn btn-success btn-xs">
<i class="fa fa-eye"></i>
</a>
<a href="<?=base_url();?>edit-semester/<?=$id;?>" class="btn btn-primary btn-xs"> <a href="<?=base_url();?>edit-semester/<?=$id;?>" class="btn btn-primary btn-xs">
<i class="fa fa-pencil"></i> <i class="fa fa-pencil"></i>
</a> </a>

View File

@ -0,0 +1,117 @@
<!-- data tables -->
<link href="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('includes/header');?>
<?php
$CI=& get_instance();
$CI->load->model('Semester_model');?>
<!-- start page container -->
<div class="page-container">
<!-- start sidebar menu -->
<?php $this->load->view('includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar col-md-9" style="margin:0px auto;padding:0">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Semester View</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="<?=base_url();?>/dashboard">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li>&nbsp;<a class="parent-item" href="<?=base_url();?>/semester">Semester</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">View Semester</li>
</ol>
</div>
</div>
<?php $this->load->view('includes/msg');?>
<div class="row">
<div class="col-md-9" style="margin:0px auto;">
<?php
if(isset($viewSemester)&& $viewSemester->num_rows()>0)
{
$view=$viewSemester->row();
$id=$view->id;
$name=$view->name;
$year=$view->year;
$subjectId=$view->subjectId;
$depId=$view->depId;
$depName=$view->depName;
$degId=$view->degId;
$degName=$view->degName;
$subId = explode(",", $subjectId);
//print_r ($facIdd);
}
?>
<!-- BEGIN PROFILE SIDEBAR -->
<div class="card card-topline-aqua">
<div class="card-body no-padding height-9">
<div class="row">
<div class="profile-userpic">
<div class="profile-usertitle-name"><?=$name;?></div> </div>
</div>
<div class="profile-usertitle">
<div class="profile-usertitle-name"><?=$year;?></div>
</div>
<hr>
<div class="row">
<div class="col-md-6 col-xs-6 b-r"> <strong>Department</strong>
<br>
<p class="text-muted"><?=$depName;?></p>
</div>
<div class="col-md-6 col-xs-6 b-r"> <strong>Degree</strong>
<br>
<p class="text-muted"><?=$degName;?></p>
</div>
<div class="col-md-12 col-xs-6 b-r"> <strong>Subject</strong>
<br>
<?php
foreach($subId as $subIdd)
{
$getSub=$CI->Semester_model->get_subject($subIdd);
if($getSub->num_rows()>0)
{
$list=$getSub->row();
$subName=$list->name;
}
?>
<div style="margin-top: 30px;" ><span class="label label-success"><?=$subName;?></span></div>
<?php
}
?>
</div>
</div>
<!-- END SIDEBAR USER TITLE -->
<!-- SIDEBAR BUTTONS -->
<!-- END SIDEBAR BUTTONS -->
</div>
</div>
<!-- END PROFILE CONTENT -->
<!-- END BEGIN PROFILE SIDEBAR -->
</div>
</div>
</div>
</div>
</div>
<?php $this->load->view('includes/footer');?>
<!-- data tables -->
<script src="<?=base_url();?>/assets/datatables/jquery.dataTables.min.js"></script>
<script src="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.js"></script>
<script src="<?=base_url();?>/assets/table_data.js"></script>

View File

@ -1,4 +1,6 @@
<link href="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <link href="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url();?>assets/select2/css/select2.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url();?>assets/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('includes/header');?> <?php $this->load->view('includes/header');?>
<!--<style> <!--<style>
.input-group .input-group-addon { .input-group .input-group-addon {
@ -37,6 +39,8 @@
<ol class="breadcrumb page-breadcrumb pull-right"> <ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="<?=base_url();?>/dashboard">Home</a>&nbsp;<i class="fa fa-angle-right"></i> <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="<?=base_url();?>/dashboard">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li> </li>
<li>&nbsp;<a class="parent-item" href="<?=base_url();?>/student">Students</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Edit Student</li> <li class="active">Edit Student</li>
</ol> </ol>
</div> </div>
@ -49,11 +53,13 @@
$id=$s->id; $id=$s->id;
$name=$s->name; $name=$s->name;
$number=$s->mobileNumber; $number=$s->mobileNumber;
$date=$s->dob;
$address=$s->address; $address=$s->address;
$student=$s->studentId; $student=$s->studentId;
$department=$s->department; $department=$s->department;
$image=$s->image;
$gender=$s->gender; $gender=$s->gender;
$s_img=$s->image; if($gender==1){$genType="Male";}else{$genType="Female";}
} ?> } ?>
<div class="row"> <div class="row">
@ -63,7 +69,7 @@
<header>Edit Student</header> <header>Edit Student</header>
</div> </div>
<div class="card-body" id="bar-parent"> <div class="card-body" id="bar-parent">
<form action="<?=base_url();?>edit_student/<?=$id;?>" method="post" > <form action="<?=base_url();?>edit-student/<?=$id;?>" method="post" enctype="multipart/form-data" >
<div class="form-body"> <div class="form-body">
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Name <label class="control-label col-md-3">Name
@ -89,6 +95,16 @@
<input name="mobileNumber" value="<?=$number;?>" type="text" placeholder="Enter hod" class="form-control error" /> <input name="mobileNumber" value="<?=$number;?>" type="text" placeholder="Enter hod" class="form-control error" />
</div> </div>
</div> </div>
<div class="form-group row">
<label class="control-label col-md-3">Date Of Birth
<span class="required"> * </span>
</label>
<div class="col-md-5">
<div class="input-append date" id="dp3">
<input type="date" value="<?=$date;?>" name="date" class="form-control input-height formDatePicker" placeholder="Date Of Birth" size="44" type="text" data-validation="required">
</div>
</div>
</div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Address <label class="control-label col-md-3">Address
@ -103,25 +119,48 @@
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<input name="department" value="<?=$department;?>" type="text" placeholder="Enter hod" class="form-control input-height" /> </div> <select class="form-control select2" name="department" data-validation="required">
<option value="" selected="selected" id="department" >Select</option>
<?php
if(isset($dep) && $dep->num_rows()>0)
{
foreach($dep->result() as $list1)
{
?> <option value="<?=$list1->id;?>" <?php if($list1->id==$department){ echo "selected";}?>><?=$list1->name;?></option><?php
}
}
?>
</select>
</div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Gender <label class="control-label col-md-3">Gender
<span class="required"> * </span> <span class="required"> * </span>
</label> </label>
<div class="col-md-5"> <div class="col-md-5">
<select class="form-control input-height" name="gender"> <select class="form-control select2" name="gender">
<option value="">Select...</option> <option value="<?=$gender;?>"><?=$genType;?></option>
<option value="Male">Male</option> <option value="1">Male</option>
<option value="Female">Female</option> <option value="2">Female</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="control-label col-md-3">Profile Img <label class="control-label col-md-3">Image
<span class="required"> * </span>
</label> </label>
<div class="compose-editor"> <div class="col-md-5">
<input name="image" value="<?=$s_img;?>" type="file" class="form-control" > <input name="image" value="<?=$image;?>" type="file" placeholder="Enter Your Image" class="form-control" multiple>
<input type="hidden" name="hiddenImage" value="<?=$image;?>">
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">
</label>
<div class="col-md-5">
<img src="<?=base_url();?>/uploads/student/<?=$image;?>" style="width:75px;height:75px;" />
</div> </div>
</div> </div>
@ -145,3 +184,6 @@
</div> </div>
</div> </div>
<?php $this->load->view('includes/footer');?> <?php $this->load->view('includes/footer');?>
<script src="<?=base_url();?>assets/select2/js/select2.js"></script>
<script src="<?=base_url();?>assets/select2/js/select2-init.js"></script>
<script src="<?=base_url();?>assets/jquery.form-validator.min.js"></script>

View File

@ -83,7 +83,7 @@
<a href="<?=base_url();?>view-student/<?=$id;?>" class="btn btn-success btn-xs"> <a href="<?=base_url();?>view-student/<?=$id;?>" class="btn btn-success btn-xs">
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
</a> </a>
<a href="<?=base_url();?>edit_student/<?=$id;?>" class="btn btn-primary btn-xs"> <a href="<?=base_url();?>edit-student/<?=$id;?>" class="btn btn-primary btn-xs">
<i class="fa fa-pencil"></i> <i class="fa fa-pencil"></i>
</a> </a>
<a data-id="<?=$id;?>" class="editsemesterclass btn btn-danger btn-xs"> <a data-id="<?=$id;?>" class="editsemesterclass btn btn-danger btn-xs">

View File

@ -102,6 +102,36 @@
<textarea type="file" name="description" placeholder="Enter Subject Description" class="form-control default" ></textarea> <textarea type="file" name="description" placeholder="Enter Subject Description" class="form-control default" ></textarea>
</div> </div>
</div> </div>
<div class="form-group row">
<label class="control-label col-md-3">Title & Image
</label>
<div class="col-md-2 compose-editor">
<input name="title[0]" id="subjectTitle_0" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimage[0]" id="subjectImage_0" type="file" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue addMore"><span class="btn btn-primary">Add <i class="fa fa-plus"></i></span></div>
</div>
</div>
<!---Duplicate ---->
<input type="hidden" value="0" id="view"/>
<div class="form-group duplicate1 row hide" id="imageTemplate" >
<label class="control-label col-md-3">
</label>
<div class="col-md-2 compose-editor">
<input name="titles[]" id="subjectTitle" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimages[]" id="subjectImage" type="file" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue removeButton" id="cat_add_id"><span class="btn btn-danger">Remove <i class="fa fa-minus"></i></span></div>
</div>
</div>
<!---Duplicate ---->
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
@ -127,3 +157,37 @@
<script src="<?=base_url();?>assets/select2/js/select2.js"></script> <script src="<?=base_url();?>assets/select2/js/select2.js"></script>
<script src="<?=base_url();?>assets/select2/js/select2-init.js"></script> <script src="<?=base_url();?>assets/select2/js/select2-init.js"></script>
<script src="<?=base_url();?>assets/jquery.form-validator.min.js"></script> <script src="<?=base_url();?>assets/jquery.form-validator.min.js"></script>
<script>
//multiple add more
invIndex = 0;
$('body').on('click','.addMore', function() {
invIndex++;
var $template = $('#imageTemplate'),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index', invIndex)
.insertBefore($template);
// Update the name attributes
$clone
.find('[id="subjectTitle"]').attr('id', 'subjectTitle_'+invIndex).end()
.find('[id="subjectImage"]').attr('id', 'subjectImage_'+invIndex).end()
.find('[name="titles[]"]').attr('name', 'title['+invIndex+']').end()
.find('[name="profileimages[]"]').attr('name', 'profileimage['+invIndex+']').end()
})
.on('click', '.removeButton', function(){
var $row = $(this).parents('.duplicate1'),
index = $row.attr('data-book-index');
$row.remove();
});
</script>

View File

@ -149,6 +149,78 @@
<textarea type="text" name="description" data-validation="required" placeholder="Enter Description" class="form-control input-height"><?=$description;?></textarea> <textarea type="text" name="description" data-validation="required" placeholder="Enter Description" class="form-control input-height"><?=$description;?></textarea>
</div> </div>
</div> </div>
<!--Multiple Add ---->
<?php
if(isset($getMultipleImage) && $getMultipleImage->num_rows()>0)
{
$totalCount=$getMultipleImage->num_rows();
}
?>
<input type="hidden" value="<?=$totalCount;?>" id="hiddenCount"/>
<hr>
<div class="form-group row">
<div class="col-md-3"></div>
<div class="col-md-4"></div>
<div class="col-md-1">
<div class="add-new-button-blue addMore"><span style="padding-top:3px;" class="btn btn-primary">Add More<i class="fa fa-plus"></i></span></div>
</div>
</div>
<?php
if(isset($getMultipleImage) && $getMultipleImage->num_rows()>0)
{
$i=0;
foreach($getMultipleImage->result() as $list)
{
$id =$list->id ;
$title=$list->title;
$image=$list->image;
$subjectId=$list->subjectId;
?>
<div class="form-group row duplicate1">
<input type="hidden" value="<?=$id;?>" id="subjectDetailId_<?=$i;?>" name="subjectDetailName[<?=$i;?>]"/>
<label class="control-label col-md-3">Title & Image
</label>
<div class="col-md-2 compose-editor">
<input value="<?=$title;?>" name="title[<?=$i;?>]" id="subjectTitle_<?=$i;?>" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimage[]" id="subjectImage_<?=$i;?>" type="file" class="form-control default">
<img src="<?=base_url();?>uploads/subject/<?=$image;?>" style="width:75px;height:75px;"/>
<input value="<?=$image;?>" name="profileimageOld[<?=$i;?>]" id="subjectImageOld_<?=$i;?>" type="hidden" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue removeButton"><span style="padding-top:3px;" class="btn btn-danger">Remove <i class="fa fa-minus"></i></span></div>
</div>
</div>
<?php
$i++;
}
}
?>
<!---Duplicate ---->
<div class="form-group duplicate1 row hide" id="imageTemplate" >
<input type="hidden" value="" id="subjectDetailId" name="subjectDetailNames[]"/>
<label class="control-label col-md-3">
</label>
<div class="col-md-2 compose-editor">
<input name="titles[]" id="subjectTitle" type="text" class="form-control default">
</div>
<div class="col-md-2 compose-editor">
<input name="profileimages[]" id="subjectImage" type="file" class="form-control default">
</div>
<div class="col-md-1">
<div class="add-new-button-blue removeButton" id="cat_add_id"><span class="btn btn-danger">Remove <i class="fa fa-minus"></i></span></div>
</div>
</div>
<!---Duplicate ---->
<!--End Multiple Add ---->
</div> </div>
<div class="form-actions"> <div class="form-actions">
<div class="row"> <div class="row">
@ -173,3 +245,37 @@
<script src="<?=base_url();?>assets/select2/js/select2.js"></script> <script src="<?=base_url();?>assets/select2/js/select2.js"></script>
<script src="<?=base_url();?>assets/select2/js/select2-init.js"></script> <script src="<?=base_url();?>assets/select2/js/select2-init.js"></script>
<script src="<?=base_url();?>assets/jquery.form-validator.min.js"></script> <script src="<?=base_url();?>assets/jquery.form-validator.min.js"></script>
<script>
//multiple add more
invIndex = $('#hiddenCount').val();
$('body').on('click','.addMore', function() {
invIndex++;
var $template = $('#imageTemplate'),
$clone = $template
.clone(true)
.removeClass('hide')
.removeAttr('id')
.attr('data-book-index', invIndex)
.insertBefore($template);
// Update the name attributes
$clone
.find('[id="subjectTitle"]').attr('id', 'subjectTitle_'+invIndex).end()
.find('[id="subjectImage"]').attr('id', 'subjectImage_'+invIndex).end()
.find('[id="subjectDetailId"]').attr('id', 'subjectDetailId_'+invIndex).end()
.find('[name="titles[]"]').attr('name', 'title['+invIndex+']').end()
.find('[name="profileimages[]"]').attr('name', 'profileimage['+invIndex+']').end()
.find('[name="subjectDetailNames[]"]').attr('name', 'subjectDetailName['+invIndex+']').end()
})
.on('click', '.removeButton', function(){
var $row = $(this).parents('.duplicate1'),
index = $row.attr('data-book-index');
$row.remove();
});
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Some files were not shown because too many files have changed in this diff Show More