// ******************************************** // // Replace shownoModalDialog with myOpenDialog // Auto Resize Window End // // ******************************************** /* function myOpenDialog(url, title, w, h, callback) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2) - 40; // deduct 40 for there is a header title var win = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); win.focus() var timer = setInterval(function () { if (win.closed) { clearInterval(timer); var returnValue = win.returnValue; callback(returnValue); } }, 500); } function do_period(id) { alert('period); var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpPeriodFrequency.php?action|' + pass_parameter ; myOpenDialog(url,'PeriodFrequency', 590, 460, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } */ function do_RequestforQuote(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ window.open('sg_poRequestforQuotation.php','requestforQuotation','width: 100%, height : 100%, menubar=Yes,scrollbars=YES,toolbar=NO'); } } function do_LocationMain(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpLocationMain.php?action|' + pass_parameter ; myOpenDialog(url,'LocationMain', 680, 620, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_Department(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpDepartment.php?action|' + pass_parameter ; myOpenDialog(url,'Department', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_EquipmentSystem(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpEquipmentSystem.php?action|' + pass_parameter ; myOpenDialog(url,'EquipmentSystem', 660, 580, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_EquipmentClass(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpEquipmentClass.php?action|' + pass_parameter ; myOpenDialog(url,'EquipmentClass', 640, 580, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_EquipmentType(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpEquipmentType.php?action|' + pass_parameter ; myOpenDialog(url,'EquipmentType', 640, 580, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_EquipmentStatus(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpEquipmentStatus.php?action|' + pass_parameter ; myOpenDialog(url,'EquipmentStatus', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_EquipmentWarranty(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpEquipmentWarranty.php?action|' + pass_parameter ; myOpenDialog(url,'EquipmentWarranty', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_Period(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpPeriodFrequency.php?action|' + pass_parameter ; myOpenDialog(url,'PeriodFrequency', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_WorkStatus(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpWorkStatus.php?action|' + pass_parameter ; myOpenDialog(url,'WorkStatus', 680, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_WorkType(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpWorkType.php?action|' + pass_parameter ; myOpenDialog(url,'WorkType', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_WorkTrade(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpWorkTrade.php?action|' + pass_parameter ; myOpenDialog(url,'WorkTrade', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_WorkPriority(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpWorkPriority.php?action|' + pass_parameter ; myOpenDialog(url,'WorkPriority', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_PersonnelDesignation(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpPersonnelDesignation.php?action|' + pass_parameter ; myOpenDialog(url,'Designation', 640, 596, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_preventiveLibrary(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpLibraryPreventive.php?action|' + pass_parameter ; myOpenDialog(url,'preventiveLibrary', 2048, 768, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_correctiveLibrary(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpLibraryCorrective.php?action|' + pass_parameter ; myOpenDialog(url,'correctiveLibrary', 2048, 768, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_generateMonthlyPM(id){ //alert('aaaa'); var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_generateMonthlyPM.php?action|' + pass_parameter ; myOpenDialog(url,'generateMonthlyPM', 680, 580, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } // Report Setup function do_ReportSetup(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpcmmsReportSetup.php?action|' + pass_parameter ; myOpenDialog(url,'reportSetup', 790, 644, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } // Menu Profiles function do_menuProfiles(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_stpMenuProfiles.php?action|' + pass_parameter ; myOpenDialog(url,'reportSetup', 790, 648, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } // Reports function do_Reports(id){ var xclassName = document.getElementById(id).className; if (xclassName == 'enabled'){ var pass_parameter = '=' + id; var url = 'sg_cmmsReports.php?action|' + pass_parameter ; myOpenDialog(url,'reports', 890, 644, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } function do_Help(){ window.open('helpDesktop/','cmmsHelp','personalbar=no, scroll:0'); //window.open('cmmsHelp.php','cmmsHelp','scroll:0'); } function do_changePassword(id){ var m_href=document.getElementById(id).href; if(m_href!=''){ var pass_parameter = '=' + id; var url = 'changePassword.php?action|' + pass_parameter ; // width, height myOpenDialog(url,'changePassword', 700, 580, function (termsOfServiceAccepted){ var retValue = termsOfServiceAccepted; }); } } // use no Modal window.shownoModalDialog = function (arg1, arg2, arg3) { var w; var h; var resizable = "no"; var scroll = "no"; var status = "no"; // get the modal specs var mdattrs = arg3.split(";"); for (i = 0; i < mdattrs.length; i++) { var mdattr = mdattrs[i].split(":"); var n = mdattr[0], v = mdattr[1]; if (n) { n = n.trim().toLowerCase(); } if (v) { v = v.trim().toLowerCase(); } if (n == "dialogheight") { h = v.replace("px", ""); } else if (n == "dialogwidth") { w = v.replace("px", ""); } else if (n == "resizable") { resizable = v; } else if (n == "scroll") { scroll = v; } else if (n == "status") { status = v; } } var left = window.screenX + (window.outerWidth / 2) - (w / 2); var top = window.screenY + (window.outerHeight / 2) - (h / 2); var targetWin = window.open(arg1, arg1, 'toolbar=no, location=no, directories=no, status=' + status + ', menubar=no, scrollbars=' + scroll + ', resizable=' + resizable + ', copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); targetWin.focus(); }; function do_Backup(id){ var bcolor=document.getElementById(id).style.color; var m_href=document.getElementById(id).href; if(m_href!=''){ var myArguments=new Object(); //var returnValue=window.showModalDialog('database_Backup.php?user='+gbl_User,self,'dialogtop:140; dialogleft: 280; center:1; dialogwidth:460; dialogheight:245; scroll:0; resizable:1'); // myOpenDialog(url, title, w, h, callback) window.shownoModalDialog('database_Backup.php?user=' + gbl_User, 'backup','center:1; dialogwidth:520; dialogheight:320; scroll:0; resizable:1'); // repalce window.shownoModalDialog with myOpenDalog //// problem decompressing if use below //var url = 'database_Backup.php'; //myOpenDialog(url, 'databaseBAckup', 520, 320, function (termsOfServiceAccepted){ // var retValue = termsOfServiceAccepted; //}); }else{alert('Disabled.');} } $(window).ready(function() { var wi = $(window).width(); $(".testp").text('Initial screen width is currently: ' + wi + 'px.'); $(window).resize(function() { var wi = $(window).width(); if (wi <= 480){ $(".testp").text('Screen width is less than or equal to 480px. Width is currently: ' + wi + 'px.'); }else if (wi <= 767){ $(".testp").text('Screen width is between 481px and 767px. Width is currently: ' + wi + 'px.'); }else if (wi <= 980){ $(".testp").text('Screen width is between 768px and 980px. Width is currently: ' + wi + 'px.'); }else if (wi <= 1200){ $(".testp").text('Screen width is between 981px and 1199px. Width is currently: ' + wi + 'px.'); } else { $(".testp").text('Screen width is greater than 1200px. Width is currently: ' + wi + 'px.'); } }); });