policybot/application/views/front/user-request.php
2021-11-30 16:26:55 +05:30

330 lines
12 KiB
PHP

<?php $this->load->view('front/includes/header'); ?>
<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />
<?php $primaryid=$this->session->userdata('primaryid');
$userrole=$this->session->userdata('userrole');
$loggedname=$this->session->userdata('loggedname');
$tables="users";
$wheres=array("id"=>$primaryid);
$shows=("*");
$userdet=$this->commonsql_model->selectTable($tables,$wheres,$shows);
if($userdet->num_rows()>0)
{
$u=$userdet->row();
$loggedusername=$u->name;
}
$CI=&get_instance();
$CI->load->model("frontend_model");
?>
<style>
.fbox-center .fbox-icon {
margin-bottom: 1rem!important;
}
.fbox-bg.fbox-center {
padding: 0 1rem 1rem !important;
}
.form-error{ text-align:end!important; }
</style>
<section id="page-title" style="background-image: url('<?=base_url();?>fassets/images/about/333.jpg');">
<div class="container clearfix">
<h1 style="text-align:center"> User Profile</h1>
<span style="text-align:center;font-weight:500">Hi <?=ucwords($loggedusername);?> , Welcome to policybot</span>
</div>
</section>
<section id="content">
<div class="content-wrap ">
<div class="container clearfix">
<div class="row" >
<div class="col-md-4 col-lg-3">
<?php $this->load->view('front/includes/leftmenu'); ?>
</div>
<div class="col-md-8 col-lg-9">
<h3>Your Request</h3>
<div class="table-responsive">
<table class="table table-striped table-bordered datatable1" cellspacing="0" width="100%">
<thead>
<tr>
<th>S.No</th>
<th>Policy Name</th>
<th>Category</th>
<th>Assigned Agent</th>
<th>Date</th>
<th>Action</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<?php
if(isset($user_req)&& $user_req->num_rows()>0)
{ $i=1;
foreach($user_req->result() as $gq){
$quoteid=$gq->id;
$user_id=$gq->user_id;
$category=$gq->category;
$cdate=$gq->cdate;
$policy_id=$gq->policy_id;
$policyname=$gq->policyname;
$status=$gq->status;
$agency_id=$gq->agency_id;
//get response given or not
$tables="quote_response";
$wheres=array("quote_id"=>$quoteid);
$shows=("*");
$get_respo_sts=$this->commonsql_model->selectTable($tables,$wheres,$shows);
if ($get_respo_sts->num_rows()>0){
$response_status="1";//response given
}
else{$response_status="0"; // response notgiven
}
$tables="categories";
$wheres=array("id"=>$category);
$shows=("*");
$categ=$this->commonsql_model->selectTable($tables,$wheres,$shows);
if ($categ->num_rows()>0){
$ca=$categ->row();
$ategoryname=$ca->name;
}
if($agency_id!=0){
$tables="users";
$wheres=array("id"=>$agency_id);
$shows=("*");
$agename=$this->commonsql_model->selectTable($tables,$wheres,$shows);
if ($agename->num_rows()>0){
$a=$agename->row();
$agency_name=$a->name;
$agency_name=$a->name;
$a_color="#fd653b";
}
}
else
{
$agency_name="Not Assigned"; $a_color="#dc3545";
}
?>
<tr>
<td><?=$i;?></td>
<td><a style="font-weight:900;color: #fd6003;" href="<?=base_url();?>policy-detail/<?=$policy_id;?>"><?=$policyname;?></a></td>
<td> <?=$ategoryname;?></td>
<td style="color:<?=$a_color;?>;font-weight: 900;"> <?=ucwords($agency_name);?></td>
<td><?=date("d-m-Y H:i:s",strtotime($cdate)); ?></td>
<td>
<?php if($status==0) { ?>
<div class="edt_list"><div><a href="<?=base_url();?>frontend/user_request_cancel/<?=$quoteid;?>" class="btn btn-danger">Cancel</a></div></ul>
<?php } else if($status==3) { ?>
<div class="edt_list"><div><span class="btn btn-danger" style="cursor:text">Canceled</span></div></div>
<?php } else if($status==1){ ?>
<div class="edt_list"><div><span class="btn btn-info" style="cursor:text">Accepted</span></div></div>
<?php } else if($status==2){ ?>
<div class="edt_list"><div><span class="btn btn-success" style="cursor:text">Process Closed</span></div></div>
<?php } else if($status==4){ ?>
<div class="edt_list"><div><span class="btn btn-success" style="cursor:text">Document Collected</span></div></div>
<?php } else if($status==5){?>
<div class="edt_list"><div><span class="btn btn-success" style="cursor:text">Waiting For Policy Issuance</span></div></div>
<?php }else if($status==6){?>
<div class="edt_list"><div><span class="btn btn-success" style="cursor:text">Waiting For Completion</span></div></div>
<?php }?>
</td>
<td> <?php if($response_status=="1" && $status==0){ ?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"><i class="fa fa-eye" aria-hidden="true" style="margin-right:1px;" ></i><a href="<?=base_url();?>view-user-response/<?=$quoteid;?>" target="_blank" style="color: #000;" >View</a></span> </div>
</div>
<?php } else if($response_status=="0" && $status==0){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Requested</a></span> </div>
</div>
<?php }else if($status==1){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text " >Waiting For Document Collection</a></span> </div>
</div>
<?php } else if($status==4){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >On Process</a></span> </div>
</div>
<?php }else if($status==5){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Verified</a></span> </div>
</div>
<?php }else if($status==6){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Policy Issued</a></span> </div>
</div>
<?php } else if($status==2){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Completed</a></span> </div>
</div>
<?php }else if($status==3){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Cancelled</a></span> </div>
</div>
<?php }else if($status==2){?>
<div class="edt_list">
<div> <span class="btn btn-warning" style="background-color: #cbed1f;border-color: #cbed1f;"> <a href="javascript:;" style="color: #000;cursor:text;" >Completed</a></span> </div>
</div>
<?php } ?>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form action="<?=base_url();?>frontend/respondtouser" method="post" >
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Respond To User</h4>
<button type="button" class="btn-close btn-sm" data-bs-dismiss="modal" aria-hidden="true"></button>
</div>
<div class="modal-body">
<p style="color:red">All Fields are manditory</p>
<div class="form-group">
<label>Contact Number</label>
<input class="form-control" type="text" name="cMobile" data-validation="number length" data-validation-length="10" >
</div>
<div class="form-group">
<label>Email Address</label>
<input class="form-control" type="text" name="cEmail" data-validation="email" >
</div>
<div class="form-group">
<label>Message</label>
<textarea class="form-control" rows="5" name="cMessage" data-validation="required" ></textarea>
</div>
<input type="hidden" name="agid" id="agid" >
<input type="hidden" name="qid" id="qid" >
<input type="hidden" name="user" id="user" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" class="btn btn-primary" name="submit" value="Submit">
</div>
</div>
</form>
</div>
</div>
<div class="modal fade" id="viewrespond" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form action="<?=base_url();?>frontend/respondtouser" method="post" >
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Your Response</h4>
<button type="button" class="btn-close btn-sm" data-bs-dismiss="modal" aria-hidden="true"></button>
</div>
<div class="modal-body">
<div class="row col-md-12 form-group">
<div class="col-md-5">
Contact
</div>
<div class="col-md-2">
:
</div>
<div class="col-md-5" >
<span id="mob"></span>
</div>
</div>
<div class="row col-md-12 form-group">
<div class="col-md-5">
Email
</div>
<div class="col-md-2">
:
</div>
<div class="col-md-5">
<span id="mai"></span>
</div>
</div>
<div class="row col-md-12 form-group">
<div class="col-md-5">
Message
</div>
<div class="col-md-2">
:
</div>
<div class="col-md-5">
<span id="msg"></span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<?php $this->load->view('front/includes/footer'); ?>
<script>
$(document).ready(function() {
$('.datatable1').dataTable();
});
</script>
<script>
$(".respond").on("click",function(){
var agid= $(this).attr("data-agid");
var qid= $(this).attr("data-qid");
var user= $(this).attr("data-user");
$("#myModal").modal("show");
$("#agid").val(agid);
$("#qid").val(qid);
$("#user").val(user);
});
</script>
<script>
$(".respondview").on("click",function(){
var msg= $(this).attr("data-msg");
var mail= $(this).attr("data-mail");
var mob= $(this).attr("data-mob");
$("#viewrespond").modal("show");
$("#msg").html(msg);
$("#mai").html(mail);
$("#mob").html(mob);
});
</script>