


<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">اداره الموظفين</a></li>
            <!--<li><a href="employeesubgroups.php?do=show">مجموعات الموظفين الفرعية</a></li>-->
            <li class="active">تفاصيل حضور وانصراف موظف</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تفاصيل حضور وانصراف موظف</h3>
                <a href="{$youtubes[180]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
            </div>
            <div class="panel-body">


                <form class="form-horizontal" method="post" action="employeeendday.php?do=closedayshow">

                    <div class="form-group">
                        <label class="col-lg-2 control-label">الشهر</label>
                        <div class="col-lg-4">
                            <input name="theDay" id="theDay" type="text" class="form-control awdatepicker" autocomplete="off" data-date-format="yyyy-mm">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">الموظف</label>
                        <div class="col-lg-4">
                            <select class="select2" name="empid" id="empid">
                                <option></option>
                                {foreach $allEmployee as $data}
                                <option value="{$data->employeeId}">{$data->employeeName}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>



                    <!-- =================================================   -->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"  class="btn btn-primary pull-left">بحث</button>
                        </div>
                    </div>


                </form>
                {if isset($employeeHistory)}
                <div id="resultDiv">
                    <br/>
                    <hr/>
                    <br/>
                    <table class="table">
                        <thead>
                            <tr>
                                <td>#</td>
                                <td>اليوم</td>
                                <td>الحضور</td>
                                <td>الانصراف</td>
                                <td>التاخير بالدقائق	</td>
                                <td>التاخير باذن	</td>
                                <td>قيمة التاخير </td>
                                <td>غائب </td>
                                <td>غائب باذن </td>
                                <td>قيمة الغياب </td>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=i value=1}
                            {assign var=totalLate value=0}
                            {assign var=totalAbsent value=0}
                            {foreach $employeeHistory as $data}
                            <tr>
                                <td>{$i}</td>
                                <td>{$data->day}</td>

                                {if $data->isAbsent != 1}<!-- not absent he has show up -->
                                <td>{$data->attendanceTime}</td>
                                <td>{$data->departureTime}</td>
                                <td>{$data->latePeriod}</td>
                                <td>
                                    {if $data->lateHasPermission == 1}
                                    <span style="color: green;font-weight: bold;">باذن</span>
                                    {else}
                                    <span style="color: red;font-weight: bold;">بدون اذن</span>
                                    {/if}
                                </td>
                                <td>{$data->lateDiscount}{assign var=totalLate value=$totalLate+$data->lateDiscount}</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                {else}<!-- absent -->
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>
                                    {if $data->isAbsent == 1}
                                    <span style="color: red;font-weight: bold;">غائب</span>
                                    {else}
                                    -
                                    {/if}
                                </td>
                                <td>
                                    {if $data->absentHasPermission == 1}
                                    <span style="color: green;font-weight: bold;">باذن</span>
                                    {else}
                                    <span style="color: red;font-weight: bold;">بدون اذن</span>
                                    {/if}
                                </td>
                                <td>{$data->absentDiscount}{assign var=totalAbsent value=$totalAbsent+$data->absentDiscount}</td>
                                {/if}

                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}
                        </tbody>
                    </table>
                    <br/>

                    <div class="col-lg-4 "><!-- col-lg-offset-8 -->
                        <div class="well well-sm">
                            <h4 class="text-center">مجموع قيم التاخير:  <span>{$totalLate}</span></h4>
                        </div>
                    </div>
                    <div class="col-lg-4 "><!-- col-lg-offset-8 -->
                        <div class="well well-sm">
                            <h4 class="text-center">مجموع قيم الغياب:  <span>{$totalAbsent}</span></h4>
                        </div>
                    </div>

                    <div class="clear"></div>
                </div>
                {/if}
            </div>
        </div>




    </div>
</div>

