<? global $vis_language; ?>
<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title"><? echo $vis_language['TXTSENDEMAIL']; ?></h4>
    </div>
    <div class="modal-body">
    	<div class="form-group">
		    <select name="vis_template" id="vis_template" class="input-sm form-control selectpicker"  <? if(count($etemplate)>10) echo 'data-live-search="true"';?>><?
                     for($i=0;$i<count($etemplate);$i++){
                         $selected = ($etemplate[$i]['etemplate_id']==1)?"selected='selected'":"";
						  echo '<option '.$selected.' value="'.$etemplate[$i]['etemplate_id'].'">'.$etemplate[$i]['etemplate_name'].'</option>'; }?>
            </select>
        </div>
    </div>
    <div class="modal-footer">
		<a class="btn btn-default" data-dismiss="modal"><? echo $vis_language['TXTCANCEL']; ?></a>
			<a class="btn btn-primary" onclick="$('#vis_custom_emails').visExecution('load_operations',{'vis_module':'client', 'vis_operation':'send_custom_email','client_id':<? echo $data['client_id']; ?>,'vis_client_id':<? echo $data['client_id']; ?>,'domain_id':<? echo $data['domain_id']; ?>,'vis_domain':<? echo $data['domain_id']; ?>,'vis_template_id':$('#vis_template').val(),'vis_email':'<? echo $data['vis_email']; ?>','vis_to_email':'<? echo $data['vis_email']; ?>','vis_salt':'<? echo $data['vis_salt']; ?>', 'is_verified':<? echo $data['is_verified']; ?>});" data-dismiss="modal"><? echo $vis_language['TXTSEND']; ?></a> 
    </div>
  </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<div id="vis_custom_emails"></div>
<script> $(".selectpicker").selectpicker();</script>