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 : 18.118.208.127


Current Path : /var/www/html/college/js/
Upload File :
Current File : /var/www/html/college/js/system_utility.js

//ChangeTablesToInnoDB
function ChangeTablesToInnoDB() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "ChangeTablesToInnoDB",
    success: ChangeTablesToInnoDBResponce,
  });
}

function ChangeTablesToInnoDBResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert("Done");
}

// Truncate Entry Tables
function TruncateEntryTables() {
  var confirm_flag = confirm(
    "do you want to truncate entry and drop gandhi grid temp tables"
  );
  if (confirm_flag) {
    $.ajax({
      type: "POST",
      async: false,
      url: $host_url + "TruncateEntryTables",
      success: TruncateEntryTablesResponce,
    });
  }
}
function TruncateEntryTablesResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert("Done");
}

function ExcuteUserDefinedQry() {
  window.enable_proper_module = "ExcuteUserDefinedQry";
  document.getElementById("module_name_for_save").value =
    "saveExcuteUserDefinedQry";
  document.getElementById("parent_menu").innerHTML = "SetUp " + ">";
  document.getElementById("display_module_name").innerHTML =
    "Excute User DefinedQry";
  $("#page_main_div").load("../html_modules/execute_query.html");
  getDefaultHeadFooterLinks("Excute UserDefined Qry");
}

function ExecuteQryFromPhp() {
  var flag = confirm("Do You Want to Execute the Current Query!");
  if (flag) {
    $("#dialog").dialog("open");
    $("#dialog").data("width.dialog", 300);
    $path = "../html_modules/password_check.html";
    $("#ui-dialog-title-dialog").html("Password");
    $("#dialog").html("");
    $("#dialog").load($path);
  }
}

var g_execute_password = "titpl123";

function CheckEnterPassword() {
  var quey_pwd = document.getElementById("query_password").value;

  if (trim(document.getElementById("query_password").value) == "") {
    jAlert("Please Enter the Password.", "Attention!");
    document.getElementById("query_password").focus();
    return;
  }
  if (quey_pwd == g_execute_password) {
    closePassword();
    $lstr_query =
      "&execute_query=" +
      encodeURIComponent(
        trim(document.getElementById("execute_query_details").value)
      );

    $.ajax({
      type: "POST",
      async: false,
      url: $host_url + "saveExcuteUserDefinedQuery",
      data: $lstr_query,
      success: ExcuteUserDefinedQueryResponce,
    });
  } else {
    jAlert("Invalid Password", "Attention!");
    closePassword();
  }
}
function ExcuteUserDefinedQueryResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}
function closePassword() {
  $("#dialog").dialog("close");
}

function GetQueryResultSet() {
  $lstr_query =
    "&execute_query=" +
    encodeURIComponent(
      trim(document.getElementById("execute_query_details").value)
    );

  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "GetQueryResultSet",
    data: $lstr_query,
    success: GetQueryResultSetResponce,
  });
}

function GetQueryResultSetResponce($responce) {
  $responce = eval("(" + $responce + ")");
  $("#query_result_set").html($responce.data);
}

//  All Grid Group Files
function populateAllGridGroupFiles() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "populateAllGridGroupFiles.demo",
    data: "schema_id=" + 0,
    success: populateAllGridGroupFilesResponce,
  });
}

function populateAllGridGroupFilesResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}

// Create All schema Files
function populateAllSchemaFiles() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "CreateAllSchemaFiles",
    data: "schema_id=" + 0,
    success: populateAllSchemaFilesResponce,
  });
}

function populateAllSchemaFilesResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}

// All Grid Files
function populateAllGridFiles() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "populateAllGridFiles.demo",
    data: "schema_id=" + 0,
    success: populateAllGridFilesResponce,
  });
}

function populateAllGridFilesResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}

//Meta Colums
function createModuleMetaColumns() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "createModuleMetaColumns.demo",
    data: "",
    success: createModuleMetaColumnsResponce,
  });
}

function createModuleMetaColumnsResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}

