<? global $vis_language;?>
<section class="padder">
   <section class="panel-default">
      <div class="panel-body">
         <div id="vis_details_list" class="vis_details_list">
            <form class="form-horizontal" data-validate="parsley" id="vis_mailqueue_form" name="vis_mailqueue_form" method="post" >
               <div class="panel-body">
                  <div class="form-group">
                     <label class="col-sm-3 control-label">Default <? echo $vis_language['TXTEMAIL']; ?></label>
                     <div class="col-sm-9">
                        <label id="defaultemail" class="form-control input-sm"><? echo $mailqueue_details['email']; ?></label>
                     </div>
                  </div>
                  <div class="form-group">
                     <label class="col-sm-3 control-label">Enter your company <? echo $vis_language['TXTEMAIL']; ?></label>
                     <div class="col-sm-9">
                        <input class="form-control input-sm" type="text"  name="vis_mailqueue" id="vis_mailqueue" onblur="vis_queue_disp()" value="<? echo $mailqueue_details['email']; ?>">
                     </div>
                  </div>
                  <div class="line b-b line-lg pull-in"></div>
                  <br/>
                  <div class="form-group">
                     <div class="col-sm-12 text-left">
                     <?=$operation['view_note']?>
                     </div>
                     </div>             
                  <div class="form-group">
                     <div class="col-sm-12 text-right">
                        <button type="button" class="btn btn-primary" onclick="return checkmailqueuedata();"><? echo $vis_language['TXTNEXT']; ?></button>
                     </div>
                  </div>
               </div>
               <input type="hidden" name="vis_mailqueue_id" value="<? echo $mailqueue_details['mailqueue_id']; ?>" />
               <input type="hidden" name="vis_operation" value="update_mailqueue_popup" />
               <input type="hidden" name="vis_module" value="setting" />
            </form>
		</div>
      </div>
   </section>
</section>

<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>
<script src="<?= VIS_PATH_SCRIPT; ?>colorpicker/js/bootstrap-colorpicker.js"></script>
<script type="text/javascript" language="javascript" >
 $(".selectpicker").selectpicker();
   
   function vis_queue_disp(){
       var email = document.getElementById('vis_mailqueue').value;
       document.getElementById('defaultemail').innerHTML=email;
	   document.getElementById('companyemailid').innerHTML=email;
   }
   
   
function checkmailqueuedata()
{ 
	var checkmsg='<?=$vis_language['MSGSUCCOPRT']?>';
	$.ajax({
            url: 'index.php',
            type: "POST",
           data: { 'vis_action': $("#vis_mailqueue_form").serialize(), 'vis_module': 'setting', 'vis_operation': 'update_mailqueue_popup', 'vis_form': 'vis_mailqueue_form' },
           success: function(data) {
			  if(data==1)
				{
				$("#vis_details_list").visExecution("load_operations",{"vis_module":"setting", "vis_operation":"new_smtp_popup"}); 
				//$("#vis_global_msg_div").visInterface("load_global_message", '<div class="alert-success">Operation completed successfully</div>');
				set_active_tab('smtp');
				}else{
				$("#vis_global_msg_div").visInterface("load_global_message", data);
				}
                 
              }
           
        });
		
}
</script>

