
<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> Pictures and Videos
                        </div>
                    </div>

                    <div class="portlet-body" id="justfordrugs" >

                        <input type="hidden" id="sonarpage" value="1"/>
                        <input type="hidden" id="patientId" value="{$patientid}"/>
                        <input type="hidden" id="tdate" value="{$today}">
                        <input type="hidden" id="controllName" value="sonar"/>

                        <form class="" role="form" action="" method="post" id="sonardata" enctype="multipart/form-data">
                            <div class="tabbable tabbable-custom tabbable-noborder">
                                <ul class="nav nav-tabs" id="rowTab">


                                    <li class="aw_3d_list active"> <a href="#tab_0_0" data-toggle="tab"> Pictures </a> </li>
                                    <li class="aw_3d_list"> <a href="#tab_1_1" data-toggle="tab"> Videos </a> </li>

                                </ul>
                                <div class="tab-content">

                                    <!---======================================================== tab1============================================================================================ ----->
                                    <div class="tab-pane active" id="tab_0_0">

                                        <!-- BEGIN PAGE CONTENT-->
                                        <div class="row" id="pic_div">

                                            <div class="portlet-title tbox">
                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold uppercase"> Pictures </span>
                                                </div>
                                                <div class="actions col-md-6">
                                                    <button type="button" class="btn btn-xs blue fright" id="addPic"><i class="fa fa-plus"></i> Add</button>
                                                    <button type="button" class="btn btn-xs blue fright" id="printPic"><i class="fa fa-plus"></i> print</button>
                                                   <!-- <a href="ms-word:ofe|u|{$hosturl}/upload/summerresaerch.docx">Open Document in Word</a>-->
                                                </div>

                                            </div>
                                            {if empty($allsonar)}

                                            <input type="hidden" id="sonaritr" name="sonaritr" value="1">
                                            <div class="col-md-3">
                                                <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 datepicker updateElement txtc" id="sonardate1" data-tableName="sonar" data-colName="sonardate" data-id="{$newImgId}" value="{$today}"/>
                                                            <label for="form_control_1">Date</label>
                                                        </div>
                                                    </div>
                                                </div>

                                                <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: 250px; height: 170px;"> </div>
                                                            <div> <span class="btn default btn-file"> <span class="fileinput-new"> Select image </span> <span class="fileinput-exists"> Change </span>
                                                                    <input type="file" name="sonarimg1" id="sonarimg1" data-tableName="sonar" data-colName="imagename" data-id="{$newImgId}" class=" form-control sonarFile">
                                                                </span>  </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" id="notes1" data-tableName="sonar" data-colName="notes" data-id="{$newImgId}" name="notes"/>
                                                            <label for="form_control_1">Notes</label>
                                                        </div>
                                                    </div>


                                                </div>
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-6">
                                                        <button type="button" class="btn btn-xs red fright removesonar" id="delsonar1" data-tableName="sonar" data-id="{$newImgId}"><i class="fa fa-close"></i></button>
                                                        <input type="checkbox" class="imagePrint" id="imagePrint{$newImgId}" name="pic[]"  value="{$newImgId}" >
                                                    </div>
                                                </div>
                                            </div>

                                            {else}
                                            <input type="hidden" id="sonaritr" name="sonaritr" value="{$sonarcount}">
                                            {assign var="i" value="1"}
                                            {foreach $allsonar as $sonar}
                                            <div class="col-md-3">
                                                <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 datepicker updateElement txtc" id="sonardate{$i}" data-tableName="sonar" data-colName="sonardate" data-id="{$sonar.id}" value="{$sonar.sonardate}"/>
                                                            <label for="form_control_1">Date</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <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: 250px; height: 170px;"> 
                                                                <img {if $sonar.imagename} src="{$hosturl}/../upload/sonar/{$sonar.imagename}"{/if}/></div>
                                                            <!--<input type="hidden" id="imageurl" name="imageurl" value="{$editElement->photos}" />-->
                                                            <div> <span class="btn default btn-file"> <span class="fileinput-new"> Select image </span> <span class="fileinput-exists"> Change </span>
                                                                    <input type="file" name="sonarimg{$i}" id="sonarimg{$i}" data-tableName="sonar" data-colName="imagename" data-id="{$sonar.id}" class=" form-control sonarFile">
                                                                </span>  </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" id="notes{$i}" data-tableName="sonar" data-colName="notes" data-id="{$sonar.id}" value="{$sonar.notes}"/>
                                                            <label for="form_control_1">Notes</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-6">
                                                        
                                                        <button type="button" class="btn btn-xs red fright removesonar" id="delsonar{$i}" data-tableName="sonar" data-id="{$sonar.id}"><i class="fa fa-close"></i></button>
                                                        <input type="checkbox" class="imagePrint" id="imagePrint{$sonar.id}" name="pic[]"  value="{$sonar.id}"/> 
                                                        
                                                    </div>
                                                </div>

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

                                            {/if}

                                        </div>

                                    </div>


                                    <!-- END SAMPLE FORM PORTLET-->



                                    <!---- =================================================================tab 2 =======================================================================================------>
                                    <div class="tab-pane " id="tab_1_1">


                                        <!-- BEGIN PAGE CONTENT-->
                                        <div class="row" id="vid_div">

                                            <div class="portlet-title tbox">
                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold uppercase">Videos</span>
                                                </div>
                                                <div class="actions col-md-6">
                                                    <button type="button" class="btn btn-xs blue fright" id="addvid"><i class="fa fa-plus"></i> Add</button>
                                                </div>
                                            </div>

                                            {if empty($allsonarvid)}
                                            <input type="hidden" id="sonarviditr" name="sonarviditr" value="1">

                                            <div class="clearfix"></div>
                                            <div class="col-md-3 vid-sonar">
                                                <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 datepicker updateElement txtc" id="sonardatev1" data-tableName="sonar" data-colName="sonardate" data-id="{$newVideoId}" value="{$today}"/>
                                                            <label for="form_control_1">Date</label>
                                                        </div>
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input type="text" class="form-control updateElement txtl edited" id="originalname1" data-tableName="sonar" data-colName="originalname" data-id="{$newVideoId}" value="{$sonarData.originalname}"/>
                                                            <label for="originalname1">Video Name</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-12">
                                                        <div class="fileinput fileinput-new" data-provides="fileinput">
                                                            <div>
                                                                <span class="input-group-addon btn default btn-file"> 
                                                                    <span class="fileinput-new"> Select file </span> 
                                                                    <span class="fileinput-exists"> Change </span>
                                                                    <input type="file" name="vediourl1" id="vediourl1" data-itr="1" accept="video/mp4" class="updateElement form-control sonarvid"  data-tableName="sonar" data-colName="vediourl" data-id="{$newVideoId}">
                                                                </span>  
                                                                <a  class="input-group-addon btn vid-show" id="show1" data-href="" style="display: none;"> Show </a> 
                                                                <a  class="input-group-addon btn vid-download" id="download1" data-href="" style="display: none;" href="{$hosturl}/controllers/sonar.php?ac=downloadfile&id={$newVideoId}" > Download </a> 
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-6">
                                                        <button type="button" class="btn btn-xs red fright removesonar" id="delsonar1" data-tableName="sonar" data-id="{$newVideoId}"><i class="fa fa-close"></i></button>
                                                    </div>
                                                </div>




                                                <!-- END SAMPLE FORM PORTLET-->

                                            </div>
                                            {else}
                                            <input type="hidden" id="sonarviditr" name="sonarviditr" value="{$sonarVidcount}">
                                            {assign var="j" value="1"}
                                            {foreach $allsonarvid as $sonar}
                                            <div class="col-md-3 vid-sonar">
                                                <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 datepicker updateElement txtc" id="sonardatev{$j}" data-tableName="sonar" data-colName="sonardate" data-id="{$sonar.id}" value="{$sonar.sonardate}"/>
                                                            <label for="sonardate{$j}">Date</label>
                                                        </div>
                                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                                            <input type="text" class="form-control updateElement txtl edited" id="originalname{$j}" data-tableName="sonar" data-colName="originalname" data-id="{$sonar.id}" value="{$sonar.originalname}"/>
                                                            <label for="originalname{$j}">Video Name</label>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="row clinick ltr" >
                                                    <div class="col-md-12">
                                                        <div class="fileinput fileinput-new" data-provides="fileinput">
                                                            <div>
                                                                <span class="input-group-addon btn default btn-file"> 
                                                                    <span class="fileinput-new" {if $sonar.vediourl}style="display: none;" {/if}> Select file </span> 
                                                                    <span class="fileinput-exists" {if $sonar.vediourl} style="display: block;" {/if}> Change </span>
                                                                    <input type="file" name="vediourl{$j}" data-itr="{$j}" id="vediourl{$j}" accept="video/mp4" class="updateElement form-control sonarvid"  data-tableName="sonar" data-colName="vediourl" data-id="{$sonar.id}">
                                
                                                                </span> 
                                                                <a  class="input-group-addon btn vid-show" id="show{$j}" {if !$sonar.vediourl}style="display: none;" {/if} data-file="{$sonar.vediourl}"> Show </a> 
                                                               <a  class="input-group-addon btn vid-download" id="download{$j}" {if !$sonar.vediourl}style="display: none;" {/if}  href="{$hosturl}/controllers/sonar.php?ac=downloadfile&id={$sonar.id}" > Download </a> 
                                                                
                                                            </div>
                                                        </div>

                                                    </div>
                                                </div>
                                                <div class="row clinick ltr" >
                                                    <div class="col-md-6">
                                                        <button type="button" class="btn btn-xs red fright removesonar" id="delsonar{$j}" data-tableName="sonar" data-id="{$sonar.id}"><i class="fa fa-close"></i></button>
                                                    </div>
                                                </div>



                                                <!-- END SAMPLE FORM PORTLET-->

                                            </div>
                                            {assign var="j" value=$j+1}
                                            {/foreach}

                                            {/if}
                                        </div>
                                        <div class="clearfix"></div>
                                        
                                    </div>
                                    

                                    <!-- END PAGE CONTENT-->







                                </div>


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

        </div>
        
</div>
</div>			
		<div id="talks-loading" style="z-index: 3000;position: absolute;top: 33%;right: 3%;left: 7%;display:none; height: 65%; background-color: rgba(0, 0, 0,0.27); padding-top: 10%;" align="center">
            <img src="{$hosturl}/upload/loading.gif">
        </div>



<div class="all">
    <!---------------------------------------------------------------------------add Drugs Model-------------------------------------------------------------------------------------->
    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showVideo" style="min-width:1000px;">
        <div class="modal-dialog  modal-lg wds90">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                    <h4 class="modal-title">  </h4>
                </div>
                <div class="modal-body">
                    <div class="portlet-body">
                        
                            <div class="row">
                                <div class="col-md-12">
                                    <video   id="video_vediourl" controls>
                                       <source src="" type="video/mp4" id="source_vediourl">
                                            Your browser does not support HTML5 video.
                                        </video>
                                </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>
    
    <div id="pImg"></div>


</div>



