
<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row">
            <div class="col-md-12">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> Rays Requests
                        </div>
                        <div class="actions">

                        </div>

                    </div>
                    <div class="portlet-body" >
                        <div class="table-toolbar">

                        </div>
                        <input type="hidden" id="visitId" value="{$visitId}" name="visitId"/>


                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th class="bold col-md-1"> <div align="center">For </div></th>
                                    <td class="bold"><div align="center"> {$rayPatientName} </div> </td>
                                </tr>
                            </thead>
                        </table>

                        {foreach $invs as $inv}
                        <table class="table table-striped table-hover table-bordered">
                            <tbody>
                                <tr>
                                    <td> 
                                        <label class="col-md-6 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">  
                                            {$inv->invname}
                                            <span style="float: left;">
                                                <input type="checkbox"  class="checkGroup" value="{$inv->id}" name="invCheck[]">
                                            </span>
                                        </label>
                                        <div class="col-md-3">
                                            <input type="file" class="rayImgMulti form-control" id="rayImg{$inv->id}"    
                                                   data-patientD="{$patientD}" 
                                                   data-colName="rayimg" data-id="{$inv->id}"  data-tableName="raysresults_img" 
                                                   accept="image/*"  name="rayimg[]" multiple  >
                                        </div>
                                        <div class="col-md-1">
                                            <img src="{$hosturl}/../upload/loading.gif" id="talks-loading{$inv->id}" style="display:none;">
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div id="rayImgDiv{$inv->id}">
                                            {assign var="i" value="1"}
                                            {foreach $inv->imgs as $img}
                                            <div class="col-md-2 wds20">
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-12">
                                                        <div class="fileinput fileinput-new" data-provides="fileinput">
                                                            <div class="fileinput-preview thumbnail" data-trigger="fileinput" 
                                                                 style="width: 100%; height: 170px;"> 
                                                                <img class="showRayImg" {if $img->rayimg} src="{$hosturl}/../upload/rayimg/{$img->rayimg}"{/if}/>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row clinick ltr" >
                                                    <div class="col-md-12">
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input type="text" class="form-control updateElement"  data-tableName="raysresults_img" 
                                                                   data-colName="notes"  data-id="{$img->id}" value="{$img->notes}"/>
                                                            <label for="form_control_1">Notes</label>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row clinick ltr" >
                                                    <div class="col-md-8">

                                                        <button type="button" class="btn btn-xs red fright delRImg" data-tableName="raysresults_img"
                                                                data-colName="notes"  data-id="{$img->id}"    data-folder="rayimg">
                                                            <i class="fa fa-close"></i>
                                                        </button>

                                                        <a class="btn btn-xs blue fright" download="{$rayPatientName} - {$statusNo} -  {$img->rayimg}" 
                                                           href="{$hosturl}/../upload/rayimg/{$img->rayimg}">
                                                            <i class="fa fa-download"></i>
                                                        </a>

                                                    </div>
                                                </div>

                                            </div>
                                            {assign var="i" value=$i+1}
                                            {/foreach}
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        {/foreach}




                        <table class="table table-striped table-hover table-bordered">
                            <tr>
                                <td>
                                    <!--a class="btn btn-success btn-xs" id="printResults" href="#" style=" float: right;" data-visitId="{$visitId}"  >
                                        <i class="fa fa-print"></i> print
                                    </a-->

                                    {if $archive != 1 } 
                                    <a class="btn blue btn-xs" href="{$hosturl}/controllers/{$controllname}.php?ac=finishRequest&id={$visitId}" style=" float: right;"  >
                                        <i class="fa fa-pencil"></i> finish
                                    </a>
                                    {/if}

                                </td>
                            </tr>
                        </table>



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

</div>

<input type="hidden" id="controllName" value="raysdept"/>
<div id="printDiv" ></div>


<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" 
     data-keyboard="false"   id="showRaysImgsM" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds65">
        <div class="modal-content" style="">
            <div class="modal-body" style="background: rgba(0,0,0,.5);">
                <div class="portlet-body">
                    <button type="button" class="close"
                            style="margin-right: 5px; margin-top: 10px; width: 20px; height: 20px;"
                            data-dismiss="modal" aria-hidden="true"></button>
                    <div class="row">
                        <div class="col-md-12" style="text-align: center;" >
                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                <div class="fileinput-preview thumbnail" data-trigger="fileinput"> 
                                    <img id="source_image" />
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

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




