<?
require_once('includes/configure.php');
require_once "../admin/include/function.php";
require_once "../admin/include/parameter.php";
require_once "../admin/include/newvalue_lib.php";
require_once ("includes/$lang/updateprofile.php");
//require_once "includes/formvalidator.php";

if(isset($_POST['btnAdd'])){
	$dob=$year."-".$month."-".$day;
	$spdob=$spyear."-".$spmonth."-".$spday;

	$sql="
		UPDATE `ivc_members` SET  `im_nominee` = \"$nominee\", `im_nomtitle` = '$nomtitle',  
		`im_dob` = '$dob', `im_nationality` = '$nationality', `im_foreignspecify` = '$foreignspecify', `im_marital` = '$marital', 
		`im_language` = '$language', `im_langaugespecify` = '$langaugespecify', `im_addr1` = \"$addr1\", `im_addr2` = \"$addr2\",
		`im_addr3` = \"$addr3\", `im_postcode` = '$postcode', `im_country` = '$country', `im_maddr1` = \"$maddr1\", `im_maddr2` =\"$maddr2\", `im_maddr3` = \"$maddr3\", 
		`im_mpostcode` = '$mpostcode', `im_mcountry` = '$mcountry', `im_phome` = '$phome', `im_mobile` = '$mobile', `im_fax` = '$fax', 
		`im_email` = '$email', `im_occupation` = '$occupation', `im_income` = '$income',  
		`im_business` = \"$business\", `im_nature` = \"$nature\", `im_offaddr1` = \"$offaddr1\", `im_offaddr2` = \"$offaddr3\", 
		`im_offaddr3` = \"$offaddr3\", `im_offpostcode` = '$offpostcode', `im_website` = '$website', `im_officephone` = '$officephone',
		`im_officeext` = '$officeext', `im_officefax` = '$officefax', `im_nominee1` = \"$nominee1\",`im_designation1` = \"$designation1\",
		`im_nomineehome1` = '$nomineehome1',`im_nomineemobile1` = '$nomineemobile1',`im_nomineefax1` = '$nomineefax1',`im_nomineeemail1` = '$nomineeemail1',
		`im_nominee2` = \"$nominee2\",`im_designation2` = \"$designation2\",`im_nomineehome2` = '$nomineehome2',`im_nomineemobile2` = '$nomineemobile2',
		`im_nomineefax2` = '$nomineefax2',`im_nomineeemail2` = '$nomineeemail2', `im_spouse` = \"$spouse\", `im_sptitle` = '$sptitle',
		`im_spic` = '$spic', `im_spdob` = '$spdob', `im_spnationality` = '$spnationality', `im_spforeignspecify` = '$spforeignspecify',
		`im_spoccupation` = '$spoccupation', `im_sphome` = '$sphome', `im_spmobile` = '$spmobile', `im_spfax` = '$spfax', `im_spemail` = '$spemail'
		  WHERE `im_id` ='".$_SESSION["egoMemberID"]."'
	";
		

	@mysql_query($sql) or die(mysql_error());
	$ainfo=RECORD_UPDATED;
	print("<script type='text/javascript'>location.href='index.php?ai=$ainfo'</script>");	

}else{
	$sql="select * from ivc_members where im_id='".$_SESSION["egoMemberID"]."'";
	$result=mysql_query($sql);	
	while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
	{
		$name=$myrow["im_name"];
		$title=$myrow["im_title"];
		$ic=$myrow["im_ic"];
		list($year,$month,$day)=explode("-",$myrow["im_dob"]);
		$cardno=$myrow["im_cardno"];
		$cardname=$myrow["im_cardname"];
		$nominee=$myrow["im_nominee"];
		$nomtitle=$myrow["im_nomtitle"];
		$nationality=$myrow["im_nationality"];		
		$foreignspecify=$myrow["im_foreignspecify"];
		$marital=$myrow["im_marital"];
		$language=$myrow["im_language"];
		$langaugespecify=$myrow["im_langaugespecify"];
		$addr1=$myrow["im_addr1"];
		$addr2=$myrow["im_addr2"];
		$addr3=$myrow["im_addr3"];									
		$postcode=$myrow["im_postcode"];									
		$country=$myrow["im_country"];									
		$maddr1=$myrow["im_maddr1"];
		$maddr2=$myrow["im_maddr2"];
		$maddr3=$myrow["im_maddr3"];									
		$mpostcode=$myrow["im_mpostcode"];									
		$mcountry=$myrow["im_mcountry"];									
		$phome=$myrow["im_phome"];
		$mobile=$myrow["im_mobile"];
		$fax=$myrow["im_fax"];
		$email=$myrow["im_email"];		
		$occupation=$myrow["im_occupation"];				
		$income=$myrow["im_income"];				
		$joindate=window_date($myrow["im_joindate"]);				
		$business=$myrow["im_business"];				
		$nature=$myrow["im_nature"];				
		$offaddr1=$myrow["im_offaddr1"];
		$offaddr2=$myrow["im_offaddr2"];
		$offaddr3=$myrow["im_offaddr3"];									
		$offpostcode=$myrow["im_offpostcode"];									
		$website=$myrow["im_website"];									
		$officephone=$myrow["im_officephone"];										
		$officeext=$myrow["im_officeext"];										
		$officefax=$myrow["im_officefax"];				
		$nominee1=$myrow["im_nominee1"];			
		$designation1=$myrow["im_designation1"];			
		$nomineehome1=$myrow["im_nomineehome1"];
		$nomineemobile1=$myrow["im_nomineemobile1"];
		$nomineefax1=$myrow["im_nomineefax1"];
		$nomineeemail1=$myrow["im_nomineeemail1"];											
		$nominee2=$myrow["im_nominee2"];			
		$designation2=$myrow["im_designation2"];			
		$nomineehome2=$myrow["im_nomineehome2"];
		$nomineemobile2=$myrow["im_nomineemobile2"];
		$nomineefax2=$myrow["im_nomineefax2"];
		$nomineeemail2=$myrow["im_nomineeemail2"];											
		$spouse=$myrow["im_spouse"];
		$sptitle=$myrow["im_sptitle"];
		list($spyear,$spmonth,$spday)=explode("-",$myrow["im_spdob"]);
		$spic=$myrow["im_spic"];
		$spnationality=$myrow["im_spnationality"];		
		$spforeignspecify=$myrow["im_spforeignspecify"];
		$sphome=$myrow["im_sphome"];
		$spmobile=$myrow["im_spmobile"];
		$spfax=$myrow["im_spfax"];
		$spemail=$myrow["im_spemail"];		
		$spoccupation=$myrow["im_spoccupation"];				


	}	
	$ret_title=get_data("nv_name,nv_chname","newvalue","where nv_id='$title'");
	if($_SESSION["egoLang"]=="CH")$title=$ret_title["nv_chname"];
	else $title=$ret_title["nv_name"];
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?= HTML_PARAMS ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= CHARSET ?>" />
<title><?=TITLE?></title>
<!-- SmartMenus 6 config and script core files -->
<? if($_SESSION["egoLang"]=="ENG"){ ?>
<script type="text/javascript" src="c_config.js"></script>
<? }else if($_SESSION["egoLang"]=="CH"){ ?>
<script type="text/javascript" src="ch_config.js"></script>
<? } ?>
<script type="text/javascript" src="c_smartmenus.js"></script>

<!-- SmartMenus 6 config and script core files -->


<link rel="stylesheet" type="text/css" href="../styles.css" >
<link rel="stylesheet" type="text/css" href="../admin/include/tabcontent.css" />
<script type="text/javascript" src="../admin/include/tabcontent.js">
</script>
<script language="javascript">
function copyaddr(){
	document.form.maddr1.value=document.form.addr1.value;
	document.form.maddr2.value=document.form.addr2.value;
	document.form.maddr3.value=document.form.addr3.value;	
	document.form.mpostcode.value=document.form.postcode.value;
	document.form.mcountry.value=document.form.country.value;
}
</script>
</head>

<body>
<table width="1000" height="600" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td height="82" background="../images/iconic_01.jpg"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="91%" height="30" align="right" valign="bottom" class="topmenu"><? include_once "includes/topmenu.php"; ?></td>
        <td width="9%" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="14" align="right">
          <? include_once "includes/menu.php"; ?>
</td>
        <td height="29" rowspan="2"></td>
      </tr>
      <tr>
        <td height="3" align="right"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="500" valign="top" background="../images/memberlogin_bg.jpg" style="background-repeat:no-repeat">
      <table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="789" height="340" valign="bottom" class="title1"><?=UPDATE_PROFILE;?></td>
      </tr>
      
      <tr>
        <td >
		<form name="form" method="post" action="<?=$PHP_SELF ?>"  >
	   <table width="820" height="250" border="0" align="center" cellpadding="0" cellspacing="0">
      
      <tr>
        
        <td valign="top">
<!--        <div class="scroll"> -->
          
          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
            
            <tr>
              <td colspan="2" ><? echo "<div class='Msg'>$action_msg</div>" ?>&nbsp;</td>
            </tr>
            <tr>
              <td width="47%" valign="top" >
                
                
                <table id="tbl-tabMainContact" class="editTbl" border="0" cellspacing="0" 
  cellpadding="0">
                  <tbody>
                    <tr>
                      <th width="172" height="23" class="text1"><div align="left"><?=NAME_MEMBER; ?> :</div></th>
                    <td width="210" class="text1"><? echo $name ?>                 <input type="hidden" name="hiddenField" /></td>
                </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=TITLE_NAME; ?> :</div></th>
                    <td class="text1"><? echo $title ?>
                      <input name="title" type="hidden" id="title" value="<? echo $title ?>" /></td>
                </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left">
                    <?=NRIC ?>
                    :</div></th>
                    <td class="text1"><? echo $ic ?><input name="ic" type="hidden" id="ic" value="<? echo $ic ?>" />                  </td>
                </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=NAME_NOMINEE;?> :</div></th>
                    <td class="text1"><input 
      name="nominee" id="nominee" value="<? echo $nominee ?>" maxlength="50" style="WIDTH: 180px"/>                  </td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=TITLE_NAME; ?> :</div></th>
                    <td class="text1"><span class="main">
                      <select name="nomtitle" id="nomtitle" style="WIDTH: 180px" onchange="javascript:if(this.options[selectedIndex].value=='add'){newvalue('Title',this.value);}">
                        <option value="1"></option>
                        <?
			 
			 	$sql="select * from newvalue where nv_type='Title' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($nomtitle==$myrow["nv_id"])echo "selected";
					echo ">";
					if($_SESSION["egoLang"]=="CH")$nvname=$myrow["nv_chname"];
					else $nvname=$myrow["nv_name"];
					
					echo "$nvname </option>";
				}
			
