<?php
$title = $name= $review = "";
$rating_point=5;
if(isset($testi_res)){
$btnname = "Update";
foreach($testi_res as $row){
$testi_id = $row->id;
$title = $row->title;
$name = $row->name;
$rating_point = $row->rating_point;
$review = $row->review;
}
$method = "admin/testimonial_update/".base64_encode($testi_id);
}else{
$method = "admin/testimonial_process";
$btnname = "Submit";
}
?>
<?php include'sidebar.php';?>
</div>
<div class="content-right">
<?php include'header.php';?>
<div class="main-content">
<div class="dash-block">
<h5 class="border-bottom pb-3">Add Testimonial</h5>
<div class="form-element">
<?=$this->session->flashdata("success_msg")?>
<form method="post" action="<?=base_url($method)?>">
<div class="row">
<div class="col-md-6">
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Title </label>
<div class="col-sm-8">
<input type="text" class="form-control" required="required" id="inputPassword" placeholder="Enter title" name="title" value="<?=$title?>">
<span class="text-danger"><?=form_error("title")?></span>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Review Star </label>
<div class="col-sm-8">
<select class="form-control" name="rating_point" required="required" >
<option <?php if($rating_point==5) { echo "selected"; }?> value="5">5</option>
<option <?php if($rating_point==4) { echo "selected"; }?> value="4">4</option>
<option <?php if($rating_point==3) { echo "selected"; }?> value="3">3</option>
<option <?php if($rating_point==2) { echo "selected"; }?> value="2">2</option>
<option <?php if($rating_point==1) { echo "selected"; }?> value="1">1</option>
</select>
<span class="text-danger"><?=form_error("title")?></span>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label">Review By </label>
<div class="col-sm-8">
<input type="text" class="form-control" required="required" id="inputPassword" placeholder="Enter Name" name="name" value="<?=$name?>">
<span class="text-danger"><?=form_error("name")?></span>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label"> Review </label>
<div class="col-sm-8">
<textarea class="form-control ckeditor" id="editor" style="height: 80px !important;" name="review" required="required"><?=$review?></textarea>
</div>
</div>
</div>
<div class="col-md-8 offset-md-2">
<button class="btn btn-submit"><?=$btnname?></button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php include'footer.php';?>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="<?=base_url('admin_assets/js/bootstrap.min.js')?>"></script>
</body>
</html>