Subversion Repositories SmartDukaan

Rev

Rev 36645 | Rev 36664 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
36645 vikas 1
<section class="wrapper">
2
    <div class="row">
3
        <div class="col-lg-12">
4
            <h3 class="page-header"><i class="icon_document_alt"></i> $username - Visit Details ($reportDate)</h3>
5
            <ol class="breadcrumb">
6
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
7
                <li><a href="javascript:void(0);" class="beat-report">Beat Report</a></li>
8
                <li><i class="fa fa-user"></i>$username</li>
9
            </ol>
10
        </div>
11
    </div>
12
    <br>
13
    <div class="row col-lg-12" style="float: right;">
14
        <div class="col-lg-3">
15
            <label>Select Date</label>
16
            <div class="input-group">
17
                <input type="date" id="user-detail-date" class="form-control" value="$reportDate" data-userid="$userId">
18
                <span class="input-group-btn">
19
                    <button type="button" class="btn btn-info user-detail-refresh" data-userid="$userId" style="margin-left:10px;">
20
                        <i class="fa fa-refresh"></i> Refresh
21
                    </button>
22
                </span>
23
            </div>
24
        </div>
25
    </div>
26
    <br><br><br>
27
 
28
    <div class="col-lg-12">
29
        <div class="row" style="margin-bottom:15px;">
30
            <div class="col-lg-3">
31
                <div class="panel panel-default" style="text-align:center; padding:10px;">
32
                    <h4 style="margin:0; color:#1abc9c; font-weight:bold;">$visits.size()</h4>
33
                    <small>Total Visits</small>
34
                </div>
35
            </div>
36
            #set($completedCount = 0)
37
            #set($pendingCount = 0)
38
            #set($deferredCount = 0)
39
            #foreach($v in $visits)
40
                #if($v.getMarkType() == "CHECKIN-CHECKOUT" || $v.getMarkType() == "CHECKOUT")
41
                    #set($completedCount = $completedCount + 1)
42
                #elseif($v.getMarkType() == "PENDING" || $v.getMarkType() == "CHECKIN")
43
                    #set($pendingCount = $pendingCount + 1)
44
                #elseif($v.getMarkType() == "DEFERRED")
45
                    #set($deferredCount = $deferredCount + 1)
46
                #end
47
            #end
48
            <div class="col-lg-3">
49
                <div class="panel panel-default" style="text-align:center; padding:10px;">
50
                    <h4 style="margin:0; color:#27ae60; font-weight:bold;">$completedCount</h4>
51
                    <small>Completed</small>
52
                </div>
53
            </div>
54
            <div class="col-lg-3">
55
                <div class="panel panel-default" style="text-align:center; padding:10px;">
56
                    <h4 style="margin:0; color:#e67e22; font-weight:bold;">$pendingCount</h4>
57
                    <small>Pending</small>
58
                </div>
59
            </div>
60
            <div class="col-lg-3">
61
                <div class="panel panel-default" style="text-align:center; padding:10px;">
62
                    <h4 style="margin:0; color:#e74c3c; font-weight:bold;">$deferredCount</h4>
63
                    <small>Deferred</small>
64
                </div>
65
            </div>
66
        </div>
67
 
68
        <table class="table table-border table-condensed table-bordered table-striped" id="userDetailTable" style="width:100%">
69
            <thead>
36656 vikas 70
            <tr >
36645 vikas 71
                <th>#</th>
72
                <th>Task Name</th>
73
                <th>Task Type</th>
74
                <th>Status</th>
75
                <th>Address</th>
76
                <th>Check In Time</th>
77
                <th>Check Out Time</th>
78
                <th>Time Spent</th>
79
                <th>Transit Time</th>
80
                <th>Distance (km)</th>
81
            </tr>
82
            </thead>
83
            <tbody>
36656 vikas 84
            #if($punchIn)
85
                <tr style="background:#d5f5e3;">
86
                    <td>--</td>
87
                    <td><strong>PUNCH IN</strong></td>
88
                    <td>$!punchIn.getTaskType()</td>
89
                    <td><span class="label label-info">PUNCHIN</span> #if($punchIn.getAttachment() && $punchIn.getAttachment() != "")<a href="https://partners.smartdukaan.com/document/$punchIn.getAttachment()" target="_blank" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:5px;"></i></a>#end</td>
90
                    <td>$!punchIn.getAddress()</td>
91
                    <td>$!punchIn.getCheckInTime()</td>
92
                    <td>--</td>
93
                    <td>--</td>
94
                    <td>--</td>
95
                    <td>$!punchIn.getTotalDistance()</td>
96
                </tr>
97
            #end
36645 vikas 98
            #set($idx = 1)
99
            #foreach($v in $visits)
100
                <tr>
101
                    <td>$idx</td>
102
                    <td>$!v.getTaskName()</td>
103
                    <td>$!v.getTaskType()</td>
104
                    <td>
105
                        #if($v.getMarkType() == "CHECKIN-CHECKOUT" || $v.getMarkType() == "CHECKOUT")