//Create View
function CreateView() {
  $.ajax({
    type: "POST",
    data: "schema_id=0",
    url: $host_url + "CreateView.demo",
    success: CreateViewResponce,
  });
}
function CreateViewResponce($responce) {
  $responce = eval("(" + $responce + ")");
  jAlert($responce.data, "Attention!");
}

//Define Flag
function UpdateDefinedFlag() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "UpdateDefinedFlag.demo",
    data: "",
    success: UpdateDefinedFlagResponce,
  });
}
function UpdateDefinedFlagResponce($responce) {
  $responce = eval("(" + $responce + ")");
  jAlert($responce.data, "Attention!");
}

//All Popup Grid Files
function CreatePopUpFiles() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "populateAllPopupGridFiles.demo",
    data: "",
    success: populateAllPopupGridFilesResponce,
  });
}
function populateAllPopupGridFilesResponce($responce) {
  $responce = eval("(" + $responce + ")");
  jAlert($responce.data, "Attention!");
}

// Update DB Fields
function updateUserSchemaElementDbField() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "updateUserSchemaElementDbField.demo",
    data: "",
    success: updateUserSchemaElementDbFieldResponce,
  });
}

function updateUserSchemaElementDbFieldResponce($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}
//downloadFileFromServer
function DownLoadUpload() {
  window.enable_proper_module = "DownLoadUpload";
  document.getElementById("module_name_for_save").value = "saveDownLoadUpload";
  document.getElementById("parent_menu").innerHTML = "SetUp " + ">";
  document.getElementById("display_module_name").innerHTML = "Down Load Upload";
  $("#page_main_div").load("../html_modules/download_upload.html");
  getDefaultHeadFooterLinks("DownLoad/Upload");
}

function downloadFileFromServer() {
  if (trim(document.getElementById("download_upload_path").value) == "") {
    alert("Please Enter the Path.");
    document.getElementById("download_upload_path").focus();
    return;
  } else {
    window.open(
      $host_url +
        "downloadFileFromServer&download_file_path=" +
        $("#download_upload_path").val()
    );
  }
}

function UploadFileToServer() {
  if (trim(document.getElementById("upload_to_server_file_name").value) == "") {
    alert("Please Enter the File Path.");
    document.getElementById("upload_to_server_file_name").focus();
    return;
  } else {
    ext = document.getElementById("upload_to_server_file_name").value;
    filepath = ext;
    ext = ext.substring(ext.length - 3, ext.length);
    ext = ext.toLowerCase();
    if (ext != "") {
      document.getElementById("form_upload_download_details").action =
        $host_url +
        "UploadFileToServer&filepath=" +
        filepath +
        "&storage_path=" +
        $("#download_upload_file_path").val();
      document.getElementById("form_upload_download_details").target = "_new";
      // document.getElementById('form_module_details_upload').target='report_display';
      document.getElementById("form_upload_download_details").submit();
    } else {
      alert("Please select a File");
    }
  }
}
//Tempate Configration

function TempateConfigration() {
  window.enable_proper_module = "TempateConfigration";
  document.getElementById("module_name_for_save").value =
    "saveTempateConfigration";
  $("#page_main_div").load("../html_modules/template_configration.html");
  getDefaultHeadFooterLinks("Tempate Configration");
}

$lintIndex = 1;

function addInputStoragePath() {
  $lintIndex = $lintIndex + 1;
  var tbody = document
    .getElementById("input_storage_table")
    .getElementsByTagName("tbody")[0];

  var row = document.createElement("TR");
  row.setAttribute("id", "tr_id" + $lintIndex);
  tbody.appendChild(row);

  var cell_2 = document.createElement("TD");
  cell_2.setAttribute("width", 50);
  cell_2.setAttribute("align", "left");
  row.appendChild(cell_2);

  var input_box = document.createElement("INPUT");
  input_box.setAttribute("type", "text");
  input_box.setAttribute("id", "input_storage_path_" + $lintIndex);
  input_box.setAttribute("name", "input_storage_path_" + $lintIndex);
  input_box.style.width = "98px";
  cell_2.appendChild(input_box);
}

function removeInputStoragePath() {
  var tbl = document.getElementById("input_storage_table");
  var lastRow = tbl.rows.length;
  if (lastRow > 2) tbl.deleteRow(lastRow - 1);
  $lintIndex--;
}