2. 頁中程式
<!DOCTYPE html>
<Html>
<Head>
<Title>RAM登錄</Title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
<!--
a:hover { color: #FF0000; text-decoration: none}
a:visited { text-decoration: none}
a:link { color: #0000FF; text-decoration: none}
a:active { text-decoration: none}
textarea { height: auto; }
input.right{
text-align:right;
}
-->
</style>
<script language="JavaScript">
<!--
var errfound = false;
var xmlHttp;
function ValidateNumber(e) {
var key;
if(window.event) {
key = e.keyCode;
}else if(e.which) {
key = e.which;
} else {
return true;
}
if(8==key || 46==key){//8:backspace 46:delete (倒退鍵和刪除鍵也允許作用)
return true;
}
var keychar = String.fromCharCode(key);
var reg = /\d/;
return reg.test(keychar);
};
function FieldLength(item,len) {
if (item.value.length > len - 1 ) return false;
else return true;
};
function ValidLength(item, len) {
return (item.length >= len);
}
function MatchLength(item, len) {
document.frmMobile.msg.value = item.length;
return (item.length == len);
}
function ShowMsg(elem, text){
window.alert(text);
elem.select();
elem.focus();
errfound = true;
}
function IsNull( val ) {
var isValid = false;
if (val+"" == "null")
isValid = true;
return isValid;
}
function IsUndef( val ) {
var isValid = false;
if (val+"" == "undefined")
isValid = true;
return isValid;
}
function IsBlank( str ) {
var isValid = false;
if ( IsNull(str) || IsUndef(str) || (str+"" == "") )
isValid = true;
return isValid;
}
function IsAlpha( str ) {
if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
return false;
var isValid = true;
str += "";
for (i = 0; i < str.length; i++) {
if ( !( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) ) {
isValid = false;
break;
}
}
return isValid;
}
function IsAlphaNum( str ) {
if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
return false;
var isValid = true;
str += "";
for (i = 0; i < str.length; i++) {
if (!(((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) ||
((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
((str.charAt(i) >= "A") && (str.charAt(i) <= "Z"))))
{
isValid = false;
break;
}
}
return isValid;
}
function IsValidEmail( str ) {
if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
return false;
var isValid = true;
str += "";
namestr = str.substring(0, str.indexOf("@"));
domainstr = str.substring(str.indexOf("@")+1, str.length);
if (IsBlank(str) || (namestr.length == 0) ||
(domainstr.indexOf(".") <= 0) ||
(domainstr.indexOf("@") != -1) ||
!IsAlpha(str.charAt(str.length-1)))
isValid = false;
return isValid;
}
function jsGetDPY(iPtype) {
var selectedValue = iPtype.options[iPtype.selectedIndex].value;
var iPRG=document.getElementById("SetDPY");
//document.frmMobile.query.value="SetDPY";
iPRG.src="CompanySetDPY1.php"+"?MODE="+selectedValue;
};
function jsSetProductMode(iPtype)
{
var selectedValue = iPtype.options[iPtype.selectedIndex].value;
var DocRoot=document.getElementById("DocRoot");
document.frmMobile.query.value="SetMode";
window.location.href = DocRoot.value+"/Company/CompanySetModeDPY.php"+"?iKIND="+selectedValue;
}
function jsSubmit()
{
var num=document.frmMobile.quantity.value;
if ( num < 1 ) {
errfound = true;
ShowMsg(document.frmMobile.quantity, '數量不能小於 1 !');
}
if (errfound==true) {
document.frmMobile.query.value="error-found";
} else {
document.frmMobile.query.value="submit";
};
}
function AlertMsg()
{
var ipar = window.parent;
var msg1="送修時請勿將機卡、機卡托盤、附配件一起送修\n";
var msg2="若需附上配件一起檢測時,請在備註欄位加註說明\n";
var msg3="Model ZR (NNN)機種,送修時請將背蓋一起送修\n";
window.alert(msg1+msg2+msg3);
}
function Validate()
{
}
//-->
</script>
</Head>
<body bgcolor="#ffffff" OnLoad="AlertMsg();">
<form onSubmit="return Validate();" method="post" name="frmMobile" target="_self" id="frmMobile" width="100%">
<table width="100%" border="0" name="mainTable" id="mainTable">
<tr>
<td width="16%" height="14"> </td>
<td height="14" bgcolor="#ffffff">
<div align="center"><IMG height=22 width=106 src=https://www.synvision.com.tw/agent/callfix/images/service_regist_title.gif ><br>
</div>
<hr>
<center>
<font color="#400080" size="2"><font color="#ff0000"></font></font> <font color="#400080" size="2">:
</font>
</center>
</td>
<td width="15%" height="14px">
</td>
</tr>
<tr>
<td width="16%" height="286"> </td>
<td height="286" bgcolor="#004080">
<table width="100%" border="0" height="257" align="center">
<tr>
<td width="30%" height="30px" bgcolor="#99cccc" align="right"><font face="新細明體" size="2" color="#333333">
商品名稱:</font>
</td>
<td width="68%" height="30px" bgcolor="#cccccc">
<select id="ProductKind" name="ProductKind" STYLE='BACKGROUND-COLOR:#44FFFF' onChange='javascript: jsSetProductMode(this)'>
<option value=DPA(單機) selected='selected'>DPA(單機)</option> <option value=DOA>DOA</option> <option value=機板>機板</option> <option value=配件>配件</option> <option value=藍芽>藍芽</option> </select>
<font size="2" color="#ff0000">*</font>
</td>
</tr>
<tr>
<td width="30%" height="30px" bgcolor="#99cccc" align="right"><font face="新細明體" size="2" color="#333333">機型:</font></td>
<td width="68%" height="30px" bgcolor="#cccccc">
<select name="ProductMode" id="ProductMode" STYLE="BACKGROUND-COLOR:#FFFFFF" onChange='javascript: jsGetDPY(this) ;'>
<option value=N1 selected='selected'>N1</option> <option value=N2>N2</option> </select>
</td>
</tr>
<tr>
<td width="30%" height="30px" bgcolor="#99cccc" align="right"><font face="新細明體" size="2" color="#333333">DPY No:</font></td>
<td width="68%" height="30px" bgcolor="#cccccc">
<div width="68%" height="30px">
<iframe name="SetDPY" id="SetDPY" vspace="50%" style="width:50%; height:50%; display:box;" frameborder="0" sandbox="allow-forms
allow-scripts allow-top-navigation" scrolling=no src="CompanySetDPY1.php" ?MODE=N1 >
</div>
</td>
</tr>
<tr>
<td width="30%" height="30px" bgcolor="#99cccc" align="right"><font face="新細明體" size="2" color="#333333">數量:</font></td>
<td width="68%" height="30px" bgcolor="#cccccc">
<input class="right" type="text" name="quantity" id="quantity" maxlength="3" size="3" style="ime-mode:disabled" onkeypress="return ValidateNumber(event)"
value=>
</td>
</tr>
</table>
<table name="tabMSG" id="tabMSG">
<tr><td>
<input type="submit" value="新 增" name="submit" onclick="javascript: jsSubmit();">
<input type="hidden" name="query" id="query" value="">
<input type="hidden" name="DocRoot" id="DocRoot" value="
https://www.synvision.com.tw">
<input type="test" name="txtMEMO" id="txtMEMO" value="">
</td></tr>
<tr><td>
訊息::MSG=,KIND:DPA(單機)
</td></tr>
</table>
</td>
</tr>
</table>
</form>
<div align="left" style="position: absolute; top: 120;left: 100px;width: 210px;height: 125px;" >
<iframe name="list1" id="list1" frameborder="0" width="900" height="800" sandbox="allow-forms allow-scripts" src="RMA_request_list.php">
</iframe>
</div>
</body>
</html>