-
Notifications
You must be signed in to change notification settings - Fork 0
/
closed.php
127 lines (100 loc) · 5.86 KB
/
closed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
require_once'header.php';
require_once'dbcon.php';
?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title danger">Closed Lead Conversations</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Date of Next Action</th>
<th>Lead Details</th>
<th>Lead Status</th>
<th>Next Action</th>
</tr>
</thead>
<tbody align="center">
<?php
$qqr= mysqli_query($con, "SELECT lead.id,lead.name,lead.date_reg,lead.email,lead.phone,
lead.company,lead.designation,lead_history.status, lead_history.next_action_time,
lead_history.next_action_date,lead_history.comments FROM lead INNER JOIN lead_history
ON lead.id = lead_history.lead_id WHERE lead.salerep_id='$id' AND next_action_date < CURDATE() AND lead_history.status >='5' ORDER BY next_action_date asc");
if($qqr){
while( $row= mysqli_fetch_array($qqr)){
$id=$row['id'];
$name=$row['name'];
$email=$row['email'];
$phone=$row['phone'];
$company=$row['company'];
$org=$row['designation'];
$status=$row['status'];
$date=$row['next_action_date'];
$time=$row['next_action_time'];
$comments=$row['comments'];
echo'<tr>
<td><span class="text-danger h5">'.$date. ' '. $time.'</span></td>
<td ><a href="javascript:void(0)" data-toggle="collapse" data-target="#pass'.$id.'" title=" Edit lead detials" >'.$name.'
<br/><i><b>'. $row['designation'].'</b> @ '. $row['company'].'<i></a>
<div class="collapse" id="pass'.$id.'">
<div class="well" style="height:auto;">
<span class="text-center"></span>
<div class="box-body">
<p class="h5">Email:'. $row['email'].' Phone:'. $row['phone'].'</p>';
echo '<p> Designation: '.$org. ' Organisation: '.$company.' </p>';
echo '</div>';
echo ' </td>
<td><p> Lead Status: '; $status = $row['status'];
switch ($status) {
case "1":
echo "Qualified";
break;
case "2":
echo "Called";
break;
case "3":
echo "Proposal";
break;
case "4":
echo "Invoice Sent";
break;
case "5":
echo "Closed Won";
break;
case "6":
echo "Closed Lost";
break;
default:
echo "Qualified";
}
if($status == 6 ){
echo' <i class="fa fa-times fa-2x" style="color:red"></i>';
}elseif($status==5) {
echo' <i class="fa fa-check fa-2x" style="color:green"></i>';
}
echo '</td>
<td>'.$comments.'</td>
</tr>';
}
?>
<?php
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer text-center">
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
</div>
<?php require_once'footer.php';?>