McGansWebsite/admin/application/views/project/edit_project.php

314 lines
12 KiB
PHP
Raw Normal View History

2023-01-08 20:46:58 +00:00
<link href="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('includes/header');?>
<div class="page-container">
<?php $this->load->view('includes/sidebar');?>
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Edit Project</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 class="active">Edit Project</li>
</ol>
</div>
</div>
<!-- Midium Model -->
<?php
if(isset($pro) && $pro->num_rows()>0)
{
$p=$pro->row();
$id=$p->id;
$date=$p->date;
$name=$p->projectName;
//$code=$p->faculty;
$studentId=$p->studentId;
$semesterId=$p->semesterId;
$subjectId=$p->subjectId;
$code=$p->code;
$departmentId=$p->departmentId;
$description=$p->description;
$video=$p->vedio;
$driveLink=$p->driveLink;
$image=$p->image;
} ?>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="card card-box">
<div class="card-head">
<header>Edit Project</header>
2023-01-08 20:46:58 +00:00
</div>
<div class="card-body" id="bar-parent">
<form action="<?=base_url();?>edit-project/<?=$id;?>" method="post" enctype="multipart/form-data" >
<div class="form-body">
<div class="form-group row">
<label class="control-label col-md-3">Project Date
<span class="required"> * </span>
</label>
<div class="col-md-5">
<input type="date" value="<?=$date;?>" name="date" data-required="1" placeholder="Enter Date" class="form-control input-height">
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Name
<span class="required"> * </span>
</label>
<div class="col-md-5">
<input type="text" value="<?=$name;?>" name="projectName" data-required="1" placeholder="Enter Name" class="form-control input-height">
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Code
<span class="required"> * </span>
</label>
<div class="col-md-5">
<input type="code" value="<?=$code;?>" name="code" data-required="1" placeholder="Enter Faculty" class="form-control input-height">
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Student
<span class="required"> * </span>
</label>
<div class="col-md-5">
<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 class="form-group row">
<label class="control-label col-md-3">Semester
<span class="required"> * </span>
</label>
<div class="col-md-5">
<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
}
}
?>
2023-01-11 07:17:57 +00:00
</select>
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Subject
<span class="required"> * </span>
</label>
<div class="col-md-5">
<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
}
}
?>
2023-01-08 20:46:58 +00:00
</select>
2023-01-08 20:46:58 +00:00
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Department.
<span class="required"> * </span>
</label>
<div class="col-md-5">
<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 class="form-group row">
<label class="control-label col-md-3">Description
<span class="required"> * </span>
</label>
<div class="col-md-5">
<textarea name="description" placeholder=" Enter Description" data-validation="required" class="form-control" rows="5"><?=$description;?></textarea>
</div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Video
</label>
<div class="col-md-5">
<input name="video" value="<?=$video;?>" type="text" placeholder="Enter Video Link" class="form-control input-height" /> </div>
</div>
<div class="form-group row">
<label class="control-label col-md-3">Drive Link
</label>
<div class="col-md-5">
<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;
$muldescription=$list->muldescription;
$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, Description & 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">
<textarea data-validation="required" name="muldescription[<?=$i;?>]" id="projectDescription_<?=$i;?>" type="text" class="form-control default"><?=$muldescription;?></textarea>
</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">
<textarea name="muldescriptions[]" data-validation="required" id="projectDescription" type="text" class="form-control default"></textarea>
</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>
<!---Duplicate ---->
<!--End Multiple Add ---->
<div class="form-actions">
<div class="row">
<div class="offset-md-3 col-md-9">
<input type="submit" name="submit" class="btn btn-info m-r-20" value="Submit">
<button type="button" class="btn btn-default">Cancel</button>
</div>
</div>
</div>
</form>
2023-01-08 20:46:58 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
</div>
</div>
</div>
<?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="projectDescription"]').attr('id', 'projectDescription_'+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="muldescriptions[]"]').attr('name', 'muldescription['+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>