<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=opReport" method="post">
            <div class="row">
                <div class="col-md-3" style="margin-bottom: 20px;">
                    <div class="form-group">
                        <label class="col-md-12 txtl">Date</label>
                        <div class="col-md-12">
                            <input type="text" class="form-control notPop datepicker" name="choose_date" id="date" value="{$today}" required="required"/>
                        </div>
                    </div>
                </div>
                <div class="col-md-3" style="margin-bottom: 20px;">
                    <label class="col-md-12 txtl">Doctor</label>
                    <div class="col-md-12">
                        <select class="form-control select2me" name="doctor_id" data-placeholder="Select...">
                            <option></option>
                            {foreach $doctors as $doctor}
                                <option value="{$doctor.user_id}" {if $doctor_id eq $doctor.user_id}selected{/if}>{$doctor.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="col-md-2" style="margin-top: 20px; margin-left: 5px;">
                    <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>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="row" style="margin-bottom: 20px !important;">
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">Report type:</label>
                    <div class="radio-list">
                        <label class="radio-inline">
                            <input type="radio" name="report_type" value="1" {if empty($report_type) or $report_type eq 1 } checked {/if}> Report 1 </label>
                        <label class="radio-inline">
                            <input type="radio" name="report_type" value="2" {if $report_type eq 2 } checked {/if}> Report 2 </label>
                        <label class="radio-inline">
                            <input type="radio" name="report_type" value="3" {if $report_type eq 3 } checked {/if}> Report 3 </label>
                        {* <label class="radio-inline">
                             <input type="radio" name="report_type" value="4" {if $report_type eq 4 } checked {/if}> Report 4 </label>*}
                        <label class="radio-inline">
                            <input type="radio" name="report_type" value="5" {if $report_type eq 5 } checked {/if}> Report 5 </label>
                        <label class="radio-inline">
                            <input type="radio" name="report_type" value="6" {if $report_type eq 6 } checked {/if}> Report 6 </label>
                    </div>
                </div>
            </div>
        </form>
        <div class="clearfix"></div>
        <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>
                                </thead>
                            </table>
                            <table class="table mt-15 dir-ar" style="border-top: 1px solid #aaa;">
                                <thead>
                                <tr class="tr-p-10 bg-ddd">
                                    <th>الرقم</th>
                                    <th style="white-space: nowrap;">اسم الحالة</th>
                                    {if empty($report_type) or $report_type eq 1 }
                                        <th>أرقام التلفونات</th>
                                    {/if}
                                    <th style="white-space: nowrap;">الطبيب المعالج</th>
                                    <th>نوع العملية</th>

                                    {if empty($report_type) or $report_type eq 1 }
                                        <th>ملاحظات</th>
                                    {elseif $report_type eq 2}
                                        <th>توقيت الشغل</th>
                                        <th>المساعد</th>
                                    {elseif $report_type eq 3}
                                        <th>رقم الغرفة</th>
                                        <th>دخول ألأقامه</th>
                                        <th>Ɖ &+ve Finding</th>
                                        <th>Hb</th>
                                        <th>Bp</th>
                                    {elseif $report_type eq 4}
                                        <th>رقم الغرفة</th>
                                        <th>دخول</th>
                                        <th>خروج</th>
                                        <th>رقم الملف</th>
                                    {elseif $report_type eq 5}
                                        <th>رقم الغرفة</th>
                                        <th>توقيت استلام cup للحاله</th>
                                        <th>توقيت تسليم cup للمعمل</th>
                                    {elseif $report_type eq 6}
                                        <th>رقم الغرفة</th>
                                        <th>مرور طبيب المقيم</th>
                                        <th>روشتات</th>
                                        <th>تسليم روشتات</th>
                                        <th>تسليم التقارير</th>
                                        <th>مرور طبيب الأطفال</th>
                                        <th>رضاعه طبيعيه</th>
                                        <th>ملاحظات</th>
                                    {/if}
                                </tr>

                                </thead>
                                <tbody>
                                {assign var="i" value=1}
                                {foreach $operations as $operation}
                                    <tr>
                                        <td style="padding: 5px;">
                                            {$i}
                                        </td>
                                        <td style="padding: 5px;white-space: nowrap;">
                                            {$operation.patient.wifename}
                                            {if !empty($operation.for_husband_ops->id)}
                                                <br>
                                                <span>{$operation.for_husband_ops->patient->husdandname}</span>
                                            {/if}
                                        </td>
                                        {if empty($report_type) or $report_type eq 1 }
                                            <td style="padding: 5px;white-space: nowrap;">
                                                {$operation.patient.phone} <br/>
                                                {$operation.patient.mobile}
                                                {if !empty($operation.for_husband_ops->id)}
                                                    <br>
                                                    <span>{$operation.for_husband_ops->patient->hus_mobile}</span>
                                                {/if}
                                            </td>
                                        {/if}
                                        <td style="padding: 5px;white-space: nowrap;">
                                            {$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>

                                        {if empty($report_type) or $report_type eq 1 }
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                        {elseif $report_type eq 2}
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                {$operation.assistant->name}
                                            </td>
                                        {elseif $report_type eq 3}
                                            <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>
                                            <td style="padding: 5px;">
                                                {$operation.operation_info->res_start_time|date_format:"h:i A"}
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                        {elseif $report_type eq 4}
                                            <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>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                {$operation.patient.statusno}
                                            </td>
                                        {elseif $report_type eq 5}
                                            <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>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                        {elseif $report_type eq 6}
                                            <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>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                            <td style="padding: 5px;">
                                                <input type="text" class="form-control">
                                            </td>
                                        {/if}

                                    </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;
        }

        input,
        textarea {
            border: none !important;
            box-shadow: none !important;
            outline: none !important;
        }
    }
</style>