?>
                        </select>
                      </span></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=DOB; ?> : </div></th>
                    <td class="text1"><?
echo "<select name='day'>";
echo '<option value=""></option>\n';
foreach ($days as $value) {
	echo '<option value="'.$value.'"';
	if($day==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} echo '</select> ';


if($_SESSION["egoLang"]=="CH")$monthlist=$months_ch;
else $monthlist=$months;

echo "<select name='month'>";
echo '<option value=""></option>\n';
foreach ($monthlist  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($month==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> ';

echo "<select name='year'>";
echo '<option value=""></option>\n';
foreach ($years as $value) {
	echo '<option value="'.$value.'"';
	if($year==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?>
                      <span class="subItem"></span></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=NATIONALITY ?> : </div></th>
                    <td class="text1"><input name="nationality" type="radio" value="Malaysian" <?=($nationality=="Malaysian" ? "CHECKED" : " ")?>/>
                      <?=MALAYSIAN; ?></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input name="nationality" type="radio" value="China" <?=($nationality=="China" ? "CHECKED" : " ")?>/>
                      <?=CHINA; ?></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input name="nationality" type="radio" value="Foreign" <?=($nationality=="Foreign" ? "CHECKED" : " ")?>/>
                      <?=FOREIGN;?><span class="subItem"> <?=SPECIFY?> </span></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input 
      name="foreignspecify" id="foreignspecify" value="<? echo $foreignspecify ?>" maxlength="50" style="WIDTH: 180px"/></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=MARITAL?> : </div></th>
                    <td class="text1"><select style="WIDTH: 180px"
      name="marital" id="marital">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Status' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($marital==$myrow["nv_id"])echo "selected";
						echo ">";
					if($_SESSION["egoLang"]=="CH")$nvname=$myrow["nv_chname"];
					else $nvname=$myrow["nv_name"];
					echo "$nvname </option>";
				}
			
?>
                      
                      </select>                  </td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"><?=LANGUAGE?> : </div></th>
                    <td class="text1"><select style="WIDTH: 180px"
      name="language" id="language">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Language' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($language==$myrow["nv_id"])echo "selected";
						echo ">";
					if($_SESSION["egoLang"]=="CH")$nvname=$myrow["nv_chname"];
					else $nvname=$myrow["nv_name"];
					echo "$nvname </option>";
				}
			
?>
                      
                      </select>                  </td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><span class="subItem"><?=SPECIFY; ?> </span></td>
                  </tr>
                    <tr>
                      <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input 
      name="langaugespecify" id="langaugespecify" value="<? echo $langaugespecify ?>" maxlength="50" style="WIDTH: 180px"/></td>
                  </tr>
                    
                    <tr>
                      <td  height="23" class="text1"><?=HOME_ADDR ?></th>
                        : <td><input name="addr1" style="WIDTH: 180px" value="<? echo $addr1 ?>" maxlength="50" />                        </td>
                        </tr>
                    <td height="23" class="text1">
                      <td><input name="addr2" style="WIDTH: 180px" value="<? echo $addr2 ?>" maxlength="50" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1">
                      <td><input name="addr3" style="WIDTH: 180px" value="<? echo $addr3 ?>" maxlength="50" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1"><?=POSTCODE?> :</td>
                          <td><input 
      name="postcode" id="postcode" style="WIDTH: 180px" value="<? echo $postcode ?>" maxlength="15" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1"><?=COUNTRY?></th>
                      : <td>                <select name="country" id="country">
                        <option value=""></option>
                        <? 	require ("includes/$lang/country.php") ?>
                        </select>
                        <? stayfocus("form","country",$country) ?>	                        </td>
                        </tr>
                  <tr>
                    <td  height="23" class="text1"><?=MAIL_ADDDR ?>                          </th>
                      : </td>
                          <td><span class="text12">
                            <input name="btnCopy" type="button" class="btn" id="btnCopy" value="<?=COPY_ABOVE; ?>" onclick="copyaddr()"/>
                            </span></td>
                        </tr>
                  <tr>
                    <td  height="23" class="text1">&nbsp;</td>
                          <td><input name="maddr1" id="maddr1" style="WIDTH: 180px" value="<? echo $maddr1 ?>" maxlength="50" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1"></td>
                          <td><input name="maddr2" id="maddr2" style="WIDTH: 180px" value="<? echo $maddr2 ?>" maxlength="50" />                        </td>
                        </tr>
                  
                  <tr>
                    <td height="23" class="text1"></td>
                          <td><input name="maddr3" id="maddr3" style="WIDTH: 180px" value="<? echo $maddr3 ?>" maxlength="50" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1"><?=POSTCODE; ?>
                      </th>
                      : </td>
                          <td><input 
      name="mpostcode" id="mpostcode" style="WIDTH: 180px" value="<? echo $mpostcode ?>" maxlength="15" />                        </td>
                        </tr>
                  <tr>
                    <td height="23" class="text1"><?=COUNTRY ?>
                      </th>
                      : </td>
                          <td><select name="mcountry" id="mcountry">
                            <option value=""></option>
                            <? 	require ("includes/$lang/country.php") ?>
                            </select>
                            <? stayfocus("form","mcountry",$mcountry) ?>                        </td>
                        </tr>
                  <tr>
                    <th height="23" class="text1"><div align="left"><?=CONTACT_NO ?> : </div></th>
                          <td class="text1"><?=CONTACT_NO_HOME;?>                          </td>
                        </tr>
                  <tr>
                    <th height="23" class="text1"><div align="left"></div></th>
                          <td class="text1"><input 
      name="phome" id="phome" style="WIDTH: 180px" value="<? echo $phome ?>" maxlength="20" />                        </td>
                        </tr>
                  <tr>
                    <th height="23" rowspan="2" class="text1"><div align="left"></div></th>
                          <td class="text1"><?=CONTACT_NO_MOBILE; ?>                          </td>
                        </tr>
                  <tr>
                    <td class="text1"><input 
      name="mobile" id="mobile" style="WIDTH: 180px" value="<? echo $mobile ?>" maxlength="20" /></td>
                        </tr>
                  <tr>
                    <th height="23" rowspan="2" class="text1"><div align="left"></div></th>
                          <td class="text1"><?=CONTACT_NO_FAX; ?>                          </td>
                        </tr>
                  <tr>
                    <td class="text1"><input 
      name="fax" id="fax" style="WIDTH: 180px" value="<? echo $fax ?>" maxlength="20" /></td>
                        </tr>
                  <tr>
                    <th height="23" class="text1"><div align="left"><?=EMAIL_MEMBER;?> : </div></th>
                          <td class="text1"><input 
      name="email" id="email" style="WIDTH: 180px" value="<? echo $email ?>" maxlength="50" />                        </td>
                        </tr>
                  
                  <tr>
                    <th height="23" class="text1"><div align="left"><?=OCCUPATION;?> : </div></th>
                    <td class="text1"><input 
      name="occupation" id="occupation" style="WIDTH: 180px" value="<? echo $occupation ?>" maxlength="50" />                  </td>
                  </tr>
                  <tr>
                    <th height="23" class="text1"><div align="left"><?=ANUUAL_INCOME; ?> : </div></th>
                    <td class="text1"><select style="WIDTH: 180px"
      name="income" id="income">
                      <option value="1"></option>
                      <?
			 
			 	$sql="select * from newvalue where nv_type='Income' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($income==$myrow["nv_id"])echo "selected";
						echo ">";
					if($_SESSION["egoLang"]=="CH")$nvname=$myrow["nv_chname"];
					else $nvname=$myrow["nv_name"];
					echo "$nvname </option>";
				}
			
?>
                      </select>                  </td>
                  </tr>
                  </tbody>
                  <tr>
                    <td>                            
                      </table></td>
              <td width="53%" rowspan="2" valign="top" ><div id="pettabs" class="indentmenu">
  <ul>
  <li><a href="#" rel="dog1" class="selected"><?=BUSINESS_INFORMATION; ?></a></li>
  <li><a href="#" rel="dog2"><?=FAMILY_INFORMATION;?></a></li>
  </ul>
  <br style="clear: left" />
  </div>
  
<div style="border:1px solid gray; width:400px; height: 630px; padding: 5px; margin-bottom:1em">
  
  <div id="dog1" class="tabcontent">
  <table id="tbl-tabAddresses" class="editTbl" border="0" cellspacing="0" cellpadding="0">
    <tbody>
      <tr>
        <td height="23" class="text1"><?=NAME_BUSINESS;?> :                        </td>
                          <td><input name="business" id="business" style="WIDTH: 180px" value="<? echo $business ?>" maxlength="100" /></td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=NATURE_BUSINESS; ?> : </td>
                          <td><input name="nature" style="WIDTH: 180px" value="<? echo $nature ?>" maxlength="100"/></td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=OFFICE_ADDR; ?> : </th>
          <td><input name="offaddr1" style="WIDTH: 180px" value="<? echo $offaddr1 ?>" maxlength="50" /></td>
                        </tr>
      <tr>
        <td height="23" class="text1"></td>
                          <td><input name="offaddr2" style="WIDTH: 180px" value="<? echo $offaddr2 ?>" maxlength="50"/></td>
                        </tr>
      <tr>
        <td height="23" class="text1"></td>
                          <td><input name="offaddr3" style="WIDTH: 180px" value="<? echo $offaddr3 ?>" maxlength="50"/></td>
                        </tr>
      <tr>                     
        <td height="23" class="text1"><?=POSTCODE; ?> : </td>
                           <td><input 
      name="offpostcode" style="WIDTH: 180px" value="<? echo $offpostcode ?>" maxlength="15" />                        </td>
        </tr>                <tr>
          <td height="23" class="text1"><?=COMPANY_WEBSITE; ?> : </td>
                          <td><input name="website" style="WIDTH: 180px" value="<? echo $website ?>" maxlength="100" /></td>
  
                      </tr>
      <tr>
        <td height="23" class="text1"><?=OFFICE_TEL; ?> : </td>
                          <td><input style="WIDTH: 100px" maxlength="20" name="officephone" value="<? echo $officephone ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=OFFICE_EXT; ?> : </td>
                          <td><input style="WIDTH: 100px" maxlength="5" name="officeext" value="<? echo $officeext ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=CONTACT_NO_FAX; ?> : </td>
                          <td><input style="WIDTH: 100px" maxlength="20" name="officefax" value="<? echo $officefax ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=NAME_NOMINEE; ?> (1) : </td>
                          <td><input style="WIDTH: 180px" maxlength="50" name="nominee1" value="<? echo $nominee1 ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=DESIGNATION; ?> : </td>
                          <td><input style="WIDTH: 180px" maxlength="50" name="designation1" value="<? echo $designation1 ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><div align="left"><?=CONTACT_NO; ?> : </div></td>
                          <td class="text1"><?=CONTACT_NO_HOME; ?>               </td>
                        </tr>
      <tr>
        <td height="23" class="text1"></td>
                          <td class="text1"><input 
      name="nomineehome1" style="WIDTH: 180px" value="<? echo $nomineehome1 ?>" maxlength="20" />                        </td>
                        </tr>
      <tr>
        <td height="23" rowspan="2" class="text1"><div align="left"></div></td>
                          <td class="text1"><?=CONTACT_NO_MOBILE;?>                          </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="nomineemobile1" style="WIDTH: 180px" value="<? echo $nomineemobile1 ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="23" rowspan="2" class="text1"></th>
                          <td class="text1"><?=CONTACT_NO_FAX; ?>                        </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="nomineefax1" style="WIDTH: 180px" value="<? echo $nomineefax1 ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="23" class="text1"><div align="left"><?=EMAIL_MEMBER; ?> : </div></th>
                          <td class="text1"><input 
      name="nomineeemail1"  style="WIDTH: 180px" value="<? echo $nomineeemail1 ?>" maxlength="50" />                        </td>
                        </tr>
      
      <tr>
        <td height="23" class="text1"><?=NAME_NOMINEE; ?> (2) : </td>
                          <td><input style="WIDTH: 180px" maxlength="50" name="nominee2" value="<? echo $nominee2 ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><?=DESIGNATION; ?> : </td>
                          <td><input style="WIDTH: 180px" maxlength="50" name="designation2" value="<? echo $designation2 ?>"/>                  </td>
                        </tr>
      <tr>
        <td height="23" class="text1"><div align="left"><?=CONTACT_NO; ?> : </div></td>
                          <td class="text1"><?=CONTACT_NO_HOME; ?>                         </td>
                        </tr>
      <tr>
        <td height="23" class="text1"></td>
                          <td class="text1"><input 
      name="nomineehome2" id="home" style="WIDTH: 180px" value="<? echo $nomineehome2 ?>" maxlength="20" />                        </td>
                        </tr>
      <tr>
        <td height="23" rowspan="2" class="text1"><div align="left"></div></td>
                          <td class="text1"><?=CONTACT_NO_MOBILE; ?>                       </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="nomineemobile2" id="nomineemobile2" style="WIDTH: 180px" value="<? echo $nomineemobile2 ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="23" rowspan="2" class="text1"></th>
                          <td class="text1"><?=CONTACT_NO_FAX; ?>                        </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="nomineefax2" style="WIDTH: 180px" value="<? echo $nomineefax2 ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="23" class="text1"><div align="left"><?=EMAIL_MEMBER; ?> : </div></th>
                          <td class="text1"><input 
      name="nomineeemail2" style="WIDTH: 180px" value="<? echo $nomineeemail2 ?>" maxlength="50" />                        </td>
                        </tr>	
      </tbody>
    </table>
  </div>
  
<div id="dog2" class="tabcontent">
  <table id="tbl-tabPostalAddresses" class="editTbl" border="0" cellspacing="0" 
cellpadding="0">
    <tbody>
      <tr>
        <td width="172" height="23" class="text1"><div align="left"><?=NAME_SPOUSE; ?> : </div></td>
                    <td width="210" class="text1"><input 
      name="spouse" id="spouse" value="<? echo $spouse ?>" maxlength="50" style="WIDTH: 180px"/>                  </td>
                  </tr>
      <tr>
        <th height="23" class="text1"><div align="left"><?=TITLE_NAME; ?> : </div></th>
                    <td class="text1">
                      <select name="sptitle" id="sptitle" style="WIDTH: 180px" >
                        <option value="1"></option>
                        <?
			 
			 	$sql="select * from newvalue where nv_type='Title' order by nv_id";
				$result=mysql_query($sql) or die(mysql_error());				
				while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC)){
					echo "<option value='".$myrow["nv_id"]."' ";
					if($sptitle==$myrow["nv_id"])echo "selected";
					echo ">";
					if($_SESSION["egoLang"]=="CH")$nvname=$myrow["nv_chname"];
					else $nvname=$myrow["nv_name"];
					echo "$nvname </option>";
				}
			
