Subversion Repositories SmartDukaan

Rev

Rev 36656 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i> $username - Visit Details ($reportDate)</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><a href="javascript:void(0);" class="beat-report">Beat Report</a></li>
                <li><i class="fa fa-user"></i>$username</li>
            </ol>
        </div>
    </div>
    <br>
    <div class="row col-lg-12" style="float: right;">
        <div class="col-lg-3">
            <label>Select Date</label>
            <div class="input-group">
                <input type="date" id="user-detail-date" class="form-control" value="$reportDate" data-userid="$userId">
                <span class="input-group-btn">
                    <button type="button" class="btn btn-info user-detail-refresh" data-userid="$userId" style="margin-left:10px;">
                        <i class="fa fa-refresh"></i> Refresh
                    </button>
                </span>
            </div>
        </div>
    </div>
    <br><br><br>

    <div class="col-lg-12">
        <div class="row" style="margin-bottom:15px;">
            <div class="col-lg-3">
                <div class="panel panel-default" style="text-align:center; padding:10px;">
                    <h4 style="margin:0; color:#1abc9c; font-weight:bold;">$visits.size()</h4>
                    <small>Total Visits</small>
                </div>
            </div>
            #set($completedCount = 0)
            #set($pendingCount = 0)
            #set($deferredCount = 0)
            #foreach($v in $visits)
                #if($v.getMarkType() == "CHECKIN-CHECKOUT" || $v.getMarkType() == "CHECKOUT")
                    #set($completedCount = $completedCount + 1)
                #elseif($v.getMarkType() == "PENDING" || $v.getMarkType() == "CHECKIN")
                    #set($pendingCount = $pendingCount + 1)
                #elseif($v.getMarkType() == "DEFERRED")
                    #set($deferredCount = $deferredCount + 1)
                #end
            #end
            <div class="col-lg-3">
                <div class="panel panel-default" style="text-align:center; padding:10px;">
                    <h4 style="margin:0; color:#27ae60; font-weight:bold;">$completedCount</h4>
                    <small>Completed</small>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="panel panel-default" style="text-align:center; padding:10px;">
                    <h4 style="margin:0; color:#e67e22; font-weight:bold;">$pendingCount</h4>
                    <small>Pending</small>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="panel panel-default" style="text-align:center; padding:10px;">
                    <h4 style="margin:0; color:#e74c3c; font-weight:bold;">$deferredCount</h4>
                    <small>Deferred</small>
                </div>
            </div>
        </div>

        <table class="table table-border table-condensed table-bordered table-striped" id="userDetailTable" style="width:100%">
            <thead>
            <tr style="background:#1abc9c; color:white;">
                <th>#</th>
                <th>Task Name</th>
                <th>Task Type</th>
                <th>Status</th>
                <th>Address</th>
                <th>Check In Time</th>
                <th>Check Out Time</th>
                <th>Time Spent</th>
                <th>Transit Time</th>
                <th>Distance (km)</th>
                <th>Description</th>
                <th style="min-width:80px;">Attachment</th>
            </tr>
            </thead>
            <tbody>
            #set($idx = 1)
            #foreach($v in $visits)
                <tr>
                    <td>$idx</td>
                    <td>$!v.getTaskName()</td>
                    <td>$!v.getTaskType()</td>
                    <td>
                        #if($v.getMarkType() == "CHECKIN-CHECKOUT" || $v.getMarkType() == "CHECKOUT")
                            <span class="label label-success">$v.getMarkType()</span>
                        #elseif($v.getMarkType() == "PENDING" || $v.getMarkType() == "CHECKIN")
                            <span class="label label-warning">$v.getMarkType()</span>
                        #elseif($v.getMarkType() == "DEFERRED")
                            <span class="label label-danger">$v.getMarkType()</span>
                        #else
                            <span class="label label-default">$!v.getMarkType()</span>
                        #end
                    </td>
                    <td>$!v.getAddress()</td>
                    <td>$!v.getCheckInTime()</td>
                    <td>$!v.getCheckOutTime()</td>
                    <td>$!v.getTimeSpent()</td>
                    <td>$!v.getTransitTime()</td>
                    <td>$!v.getTotalDistance()</td>
                    <td>$!v.getTaskDescription()</td>
                    <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>
                </tr>
                #set($idx = $idx + 1)
            #end
            </tbody>
        </table>
    </div>
</section>

<script>
    $('#userDetailTable').DataTable({
        "scrollX": true,
        "bPaginate": true,
        "bLengthChange": true,
        "bFilter": true,
        "bInfo": true,
        "bAutoWidth": false
    });
</script>