OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
award
/
admin
/
inc
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/02/2020 03:45:31 PM
rwxrwxr-x
📄
common.js
14.58 KB
12/02/2020 03:45:29 PM
rw-rw-r--
📄
loader.gif
63.5 KB
12/02/2020 03:45:29 PM
rw-rw-r--
📄
style.css
193.63 KB
12/02/2020 03:45:30 PM
rw-rw-r--
📄
validate.logged.php
333 bytes
12/02/2020 03:45:30 PM
rw-rw-r--
Editing: common.js
Close
/***************************************************** * Common Javascript functions *****************************************************/ function np() { return void(0); } function clearForm(wchForm) { $('#' + wchForm)[0].reset(); $('#panelStatus').html(''); return false; } function chkLogin() { var loginEmail = $('#loginEmail').val(); var loginPwd = $('#loginPwd').val(); if (loginEmail == '' || loginPwd == '') { alert('Both Login and Password are required!'); return false; } $.ajax({ url: 'process/chk.login.php', method: 'POST', data: {email: loginEmail, pwd: loginPwd}, }) .done(function(res) { console.log(res); if (res == 'OK') { window.location = 'dashboard.php'; } else { alert('ERROR: User or Password is incorrect!'); } }); return false; } function goSection(secName, elm, act) { $('.nav-link').removeClass('active'); $(elm).addClass('active'); if (act == undefined) act = ''; $('#panelContent').html('').show().load('process/get.section.' + secName + '.php', {act: act}); } function searchNominator(pageNum) { if (pageNum == undefined) pageNum = 0; var data = $('#frmSearch').serializeArray(); data.push({name: 'pageNum', value: pageNum}); $('#panelSearch').html('').load('process/get.section.nominator.php', data); return false; } function searchNomination(pageNum) { if (pageNum == undefined) pageNum = 0; var data = $('#frmSearch').serializeArray(); data.push({name: 'pageNum', value: pageNum}); $('#panelSearch').html('').load('process/get.section.nomination.php', data); return false; } function searchUser(pageNum) { if (pageNum == undefined) pageNum = 0; var data = $('#frmSearch').serializeArray(); data.push({name: 'pageNum', value: pageNum}); $('#panelSearch').html('').load('process/get.section.user.php', data); return false; } function chkEditNominator() { $('#panelStatus').html(''); var editId = $('#editId').val(); var registerFirstName = $('#registerFirstName').val(); var registerLastName = $('#registerLastName').val(); var registerAffiliation = $('#registerAffiliation').val(); var registerPhone = $('#registerPhone').val(); var registerAddress = $('#registerAddress').val(); var registerCity = $('#registerCity').val(); var registerCountry = $('#registerCountry').val(); var registerPincode = $('#registerPincode').val(); var registerEmail = $('#registerEmail').val(); if (registerFirstName == '') { alert('First Name not entered!'); return false; } if (registerLastName == '') { alert('Last Name not entered!'); return false; } if (registerAffiliation == '') { alert('Affiliation not entered!'); return false; } if (registerPhone == '') { alert('Phone not entered!'); return false; } if (registerAddress == '') { alert('Address not entered!'); return false; } if (registerCity == '') { alert('City not entered!'); return false; } if (registerCountry == '') { alert('Country not entered!'); return false; } if (registerPincode == '') { alert('Pincode not entered!'); return false; } if (registerEmail == '') { alert('Email not entered!'); return false; } $.ajax({ method: 'POST', url: 'process/get.section.nominator.php', data: $('#frmEdit').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetEdit_B').html('Nominator has been edited!'); $('#widgetEdit_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchNominator(pageNum); } else { $('#panelStatus').html('<small>Error: Could not edit Nominator!</small>'); } }); return false; } function chkEditVolume() { $('#panelStatus').html(''); var editId = $('#editId').val(); var volumeName = $('#volumeName').val(); var volumeYear = $('#volumeYear').val(); if (volumeName == '') { $('#panelStatus').html('<small>Error: Volume Name not entered!</small>'); return false; } if (volumeYear == '') { $('#panelStatus').html('<small>Error: Volume Year not entered!</small>'); return false; } $.ajax({ method: 'POST', url: 'process/get.section.volume.php', data: {act: 'chkExist', editId: editId, volumeName: volumeName} }) .done(function(response) { if (response == 'OK') { $.ajax({ method: 'POST', url: 'process/get.section.volume.php', data: $('#frmEdit').serializeArray(), }) .done(function(response) { if (response == 'OK') { $('#widgetEdit_B').html('Volume has been edited!'); $('#widgetEdit_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchVolume(pageNum); } else { $('#panelStatus').html('<small>Error: Could not edit Volume!</small>'); } }); } else { $('#panelStatus').html('<small>' + response + '</small>'); } }); return false; } function chkEditAuthor() { $('#panelStatus').html(''); var editId = $('#editId').val(); var authorName = $('#authorName').val(); if (authorName == '') { $('#panelStatus').html('<small>Error: Author not entered!</small>'); return false; } $.ajax({ method: 'POST', url: 'process/get.section.author.php', data: $('#frmEdit').serializeArray(), }) .done(function(response) { if (response == 'OK') { $('#widgetEdit_B').html('Author has been edited!'); $('#widgetEdit_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchAuthor(pageNum); } else { $('#panelStatus').html('<small>Error: Could not edit Author!</small>'); } }); return false; } function chkEditUser() { $('#panelStatus').html(''); var editId = $('#editId').val(); var userName = $('#userName').val(); var userPassword = $('#userPassword').val(); var userEmail = $('#userEmail').val(); if (userName == '') { $('#panelStatus').html('<small>Error: User Name not entered!</small>'); return false; } if (userPassword == '') { $('#panelStatus').html('<small>Error: Password not entered!</small>'); return false; } if (userEmail == '') { $('#panelStatus').html('<small>Error: Email not entered!</small>'); return false; } $.ajax({ method: 'POST', url: 'process/get.section.user.php', data: {act: 'chkExist', editId: editId, userEmail: userEmail} }) .done(function(response) { if (response == 'OK') { $.ajax({ method: 'POST', url: 'process/get.section.user.php', data: $('#frmEdit').serializeArray(), }) .done(function(response) { if (response == 'OK') { $('#widgetEdit_B').html('User has been edited!'); $('#widgetEdit_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchUser(pageNum); } else { $('#panelStatus').html('<small>Error: Could not edit User!</small>'); } }); } else { $('#panelStatus').html('<small>' + response + '</small>'); } }); return false; } function chkDelVolume() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.volume.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Volume has been deactivated!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchVolume(pageNum); } else { $('#panelStatus').html('<small>Error: Could not deactivate Volume!</small>'); } }); return false; } function chkDelIssue() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.issue.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Issue has been deactivated!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchIssue(pageNum); } else { $('#panelStatus').html('<small>Error: Could not deactivate Issue!</small>'); } }); return false; } function chkDecArticle() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.article.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Article has been deactivated!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchArticle(pageNum); } else { $('#panelStatus').html('<small>Error: Could not deactivate Article!</small>'); } }); return false; } function chkDelArticle() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.article.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Article has been deleted!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchArticle(pageNum); } else { $('#panelStatus').html('<small>Error: Could not delete Article!</small>'); } }); return false; } function chkDelAuthor() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.author.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Author has been deactivated!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchAuthor(pageNum); } else { $('#panelStatus').html('<small>Error: Could not deactivate Author!</small>'); } }); return false; } function chkDelUser() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.user.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('User has been deactivated!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchUser(pageNum); } else { $('#panelStatus').html('<small>Error: Could not deactivate User!</small>'); } }); return false; } function chkDelSlide() { $.ajax({ method: 'POST', url: 'process/get.section.general.php', data: $('#frmDel').serializeArray() }) .done(function(response) { $('#widgetDel_B').html('Slide has been deleted!'); $('#widgetDel_F').hide(); $('#panelContent').load('process/get.section.general.php', {act: 'banners'}); }); return false; } function chkDelCategory() { $('#panelStatus').html(''); $.ajax({ method: 'POST', url: 'process/get.section.category.php', data: $('#frmDel').serializeArray() }) .done(function(response) { if (response == 'OK') { $('#widgetDel_B').html('Category has been deleted!'); $('#widgetDel_F').hide(); var pageNum = $('#listingPageNum').data('pagenum'); searchCategory(pageNum); } else { $('#panelStatus').html('<small>Error: Could not delete Category!</small>'); } }); return false; } function updatePublishedPages() { $('#panelSearch').html(''); var publishedPagesCounter = $('#publishedPagesCounter').val(); if (publishedPagesCounter == '') { $('#panelSearch').html('<div class="m-2 text-danger">Error: Published Pages value not entered!</div>'); return false; } $.ajax({ method: 'POST', url: 'process/get.section.general.php', data: {act: 'publishedPagesUpdate', publishedPagesCounter: publishedPagesCounter} }) .done(function(response) { if (response == 'OK') { $('#panelSearch').html('<div class="m-2">Published Pages value has been updated!</div>'); } else { $('#panelSearch').html('<div class="m-2 text-danger">Error: Published Pages value could not be updated!</div>'); } }); return false; } function updateHeaderSlide(wchSlide) { var slide = $('#slideFile' + wchSlide).val(); if (slide == '') { alert('No file selected to upload!'); return false; } var formData = new FormData(); formData.append('act', 'slideUpload'); formData.append('uploadSlideNum', wchSlide); formData.append('uploadSlideFile', $('#slideFile' + wchSlide)[0].files[0]); $.ajax({ method: 'POST', url: 'process/get.section.general.php', data: formData, processData: false, contentType: false, enctype: 'multipart/form-data', error: function (error) { alert('ERROR: There was an error processing your request!'); } }) .done(function(res) { $('#panelContent').load('process/get.section.general.php', {act: 'banners'}); }); return false; } function moveHeaderSlide(wchDir, wchSlide) { $.ajax({ method: 'POST', url: 'process/get.section.general.php', data: {act: wchDir, slideNum: wchSlide}, error: function (error) { alert('ERROR: There was an error processing your request!'); } }) .done(function(res) { $('#panelContent').load('process/get.section.general.php', {act: 'banners'}); alert('Slide position has been updated!'); }); } function addCategory() { $('#panelSearch').html('').show().load('process/get.section.category.php', {act: 'addForm'}); } function addVolume() { $('#panelSearch').html('').show().load('process/get.section.volume.php', {act: 'addForm'}); } function addIssue() { $('#panelSearch').html('').show().load('process/get.section.issue.php', {act: 'addForm'}); } function addForthcomingArticle() { $('#panelSearch').html('').show().load('process/get.section.article.php', {act: 'addFormF'}); } function getIssues() { $('#articleIssueNum').empty(); var volumeNum = $('#articleVolumeId').val(); if (volumeNum == '') { $('#articleIssueNum').append('<option value="">--[select volume first]--</option>'); } else { $.ajax({ method: 'POST', url: 'process/get.section.issue.php', data: {act: 'getIssues', volumeNum : volumeNum}, error: function (error) { alert('ERROR: There was an error processing your request!'); } }) .done(function(res) { if (res != '') { var arrIssue = res.split(','); $.each(arrIssue, function(index, value) { $('#articleIssueNum').append('<option>' + value + '</option>'); }); } }); } } function getEditIssues() { $('#articleIssueNum').empty(); var volumeNum = $('#articleVolumeId').val(); if (volumeNum == '') { $('#articleIssueNum').append('<option value="">--[select volume first]--</option>'); } else { $.ajax({ method: 'POST', url: 'process/get.section.issue.php', data: {act: 'getIssues', volumeNum : volumeNum}, error: function (error) { alert('ERROR: There was an error processing your request!'); } }) .done(function(res) { if (res != '') { var arrIssue = res.split(','); $.each(arrIssue, function(index, value) { $('#articleIssueNum').append('<option>' + value + '</option>'); }); } }); } }