106
                            <span class="label label-success">$v.getMarkType()</span>
107
                        #elseif($v.getMarkType() == "PENDING" || $v.getMarkType() == "CHECKIN")
108
                            <span class="label label-warning">$v.getMarkType()</span>
109
                        #elseif($v.getMarkType() == "DEFERRED")
110
                            <span class="label label-danger">$v.getMarkType()</span>
111
                        #else
112
                            <span class="label label-default">$!v.getMarkType()</span>
113
                        #end
36656 vikas 114
                        <a href="javascript:void(0);" class="beat-history-link" data-userid="$userId" data-taskid="$v.getTaskId()" data-tasktype="$!v.getTaskType()" data-taskname="$!v.getTaskName()" title="View History" style="margin-left:5px;"><i class="fa fa-history" style="color:#3498db; font-size:14px;"></i></a>
115
                        #if($v.getAttachment() && $v.getAttachment() != "")<a href="https://partners.smartdukaan.com/document/$v.getAttachment()" target="_blank" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:3px; font-size:14px;"></i></a>#end
36645 vikas 116
                    </td>
117
                    <td>$!v.getAddress()</td>
118
                    <td>$!v.getCheckInTime()</td>
119
                    <td>$!v.getCheckOutTime()</td>
120
                    <td>$!v.getTimeSpent()</td>
121
                    <td>$!v.getTransitTime()</td>
122
                    <td>$!v.getTotalDistance()</td>
123
                </tr>
124
                #set($idx = $idx + 1)
125
            #end
36656 vikas 126
            #if($punchOut)
127
                <tr style="background:#fadbd8;">
128
                    <td>--</td>
129
                    <td><strong>PUNCH OUT</strong></td>
130
                    <td>$!punchOut.getTaskType()</td>
131
                    <td><span class="label label-danger">PUNCHOUT</span> #if($punchOut.getAttachment() && $punchOut.getAttachment() != "")<a href="https://partners.smartdukaan.com/document/$punchOut.getAttachment()" target="_blank" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:5px;"></i></a>#end</td>
132
                    <td>$!punchOut.getAddress()</td>
133
                    <td>$!punchOut.getCheckInTime()</td>
134
                    <td>--</td>
135
                    <td>--</td>
136
                    <td>--</td>
137
                    <td>$!punchOut.getTotalDistance()</td>
138
                </tr>
139
            #end
36645 vikas 140
            </tbody>
36656 vikas 141
            <tfoot>
142
                <tr style="background:#f2f3f4; font-weight:bold;">
143
                    <td colspan="5" style="text-align:right;">Totals</td>
144
                    <td>--</td>
145
                    <td>--</td>
146
                    <td>$totalTimeSpentStr</td>
147
                    <td>$totalTransitStr</td>
148
                    <td>$totalDistanceStr km | Visits: $visitCount | Leads: $leadCount</td>
149
                </tr>
150
            </tfoot>
36645 vikas 151
        </table>
152
    </div>
153
</section>
154
 
36656 vikas 155
<!-- Task History Modal -->
156
<div class="modal fade" id="taskHistoryModal" tabindex="-1" role="dialog">
157
    <div class="modal-dialog modal-lg" role="document" style="width:85%;">
158
        <div class="modal-content">
159
            <div class="modal-header" style="background:#3498db; color:white;">
160
                <button type="button" class="close" data-dismiss="modal" style="color:white;">&times;</button>
161
                <h4 class="modal-title" id="taskHistoryModalTitle">Task History</h4>
162
            </div>
163
            <div class="modal-body" id="taskHistoryModalBody">
164
                <div class="text-center"><i class="fa fa-spinner fa-spin fa-2x"></i> Loading...</div>
165
            </div>
166
            <div class="modal-footer">
167
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
168
            </div>
169
        </div>
170
    </div>
171
</div>
172
 
36645 vikas 173
<script>
174
    $('#userDetailTable').DataTable({
175
        "scrollX": true,
176
        "bPaginate": true,
177
        "bLengthChange": true,
178
        "bFilter": true,
179
        "bInfo": true,
180
        "bAutoWidth": false
181
    });
36656 vikas 182
 
183
    $(document).on('click', '.beat-history-link', function () {
184
        var userId = $(this).data('userid');
185
        var taskId = $(this).data('taskid');
186
        var taskType = $(this).data('tasktype');
187
        var taskName = $(this).data('taskname');
188
 
189
        $('#taskHistoryModalTitle').text('History - ' + taskName);
190
        $('#taskHistoryModalBody').html('<div class="text-center"><i class="fa fa-spinner fa-spin fa-2x"></i> Loading...</div>');
191
        $('#taskHistoryModal').modal('show');
192
 
193
        doGetAjaxRequestHandler(context + "/beat-report/task-history?userId=" + userId + "&taskId=" + taskId + "&taskType=" + encodeURIComponent(taskType),
194
            function (response) {
195
                $('#taskHistoryModalBody').html(response);
196
            });
197
    });
36645 vikas 198
</script>