///////////////////////////////////////////////////////////admin_user_update function checkuserForm(){ if(document.update.uname.value=="") { alert("請填寫姓名!"); document.update.uname.focus(); return false; } if(document.update.email.value=="") { alert("請填寫電子郵件!"); document.update.email.focus(); return false; } if(!check_passwd(document.update.passwd.value,document.update.ckpasswd.value)) { document.update.passwd.focus(); return false; } if(!checkmail(document.update.email)) { document.update.email.focus(); return false; } return confirm('確定修改嗎?'); } function check_passwd(pw1,pw2){ for(var idx=0;idx='0'&& uip.charAt(idx)<='9')) { alert("IP不能不是數字 !\n"); return false; } if(uip.length>3){ alert( "IP長度不能超過3位數!\n" ); return false; } } return true; } /////////////////////////////////////////////////////////// function request_type(s,tabT,tabW){ var show_users = document.getElementById("show_type"); sText = '' ; if (s != 'free' ){ sText +=''; }else{ sText +=''; sText +=''; } sText +='

系統型態

'+s+'

Linux

Window

'; show_users.innerHTML = sText; } ///////////////////////////////////////////////////////////////////////////////// function ch_del(){ return confirm('確定刪除?'); } ///////////////////////////////////////////////////////////////////////////////// function checkvmoff(){ var form_name = document.getElementById('FormStop'); var usb_chlog = document.getElementById("hid_usb").value; var A ; for (var i=0; i40){ alert("課程名稱長度不可超過40字元!"); document.add_ohd.oh_name.focus(); return false; } if(document.add_ohd.oh_filename.value==""){ alert("請填寫裝置名稱!"); document.add_ohd.oh_filename.focus(); return false; } if(!check_ohdfname(document.add_ohd.oh_filename.value)) { document.add_ohd.oh_filename.focus(); return false; } return confirm('確定要新增硬碟: '+ document.add_ohd.oh_name.value +' 嗎?'); } function check_ohdfname(pw1){ if(pw1.length<5 || pw1.length>25){ alert( "名稱長度只能5到25個字母 !\n" ); return false; } for(var idx=0;idx= 'a' && pw1.charAt(idx) <= 'z' ) || (pw1.charAt(idx) >= 'A' && pw1.charAt(idx) <= 'Z' ) || (pw1.charAt(idx) >= '0' && pw1.charAt(idx) <= '9' ))){ alert("裝置名稱不可以含有中文 !\n"); return false; } // if(!(( pw1.charAt(idx) >='a' && pw1.charAt(idx) <='z') || ( pw1.charAt(idx) >='A' && pw1.charAt(idx) <='Z'))){ // alert("裝置名稱不可以含有中文 !\n"); // return false; // } } return true; } function checkhdForm(){ if(document.update.hd_name.value=="") { alert("請填寫硬碟名稱!"); document.update.hd_name.focus(); return false; } if(document.update.hd_filename.value=="") { alert("請填寫裝置名稱!"); document.update.hd_filename.focus(); return false; } if(document.update.hd_size.value=="") { alert("請填寫硬碟大小!"); document.update.hd_size.focus(); return false; } return confirm('確定修改嗎?'); } ////////////////////////////////////////////////////////////////////////////// function vm_max(){ var obj = document.getElementById('vm_max'); var st = '

每台伺服器啟用的機器上限:

'; obj.innerHTML = st; } ///////////////////////////////////////////////////////////Management_vmstatus_no.php function request_hds(s) { var oXmlHttp = new XMLHttpRequest(); oXmlHttp.open("get", "/gocloud/require/show_hds.php?original=" + s , true); oXmlHttp.onreadystatechange = function () { if (oXmlHttp.readyState == 4) { if (oXmlHttp.status == 200) { show_hds(oXmlHttp.responseText); }else{ show_hds("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate } } }; oXmlHttp.send(null); } function show_hds(sText) { var show_hds = document.getElementById("show_hds"); show_hds.innerHTML = sText; } ////////////////////////////////////////////////////////////////////////////// function request_image(s){ var oXmlHttp = new XMLHttpRequest(); oXmlHttp.open("get", "./../require/show_images.php?show=" + s , true); oXmlHttp.onreadystatechange = function (){ if (oXmlHttp.readyState == 4){ if (oXmlHttp.status == 200) { show_images(oXmlHttp.responseText); }else{ show_images("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate } } }; oXmlHttp.send(null); } function show_images(sText){ var show_images = document.getElementById("show_images"); show_images.innerHTML = sText; } ////////////////////////////////////////////////////////////////////////////// function show_cdrom(){ var obj = document.getElementById('cdrom'); var st = '

放入光碟:' st = st+'否 '; st = st+'

'; obj.innerHTML = st; } /////////////////////////////////////////////////////////// function restore_num(s,page){ request_hddata(s); if (confirm("確定增加 5 次嗎?") ){ parent.location='../require/Management_hd_s_manager.php?rid='+s+'&page='+page; } } /////////////////////////////////////////////////////////// function restore_toz(s,page){ request_hddata(s); if (confirm("確定不給復原機會?") ){ parent.location='../require/Management_hd_s_manager.php?toz='+s+'&page='+page; } } /////////////////////////////////////////////////////////// function request_menu(s){ var oXmlHttp = new XMLHttpRequest(); oXmlHttp.open("get", "./../require/show_menu.php?show=" + s , true); oXmlHttp.onreadystatechange = function (){ if (oXmlHttp.readyState == 4){ if (oXmlHttp.status == 200) { show_images(oXmlHttp.responseText); }else{ show_images("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate } } }; oXmlHttp.send(null); } function show_menu(sText){ var show_images = document.getElementById("show_menu"); show_images.innerHTML = sText; } /////////////////////////////////////////////////////////// function request_chklogin(){ var oXmlHttp = new XMLHttpRequest(); oXmlHttp.open("get", "../admin/admin_system_check_login.php", true); oXmlHttp.onreadystatechange = function (){ if (oXmlHttp.readyState == 4){ if (oXmlHttp.status == 200) { show_chklogin(oXmlHttp.responseText); }else{ show_chklogin("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate } } }; oXmlHttp.send(null); } function show_chklogin(sText){ var show_images = document.getElementById("chklogin"); show_images.innerHTML = sText; } /////////////////////////////////////////////student_restore.php function checkrestore(){ var hx =0 ; var form_name = document.getElementById('form_hd_r'); var Otype = (form_name.uhd.toString()); // var Otype = (form_name.uhd); // alert( Otype ); // if ( Otype == 'object NodeList' ){ // alert( "2" ); // } // if(form_name.uhd.checked){ // alert( "GG" ); // } // alert(form_name.hid_hdnum.value); if(form_name.hid_hdnum.value == 1){ if(form_name.uhd.checked){ hx++; // alert( "yes" ); } }else{ for (var i=0; i