AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.103
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/public_html/lrsys_apps/meridional/application/plugins/module_hr/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/public_html/lrsys_apps/meridional/application/plugins/module_hr/assets/js/default.js
$(function(){

  $(".select2").select2({
    theme: "bootstrap"
  });

  $(".dt").mask("99/99/9999");

  $(".dt").datepicker({
      dateFormat: "dd/mm/yyyy",
      autoclose: true
  }).on('change', function () {
      $(this).datepicker('hide');
  });

  $(".clss_hr").on("keyup", function(){
    validate = $(this).val().split(":");
      if( (validate[0] > 23) ||
          (validate[1] > 59) ){
          $(this).val('');
          $(this).focus();
          return;
      }
  });

  $(".dt").on("change", function(){
    validate = $(this).val().split("/");
      if( (validate[0] > 31) ||
          (validate[1] > 12) ||
          (validate[2] < 1900) ){
          $(this).val('');
          $(this).focus();
          return;
      }
  });

  $(".progress").hide();
  $("#emsg").hide();
  var _url = $("#_url").val();

  $('.sun').hide();
  $('.rsuns').hide();

  $('#qtd_sun').on("keyup", function(){
    if($('#qtd_sun').val()>0)
      $('.sun').show();
    else
      $('.sun').hide();
      $('.suns').html('');
  });

  function progress(){
    var pbar = $('#progressbar');
    pbar.hide();

    pbar.progressbar({
        warningMarker: 100,
        dangerMarker: 100,
        maximum: 100,
        step: 15
    });
    var timer = setInterval(function () {
            pbar.progressbar('stepIt');

        }, 100);
    $('#ibox_form').block({ message: null });
    $('#progressbar').show();
    $('.progress').show();

    $('.progress .progress-bar').progressbar();
  }

  $('.sun').on("click", function(){
      progress();
      $('.suns').html('');
      valor = $('#qtd_sun').val();
      html = '<br><ul class="nav nav-tabs">';
      qtd = 1;
      while(valor>0){
        html +='<li role="presentation" class=""><a data-toggle="tab" href="#sun'+qtd+'">'+qtd+'º filho</a></li>';
        valor = valor-1;
        qtd = qtd+1;
      }
      html+='</ul>';
      valor = $('#qtd_sun').val();
      qtd = 1;
      html += '<div class="tab-content col-sm-6">';
      while(valor>0){
        html +='<div id="sun'+qtd+'" class="tab-pane fade">';
        html +='<br><input type="text" id="nm_sun_'+qtd+'" name="nm_sun_'+qtd+'" class="form-control" maxlength="100" placeholder="Digite o nome do filho">';
        html +='<br><input type="text" id="dt_sun_'+qtd+'" name="dt_sun_'+qtd+'" class="form-control dt" datepicker data-date-format="dd/mm/yyyy" data-auto-close="true" placeholder="Digite a data de nascimento">';
        html +='<br><input type="text" id="lcl_sun_'+qtd+'" name="lcl_sun_'+qtd+'" class="form-control" maxlength="100" placeholder="Digite o local de nascimento">';
        html +='<br><input type="text" id="liv_sun_'+qtd+'" name="liv_sun_'+qtd+'" class="form-control" maxlength="100" placeholder="Digite o livro.">';
        html +='<br><input type="text" id="car_sun_'+qtd+'" name="car_sun_'+qtd+'" class="form-control" maxlength="100" placeholder="Digite o cartório de nascimento">';
        html +='<br><input type="text" id="reg_sun_'+qtd+'" name="reg_sun_'+qtd+'" class="form-control" maxlength="100" placeholder="Digite o registro do filho">';
        html +='</div>';
        valor = valor-1;
        qtd = qtd+1;
      }
      html+="</div>";
      $(html).appendTo('.suns');
      $(".dt").mask("99/99/9999");
      $(".dt").datepicker({
          dateFormat: "dd/mm/yyyy",
          autoclose: true
      }).on('change', function () {
          $(this).datepicker('hide');
      });
      $('.progress').hide();
      $('#ibox_form').unblock();
      $('.rsuns').show();
  });

	$('.redf_hr_on').hide();

	$(".clss_hr").mask("99:99");

  $("#func_salary").maskMoney();

	$('.redf_hr').on('click', function(){
		$('.redf_hr_on').show();
	});

	$('.clse_redf_hr').on('click', function(){
		$('.redf_hr_on').hide();
	});

	$('.redf_hr_func').on('click', function(){
		if($('#nv_hr_ini_mn').val() != ''){
			$('.hr_ini_manha').val($('#nv_hr_ini_mn').val());
		}

		if($('#nv_hr_fim_mn').val() != ''){
			$('.hr_fim_manha').val($('#nv_hr_fim_mn').val());
		}

		if($('#nv_hr_ini_tr').val() != ''){
			$('.hr_ini_tard').val($('#nv_hr_ini_tr').val());
		}

		if($('#nv_hr_fim_tr').val() != ''){
			$('.hr_fim_tard').val($('#nv_hr_fim_tr').val());
		}
	});


  $("#submit_func").click(function (e) {
      progress();
      e.preventDefault();
      $('#fForm').block({message: block_msg});
      var _url = $("#_url").val();
      $.ajax({
       type: 'POST',
       url: _url+'module_hr/hr/add-post',
       data: new FormData($("#fForm")[0]),
       processData: false, 
       contentType: false, 
       success: function(data){
         if (data.indexOf('OK')>-1) {
              id = data.split('_');
              setUrlDropzne(id[1]);
              execQueue();
              setTimeout(function(){
                window.location = _url + 'module_hr/hr/list';
              }, 2000);
          } else {
              $('#fForm').unblock();
              var body = $("html, body");
              body.animate({scrollTop: 0}, '1000', 'swing');
              $("#emsgbody").html(data);
              $("#emsg").show("slow");
              execQueue();
          }
          $('.progress').hide();
          $('#ibox_form').unblock();
        }  
    });
                    
  });

    /////////////////////////FIM IMAGES

    //NOVO SETOR
    var ms_add_sector = $("#msg_add_sect").val();
    var ms_add_sector_nm = $("#msg_add_sect_nm").val();
    var ib_form_bootbox_1 = "<form class=\"form-horizontal push-10\" method=\"post\" onsubmit=\"return false;\">\n    <div class=\"form-group\">\n        <div class=\"col-xs-12\">\n            <div class=\"form-material floating\">\n                <input class=\"form-control\" type=\"text\" id=\"sector_name\" name=\"sector_name\">\n                <label for=\"envato_api_key\">" + ms_add_sector_nm + "</label>\n                           </div>\n        </div>\n    </div>\n\n</form>";
    $("#add_new_sector").click(function (e) {
        e.preventDefault();
        //cria o bootbox para cadastrar novo setor
            bootbox.dialog({
            title: ms_add_sector,
            message: ib_form_bootbox_1,
            buttons: {
                success: {
                    label: "Save",
                    className: "btn-primary",
                    callback: function () {
                        var sector_name_val = $('#sector_name').val();
                        if (sector_name_val != '') {
                            $.post(_url + "module_hr/hr/add-sector", {sector_name: sector_name_val})
                              .done(function (data) {
                                  if ($.isNumeric(data)) {
                                      loadSector();
                                      $('#sector_name').val("");
                                  } else {
                                      bootbox.alert(data);
                                      $('#sector_name').val("");
                                  }
                              });
                        }
                    }
                }
            },
            show: true
        });
    });

    function loadSector(){
        $.getJSON($("#_url").val() + 'module_hr/hr/sectors',function (j) {
            var options = '<option></option>';
            for (var i = 0; i < j.length; i++) {
                options += '<option value="' + j[i].id + '">' + j[i].name + '</option>';
            }
            $('#sector_m').html(options);
        });
    }

    //FIM SETOR

    //NOVA FUNÇÃO
    var ms_add_function = $("#msg_add_func").val();
    var ms_add_function_nm = $("#msg_add_func_nm").val();
    var ib_form_bootbox_2 = "<form class=\"form-horizontal push-10\" method=\"post\" onsubmit=\"return false;\">\n    <div class=\"form-group\">\n        <div class=\"col-xs-12\">\n            <div class=\"form-material floating\">\n                <input class=\"form-control\" type=\"text\" id=\"function_name\" name=\"function_name\">\n                <label for=\"envato_api_key\">" + ms_add_function_nm + "</label>\n                           </div>\n        </div>\n    </div>\n\n</form>";

    $("#add_new_function").click(function (e) {
        e.preventDefault();
        //cria o bootbox para cadastrar novo funcao
            bootbox.dialog({
            title: ms_add_function,
            message: ib_form_bootbox_2,
            buttons: {
                success: {
                    label: "Save",
                    className: "btn-primary",
                    callback: function () {
                        var function_name_val = $('#function_name').val();
                        if (function_name_val != '') {
                            $.post(_url + "module_hr/hr/add-function", {function_name: function_name_val})
                              .done(function (data) {
                                  if ($.isNumeric(data)) {
                                      loadFunction();
                                      $('#function_name').val("");
                                  } else {
                                      bootbox.alert(data);
                                      $('#function_name').val("");
                                  }
                              });
                        }
                    }
                }
            },
            show: true
        });
    });

    function loadFunction(){
        $.getJSON($("#_url").val() + 'module_hr/hr/functions',function (j) {
            var options = '<option></option>';
            for (var i = 0; i < j.length; i++) {
                options += '<option value="' + j[i].id + '">' + j[i].name + '</option>';
            }
            $('#function_m').html(options);
        });
    }

    //FIM FUNÇÃO

    loadSector();
    loadFunction();
	 


   ////////////////////////IMAGES
    var idRefImgs = "" /*id apos gravar a primeira imagem.*/
    var upload_resp;
    var $ib_form_submit = $("#submit");
    var ib_file_photo;
    var ib_file_rg;
    var ib_file_cpf;
    var ib_file_tit_eleit;
    var ib_file_comp_escol;
    var ib_file_cnh;
    var ib_file_reserv;
    var ib_file_residen;
    var ib_file_ctps;
    var ib_file_ex_medc;

    criaDropzone1(_url + "module_hr/hr/empl-add-image/7");
    criaDropzone2(_url + "module_hr/hr/empl-add-image/9");
    criaDropzone3(_url + "module_hr/hr/empl-add-image/4");
    criaDropzone4(_url + "module_hr/hr/empl-add-image/10");
    criaDropzone5(_url + "module_hr/hr/empl-add-image/2");
    criaDropzone6(_url + "module_hr/hr/empl-add-image/1");
    criaDropzone7(_url + "module_hr/hr/empl-add-image/8");
    criaDropzone8(_url + "module_hr/hr/empl-add-image/3");
    criaDropzone9(_url + "module_hr/hr/empl-add-image/5");
    criaDropzone10(_url + "module_hr/hr/empl-add-image/6");
    
    function criaDropzone1(urlId){

        ib_file_photo = new Dropzone("#upload_container_1",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/7',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_photo.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_photo.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_photo.removeFile(file);
            }
        });
    }

    function criaDropzone2(urlId){

        ib_file_rg = new Dropzone("#upload_container_2",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/9',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_rg.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_rg.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_rg.removeFile(file);
            }
        });
    }

    function criaDropzone3(urlId){

        ib_file_cpf = new Dropzone("#upload_container_3",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/4',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_cpf.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_cpf.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_cpf.removeFile(file);
            }
        });
    }

    function criaDropzone4(urlId){

        ib_file_tit_eleit = new Dropzone("#upload_container_4",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/10',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_tit_eleit.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_tit_eleit.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_tit_eleit.removeFile(file);
            }
        });
    }

    function criaDropzone5(urlId){

        ib_file_comp_escol = new Dropzone("#upload_container_5",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/2',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_comp_escol.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_comp_escol.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_comp_escol.removeFile(file);
            }
        });
    }

    function criaDropzone6(urlId){

        ib_file_cnh = new Dropzone("#upload_container_6",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/1',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_cnh.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_cnh.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_cnh.removeFile(file);
            }
        });
    }

    function criaDropzone7(urlId){

        ib_file_reserv = new Dropzone("#upload_container_7",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/8',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_reserv.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_reserv.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_reserv.removeFile(file);
            }
        });
    }

    function criaDropzone8(urlId){

        ib_file_residen = new Dropzone("#upload_container_8",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/3',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_residen.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_residen.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_residen.removeFile(file);
            }
        });
    }

    function criaDropzone9(urlId){

        ib_file_ctps = new Dropzone("#upload_container_9",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/5',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_ctps.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_ctps.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_ctps.removeFile(file);
            }
        });
    }

    function criaDropzone10(urlId){

        ib_file_ex_medc = new Dropzone("#upload_container_10",
            {
                url: urlId,
                maxFiles: 1,
                maxFilesize: 4,
                acceptedFiles: "image/*",
                uploadMultiple: false,
                autoProcessQueue: false,
                addRemoveLinks: true,
                dictRemoveFile: 'Remover',
                dictCancelUpload: 'Cancelar',
                dictInvalidFileType: 'Arquivo inválido! Apenas imagens.',
                dictFileTooBig: 'Limite de 4 Mb excedido.',
                dictMaxFilesExceeded: 'Você só pode enviar 1 imagem.',
                init: function() {
                  // //console.log(this);
                  this.on("maxfilesexceeded", function(file) {
                        this.removeAllFiles();
                        this.addFile(file);
                  });              
                },
                removedfile: function (file) {
                    $.ajax({
                        type: 'POST',
                        url: _url + 'module_hr/hr/empl-delete-image/6',
                        data: "id=" + $("#id_ref_imgs").val(),
                        dataType: 'html'
                    }).done(function (data) {
                        var obj = JSON.parse(data);
                        toastr.success(obj.msg);
                        if (obj.status == 'OK') {
                            var _ref;
                            return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
                        }
                    });
                }
            }
        );
        ib_file_ex_medc.on("sending", function () {
            $ib_form_submit.prop('disabled', true);
        });
        ib_file_ex_medc.on("success", function (file, response) {
            $ib_form_submit.prop('disabled', false);
            upload_resp = response;
            if (upload_resp.success == 'Yes') {
                if($("#id_ref_imgs").val() == "")
                  $("#id_ref_imgs").val(upload_resp.id);
                if(idRefImgs == "")
                  setUrlDropzne(upload_resp.id);
                toastr.success(upload_resp.msg);
            } else {
                toastr.error(upload_resp.msg);
                ib_file_ex_medc.removeFile(file);
            }
        });
    }

    function execQueue(){
      ib_file_photo.processQueue();
      ib_file_rg.processQueue();
      ib_file_cpf.processQueue();
      ib_file_tit_eleit.processQueue();
      ib_file_comp_escol.processQueue();
      ib_file_cnh.processQueue();
      ib_file_reserv.processQueue();
      ib_file_residen.processQueue();
      ib_file_ctps.processQueue();
      ib_file_ex_medc.processQueue();
    }

    if($("#id_ref_imgs").val()!="")
      setUrlDropzne($("#id_ref_imgs").val());

    function setUrlDropzne(id){
      ib_file_photo.options.url = _url + "module_hr/hr/empl-add-image/7/"+id;
      ib_file_rg.options.url = _url + "module_hr/hr/empl-add-image/9/"+id;
      ib_file_cpf.options.url = _url + "module_hr/hr/empl-add-image/4/"+id;
      ib_file_tit_eleit.options.url = _url + "module_hr/hr/empl-add-image/10/"+id;
      ib_file_comp_escol.options.url = _url + "module_hr/hr/empl-add-image/2/"+id;
      ib_file_cnh.options.url = _url + "module_hr/hr/empl-add-image/1/"+id;
      ib_file_reserv.options.url = _url + "module_hr/hr/empl-add-image/8/"+id;
      ib_file_residen.options.url = _url + "module_hr/hr/empl-add-image/3/"+id;
      ib_file_ctps.options.url = _url + "module_hr/hr/empl-add-image/5/"+id;
      ib_file_ex_medc.options.url = _url + "module_hr/hr/empl-add-image/6/"+id;
      idRefImgs = id;
    }
              

});

Anon7 - 2022
AnonSec Team