0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.147.74.100


Current Path : /proc/thread-self/root/var/www/html/univadmin/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin/js/spadmin_27012018.js

var $host_url="http://"+window.location.host+"/"+window.location.pathname.split('/')[1]+"/app.php?a=";

var funivcode, funivname;

function loadMaster()
{
  // loadProfile();
    //loadExamApplication();
	$.ajax({
        type: 'post',
        url: $host_url+'isloggedin',
        //data:parameters,
        success: function(response)
        {
          var { error_code, data, status  } = JSON.parse(response);
          
          if(error_code == 0)
          {
            ({funivcode, funivname} = data.result);    
            $("#loadmenu li").click(function() {
              // remove classes from all
              $("li").removeClass("active");
              // add class to the one we clicked
              $(this).addClass("active");
              
              $('body').removeClass("overlay-open");
              $('.overlay').css("display", "none");
            });

            $("#nav-header").html("University Admin");
            loadCollSMS();
          }
          else
          {
          	alert("Please login");
            window.location.href = 'index.html';
          }
        }
    });
}

function loadUnivs(id) 
{
  $.ajax({
    type: 'post',
    url: $host_url+'getUnivs',
    //data:parameters,
    success: function(response)
    {
      var { error_code, data, status  } = JSON.parse(response);
      if(error_code == 0)
      {
        var univs = data.data;
        var options;
        for(var i = 0; i< univs.length; i++)
        {
          options += `<option value="${univs[i].funivcode}">${univs[i].funivname}</options>`;
        }

        $('#'+id).html(options);
      }
    }
  });
}

function loadCollSMS()
{
  $('#loadtab').load('html_modules/collSMS.html?v='+version, () => loadUnivs('univname') );
}

function loadScriptUpload()
{
  $('#loadtab').load('html_modules/scriptStatusUpload.html?v='+version, () => {
    loadUnivs('univname');
    
  }
  );
}

var gfilename;

function UploadDocument()
{
	file_file = 'file';
	var file_name = $("#"+file_file).val();									  
	var file_size = $("#"+file_file)[0].files[0].size;				
	var file_extn = file_name.split('.').pop();
	var file_extn = file_extn.toLowerCase();		
	if(file_extn=="xlsx")
	{
		
	}
	else
	{
		alert("XLSX files are allowed!");	
		return false;
	}
	
	
	if(file_size >= 1000000)
	{
		alert('Upload files with size less then 1MB!');
		return false;
	}
	
	var file_data = $("#"+file_file).prop('files')[0];   
    var form_data = new FormData();                  
    form_data.append('file', file_data);

	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='../images/ajax-loader.gif' border='0'></h1>" });
	$.ajax({
		type: "POST",
		url: "upload_file.php",
		data: form_data,
		cache: false,
		contentType: false,
		processData: false,
		success: function(data)
		{	
      $.unblockUI();
      console.log(data);
      gfilename = data;
			// $('#h_'+file_file).val(data);
			
			// var str = `<a href = "${$host_url1+'/upload/'+data}" target = "_blank">${file_file}</a>`;
			// document.getElementById('attach_td_'+file_file).innerHTML = str;
				
		},
		error: function(data)
		{	
			alert(data);				
		}
	});
}

function uploadScriptStats()
{
  var univcode = $("#univname").val();
  var deggrp = $("#deggrp").val();

  var parameters = "univcode="+univcode+"&deggrp="+deggrp+"&gfilename="+gfilename;
  $.blockUI({ message: "<img src='images/Loading_icon.gif' border='0'>" });

  $.ajax({
    type: 'post',
    url: $host_url+'uploadScriptStats',
    data:parameters,
    success: function(response)
    {
      $.unblockUI();
      console.log(response);
    }
  });
}


function sendSms()
{
  var univcode = $("#univname").val();
  var type = $("#type").val();
  var message = $("#message").val();
  message = message.replace("'","");
  message = message.replace('"',"");
  var parameters = "univcode="+univcode+"&type="+type+"&message="+message;
  $.blockUI({ message: "<img src='images/Loading_icon.gif' border='0'>" });
  $.ajax({
    type: 'post',
    url: $host_url+'sendsms',
    data:parameters,
    success: function(response)
    {
      $.unblockUI();
      var { error_code, data, status  } = JSON.parse(response);
      if(error_code == 0)
      {
        $('#res_table').html(data.sms);
      }
    }
  });

}


function loadoasisLinks()
{
  $('#loadtab').load('html_modules/oasislinks.html?v='+version, function(){

  });
}

function getCollege(coll)
{
  $('#event').hide();
  if(coll=='student')
 {
    /*document.getElementById('collfrom').disabled=true;
    document.getElementById('collto').disabled=true;
    document.getElementById('Regfrom').disabled=true;
    document.getElementById('Regto').disabled=true;
    document.getElementById('semister').disabled=true;*/
    $('#event').show();
  }
  else
  {
    document.getElementById('collfrom').disabled=false;
    document.getElementById('collto').disabled=false;
    document.getElementById('Regfrom').disabled=false;
    document.getElementById('Regto').disabled=false;
    document.getElementById('semister').disabled=false;
  }
 
}