| 36621 |
ranu |
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> PLAN A BEAT</h3>
|
|
|
5 |
<ol class="breadcrumb">
|
|
|
6 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
|
|
7 |
<li><i class="icon_document_alt"></i>Plan a Beat</li>
|
|
|
8 |
</ol>
|
|
|
9 |
</div>
|
|
|
10 |
</div>
|
|
|
11 |
|
|
|
12 |
<!-- Main Tabs -->
|
|
|
13 |
<ul class="nav nav-tabs" id="beat-main-tabs" style="margin-bottom:15px;">
|
|
|
14 |
<li class="active"><a href="#beat-tab-create" data-toggle="tab"><strong>Create Beat</strong></a></li>
|
|
|
15 |
<li><a href="#beat-tab-calendar" data-toggle="tab"><strong>Calendar</strong></a></li>
|
|
|
16 |
</ul>
|
|
|
17 |
|
|
|
18 |
<div class="tab-content">
|
|
|
19 |
<div class="tab-pane active" id="beat-tab-create">
|
|
|
20 |
|
|
|
21 |
<!-- Step 1: Select Auth User -->
|
|
|
22 |
<div class="row" id="beat-step-user">
|
|
|
23 |
<div class="col-lg-2 form-group">
|
|
|
24 |
<label>Category</label>
|
|
|
25 |
<select id="beat-category" class="form-control input-sm">
|
|
|
26 |
<option value="4">Sales</option>
|
|
|
27 |
</select>
|
|
|
28 |
</div>
|
|
|
29 |
<div class="col-lg-2 form-group">
|
|
|
30 |
<label>Level</label>
|
|
|
31 |
<select id="beat-level" class="form-control input-sm">
|
|
|
32 |
<option value="">Select Level</option>
|
|
|
33 |
#foreach($et in $escalationTypes)
|
|
|
34 |
<option value="$et">$et</option>
|
|
|
35 |
#end
|
|
|
36 |
</select>
|
|
|
37 |
</div>
|
|
|
38 |
<div class="col-lg-3 form-group">
|
|
|
39 |
<label>Auth User</label>
|
|
|
40 |
<select id="beat-auth-user" class="form-control input-sm">
|
|
|
41 |
<option value="">Select Auth User</option>
|
|
|
42 |
</select>
|
|
|
43 |
</div>
|
|
|
44 |
<div class="col-lg-2 form-group">
|
|
|
45 |
<label> </label><br>
|
|
|
46 |
<button class="btn btn-primary btn-sm beat-load-user" type="button">Load</button>
|
|
|
47 |
</div>
|
|
|
48 |
</div>
|
|
|
49 |
|
|
|
50 |
<!-- Step 2: Set Start Location -->
|
|
|
51 |
<div id="beat-step-location" style="display:none;">
|
|
|
52 |
<div class="panel panel-info">
|
|
|
53 |
<div class="panel-heading"><strong>Set Start Location (Base)</strong></div>
|
|
|
54 |
<div class="panel-body">
|
|
|
55 |
<div class="row">
|
|
|
56 |
<div class="col-lg-4">
|
|
|
57 |
<input type="text" id="beat-location-search" class="form-control input-sm"
|
|
|
58 |
placeholder="Search location...">
|
|
|
59 |
<div id="beat-base-info" style="margin-top:10px;color:#888;"></div>
|
|
|
60 |
</div>
|
|
|
61 |
<div class="col-lg-6">
|
|
|
62 |
<div id="beat-location-map" style="height:250px;border:1px solid #ddd;"></div>
|
|
|
63 |
</div>
|
|
|
64 |
<div class="col-lg-2">
|
|
|
65 |
<button class="btn btn-success btn-sm beat-confirm-location" type="button">Confirm
|
|
|
66 |
Start
|
|
|
67 |
</button>
|
|
|
68 |
</div>
|
|
|
69 |
</div>
|
|
|
70 |
</div>
|
|
|
71 |
</div>
|
|
|
72 |
</div>
|
|
|
73 |
|
|
|
74 |
<!-- Step 3: Multi-Day Planning -->
|
|
|
75 |
<div id="beat-step-plan" style="display:none;">
|
|
|
76 |
<!-- Day Tabs -->
|
|
|
77 |
<ul class="nav nav-tabs" id="beat-day-tabs">
|
|
|
78 |
<li class="active"><a href="#beat-day-1" data-toggle="tab">Day 1</a></li>
|
|
|
79 |
</ul>
|
|
|
80 |
|
|
|
81 |
<!-- Day Content -->
|
|
|
82 |
<div class="tab-content" id="beat-day-content">
|
|
|
83 |
<div class="tab-pane active" id="beat-day-1">
|
|
|
84 |
</div>
|
|
|
85 |
</div>
|
|
|
86 |
|
|
|
87 |
<!-- Progress Bar -->
|
|
|
88 |
<div style="margin:10px 0;">
|
|
|
89 |
<div style="display:flex;align-items:center;gap:10px;">
|
|
|
90 |
<span><strong>Day Time:</strong></span>
|
|
|
91 |
<div style="flex:1;background:#eee;border-radius:10px;height:20px;overflow:hidden;">
|
|
|
92 |
<div id="beat-time-bar"
|
|
|
93 |
style="height:100%;background:#27AE60;width:0%;transition:width 0.3s;border-radius:10px;text-align:center;color:#fff;font-size:11px;line-height:20px;">
|
|
|
94 |
0h / 9h
|
|
|
95 |
</div>
|
|
|
96 |
</div>
|
|
|
97 |
<button class="btn btn-warning btn-sm beat-end-day" type="button">End Day</button>
|
|
|
98 |
<button class="btn btn-info btn-sm beat-finish-plan" type="button">Finish Planning</button>
|
|
|
99 |
</div>
|
|
|
100 |
</div>
|
|
|
101 |
|
|
|
102 |
<!-- Partner + Lead Lists and Map -->
|
|
|
103 |
<div style="display:flex;gap:10px;">
|
|
|
104 |
<div style="width:420px;min-width:420px;">
|
|
|
105 |
<!-- Partners Panel -->
|
|
|
106 |
<div class="panel panel-default" style="margin-bottom:5px;">
|
|
|
107 |
<div class="panel-heading" style="padding:5px 10px;">
|
|
|
108 |
<strong>Partners</strong>
|
|
|
109 |
<label class="pull-right" style="margin:0;font-weight:normal;"><input type="checkbox"
|
|
|
110 |
id="beat-select-all-partners">
|
|
|
111 |
Select All</label>
|
|
|
112 |
</div>
|
|
|
113 |
<div style="padding:3px;">
|
|
|
114 |
<input type="text" id="beat-partner-search" placeholder="Search partners..."
|
|
|
115 |
class="form-control input-sm">
|
|
|
116 |
</div>
|
|
|
117 |
<div style="max-height:250px;overflow-y:auto;padding:0;">
|
|
|
118 |
<table class="table table-condensed table-hover" style="margin-bottom:0;">
|
|
|
119 |
<tbody id="beat-partner-list"></tbody>
|
|
|
120 |
</table>
|
|
|
121 |
</div>
|
|
|
122 |
</div>
|
|
|
123 |
<!-- Leads Panel -->
|
|
|
124 |
<div class="panel panel-default" style="margin-bottom:5px;">
|
|
|
125 |
<div class="panel-heading" style="padding:5px 10px;background:#FFF3E0;">
|
|
|
126 |
<strong>Leads (Follow-up)</strong>
|
|
|
127 |
</div>
|
|
|
128 |
<div style="max-height:200px;overflow-y:auto;padding:0;">
|
|
|
129 |
<table class="table table-condensed table-hover" style="margin-bottom:0;">
|
|
|
130 |
<tbody id="beat-lead-list"></tbody>
|
|
|
131 |
</table>
|
|
|
132 |
</div>
|
|
|
133 |
</div>
|
|
|
134 |
<!-- Selected Route -->
|
|
|
135 |
<div class="panel panel-success" style="margin-bottom:0;">
|
|
|
136 |
<div class="panel-heading" style="padding:5px 10px;">
|
|
|
137 |
<strong>Selected Route</strong> — <span id="beat-selected-count">0</span> stops
|
|
|
138 |
</div>
|
|
|
139 |
<div style="max-height:200px;overflow-y:auto;padding:0;">
|
|
|
140 |
<table class="table table-condensed" style="margin-bottom:0;">
|
|
|
141 |
<tbody id="beat-selected-list"></tbody>
|
|
|
142 |
</table>
|
|
|
143 |
</div>
|
|
|
144 |
<div class="panel-footer" style="padding:5px 10px;">
|
|
|
145 |
<button class="btn btn-success btn-sm pull-right save-beat-plan" type="button"
|
|
|
146 |
style="display:none;">Save Beat Plan
|
|
|
147 |
</button>
|
|
|
148 |
<div class="clearfix"></div>
|
|
|
149 |
</div>
|
|
|
150 |
</div>
|
|
|
151 |
</div>
|
|
|
152 |
<div style="flex:1;">
|
|
|
153 |
<div id="beat-route-summary"
|
|
|
154 |
style="display:none;background:#2C3E50;color:#FFF;padding:10px 15px;margin-bottom:5px;border-radius:4px;font-size:14px;"></div>
|
|
|
155 |
<div id="beat-map" style="height:600px;width:100%;border:1px solid #ddd;"></div>
|
|
|
156 |
</div>
|
|
|
157 |
</div>
|
|
|
158 |
</div>
|
|
|
159 |
|
|
|
160 |
<!-- Step 4: Day Break Modal -->
|
|
|
161 |
<div class="modal fade" id="beatDayBreakModal" tabindex="-1">
|
|
|
162 |
<div class="modal-dialog">
|
|
|
163 |
<div class="modal-content">
|
|
|
164 |
<div class="modal-header" style="background:#2C3E50;color:#fff;">
|
|
|
165 |
<h4 class="modal-title">Day Break</h4>
|
|
|
166 |
</div>
|
|
|
167 |
<div class="modal-body">
|
|
|
168 |
<p id="beat-daybreak-info" style="font-size:16px;"></p>
|
|
|
169 |
<hr>
|
|
|
170 |
<p><strong>Where does the user stay tonight?</strong></p>
|
|
|
171 |
<div class="radio"><label><input type="radio" name="beatStayOption" value="HOME" checked> Go
|
|
|
172 |
back home (Base Location)</label></div>
|
|
|
173 |
<div class="radio"><label><input type="radio" name="beatStayOption" value="HOTEL"> Stay at
|
|
|
174 |
hotel/other location</label></div>
|
|
|
175 |
<div id="beat-hotel-fields" style="display:none;margin-left:25px;">
|
|
|
176 |
<input type="text" id="beat-hotel-name" class="form-control input-sm"
|
|
|
177 |
placeholder="Hotel / Location name" style="margin-bottom:5px;">
|
|
|
178 |
<input type="text" id="beat-hotel-search" class="form-control input-sm"
|
|
|
179 |
placeholder="Search location on map...">
|
|
|
180 |
<div id="beat-hotel-map"
|
|
|
181 |
style="height:200px;border:1px solid #ddd;margin-top:5px;"></div>
|
|
|
182 |
</div>
|
|
|
183 |
</div>
|
|
|
184 |
<div class="modal-footer">
|
|
|
185 |
<button class="btn btn-primary beat-continue-next-day" type="button">Continue to Next Day
|
|
|
186 |
</button>
|
|
|
187 |
</div>
|
|
|
188 |
</div>
|
|
|
189 |
</div>
|
|
|
190 |
</div>
|
|
|
191 |
|
|
|
192 |
<!-- Step 5: Calendar Date Assignment Modal -->
|
|
|
193 |
<div class="modal fade" id="beatCalendarModal" tabindex="-1">
|
|
|
194 |
<div class="modal-dialog modal-lg">
|
|
|
195 |
<div class="modal-content">
|
|
|
196 |
<div class="modal-header" style="background:#2C3E50;color:#fff;">
|
|
|
197 |
<h4 class="modal-title">Assign Dates to Plan</h4>
|
|
|
198 |
</div>
|
|
|
199 |
<div class="modal-body">
|
|
|
200 |
<div class="row">
|
|
|
201 |
<div class="col-lg-7">
|
|
|
202 |
<p><strong>Select start date:</strong></p>
|
|
|
203 |
<input type="date" id="beat-cal-start" class="form-control input-sm"
|
|
|
204 |
style="width:200px;">
|
|
|
205 |
<br>
|
|
|
206 |
<p><strong>Mark leave days (click to toggle):</strong></p>
|
|
|
207 |
<div id="beat-calendar-grid" style="font-family:monospace;"></div>
|
|
|
208 |
</div>
|
|
|
209 |
<div class="col-lg-5">
|
|
|
210 |
<h4>Plan Summary</h4>
|
|
|
211 |
<div id="beat-plan-summary"></div>
|
|
|
212 |
<hr>
|
|
|
213 |
<h4>Date Assignments</h4>
|
|
|
214 |
<div id="beat-date-assignments"></div>
|
|
|
215 |
</div>
|
|
|
216 |
</div>
|
|
|
217 |
</div>
|
|
|
218 |
<div class="modal-footer">
|
|
|
219 |
<button class="btn btn-success beat-submit-plan" type="button">Save & Submit Plan</button>
|
|
|
220 |
</div>
|
|
|
221 |
</div>
|
|
|
222 |
</div>
|
|
|
223 |
</div>
|
|
|
224 |
</div><!-- end beat-tab-create -->
|
|
|
225 |
|
|
|
226 |
<!-- ============ CALENDAR TAB ============ -->
|
|
|
227 |
<div class="tab-pane" id="beat-tab-calendar">
|
|
|
228 |
<div class="row" style="margin-bottom:10px;">
|
|
|
229 |
<div class="col-lg-2 form-group">
|
|
|
230 |
<label>Category</label>
|
|
|
231 |
<select id="cal-category" class="form-control input-sm">
|
|
|
232 |
<option value="4">Sales</option>
|
|
|
233 |
</select>
|
|
|
234 |
</div>
|
|
|
235 |
<div class="col-lg-2 form-group">
|
|
|
236 |
<label>Level</label>
|
|
|
237 |
<select id="cal-level" class="form-control input-sm">
|
|
|
238 |
<option value="">Select Level</option>
|
|
|
239 |
#foreach($et in $escalationTypes)
|
|
|
240 |
<option value="$et">$et</option>
|
|
|
241 |
#end
|
|
|
242 |
</select>
|
|
|
243 |
</div>
|
|
|
244 |
<div class="col-lg-3 form-group">
|
|
|
245 |
<label>Auth User</label>
|
|
|
246 |
<select id="cal-auth-user" class="form-control input-sm">
|
|
|
247 |
<option value="">Select Auth User</option>
|
|
|
248 |
</select>
|
|
|
249 |
</div>
|
|
|
250 |
<div class="col-lg-2 form-group">
|
|
|
251 |
<label> </label><br>
|
|
|
252 |
<button class="btn btn-primary btn-sm cal-load" type="button">Load Calendar</button>
|
|
|
253 |
</div>
|
|
|
254 |
</div>
|
|
|
255 |
|
|
|
256 |
<div id="cal-container" style="display:none;">
|
|
|
257 |
<div style="display:flex;gap:15px;">
|
|
|
258 |
<!-- Left: Beat List -->
|
|
|
259 |
<div style="width:260px;min-width:260px;">
|
|
|
260 |
<div class="panel panel-default">
|
|
|
261 |
<div class="panel-heading"><strong>Beats</strong></div>
|
|
|
262 |
<div id="cal-beat-list" style="max-height:600px;overflow-y:auto;padding:10px;">
|
|
|
263 |
</div>
|
|
|
264 |
</div>
|
|
|
265 |
</div>
|
|
|
266 |
|
|
|
267 |
<!-- Right: Calendar Grid -->
|
|
|
268 |
<div style="flex:1;">
|
|
|
269 |
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;">
|
|
|
270 |
<button class="btn btn-default btn-sm cal-prev-month">< Prev</button>
|
|
|
271 |
<h4 id="cal-month-title" style="margin:0;"></h4>
|
|
|
272 |
<button class="btn btn-default btn-sm cal-next-month">Next ></button>
|
|
|
273 |
</div>
|
|
|
274 |
<div id="cal-grid"></div>
|
|
|
275 |
<div style="margin-top:10px;font-size:12px;color:#777;">
|
|
|
276 |
<span style="display:inline-block;width:14px;height:14px;background:#f5f5f5;border:1px solid #ddd;vertical-align:middle;"></span>
|
|
|
277 |
Sunday
|
|
|
278 |
<span style="display:inline-block;width:14px;height:14px;background:#FFF9C4;border:1px solid #ddd;vertical-align:middle;"></span>
|
|
|
279 |
Holiday
|
|
|
280 |
<span style="display:inline-block;width:14px;height:14px;background:#FFCDD2;border:1px solid #ddd;vertical-align:middle;"></span>
|
|
|
281 |
Running (locked)
|
|
|
282 |
<span style="display:inline-block;width:14px;height:14px;background:#E8F5E9;border:1px solid #ddd;vertical-align:middle;"></span>
|
|
|
283 |
Scheduled
|
|
|
284 |
<span style="display:inline-block;width:14px;height:14px;background:#E0E0E0;border:1px solid #ddd;vertical-align:middle;"></span>
|
|
|
285 |
Completed
|
|
|
286 |
</div>
|
|
|
287 |
</div>
|
|
|
288 |
</div>
|
|
|
289 |
</div>
|
|
|
290 |
</div><!-- end beat-tab-calendar -->
|
|
|
291 |
|
|
|
292 |
</div><!-- end tab-content -->
|
|
|
293 |
</section>
|
|
|
294 |
|
|
|
295 |
<style>
|
|
|
296 |
.beat-distance-label {
|
|
|
297 |
background: #2C3E50;
|
|
|
298 |
padding: 2px 6px;
|
|
|
299 |
border-radius: 10px;
|
|
|
300 |
white-space: nowrap;
|
|
|
301 |
}
|
|
|
302 |
|
|
|
303 |
.beat-partner-row.selected {
|
|
|
304 |
background: #E8F5E9;
|
|
|
305 |
}
|
|
|
306 |
|
|
|
307 |
.beat-lead-row.selected {
|
|
|
308 |
background: #FFF3E0;
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
#beat-selected-list tr {
|
|
|
312 |
cursor: move;
|
|
|
313 |
}
|
|
|
314 |
|
|
|
315 |
.beat-day-tab-done {
|
|
|
316 |
color: #27AE60;
|
|
|
317 |
}
|
|
|
318 |
|
|
|
319 |
/* Calendar styles */
|
|
|
320 |
.cal-table {
|
|
|
321 |
width: 100%;
|
|
|
322 |
border-collapse: collapse;
|
|
|
323 |
table-layout: fixed;
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
.cal-table th {
|
|
|
327 |
text-align: center;
|
|
|
328 |
padding: 8px;
|
|
|
329 |
background: #34495E;
|
|
|
330 |
color: #fff;
|
|
|
331 |
font-size: 13px;
|
|
|
332 |
}
|
|
|
333 |
|
|
|
334 |
.cal-table td {
|
|
|
335 |
border: 1px solid #ddd;
|
|
|
336 |
height: 90px;
|
|
|
337 |
vertical-align: top;
|
|
|
338 |
padding: 4px;
|
|
|
339 |
font-size: 12px;
|
|
|
340 |
position: relative;
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
.cal-table td.cal-sunday {
|
|
|
344 |
background: #f5f5f5;
|
|
|
345 |
color: #ccc;
|
|
|
346 |
}
|
|
|
347 |
|
|
|
348 |
.cal-table td.cal-holiday {
|
|
|
349 |
background: #FFF9C4;
|
|
|
350 |
}
|
|
|
351 |
|
|
|
352 |
.cal-table td.cal-blocked {
|
|
|
353 |
cursor: not-allowed;
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
.cal-table td.cal-available {
|
|
|
357 |
cursor: pointer;
|
|
|
358 |
}
|
|
|
359 |
|
|
|
360 |
.cal-table td.cal-available:hover {
|
|
|
361 |
background: #E3F2FD;
|
|
|
362 |
}
|
|
|
363 |
|
|
|
364 |
.cal-date-num {
|
|
|
365 |
font-weight: bold;
|
|
|
366 |
font-size: 13px;
|
|
|
367 |
}
|
|
|
368 |
|
|
|
369 |
.cal-beat-chip {
|
|
|
370 |
display: block;
|
|
|
371 |
margin: 2px 0;
|
|
|
372 |
padding: 2px 5px;
|
|
|
373 |
border-radius: 3px;
|
|
|
374 |
color: #fff;
|
|
|
375 |
font-size: 10px;
|
|
|
376 |
white-space: nowrap;
|
|
|
377 |
overflow: hidden;
|
|
|
378 |
text-overflow: ellipsis;
|
|
|
379 |
cursor: pointer;
|
|
|
380 |
}
|
|
|
381 |
|
|
|
382 |
.cal-beat-chip.cal-running {
|
|
|
383 |
animation: pulse-border 1.5s infinite;
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
@keyframes pulse-border {
|
|
|
387 |
0%, 100% {
|
|
|
388 |
box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
|
|
|
389 |
}
|
|
|
390 |
50% {
|
|
|
391 |
box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.2);
|
|
|
392 |
}
|
|
|
393 |
}
|
|
|
394 |
|
|
|
395 |
.cal-beat-chip.cal-completed {
|
|
|
396 |
opacity: 0.5;
|
|
|
397 |
text-decoration: line-through;
|
|
|
398 |
}
|
|
|
399 |
|
|
|
400 |
.cal-beat-card {
|
|
|
401 |
border: 1px solid #ddd;
|
|
|
402 |
border-radius: 6px;
|
|
|
403 |
padding: 10px;
|
|
|
404 |
margin-bottom: 8px;
|
|
|
405 |
cursor: pointer;
|
|
|
406 |
transition: box-shadow 0.2s;
|
|
|
407 |
}
|
|
|
408 |
|
|
|
409 |
.cal-beat-card:hover {
|
|
|
410 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
|
411 |
}
|
|
|
412 |
|
|
|
413 |
.cal-beat-card.cal-active {
|
|
|
414 |
border: 2px solid #3498DB;
|
|
|
415 |
box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
|
|
|
416 |
}
|
|
|
417 |
</style>
|
|
|
418 |
|
|
|
419 |
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAckO0y4Z6WhBOuMjNjioWLSYZDhGEvGBc&libraries=places&callback=initBeatMap&v=weekly"
|
|
|
420 |
async defer></script>
|