<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=supportReport" 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>Support Report
                        </div>
                    </div>
                    <div class="portlet-body all">

                        <!--Begin Semen-->

                        <div class="row" style="overflow: auto;direction: rtl; ">
                            <table class="table mt-15 dir-ar" style="border-top: 1px solid #aaa;">
                                <thead>
                                <tr class="tr-p-10 bg-ddd">
                                    <th style="min-width: 150px">اسم الحالة</th>
                                    <th>رقم الملف</th>
                                    <th>رقم الهاتف ١</th>
                                    <th>رقم الهاتف ٢</th>
                                    <th style="min-width: 110px">الطبيب المعالج</th>
                                    <th>نوع العملية</th>
                                    <th style="min-width: 110px">تكلفه العملية</th>
                                    <th>أجمالي تكلفه العملية</th>
                                    <th>موعد العملية</th>
                                    <th style="min-width: 150px">شروط العملية</th>
                                    <th style="min-width: 200px">الرسالة النصية</th>
                                    <th>إرسال</th>
                                    <th style="min-width: 110px">اسم الموظف</th>
                                    <th>التواصل مع الحالة</th>
                                    <th style="min-width: 200px">ملاحظات</th>
                                </tr>

                                </thead>
                                <tbody>
                                {foreach $operations as $operation}
                                    <tr>
                                        <td style="padding: 5px;">
                                            {if $operation->for_husband eq 1}
                                                {$operation->patient->husbandname}
                                            {else}
                                                {$operation->patient->wifename}
                                            {/if}
                                        </td>
                                        <td style="padding: 5px;">{$operation->patient->statusno}</td>
                                        <td style="padding: 5px;">{$operation->patient->phone}</td>
                                        <td style="padding: 5px;">{$operation->patient->mobile}</td>
                                        <td style="padding: 5px;">{$operation->doctor->name}</td>
                                        <td style="padding: 5px;">{$operation->operation_type->title}</td>
                                        <td style="padding: 5px;">{$operation->cost_details}</td>
                                        <td style="padding: 5px;">{$operation->cost}</td>
                                        <td style="padding: 5px;">{$operation->start_time|date_format:"h a"}</td>
                                        <td style="padding: 5px;">{$operation->instructions}</td>
                                        <td style="padding: 5px;">
                                            <input type="text" class="form-control updateColData" name="sms_message_{$operation->id}" data-id="{$operation->id}"
                                                   value="{$operation->sms_message}" id="sms_message_{$operation->id}"
                                                   data-col-name="sms_message" data-table-name="operations_rooms_cal"  {if $operation->contacted_patient eq 1}disabled{/if}>
                                        </td>
                                        <td style="padding: 5px;">
                                            <button type="button" class="btn btn-sm btn-primary send_sms" id="sms_btn_{$operation->id}" data-id="{$operation->id}" {if $operation->contacted_patient eq 1}disabled{/if}>Send</button>
                                        </td>
                                        <td style="padding: 5px;">
                                            <span id="contacted_user_{$operation->id}">{$operation->contacted_user->name}</span>
                                        </td>
                                        <td style="padding: 5px;">
                                            <input type="checkbox" name="is_contacted_{$operation->id}" data-id="{$operation->id}" class="contacted_patient"
                                                   {if $operation->contacted_patient eq 1}checked{/if} value="1">
                                        </td>
                                        <td style="padding: 5px;">
                                            <input type="text" class="form-control updateColData" data-id="{$operation->id}" value="{$operation->contacted_notes}"
                                                   name="notes_{$operation->id}" id="notes_{$operation->id}"
                                                   data-col-name="contacted_notes" data-table-name="operations_rooms_cal" {if $operation->contacted_patient eq 1}disabled{/if}>
                                        </td>
                                    </tr>
                                {/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>