@extends('admin.layouts.master')

@section('title')
    Unit Manager Releases
@stop

@section('style')

@stop

@section('content')
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <span class="fa fa-user"></span> Unit Manager Releases
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-user"></i> Admin Panel</a></li>
                <li class="active">Unit Manager Releases</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content" style=" padding-bottom: 10%;">
            <div class="page-header">
                <a href="{{ url()->previous() }}" class="btn btn-primary"><i class="fa fa-backward"></i> Back</a>
            </div>

            <div class="col-md-6">
                <div class="form-group" style="text-align: left;background:rgba(0,0,0,0);border:none;" id="">
                    <span id="">Manager Code : <span class="label label-warning">{{$rpts[0]->agent_code}}</span></span><br>
                    <span id="">Manager Name : <span class="label label-success"> {{$rpts[0]->agent_name}}</span></span><br>
                </div>
            </div>

            <table class="table table-hover" id="user_table" width="100%">
                <thead>
                <tr style="background: grey ;color:#fff; font-weight: bold">
                    <td hidden>ID</td>
                    <td>No.</td>
                    <td>Date</td>
                    <td>Project Name</td>
                    <td style="text-align: center">Blk / Lot</td>
                    {{--<td>Code</td>
                    <td>Agent Name</td>--}}
                    <td>Remarks</td>
                    <td style="text-align: center">Rate</td>
                    <td>Comm Amount</td>
                    <td>Tax</td>
                    <td>C/A Payment</td>
                    <td>Net Amount</td>
                </tr>
                </thead>
                @foreach($rpts as $key=>$rpt)
                    <tr>
                        <td hidden>{{$rpt->id}}</td>
                        <td>{{$loop->index+1}}</td>
                        <td>{{date("d-M-Y", strtotime($rpt->created_at))}}</td>
                        <td>{{$rpt->prj_name}}</td>
                        <td style="text-align: center">Blk {{$rpt->blk }} | Lot {{$rpt->lot}}</td>
                        {{--<td>{{$rpt->agent_code}}</td>
                        <td width="20%">{{$rpt->agent_name}}</td>--}}
                        <td>{{$rpt->remarks}}</td>
                        <td style="text-align: center">{{number_format($rpt->um_pcg_rate, 0)}}%</td>
                        <td style="text-align: right">{{number_format($rpt->um_com_rate,2)}}</td>
                        <td style="text-align: right">{{number_format($rpt->tax,2)}}</td>
                        <td style="text-align: right">{{number_format($rpt->um_payment_adv,2)}}</td>
                        <td style="text-align: right">{{number_format($rpt->net_comm,2)}}</td>
                        {{--<td class="btn btn-default ">
                            <a href="{{ route('agents.edit',[$rpt->id]) }}" class="btn btn-primary btn-xs"><i class="fa fa-edit"></i></a>
                        </td>--}}
                    </tr>
                    @endforeach
            </table>
            @if(Session('info'))
                <div class="row">
                    <div class="col-md-6 col-md-offset-3 text-center">
                        <div class="tem alert alert-success navbar-fixed-bottom"><span class="glyphicon glyphicon-ok-circle"></span> {{Session('info')}}</div>
                    </div>
                </div>
            @endif
        </section>

    </div>
@stop

@section('script')
    <script>
        /*$(document).ready(function() {
            $('#user_table').DataTable( {
                "bDestroy": true,
                "order": [[ 0, "desc" ]]
            });
        });*/
        /*$("#btnAdd").on("click", function(){
            $('#addModal').modal('toggle');
        });*/
    </script>
@stop