Subversion Repositories SmartDukaan

Rev

Rev 36645 | Rev 36664 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36645 Rev 36656
Line 65... Line 65...
65
            </div>
65
            </div>
66
        </div>
66
        </div>
67
 
67
 
68
        <table class="table table-border table-condensed table-bordered table-striped" id="userDetailTable" style="width:100%">
68
        <table class="table table-border table-condensed table-bordered table-striped" id="userDetailTable" style="width:100%">
69
            <thead>
69
            <thead>
70
            <tr style="background:#1abc9c; color:white;">
70
            <tr >
71
                <th>#</th>
71
                <th>#</th>
72
                <th>Task Name</th>
72
                <th>Task Name</th>
73
                <th>Task Type</th>
73
                <th>Task Type</th>
74
                <th>Status</th>
74
                <th>Status</th>
75
                <th>Address</th>
75
                <th>Address</th>
76
                <th>Check In Time</th>
76
                <th>Check In Time</th>
77
                <th>Check Out Time</th>
77
                <th>Check Out Time</th>
78
                <th>Time Spent</th>
78
                <th>Time Spent</th>
79
                <th>Transit Time</th>
79
                <th>Transit Time</th>
80
                <th>Distance (km)</th>
80
                <th>Distance (km)</th>
81
                <th>Description</th>
-
 
82
                <th style="min-width:80px;">Attachment</th>
-
 
83
            </tr>
81
            </tr>
84
            </thead>
82
            </thead>
85
            <tbody>
83
            <tbody>
-
 
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
86
            #set($idx = 1)
98
            #set($idx = 1)
87
            #foreach($v in $visits)
99
            #foreach($v in $visits)
88
                <tr>
100
                <tr>
89
                    <td>$idx</td>
101
                    <td>$idx</td>
90
                    <td>$!v.getTaskName()</td>
102
                    <td>$!v.getTaskName()</td>
Line 97... Line 109...
97
                        #elseif($v.getMarkType() == "DEFERRED")
109
                        #elseif($v.getMarkType() == "DEFERRED")
98
                            <span class="label label-danger">$v.getMarkType()</span>
110
                            <span class="label label-danger">$v.getMarkType()</span>
99
                        #else
111
                        #else
100
                            <span class="label label-default">$!v.getMarkType()</span>
112
                            <span class="label label-default">$!v.getMarkType()</span>
101
                        #end
113
                        #end
-
 
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
102
                    </td>
116
                    </td>
103
                    <td>$!v.getAddress()</td>
117
                    <td>$!v.getAddress()</td>
104
                    <td>$!v.getCheckInTime()</td>
118
                    <td>$!v.getCheckInTime()</td>
105
                    <td>$!v.getCheckOutTime()</td>
119
                    <td>$!v.getCheckOutTime()</td>
106
                    <td>$!v.getTimeSpent()</td>
120
                    <td>$!v.getTimeSpent()</td>
107
                    <td>$!v.getTransitTime()</td>
121
                    <td>$!v.getTransitTime()</td>
108
                    <td>$!v.getTotalDistance()</td>
122
                    <td>$!v.getTotalDistance()</td>
109
                    <td>$!v.getTaskDescription()</td>
-
 
110
                    <td>#if($v.getAttachment() && $v.getAttachment() != "")<a href="https://partners.smartdukaan.com/document/$v.getAttachment()" target="_blank"><i class="fa fa-paperclip"></i> View</a>#else--#end</td>
-
 
111
                </tr>
123
                </tr>
112
                #set($idx = $idx + 1)
124
                #set($idx = $idx + 1)
113
            #end
125
            #end
-
 
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
114
            </tbody>
140
            </tbody>
-
 
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>
115
        </table>
151
        </table>
116
    </div>
152
    </div>
117
</section>
153
</section>
118
 
154
 
-
 
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
 
119
<script>
173
<script>
120
    $('#userDetailTable').DataTable({
174
    $('#userDetailTable').DataTable({
121
        "scrollX": true,
175
        "scrollX": true,
122
        "bPaginate": true,
176
        "bPaginate": true,
123
        "bLengthChange": true,
177
        "bLengthChange": true,
124
        "bFilter": true,
178
        "bFilter": true,
125
        "bInfo": true,
179
        "bInfo": true,
126
        "bAutoWidth": false
180
        "bAutoWidth": false
127
    });
181
    });
-
 
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
    });
128
</script>
198
</script>