";
$("#dav-"+message_id1).append(filename);
}
//alert(files);
//document.getElementById('dav').innerHTML=str;\
});
$(document).on('click', '#send', function(){
call=1;
document.getElementById('progressBar-'+message_id1).style.display='';
//var message=document.getElementById('message').innerHTML;
//var message_id=document.getElementById('message_id').value;
//var receiver=document.getElementById('receiver').value;
//var sender=document.getElementById('sender').value;
//var subject=document.getElementById('subject').value;alert(message_id);
// alert(files.files[0]);
//document.getElementById('dav').innerHTML=str;
//function uploadFile(){
//var file = _(files).files[0];alert(file);
var fileSelect = document.getElementById('file');
var files = fileSelect.files; //alert(files);alert('aaaaaaaa');
// Create a new FormData object.
var formData = new FormData();
// Loop through each of the selected files.
for (var i = 0; i < files.length; i++) {
var file = files[i];
// Check the file type.
// if (!file.type.match('image.*')) {
//continue;
//}
// Add the file to the request.
formData.append('file1[]', file);
}
formData.append('message',message);
formData.append('message_id',message_id1);
formData.append('receiver',receiver1);
formData.append('sender',sender1);formData.append('subject',subject1);formData.append('read','');
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.upload.addEventListener("progress", progressHandler, false);
xmlhttp.addEventListener("load", completeHandler, false);
xmlhttp.addEventListener("error", errorHandler, false);
xmlhttp.addEventListener("abort", abortHandler, false);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
// document.getElementById('ajax').innerHTML="";
var info=xmlhttp.responseText;
if(info!=='OK'){
document.getElementById('error-'+message_id1).innerHTML=info;}else{
hide('#div-'+message_id1);
fetch_mail(message_id1,receiver1,sender1,subject1);
$('#div-'+message_id1).show(500);$('html, body').animate({scrollTop: $("#div-"+message_id1).offset().top}, 2000);
}
} else {
// alert(info);
}}
xmlhttp.open('POST','project_php/upload.php', true);
xmlhttp.send(formData);
//}
});
$('#checkbox1').click(function(event) { //on click
if(this.checked) { // check select status
$('.checkbox').each(function() { //loop through each checkbox
this.checked = true; //select all checkboxes with class "checkbox1"
});
}else{
$('.checkbox').each(function() { //loop through each checkbox
this.checked = false; //deselect all checkboxes with class "checkbox1"
});
}
});
});
function _(elem){
return document.getElementById(elem);
}
function progressHandler(event){
_('loaded_n_total-'+message_id1).innerHTML = 'Uploaded '+event.loaded+' bytes of '+event.total;
var percent = (event.loaded / event.total) * 100;
_('progressBar-'+message_id1).value = Math.round(percent);
_('status-'+message_id1).innerHTML = Math.round(percent)+'% uploaded... please wait';
}
function completeHandler(event){
_('status-'+message_id1).innerHTML = event.target.responseText;
_('progressBar-'+message_id1).value = 0;
}
function errorHandler(event){
_('status-'+message_id1).innerHTML = 'Upload Failed';
}
function abortHandler(event){
_('status-'+message_id1).innerHTML = 'Upload Aborted';
}
function go(){
$("#sector").css('display','none');
$("#sector").show(500);
}
function go1(){
$("#sector").hide(500);}
function apply(id_applicant,id_advert){
document.getElementById('cont1').style.backgroundColor="#FFFFFF";
document.getElementById('cont1').style.width="100%";
document.getElementById('cont1').style.height="100%";
document.getElementById('cont1').style.marginLeft="auto";
document.getElementById('cont1').style.marginRight="auto";
document.getElementById('cont1').style.position="fixed";
document.getElementById('cont1').style.opacity="0.9";
document.getElementById('cont1').style.display="table";
document.getElementById('cont1').style.zIndex="100";
document.getElementById('cont1').style.textAlign="center";
document.getElementById('cont1').innerHTML="";
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var ipnurl=xmlhttp.responseText;
document.getElementById('cont1').innerHTML="";
if(ipnurl=='OK'){
document.getElementById('cont1').innerHTML="
Application has been successfully sent. |
";
document.getElementById('apply').style.display="none";
setTimeout(clean, 2000);
}else{
document.getElementById('cont1').innerHTML="Error occurred, please retry later.(Се случи грешка, повторно обидете се подоцна.) |
";
setTimeout(clean, 2000);
}
}}
xmlhttp.open('POST','project_php/cvgenerator_ajax.php',true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send('applicant='+id_applicant+'&advert='+id_advert);
}
function clean (){
document.getElementById('cont1').innerHTML="";
document.getElementById('cont1').style.display="none";
}
function clean2 (){
document.getElementById('cont2').innerHTML="";
document.getElementById('cont2').style.display="none";
}
calls=1;
target='';
function see_applicants(id_advert){
fetch_applicants(id_advert,'see');target=id_advert;
}
function scrolled1(o)
{//alert(o.scrollTop); //o.scrollHeight1873
//visible height + pixel scrolled = total height
if((o.offsetHeight + o.scrollTop)+10 > o.scrollHeight)
{if(calls!=-1){
fetch_applicants(target,'see');
//alert('End');
}}
}
function fetch_applicants(id_advert,purpose){
if(calls!=='NO RESULTS'){
if(calls==1){
document.getElementById('cont1').style.backgroundColor="#FFFFFF";
document.getElementById('cont1').style.width="100%";
document.getElementById('cont1').style.height="100%";
document.getElementById('cont1').style.marginLeft="auto";
document.getElementById('cont1').style.marginRight="auto";
document.getElementById('cont1').style.position="fixed";
document.getElementById('cont1').style.opacity="0.9";
document.getElementById('cont1').style.display="table";
document.getElementById('cont1').style.zIndex="8";
document.getElementById('cont1').style.textAlign="center";
document.getElementById('cont1').innerHTML="";}
if(calls=="a_letter"){document.getElementById('apl_letter').innerHTML="";}
else if(calls=="Save"){
var content=document.getElementById('apl_letter').innerText;
id_advert="";
purpose="";
document.getElementById('apl_letter').innerHTML="";}
else if(calls!=="a_letter" && calls!=="Save"){
loader="";
$("#applicants_holder").append(loader);
$('#holder').show(500);}
//document.getElementById('holder').style.display="";
//if(calls>1){document.getElementById('stat').innerHTML='LOADING MESSAGES,please wait...!';}
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var ipnurl=xmlhttp.responseText;
if(calls=="a_letter"){
document.getElementById('apl_letter').innerHTML=ipnurl;
}
if(ipnurl!=='OKSAVE'){
document.getElementById('cont1').innerHTML="";
loaders.remove();}
if(purpose=='see'){
if(ipnurl!=='NO RESULTS' && ipnurl!=='OKSAVE'){
$('#applicants_holder').append(ipnurl);
//document.getElementById('applicants_holder').innerHTML=ipnurl;
calls=calls+1;}else{calls='NO RESULTS';}
}
if(ipnurl=='okrejecting'){
$("#holder").hide(500);document.getElementById("applicants_holder").innerHTML="";calls=1;
document.getElementById('cont1').innerHTML="Rejecting undone. Reopen list again to see all candidates. |
";
setTimeout(clean, 3000);
}
else if(ipnurl=='OKSAVE'){
document.getElementById('cont2').innerHTML="Application letter successfully saved! |
";
setTimeout(clean2, 3000);
}
else
{
$('#'+purpose).hide(500);}
}
}
xmlhttp.open('POST','project_php/cvgenerator_ajax.php',true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send('ad_id='+id_advert+'&calls='+calls+'&purpose='+purpose+'&content='+content);}
}
function resetme(){
calls=1;
}
function call_reset(){
setTimeout(resetme, 2000);
}
function reject(id_advert,id_){
fetch_applicants(id_advert,id_);
}
$('html').keyup(function(e){if(e.keyCode == 8)numberit();})
function application_letter(id_advert,id_user){
id_advert='';
document.getElementById('cont2').style.backgroundColor="#FFFFFF";
document.getElementById('cont2').style.width="100%";
document.getElementById('cont2').style.height="100%";
document.getElementById('cont2').style.marginLeft="auto";
document.getElementById('cont2').style.marginRight="auto";
document.getElementById('cont2').style.position="fixed";
document.getElementById('cont2').style.opacity="0.9";
document.getElementById('cont2').style.display="table";
document.getElementById('cont2').style.zIndex="25";
document.getElementById('cont2').style.textAlign="center";
var appl_letter='';
$('#cont2').append(appl_letter);
calls='a_letter';
fetch_applicants(id_advert,id_user);
}
function update(){
calls='a_letter';
}
function _(el){
return document.getElementById(el);
}
function uploadFile(){
var files = _("file1").files;
for(var i=0;i | "+file.name+" | "+file.size+"-kb | ";
$('#dynamic').append(cnt);}
}
else{
id='_'
document.getElementById(file.name+'_').src='http://educirajse.com/project_php/files_new/_small/'+file.name;
}}
}}
ajax.open("POST", "project_php/upload_cvcreator.php");
ajax.send(formdata);
}
ajax.upload.addEventListener("progress", progressHandler, false);
ajax.addEventListener("load", completeHandler, false);
ajax.addEventListener("error", errorHandler, false);
ajax.addEventListener("abort", abortHandler, false);
}
function progressHandler(event){
_("loaded_n_total").innerHTML = "Uploaded "+event.loaded+" bytes of "+event.total;
var percent = (event.loaded / event.total) * 100;
_("progressBar").value = Math.round(percent);
_("status").innerHTML = Math.round(percent)+"% uploaded... please wait";
}
function completeHandler(event){
_("status").innerHTML = event.target.responseText;
_("progressBar").value = 0;
}
function errorHandler(event){
_("status").innerHTML = "Upload Failed";
}
function abortHandler(event){
_("status").innerHTML = "Upload Aborted";
}
function changepassword(){
document.getElementById('cont1').style.backgroundColor="#FFFFFF";
document.getElementById('cont1').style.width="100%";
document.getElementById('cont1').style.height="100%";
document.getElementById('cont1').style.marginLeft="auto";
document.getElementById('cont1').style.marginRight="auto";
document.getElementById('cont1').style.position="fixed";
document.getElementById('cont1').style.opacity="0.9";
document.getElementById('cont1').style.display="table";
document.getElementById('cont1').style.zIndex="8";
document.getElementById('cont1').style.textAlign="center";
document.getElementById('cont1').innerHTML="";
var pasexists=document.getElementById('password_e').value;
var pasexistse=document.getElementById('password_e1').value;
var pasexists1_=document.getElementById('password1_').value;
if(pasexistse!=pasexists1_){
document.getElementById('cont1').innerHTML="Error: passwords mismatch...! |
";
setTimeout(clean, 3000);
}else{
//document.getElementById('holder').style.display="";
//if(calls>1){document.getElementById('stat').innerHTML='LOADING MESSAGES,please wait...!';}
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{ // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var ipnurl=xmlhttp.responseText;
if(ipnurl=='OKSAVE'){
document.getElementById('cont1').innerHTML="Password successfully changed. |
";
setTimeout(clean, 3000);
}else{
document.getElementById('cont1').innerHTML="";
setTimeout(clean, 3000);
}
}
}
xmlhttp.open('POST','project_php/cvgenerator_ajax.php',true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send('password='+pasexists+'&npass='+pasexistse+'&npass1='+pasexists1_);
}}
Прво логирајте се со цел да пристапите во оваа страна!