<commit_before><link rel="stylesheet" type="text/css" href="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-summernote/summernote.css">

<script src="<?php echo $this->basePath()?>/metronic/theme/assets/admin/pages/scripts/components-editors.js"></script>
<script type="text/javascript" src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script>
<script type="text/javascript" src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-markdown/lib/markdown.js" type="text/javascript"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-markdown/js/bootstrap-markdown.js" type="text/javascript"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-summernote/summernote.min.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {       
   ComponentsEditors.init();
});   
</script>


<div class="row">
					<div class="col-md-12">
						<!-- BEGIN SAMPLE FORM PORTLET-->
						<div class="portlet light">
							<div class="portlet-title">
								<div class="caption font-green-haze">
									<i class="icon-envelope font-green-haze"></i>
									<span class="caption-subject bold uppercase">  &nbsp;Enviar correo electr&oacute;nico   </span>
								</div>
								<div class="actions">									
									<a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title="">
									</a>
								</div>
							</div>
							<div class="portlet-body form">
						      <div class="form-body">
                              <div class="row">
										<div class="col-md-4 col-md-push-1 form-group form-md-line-input has-info ">
											<select onchange="buscaCampanas()" class="form-control" id="combo_sede" name="COD_SEDE">
                                            <option value="0">Seleccione una Sede</option>
                                            <?php for ($i=0;$i<count($sedes);$i++){                                                      
                                                      echo "<option value=".$sedes[$i]['COD_SEDE'].">".$sedes  [$i]['NOMBRE_SEDE']."</option>\n";
                                               }        
                                                ?>

											</select>
											<label for="combo_sede"><strong>Sede</strong></label>
										</div>
                                                                                
                                        <div class="col-md-4 col-md-push-2 form-group form-md-line-input has-info ">
											<select class="form-control" id="combo_campana" name="ID_CAMPANA" onclick="muestraCuerpo()">                                                                                 

											</select>
											<label for="combo_campanas"><strong>Campa&ntilde;as</strong></label>
										</div>
                                </div>
                                <div id="cuerpo_correo" class="row hidden">
					<div class="col-md-12">
						<!-- BEGIN EXTRAS PORTLET-->
						<div class="portlet box blue-hoki">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-edit"></i>Redactar correo
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse">
									</a>  
                                    <a onclick="limpia()" class="reload">
									</a>                                  
								</div>
							</div>
							<div class="portlet-body form">
								<form class="form-horizontal form-bordered">
									<div class="form-body">
										<div class="form-group">
											<label class="control-label col-md-1">Cuerpo correo </label>
											<div class="col-md-11">
												<div name="summernote" id="summernote_1">
												</div>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
                <div  id="btn_correo" class="row hidden">
					<div class="col-md-6 col-md-push-3 text-center">                                
                                <a onclick="enviaCorreos()" class="btn green"><i class="fa fa-paper-plane"></i> &nbsp;Enviar Correo a X prospectos</a>
					</div>
				</div>

                              </div>
						
    
                                
                                
                                
                            </div>
                                
                                

                            </div>
                        </div>
                   </div>
<script>
function limpia(){    
setTimeout(function(){
  $(".note-editable").empty()
}, 900);   
}
function buscaCampanas(){
postData = {'COD_SEDE' : $("#combo_sede").val()}
$.ajax(
    {
        url : '<?php echo $this->basePath()."/admincentral/correo/getcampanas"?>',
        type: "POST",
        data : postData,
        dataType : 'json',
        success : function(response) {         
        var combo1 = $("#combo_campana");                          
         // Limpiamos combos
         combo1.find('option').remove();                
         //Cagamos combo1
         $(response.campanas).each(function(i, v){ // indice, valor                    
         combo1.append('<option value="' + response.campanas[i]['ID_CAMPANA'] + '">' + response.campanas[i]['NOMBRE_CAMPANA'] + '</option>');
         })                          
         combo1.prop('disabled', false);              
        },
        error: function(jqXHR, textStatus, errorThrown) 
        {            
            toastr.warning("Error! Favor contactar con administrador del sistema"); 
        }
    });
}
function muestraCuerpo(){
    if($("#combo_campana").val()>0){
    $("#cuerpo_correo").removeClass("hidden");
    $("#btn_correo").removeClass("hidden");   
    }         
}
function enviaCorreos(){    
bootbox.confirm("<strong>Esta seguro ?", function(result) {
    if (result){      
      var postData = {
        'COD_SEDE': $("#combo_sede").val(),
        'ID_CAMPANA': $("#combo_campana").val(),
        'CUERPO':  $(".note-editable").html()      
      }
      $.ajax(
        {
          url : '<?php echo $this->basePath()."/admincentral/correo/enviar"?>',
            type: "POST",
            data : postData,
            dataType : 'json',
            success : function(response) {          
                toastr.success(response.descr);
        },
        error: function(jqXHR, textStatus, errorThrown) 
        {
            toastr.error('Error ! Favor contactar con administrador del sistema');            
           // $("#alertnok").html('<span class="alert alert-success">Error en el env&iacute;o de datos al servidor</span>');      
        }
    });                  
    }else{
    toastr.info('Env&iacute;o cancelado'); 
} 
    
});
}

</script><commit_msg>centos toastr top center<commit_after><link rel="stylesheet" type="text/css" href="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-summernote/summernote.css">

