<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-users"></i>Financial Report
                        </div>
                    </div>
                    <div class="portlet-body all">
                        <input type="hidden" id="reportPage" value="1"/>
                        <input type="hidden" id="tdate" value="{$today}">
                        <input type="hidden" id="controllName" value="balance"/>
                        <!--Begin Semen-->

                        <div class="row">
                            <div class="row clinick posre">
                                <div class="col-md-2">
                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                        <input type="text" class="form-control datepicker txtc balanceSearch" id="findate" value="{$today}"/>
                                        <label for="form_control_1">Date From </label>
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group form-md-line-input form-md-floating-label has-info">
                                        <input type="text" class="form-control datepicker txtc balanceSearch" id="tofindate" value="{$today}"/>
                                        <label for="form_control_1">Date To </label>
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label class="control-label ls2">Type</label>

                                        <select class="form-control balanceSearch" id="type">
                                            <option value="1" >Both</option>
                                            <option value="2" >Add</option>
                                            <option value="3" >Pay</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label ls2">Patient Name</label>

                                        <select class="form-control searchFin balanceSearch" id="patientName">
                                            <option value="">choose</option>
                                            {foreach  $allPatients as $data}
                                            <option value="{$data->id}" >{$data->wifename}</option>
                                            {/foreach}
                                        </select>

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label ls2">Husband Name</label>

                                        <select class="form-control searchFin balanceSearch" id="husband">
                                            <option value="">choose</option>
                                            {foreach  $allPatients as $data}
                                            <option value="{$data->husdandname}" >{$data->husdandname}</option>
                                            {/foreach}
                                        </select>

                                    </div>
                                </div>

                            </div>

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

                            <div class="portlet box white">
                                <div class="portlet-title">
                                    <div class="actions">
                                        <a class="btn btn-default btn-sm" id="printfi" >
                                            <i class="fa fa-print"></i> Print </a>

                                    </div>
                                </div>

                                <div class="portlet-body form" id="financialDiv">
                                    <table class="table table-hover portlet light bg-inverse " id="controllpropr">
                                        <thead>
                                            <tr>
                                                <th style="width: 10px !important;">#</th>
                                                <th>
                                                    Patient Name
                                                </th>
                                                <th>Patient Number</th>
                                                <th>Type</th>
                                                <th>
                                                    Cost
                                                </th>

                                            </tr>
                                        </thead>
                                        <tbody>
                                            {assign var="i" value="1"}
                                            {foreach $allData as $data}
                                            <tr class="odd ">
                                                <td>{$i}</td>
                                                <td>
                                                    <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data.patientid}" target="_new">{$data.wifename}</a>
                                                </td>
                                                <td>{$data.patientid}</td>
                                                <td>{$data.type}</td>
                                                <td>
                                                    {$data.detectionvalue}
                                                </td>

                                            </tr>
                                            {assign var="i" value={$i+1}}
                                            {/foreach}
                                            {if !empty($allData)}
                                            <tr class="odd ">
                                                <th>Total Cost</th>
                                                <td></td>
                                                <td></td>
                                                <td></td>
                                                <td>{$totalCost}</td>
                                            </tr>
                                            {/if}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>

                    <!--End Semen-->


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

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

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