?>
                        </select>
                      </span></td>
                  </tr>					
      <tr>
        <td height="23" class="text1"><?=NRIC; ?> : </td>
                    <td class="text1"><input 
      name="spic" id="spic" value="<? echo $spic ?>" maxlength="20" style="WIDTH: 180px"/>                  </td>
                  </tr>
      <tr>
        <td height="23" class="text1"><div align="left"><?=DOB; ?> : </div></td>
                    <td class="text1"><?
echo "<select name='spday'>";
echo '<option value=""></option>\n';
foreach ($days as $value) {
	echo '<option value="'.$value.'"';
	if($spday==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} echo '</select> ';

if($_SESSION["egoLang"]=="CH")$monthlist=$months_ch;
else $monthlist=$months;

echo "<select name='spmonth'>";
echo '<option value=""></option>\n';
foreach ($monthlist  as $key => $value) {
	echo '<option value="'.$key.'"';
	if($spmonth==$key)echo ' selected';
	echo '>'.$value.'</option>\n';
}
echo '</select> ';

echo "<select name='spyear'>";
echo '<option value=""></option>\n';
foreach ($years as $value) {
	echo '<option value="'.$value.'"';
	if($spyear==$value)echo ' selected';
	echo '>'.$value.'</option>\n';
} 
echo '</select> ';
?></td>
                  </tr>
      <tr>
        <th height="23" class="text1"><div align="left"><?=NATIONALITY; ?> : </div></th>
                    <td class="text1"><input name="spnationality" type="radio" value="Malaysian" <?=($spnationality=="Malaysian" ? "CHECKED" : " ")?>/>
                      <?=MALAYSIAN; ?></td>
                  </tr>
      <tr>
        <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input name="spnationality" type="radio" value="Foreign" <?=($spnationality=="Foreign" ? "CHECKED" : " ")?>/>
                      <?=FOREIGN; ?><span class="subItem"> <?=SPECIFY; ?> </span></td>
                  </tr>
      <tr>
        <th height="23" class="text1"><div align="left"></div></th>
                    <td class="text1"><input 
      name="spforeignspecify" id="spforeignspecify" value="<? echo $spforeignspecify ?>" maxlength="50" style="WIDTH: 180px"/></td>
                  </tr>				
      <tr>
        <th height="23" class="text1"><div align="left"><?=OCCUPATION; ?> : </div></th>
                    <td class="text1"><input 
      name="spoccupation" id="spoccupation" style="WIDTH: 180px" value="<? echo $spoccupation ?>" maxlength="50" />                  </td>
                  </tr>
      <tr>
        <th height="23" class="text1"><div align="left"><?=CONTACT_NO; ?> : </div></th>
                          <td class="text1"><?=CONTACT_NO_HOME; ?>                         </td>
                        </tr>
      <tr>
        <th height="23" class="text1"><div align="left"></div></th>
                          <td class="text1"><input 
      name="sphome" id="sphome" style="WIDTH: 180px" value="<? echo $sphome ?>" maxlength="20" />                        </td>
                        </tr>
      <tr>
        <th height="23" rowspan="2" class="text1"><div align="left"></div></th>
                          <td class="text1"><?=CONTACT_NO_MOBILE; ?>                          </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="spmobile" id="spmobile" style="WIDTH: 180px" value="<? echo $spmobile ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="23" rowspan="2" class="text1"><div align="left"></div></th>
                          <td class="text1"><?=CONTACT_NO_FAX ?>                         </td>
                        </tr>
      <tr>
        <td class="text1"><input 
      name="spfax" id="spfax" style="WIDTH: 180px" value="<? echo $spfax ?>" maxlength="20" /></td>
                        </tr>
      <tr>
        <th height="26" class="text1"><div align="left"><?=EMAIL_MEMBER; ?> : </div></th>
                          <td class="text1"><input 
      name="spemail" id="spemail" style="WIDTH: 180px" value="<? echo $spemail ?>" maxlength="50" />                        </td>
                        </tr>
      </tbody>
    </table></div>			  
  </div>
  
<script type="text/javascript">

var mypets=new ddtabcontent("pettabs")
mypets.setpersist(true)
mypets.setselectedClassTarget("link")
mypets.init(0)

</script></td>
            </tr>
            <tr>
              <td valign="top" >&nbsp;</td>
            </tr>
            
            <tr class="small">
              <td height="1" colspan="2" bgcolor="#999999"></td>
            </tr>
            <tr class="small">
              <td height="30" colspan="2" class="text1"><span class="require"> <?=FORM_REQUIRED_INFORMATION?></span></td>
            </tr>
            <tr>
              <td colspan="2" valign="top" ><span class="text12">
                <input name="btnAdd" type="submit" class="btn" id="btnAdd" value="<?=BUTTON_UPDATE;?>" />
  &nbsp;&nbsp;</span></td>
              </tr>
          </table>	
		  <!--
		  </div>
		  -->
		  </td></tr>
    </table>
		</form>		</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><? include_once "includes/bottom.php" ?></td>
  </tr>
</table>
</body>
</html>