
<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 
                        </div>
                        <div class="actions">

                        </div>

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

                        </div>

                        {if $raysCount > 0 }
                        <div class="col-md-12">

                            {foreach $raysVisits as $visit}
                            <table class="table table-striped table-hover table-bordered">
                                <thead>
                                    <tr>
                                        <th style="background: #bada9a;">Data : {$visit.visitdate}</th>
                                        <th style="background: #bada9a;">For  : {$visit.patientName}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td colspan="2">

                                            {foreach $visit.raysresults as $ray}
                                            <table class="table  table-hover table-bordered">
                                                <tbody>
                                                    <tr>
                                                        <td> 
                                                            <label class="col-md-6 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">  
                                                                {$ray->invname} </a> 
                                                            </label>
                                                            <div class="col-md-3">
                                                                {if $visit.allowChange == 1 }
                                                                <input type="file" class="rayImgMulti form-control" id="rayImg{$ray->id}"   
                                                                       data-patientD="{$visit.patientD}" 
                                                                       data-colName="rayimg" data-id="{$ray->id}"  data-tableName="raysresults_img" 
                                                                       accept="image/*"  name="rayimg[]" multiple  >
                                                                {/if}
                                                            </div>
                                                            <div class="col-md-1">
                                                                <img src="{$hosturl}/../upload/loading.gif" id="talks-loading{$ray->id}" style="display:none;">
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div id="rayImgDiv{$ray->id}">
                                                                {assign var="i" value="1"}
                                                                {foreach $ray->imgs as $img}
                                                                <div class="col-md-2 wds20">
                                                                    <div class="row clinick ltr" >
                                                                        <div class="col-md-12">
                                                                            <div class="fileinput fileinput-new wds100" 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" 
                                                                                       {if $visit.allowChange != 1 } readonly   {/if}
                                                                                       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">
                                                                            {if $visit.allowChange == 1 }
                                                                            <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>
                                                                            {/if}
                                                                            <a class="btn btn-xs blue fright" download="{$visit.patientD} -  {$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}
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            {/foreach}

                        </div>
                        {else}
                        <div class="col-md-12">
                            <h3 style="text-align: center;color: red;"> No Data Available Now.</h3>
                        </div>

                        {/if}
                    </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>




