policybot/application/views/front/user-order.php

275 lines
8.3 KiB
PHP
Raw Permalink Normal View History

2021-11-30 10:56:55 +00:00
<?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 Order</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>Agent Name</th>
<th>Date</th>
<th>Action</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<?php
if(isset($user_ord)&& $user_ord->num_rows()>0)
{ $i=1;
foreach($user_ord->result() as $gq){
$quoteid=$gq->id;
$agency_id=$gq->agency_id;
$policyname=$gq->policyname;
$category=$gq->category;
$policy_id=$gq->policy_id;
$cdate=$gq->cdate;
$status=$gq->status;
$tables="users";
$wheres=array("id"=>$agency_id);
$shows=("*");
$agedet=$this->commonsql_model->selectTable($tables,$wheres,$shows);
$tables="categories";
$wheres=array("id"=>$category);
$shows=("*");
$categ=$this->commonsql_model->selectTable($tables,$wheres,$shows);
if ($categ->num_rows()>0){
$ca=$categ->row();
$categoryname=$ca->name;
}
if ($agedet->num_rows()>0){
$ad=$agedet->row();
$agentname=$ad->name;
}
?>
<tr>
<td><?=$i;?></td>
<td><a style="font-weight:900;color: #fd6003;" href="<?=base_url();?>policy-detail/<?=$policy_id;?>"><?=$policyname;?></a></td>
<td><a style="font-weight:900;color: #fd6003;" ><?=ucwords($agentname);?></a></td>
<td><?=date("d-m-Y H:i:s",strtotime($cdate)); ?></td>
<td>
<?php if($status==0) { ?>
<a href="<?=base_url();?>frontend/cancelorderofagent/<?=$quoteid;?>"> <span class="btn-sm btn-design btn-warning">Cancel</span></a>
<?php } else if($status==1) { ?>
<span class="btn-sm btn-design btn-info">Accepted</span>
<?php } else if($status==2) { ?>
<span class="btn-sm btn-design btn-success">Completed</span>
<?php } else { ?>
<span class="btn-sm btn-design btn-danger">Canceled</span>
<?php } ?>
</td>
<td>
<?php if($status==0) { ?>
<span class="btn-sm btn-design btn-warning">Pending</span>
<?php } else if($status==1) { ?>
<span class="btn-sm btn-design btn-info">In Progress</span>
<?php } else if($status==2) { ?>
<span class="btn-sm btn-design btn-success">Completed</span>
<?php } else { ?>
<span class="btn-sm btn-design btn-danger">Canceled</span>
<?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>