⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
crm.dev-unit.com
/
public
/
assets
/
js
/
leads
/
View File Name :
create-edit.js
(()=>{"use strict";$(document).ready((function(){$("#leadTagID").select2({width:"calc(100% - 44px)",placeholder:Lang.get("messages.placeholder.select_tags")}),$("#memberId,#countryId,#languageId").select2({width:"100%"}),$("#sourceId").select2({width:"calc(100% - 44px)",placeholder:Lang.get("messages.placeholder.select_source")}),$("#statusId").select2({width:"calc(100% - 44px)",placeholder:Lang.get("messages.placeholder.select_status")}),window.toggleDateField=function(e){!0===$(e).prop("checked")?$("#contactForm").slideUp():$("#contactForm").slideDown()},$(document).on("change","#checkContact",(function(){toggleDateField("#checkContact")})),"undefined"!=typeof isEdit&&isEdit&&toggleDateField("#checkContact"),$("#contactDateId").datetimepicker({format:"YYYY-MM-DD HH:mm:ss",useCurrent:!0,sideBySide:!0,icons:{up:"fa fa-chevron-up",down:"fa fa-chevron-down",next:"fa fa-chevron-right",previous:"fa fa-chevron-left"}}),$("#leadDescription").summernote({minHeight:200,toolbar:[["style",["bold","italic","underline","clear"]],["font",["strikethrough"]],["para",["paragraph"]]]}),$(document).on("submit","#createLead, #editLead",(function(){jQuery(this).find("#btnSave").button("loading");var e=""===$("<div />").html($("#leadDescription").summernote("code")).text().trim().replace(/ \r\n\t/g,"");if($("#leadDescription").summernote("isEmpty"))$("#leadDescription").val("");else if(e){return displayErrorMessage("Description field is not contain only white space"),jQuery(this).find("#btnSave").button("reset"),!1}if(""!==$("#error-msg").text())return $("#phoneNumber").focus(),!1})),$(document).on("blur","#website",(function(){var e=$(this).val();isEmpty(e)?$("#website").val(""):(e=websiteURLConvert(e),$("#website").val(e))})),window.websiteURLConvert=function(e){return~e.indexOf("http")||(e="http://"+e),e}})),$(document).on("submit","#addNewForm",(function(e){e.preventDefault(),processingBtn("#addNewForm","#btnSave","loading"),$.ajax({url:route("lead.source.store"),type:"POST",data:$(this).serialize(),success:function(e){if(e.success){displaySuccessMessage(e.message),$("#addModal").modal("hide");var t={id:e.data.id,name:e.data.name},a=new Option(t.name,t.id,!1,!0);$("#sourceId").append(a).trigger("change")}},error:function(e){displayErrorMessage(e.responseJSON.message)},complete:function(){processingBtn("#addNewForm","#btnSave")}})})),$("#addModal").on("hidden.bs.modal",(function(){resetModalForm("#addNewForm","#validationErrorsBox")})),$(document).on("submit","#addLeadStatusForm",(function(e){e.preventDefault(),processingBtn("#addLeadStatusForm","#btnSave","loading"),$.ajax({url:route("lead.status.store"),type:"POST",data:$(this).serialize(),success:function(e){if(e.success){displaySuccessMessage(e.message),$("#addLeadStatusModal").modal("hide");var t={id:e.data.id,name:e.data.name},a=new Option(t.name,t.id,!1,!0);$("#statusId").append(a).trigger("change")}},error:function(e){displayErrorMessage(e.responseJSON.message)},complete:function(){processingBtn("#addLeadStatusForm","#btnSave")}})})),$("#addLeadStatusModal").on("hidden.bs.modal",(function(){resetModalForm("#addLeadStatusForm","#validationErrorsBox")}))})();