<div class="page-content-wrapper">
    <div class="page-content">
        <form role="form" class="hidden-print" id="new_operation_form" action="{$hosturl}/controllers/operations_reports.php?ac=listReport" method="post">
            <div class="row">
                <div class="col-md-4" style="margin-bottom: 20px;">
                    <div class="form-group">
                        <label class="col-md-3 txtl">Date</label>
                        <div class="col-md-9">
                            <input type="text" class="form-control notPop datepicker" name="choose_date" id="date" value="{$today}" required="required"/>
                        </div>
                    </div>
                </div>
                <div class="col-md-2">
                    <button type="submit" class="btn btn-sm btn-primary">Filter</button>
                    <button type="button" id="print_page" class="btn btn-sm btn-success">Print</button>
                    {*                    <a href="{$hosturl}/controllers/operations_reports.php?ac=exportPDF" class="btn btn-sm btn-success">Export PDF</a>*}
                </div>
            </div>
        </form>
        <div class="row">
            <div class="col-md-12" id="list_container">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title hidden-print">
                        <div class="caption">
                            <i class="fa fa-users"></i>List Report
                        </div>
                    </div>
                    <div class="portlet-body all">

                        <!--Begin Semen-->

                        <div class="row">
                            <table class="table mt-15 dir-ar" style="border-top: 1px solid #aaa;">
                                <thead>
                                <tr class="tr-p-10">
                                    <th style="background-color: #fff;">اليوم:</th>
                                    <th style="background-color: #fff;">{$arDay}</th>
                                    <th style="background-color: #fff;">التاريخ:</th>
                                    <th style="background-color: #fff;">{$today}</th>
                                    <th style="background-color: #fff;"></th>
                                </tr>
                                <tr class="tr-p-10">
                                    <th colspan="5" style="background-color: #fff;">Operation List</th>
                                </tr>
                                <tr class="tr-p-10 bg-ddd">
                                    <th>الرقم</th>
                                    <th>اسم الحالة</th>
                                    <th>الطبيب المعالج</th>
                                    <th>نوع العملية</th>
                                    <th>رقم الغرفة</th>
                                </tr>

                                </thead>
                                <tbody>
                                {assign var="i" value=1}
                                {foreach $operations as $operation}
                                    <tr>
                                        <td style="padding: 5px;">
                                            {$i}
                                        </td>
                                        <td style="padding: 5px;">
                                            {$operation.patient.wifename}
                                            {if !empty($operation.for_husband_ops->id)}
                                                <br>
                                                <span>{$operation.for_husband_ops->patient->husdandname}</span>
                                            {/if}
                                        </td>
                                        <td style="padding: 5px;">
                                            {$operation.doctor->name}
                                            {if !empty($operation.for_husband_ops->id)}
                                                <br>
                                                <span>{$operation.for_husband_ops->doctor->name}</span>
                                            {/if}
                                        </td>
                                        <td style="padding: 5px;">
                                            {$operation.operation_type->title}
                                            {if !empty($operation.operation_info->notes)}
                                                <br/>
                                                <span>{$operation.operation_info->notes}</span>
                                            {/if}

                                            {if !empty($operation.for_husband_ops->id)}
                                                <br>
                                                <span>{$operation.for_husband_ops->operation_type->title}</span>
                                                {if !empty($operation.for_husband_ops->operation_info->notes)}
                                                    <br/>
                                                    <span>{$operation.for_husband_ops->operation_info->notes}</span>
                                                {/if}
                                            {/if}
                                        </td>
                                        <td style="padding: 5px;">
                                            {$operation.room->name}
                                            {if !empty($operation.for_husband_ops->id)}
                                                <br>
                                                <span>{$operation.for_husband_ops->room->name}</span>
                                            {/if}
                                        </td>
                                    </tr>
                                    {assign var="i" value=$i+1}
                                {/foreach}
                                </tbody>
                            </table>
                        </div>

                    </div>

                    <!--End Semen-->


                    <div class="clearfix"></div>

                </div>
            </div>
        </div>
    </div>
</div>

<style>
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .dir-ar {
        direction: rtl;
    }

    .mt-15 {
        margin-top: 15px !important;
    }

    .tr-p-10 th, .tr-p-10 td {
        padding: 10px !important;
    }

    .brown-tr {
        background: #f5ead2;
    }

    .blue-tr {
        background: #d6ebfd;
    }

    .rooms_report_tab .nav-tabs > li.active > a, .rooms_report_tab .nav-tabs > li.active > a:focus, .rooms_report_tab .nav-tabs > li.active > a:hover {
        color: #342d2d;
        background: beige
    }

    .table > thead > tr > th {
        border-bottom: 1px solid #aaa;
    }

    @media print {
        .bg-ddd {
            background: #DDD !important;
        }

        .bg-ddd td {
            background: #DDD !important;
        }

        .bg-ddd th {
            background: #DDD !important;
        }
    }

</style>