<? global $vis_language; ?> 
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
   <div class="col-sm-6">
      <h3 class="m-b-xs text-black"><?  echo $vis_language['TXTADDEXOTELAPP']; ?></h3>
      <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
		<li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME']; ?></a></li>
		<li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><? echo $vis_language['TXTSETTINGS']; ?></a></li>
		<li><a class="link" href="#/setting/exotel/<? echo $vis_language['TXTEXOTEL'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTEXOTEL'];?>',{'vis_module':'setting','vis_operation':'exotel'});"><? echo $vis_language['TXTEXOTEL']; ?></a></li>
		<li><a class="link" href="#/setting/exotel_apps/<? echo $vis_language['TXTEXOTELAPPS'].'/'.$action[4];?>" ><? echo $vis_language['TXTEXOTELAPPS']; ?></a></li>
		<li class="active"><? echo $vis_language['TXTADDEXOTELAPP']; ?></li>
	 </ul>
   </div> 
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $vis_language['TXTADDEXOTELAPP']; ?></header>
      <form class="form-horizontal" data-validate="parsley" id="vis_new_exotel_app" name="vis_new_exotel_app" method="post" >
	  
         <div class="panel-body">
            <div class="col-md-12">
               <div class="wrapper">
				    <div class="form-group">
					<label class="col-sm-2 control-label p-d-sm"><? echo $vis_language['TXTTITLE']; ?></label>
                    <div class="col-sm-10">
                        <input class="form-control input-sm" type="text" name="vis_title" id="vis_title" value="">
                     </div>
				  </div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label p-d-sm"><? echo $vis_language['TXTAPPID']; ?></label>
                    <div class="col-sm-10">
                       <input class="form-control input-sm" type="text"  name="vis_exotel_app_id" id="vis_exotel_app_id" value=""  >
                    </div>
				  </div>
				  <div class="form-group">
                    <label class="col-sm-2 control-label p-d-sm"><? echo $vis_language['TXTDEPARTMENT']; ?></label>
                    <div class="col-sm-10">
                       <select name="vis_department" id="vis_department_new" class="form-control input-sm selectpicker"<? if(count($departments)>10) echo ' data-live-search="true"';?> ><?
									if($departments!=-1) for($i=0;$i<count($departments); $i++)
									echo '<option value="'.$departments[$i]['domain_id'].':'.$departments[$i]['department_id'].'">'.$departments[$i]['domain_name'].' :: '.$departments[$i]['department_name'].'</option>' ?>
									</select>
                  </div>
				  </div>					  
				  <div class="form-group">
                    <label class="col-sm-2 control-label p-d-sm"><? echo $vis_language['TXTEXOPHONE']; ?></label>
                    <div class="col-sm-8">
					    <input id="vis_exo_phone1"   name="vis_exo_phone[]" class="form-control input-sm " type="text" value="" placeholder="04439592073" onkeypress="return isNumberKey(event)" >
						<span id="exo1"></span>
                    </div>
					<div class="col-sm-2">
						  <label>
						  <button type="button" class="btn btn-primary btn-xs"  onclick="javascript:vis_add_new()"><? echo $vis_language['TXTADDNEW']; ?></button>
						  </label>
								  
					   </div>
				  </div>
				   <div class="form-group">
					<label class="col-sm-2 control-label" ><? echo $vis_language['TXTAUTOTICKETECREATION']; ?></label>
					<div class="col-sm-10">
						<label class="switch"  value="1" radio-no-uncheck  >
						<input type="checkbox"  name="vis_auto_tickete"  id="vis_auto_tickete" value="1"   checked="checked" > 
						<span></span>
						</label>
					</div>
				  </div>
				
				   <input type="hidden" id="exo_cnt" value="1" >
				    <input type="hidden" id="vis_integration_id" name="vis_integration_id" value="<?php echo $action[4]; ?>" >
				  
               </div>
            </div>
            </div>
      </form>
        <div class="padder">
		    <div class="line b-b line-lg pull-in"></div><br/>
         <div class="col-sm col-sm-offset-2">
            <button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'add_exotel_app', 'vis_form':'vis_new_exotel_app' })"><? echo $vis_language['TXTADD']; ?></button>
         </div><br/>
      </div>
   </section>
</section>
<script type="text/javascript">
    $(".selectpicker").selectpicker();	
    function vis_add_new(){ 
		var exo_main = $("#exo_cnt").val();
		exo_cnt= Math.round(exo_main)+1;
		$("#exo"+exo_main).html('<br><input id="vis_exo_phone'+exo_cnt+'"   name="vis_exo_phone[]" class="form-control input-sm " type="text" value="" placeholder="04439592073" onkeypress="return isNumberKey(event)"  ><span id="exo'+exo_cnt+'"></span>');		
								
		$("#exo_cnt").val(exo_cnt);
	}
	function vis_remove_exophone(){ 
		var exo_main = $("#exo_cnt").val();
		exo_cnt= Math.round(exo_main)+1;
	}	
	 function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }


</script>