<script src="<?php echo $this->basePath()?>/metronic/theme/assets/admin/pages/scripts/components-editors.js"></script>
<script type="text/javascript" src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script>
<script type="text/javascript" src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-markdown/lib/markdown.js" type="text/javascript"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-markdown/js/bootstrap-markdown.js" type="text/javascript"></script>
<script src="<?php echo $this->basePath()?>/metronic/theme/assets/global/plugins/bootstrap-summernote/summernote.min.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {       
   ComponentsEditors.init();
});   
</script>


<div class="row">
					<div class="col-md-12">
						<!-- BEGIN SAMPLE FORM PORTLET-->
						<div class="portlet light">
							<div class="portlet-title">
								<div class="caption font-green-haze">
									<i class="icon-envelope font-green-haze"></i>
									<span class="caption-subject bold uppercase">  &nbsp;Enviar correo electr&oacute;nico   </span>
								</div>
								<div class="actions">									
									<a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title="">
									</a>
								</div>
							</div>
							<div class="portlet-body form">
						      <div class="form-body">
                              <div class="row">
										<div class="col-md-4 col-md-push-1 form-group form-md-line-input has-info ">
											<select onchange="buscaCampanas()" class="form-control" id="combo_sede" name="COD_SEDE">
                                            <option value="0">Seleccione una Sede</option>
                                            <?php for ($i=0;$i<count($sedes);$i++){                                                      
                                                      echo "<option value=".$sedes[$i]['COD_SEDE'].">".$sedes  [$i]['NOMBRE_SEDE']."</option>\n";
                                               }        
                                                ?>

											</select>
											<label for="combo_sede"><strong>Sede</strong></label>
										</div>
                                                                                
                                        <div class="col-md-4 col-md-push-2 form-group form-md-line-input has-info ">
											<select class="form-control" id="combo_campana" name="ID_CAMPANA" onclick="muestraCuerpo()">                                                                                 

											</select>
											<label for="combo_campanas"><strong>Campa&ntilde;as</strong></label>
										</div>
                                </div>
                                <div id="cuerpo_correo" class="row hidden">
					<div class="col-md-12">
						<!-- BEGIN EXTRAS PORTLET-->
						<div class="portlet box blue-hoki">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-edit"></i>Redactar correo
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse">
									</a>  
                                    <a onclick="limpia()" class="reload">
									</a>                                  
								</div>
							</div>
							<div class="portlet-body form">
								<form class="form-horizontal form-bordered">
									<div class="form-body">
										<div class="form-group">
											<label class="control-label col-md-1">Cuerpo correo </label>
											<div class="col-md-11">
												<div name="summernote" id="summernote_1">
												</div>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
                <div  id="btn_correo" class="row hidden">
					<div class="col-md-6 col-md-push-3 text-center">                                
                                <a onclick="enviaCorreos()" class="btn green"><i class="fa fa-paper-plane"></i> &nbsp;Enviar Correo a prospectos</a>
					</div>
				</div>

                              </div>
						
    
                                
                                
                                
                            </div>
                                
                                

                            </div>
                        </div>
                   </div>
<script>
toastr.options = {
  "positionClass": "toast-top-center",
}
function limpia(){    
setTimeout(function(){
  $(".note-editable").empty()
}, 900);   
}
function buscaCampanas(){
postData = {'COD_SEDE' : $("#combo_sede").val()}
$.ajax(
    {
        url : '<?php echo $this->basePath()."/admincentral/correo/getcampanas"?>',
        type: "POST",
        data : postData,
        dataType : 'json',
        success : function(response) {         
        var combo1 = $("#combo_campana");                          
         // Limpiamos combos
         combo1.find('option').remove();                
         //Cagamos combo1
         $(response.campanas).each(function(i, v){ // indice, valor                    
         combo1.append('<option value="' + response.campanas[i]['ID_CAMPANA'] + '">' + response.campanas[i]['NOMBRE_CAMPANA'] + '</option>');
         })                          
         combo1.prop('disabled', false);              
        },
        error: function(jqXHR, textStatus, errorThrown) 
        {            
            toastr.warning("Error! Favor contactar con administrador del sistema"); 
        }
    });
}
function muestraCuerpo(){
    if($("#combo_campana").val()>0){
    $("#cuerpo_correo").removeClass("hidden");
    $("#btn_correo").removeClass("hidden");   
    }         
}
function enviaCorreos(){    
bootbox.confirm("<strong>Esta seguro ?", function(result) {
    if (result){      
      var postData = {
        'COD_SEDE': $("#combo_sede").val(),
        'ID_CAMPANA': $("#combo_campana").val(),
        'CUERPO':  $(".note-editable").html()      
      }
      $.ajax(
        {
          url : '<?php echo $this->basePath()."/admincentral/correo/enviar"?>',
            type: "POST",
            data : postData,
            dataType : 'json',
            success : function(response) {          
                toastr.success(response.descr);
        },
        error: function(jqXHR, textStatus, errorThrown) 
        {
            toastr.error('Error ! Favor contactar con administrador del sistema');            
           // $("#alertnok").html('<span class="alert alert-success">Error en el env&iacute;o de datos al servidor</span>');      
        }
    });                  
    }else{
    toastr.info('Env&iacute;o cancelado'); 
} 
    
});
}

</script>
{'fraction_non_alphanumeric': 0.1556494480032711, 'fraction_numerical': 0.0043614556358184545, 'mean_word_length': 1.472620050547599, 'pattern_counts': {'":': 1, '<': 241, '<?xml version=': 0, '>': 259, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1560419', 'n_tokens_mistral': 5079, 'n_tokens_neox': 4209, 'n_words': 668}