-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeadline.php
125 lines (97 loc) · 5.63 KB
/
deadline.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
<?php
require_once'header.php';
require_once'dbcon.php';
?>
<section class="content">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title danger">Approaching Task and Schedules</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>Next Action</th>
<th> Add Next Action </th>
</tr>
</thead>
<tbody align="center">
<?php
//Longest Query Ever liveth lolz
$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 BETWEEN curdate() and curdate() + interval 3 day AND lead_history.status <= '4' AND lead_history.init='1' ORDER BY next_action_date asc");
if(mysqli_num_rows($qqr)!= 0){
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=" View 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>
<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";
};echo '<p> Designation: '.$org. ' Organisation: '.$company.' </p>';
echo ' </div> </div></div>';
echo ' </td>
<td>'.$comments.'</td>
<td><a href="addcomment?id='. $row['id'].'"data-toggle="tooltip" title="Add a Next Action"><i class="fa fa-edit"></i></a></td>
</tr>';
}
?>
<?php
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
<div class="box-footer text-center">
<a href="home" class="uppercase"> Back to Home</a>
</div>
<!-- /.box-footer -->
</div>
</section>
<?php require_once'footer.php'; ?>