Admin constribute for OSC PHP

源代码在线查看: account_check.js.php

软件大小: 84 K
上传用户: sunqingyan
关键词: constribute Admin OSC PHP
下载地址: 免注册下载 普通下载 VIP

相关代码

								/*
				  $Id: account_check.js.php,v 1.8 2003/02/10 22:30:55 hpdl Exp $
				
				  osCommerce, Open Source E-Commerce Solutions
				  http://www.oscommerce.com
				
				  Copyright (c) 2003 osCommerce
				
				  Released under the GNU General Public License
				*/
				?>
				
								if (substr(basename($PHP_SELF), 0, 12) == 'admin_member') {
				?>
				
				
								function validateForm() { 
				  var p,z,xEmail,errors='',dbEmail,result=0,i;
				
				  var adminName1 = document.newmember.admin_firstname.value;
				  var adminName2 = document.newmember.admin_lastname.value;
				  var adminEmail = document.newmember.admin_email_address.value;
				  
				  if (adminName1 == '') { 
				    errors+='';
				  } else if (adminName1.length < ) { 
				    errors+='- Firstname length must over  \n';
				  }
				
				  if (adminName2 == '') { 
				    errors+='';
				  } else if (adminName2.length < ) { 
				    errors+='- Lastname length must over  \n';
				  }
				
				  if (adminEmail == '') {
				    errors+='';
				  } else if (adminEmail.indexOf("@") = (adminEmail.length - 3) || adminEmail.indexOf(".") = (adminEmail.length - 2) || adminEmail.indexOf("@.") >= 0 ) {
				    errors+='';
				  } else if (adminEmail.length < ) {
				    errors+='';
				  }
				
				  if (errors) alert('The following error(s) occurred:\n'+errors);
				  document.returnValue = (errors == '');
				}
				
				
				function checkGroups(obj) {
				  var subgroupID,i;
				  subgroupID = eval("this.defineForm.subgroups_"+parseFloat((obj.id).substring(7)));
				    
				  if (subgroupID.length > 0) {
				    for (i=0; i				      if (obj.checked == true) { subgroupID[i].checked = true; }
				      else { subgroupID[i].checked = false; }
				    }
				  } else {
				    if (obj.checked == true) { subgroupID.checked = true; }
				    else { subgroupID.checked = false; }
				  }
				}
				
				function checkSub(obj) {
				  var groupID,subgroupID,i,num=0;
				  groupID = eval("this.defineForm.groups_"+parseFloat((obj.id).substring(10)));
				  subgroupID = eval("this.defineForm."+(obj.id));
				      
				  if (subgroupID.length > 0) {    
				    for (i=0; i < subgroupID.length; i++) {
				      if (subgroupID[i].checked == true) num++;
				    }
				  } else {
				    if (subgroupID.checked == true) num++;
				  }
				  if (num>0) { groupID.checked = true; }
				  else { groupID.checked = false; }
				}
				//-->
				
				
								} else {
				?>
				
				
								function validateForm() { 
				  var p,z,xEmail,errors='',dbEmail,result=0,i;
				
				  var adminName1 = document.account.admin_firstname.value;
				  var adminName2 = document.account.admin_lastname.value;
				  var adminEmail = document.account.admin_email_address.value;
				  var adminPass1 = document.account.admin_password.value;
				  var adminPass2 = document.account.admin_password_confirm.value;
				  
				  if (adminName1 == '') { 
				    errors+='';
				  } else if (adminName1.length < ) { 
				    errors+='\n';
				  }
				
				  if (adminName2 == '') { 
				    errors+='';
				  } else if (adminName2.length < ) { 
				    errors+='\n';
				  }
				
				  if (adminEmail == '') {
				    errors+='';
				  } else if (adminEmail.indexOf("@") = (adminEmail.length - 3) || adminEmail.indexOf(".") = (adminEmail.length - 2) || adminEmail.indexOf("@.") >= 0 ) {
				    errors+='';
				  } else if (adminEmail.length < ) {
				    errors+='';
				  }
				  
				  if (adminPass1 == '') { 
				    errors+='';
				  } else if (adminPass1.length < ) { 
				    errors+='\n';
				  } else if (adminPass1 != adminPass2) {
				    errors+='';
				  }
				  
				  if (errors) alert('The following error(s) occurred:\n'+errors);
				  document.returnValue = (errors == '');
				}
				
				//-->
				
				
								}
				?>			

相关资源