<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
</style>
<script src="{$path}/SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script>

    function getname()
    {

        document.getElementById("nameopration").value = ($("#operationname option:selected").text());

    }
</script>
<link href="{$path}/SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active"> تقرير حضور</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading"> تقرير حضور
                <a href="{$youtubes[174]->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-inline hidden-print" action="presenceReport.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">المستخدم</label>
                        <select class="select2 wdt100"  name="usersearchid" id="usersearchid" >
                            <option value="-1">اختر مستخدم</option>


                            {foreach $usersearchData as $usersearch}


                            <option value="{$usersearch->userid}">{$usersearch->username}</option>


                            {/foreach}


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">
                    <hr/>
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>الرقم </th>
                                <th>اسم المستخدم</th>
                                <th>بيانات الدخول</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=i value=1}
                            {foreach $movementmanageData as $key=>$value}

                            {assign var="parts" value=","|explode:$key}
                            {assign var="userid" value=$parts[0]}
                            {assign var="userName" value=$parts[1]}
                            <tr>
                                <td>{$i}</td>
                                <td>{$userName}</td>
                                <td>
                                    <table class="table table-black">
                                        <thead>
                                            <tr>
                                                <th>مرات الدخول </th>
                                                <th>التاريخ </th>
                                                <th>نوع الجهاز</th>
                                                <th>ip</th>
                                                <th>mac</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {assign var=i2 value=1}
                                            {foreach $value as $movementmanage}
                                            <tr>
                                                <td rowspan="count($value)">{$i2}</td>
                                                <td>{$movementmanage['movementmanagedate']} </td>
                                                <td>{$movementmanage['deviceType']} </td>
                                                <td>{$movementmanage['ip']} </td>
                                                <td>{$movementmanage['mac']} </td>
                                            </tr>
                                            {assign var=i2 value=$i2+1}
                                            {/foreach}
                                        </tbody>
                                    </table>

                                </td>
                            </tr>
                            {capture assign=i}{$i+1}{/capture}
                            {/foreach}

                        </tbody>

                    </table>
                    <div class="clearfix"></div>
                    <hr />
                    <div  class="noprint">
                        <div class="clearfix"></div>
                        <div class="form-group">
                            <div class="col-lg-4">
                                <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right hidden-print">طباعة</button>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>

            </div>
        </div>
        {literal}
        <script type="text/javascript">

        </script>
        {/literal}
        <script type="text/javascript">
            var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
            var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
        </script>