| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/electrojournal.com/admin/ |
Upload File : |
$(document).ready(function(){
$('form').prop('autocomplete', 'off');$(':input,button').prop('disabled',false);$('.collapsible').collapsible();
$('form.ajax').live('submit', function(){
var l=$('.loader'),i=$(':input,button'),opt = this.option.value,cnf = this.confrm.value;
if(cnf && !confirm(cnf)){ $('button.h').hide(0);document.adminform.reset();_load(); return false; }
$.ajax({
type:$(this).prop('method'),
url:$(this).prop('action'),
data:new FormData(this),
cache:false,
dataType:'json',
contentType:false,
processData:false,
beforeSend:function(){
l.show(0),i.prop('disabled', true),$('.toast').remove();
},
success:function(json){
l.hide(0),i.prop('disabled',false);
if(typeof(json.stat) !== 'undefined' && json.stat === true){ _load(); if($('form.fix').is(':visible')){$('form.fix').trigger('reset').hide(0);} }
if(typeof(json.text) !== 'undefined'){ _show(json.text); }
if(typeof(json.surl) !== 'undefined'){ window.self.location = json.surl; }
if(typeof(json.path) !== 'undefined'){ $('form.fix').trigger('reset').hide(0);$('input.url').val(json.path).show(0); }
},
error:function(jqXHR, exception){
l.hide(0),i.prop('disabled', false);M.toast({html: eCTRL(jqXHR, exception), displayLength: 30000, inDuration: 0});
}
});
return false;
});
$('.checkall').live('click',function(){
if(this.checked){
$('.checkbox').each(function(){ this.checked = true;$(this).parents('tr').addClass('checked'); });
}else{
$('.checkbox').each(function(){ this.checked = false;$(this).parents('tr').removeClass('checked'); });
}
if($('.checkbox:checked').length > 0){
$('button.h').show(0);
}else{
$('button.h').hide(0);
}
});
$('.checkbox').live('click',function(){
if($('.checkbox:checked').length == $('.checkbox').length){ $('.checkall').prop('checked',true); }else{ $('.checkall').prop('checked',false); }
if($('.checkbox:checked').length > 0){ $('button.h').show(0); }else{ $('button.h').hide(0); }
if(this.checked){
$(this).parents('tr').addClass('checked');
}else{
$(this).parents('tr').removeClass('checked');
}
});
var lastChecked = null;
$('.checkbox').live('click',function(e){
if(!lastChecked){
lastChecked = this;
return;
}
if(e.shiftKey){
var start = $('.checkbox').index(this);
var end = $('.checkbox').index(lastChecked);
$('.checkbox').slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', lastChecked.checked).parents('tr').addClass('checked');
}
lastChecked = this;
});
$('table input[type=text]').live('focus', function(){
$(this).parents('tr').find('.checkbox').prop('checked',true);$('button.h').show(0);
});
$('table input[type=text],.form > .head input[type=text]').live('keypress', function(e){
if(e.keyCode == 13){
return false;
}
});
var e={cssClass:'el-rte',height:450,toolbar:'complete',cssfiles:['https://www.akinik.com/assets/css/elrte-inner.css']};
$('[class=htmleditor]').each(function(){$(this).elrte(e)});
$('.addgraphics').live('click',function(){
$('.morefield').append('<div class="wrap"><div class="row"><div class="col s12 m12 l12"><label for="picture">picture</label><div class="flex"><div class="file-field" style="width:100%;margin-right:10px"><div class="btn btn-flat grey lighten-1"><span>picture</span><input type="file" name="picture[]" multiple /></div><div class="file-path-wrapper"><input type="text" placeholder="Only JPG, JPEG, PNG and GIF allowed." class="file-path" /></div></div><button type="button" class="waves-effect btn-flat grey lighten-1" style="width:36px;height:32px;line-height:32px;padding:0" onclick="$(this).parents(\'.wrap\').remove();"><i class="material-icons">remove</i></button></div></div></div><div class="row"><div class="col s12 m12 l12"><label for="alternative_text">alternative text</label><br clear="all"><textarea rows="25" cols="25" name="alt[]" class="htmleditor" multiple></textarea></div></div></div>');
$('[class=htmleditor]').each(function(){$(this).elrte(e)});
});
window.addEventListener('popstate', function(e){ _load(); });
});
$('.int').live('paste input', function(e){
var initVal = $(this).val();
outputVal = initVal.replace(/[^0-9]/g, '');
if(initVal != outputVal)
$(this).val(outputVal);
});
$('.dec').live('paste input', function(e){
var initVal = $(this).val();
outputVal = initVal.replace(/[^0-9.]/g, '');
if(initVal != outputVal)
$(this).val(outputVal);
});
function _find(k){
k.value ? _purl(document.searchform.action + '/' + k.value) : k.focus();return false;
}
function _curl(param){
window.self.location = document.adminform.action + (param ? '/' + param : '');
}
function _purl(url){
history.pushState({}, null, url);$('html, body').animate({ scrollTop: 0 }, 300);_load();
}
function _show(html){
M.toast({html: html, displayLength: 30000, inDuration: 0});
}
function _page(page){
_purl('?pn=' + page.replace(/(^[\s]+|[\s]+$)/g, ''));
}
function _sopt(opt, cnf, btn){
if(typeof(opt) !== 'undefined'){ document.adminform.option.value = opt; }
if(typeof(cnf) !== 'undefined'){ document.adminform.confrm.value = cnf; } else { document.adminform.confrm.value = ''; }
if(typeof(btn) !== 'undefined'){ $(btn).parents('tr').find('.checkbox').prop('checked',true); }
}
function _load(){
$('#load').load(window.self.location + ' #load>*','',function(){
$('form').prop('autocomplete', 'off');$(':input,button').prop('disabled',false);$('.collapsible').collapsible();
var e={cssClass:'el-rte',height:450,toolbar:'complete',cssfiles:['https://www.akinik.com/assets/css/elrte-inner.css']};
$('[class=htmleditor]').each(function(){$(this).elrte(e)});
});
}
function _post($this){
var l = $('.progress'),i = $(':input,button');
$.ajax({
type:$this.method,
url:$this.action,
data:$($this).serialize(),
cache:false,
dataType:'json',
beforeSend:function(){
l.show(0),i.prop('disabled', true);$('.toast').remove();
},
success:function(json){
if(typeof(json.text) !== 'undefined'){ l.hide(0),i.prop('disabled',false);_show(json.text); }
if(typeof(json.surl) !== 'undefined'){ window.self.location = json.surl; }
if(typeof(json.html) !== 'undefined'){ l.hide(0),i.prop('disabled',false);$('body').html(json.html); }
},
error:function(jqXHR, exception){
l.hide(0),i.prop('disabled',false);_show(eCTRL(jqXHR, exception));
}
});
return false;
}
function eCTRL(jqXHR,exception){if(jqXHR.status===0){return 'Not connected. Please verify your network connection.';}else if(jqXHR.status==404){return 'The requested page not found. [404]';}else if(jqXHR.status==500){return 'Internal Server Error [500].';}else if(exception==='parsererror'){return 'Requested JSON parse failed.';}else if(exception==='timeout'){return 'Time out error.';}else if(exception==='abort'){return 'Ajax request aborted.';}else{return 'Uncaught Error: '+jqXHR.responseText;}}
function fetchauthors(option) {
adminform.option.value = option;
$.ajax({
type:'post',
url:adminform.action,
data:new FormData(adminform),
cache:false,
dataType:'json',
contentType:false,
processData:false,
beforeSend:function(){
$('.toast').remove();
},
success:function(json){
if(typeof(json.stat) !== 'undefined' && json.stat === true){
_load();
}
if(typeof(json.text) !== 'undefined'){
M.toast({html: json.text, displayLength: 30000, inDuration: 0});
}
if(typeof(json.html) !== 'undefined'){
fetchedauthors.innerHTML = json.html;
}
},
error:function(jqXHR, exception){
M.toast({html: eCTRL(jqXHR, exception), displayLength: 30000, inDuration: 0});
}
});
return false;
}
function addauthors() {
let html = `<tr>
<td><input type="text" name="aa_authorname[]" class="form-control" /></td>
<td><input type="text" name="aa_authoremail[]" class="form-control" /></td>
<td><input type="text" name="aa_authorphone[]" class="form-control" /></td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendmail[]" maxlength="1" /><br clear="all">Mail
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;width:80px;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcertificate[]" maxlength="1" /><br clear="all">Certificate
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#d5d5d5;">
<input style="width:36px;padding:0;text-align:center;" class="mailCheckbox form-control" type="text" name="sendcopyrightform[]" maxlength="1" /><br clear="all">Copyright
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwamessage[]" maxlength="1" /><br clear="all">Message
</td>
<td nowrap style="width:50px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:500;background-color:#c5c5c5;">
<input style="width:36px;padding:0;text-align:center;" class="waCheckbox form-control" type="text" name="sendwaadvertisement[]" maxlength="1" /><br clear="all">Advertisement
</td>
<td nowrap style="width:70px;">
<button class="btn-control" style="width:60px;padding:.375rem 0!important;" type="button" onclick="$(this).closest('tr').remove()">Remove</button>
</td>
</tr>`;
multiauthors.innerHTML += html;
}
function addauthorsinmodal() {
let html = `<tr>
<td><input type="text" name="new_aa_authorname[]" class="form-control" /></td>
<td><input type="text" name="new_aa_authoremail[]" class="form-control" /></td>
<td><input type="text" name="new_aa_authorphone[]" class="form-control" /></td>
<td nowrap style="width:70px;">
<button class="btn-control" style="width:60px;padding:.375rem 0!important;" type="button" onclick="$(this).closest('tr').remove()">Remove</button>
</td>
</tr>`;
multiauthors.innerHTML += html;
}