<?php
$menu_bar_decision = "SELL";    
include_once('heading_7.inc.php'); 
 error_reporting(E_ALL);
?>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0"  bgcolor="#F2F2F4"  class="mainTableBorder">
  
  <tr>
    <td width="100%" colspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="3%" height="258" valign="top">
		  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="whitebg">
              <tr>
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="greyTitle">
                    <tr>
                      <td width="2%">&nbsp;</td>
                      <td width="66%" class="greyTitle"> <?php echo "'".$agencyName."'" ?> - Edit Member </td>

                      <td width="32%" class="smallGreyTitle"><table width="307" border="0" align="right" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="123" align="center" class="smallGreyTitle"><a href="<?php echo $this->config->secure_site_url();?>admin/agency/" class="link05">Agency Home </a></td>
                            <td width="10" class="smallGreyTitle">|</td>
                            <td width="117" align="center" class="smallGreyTitle"><a href="<?php echo $this->config->secure_site_url();?>admin/agency/agency_manage_agentProperty" class="link05">Manage Property</a></td>
                            <td  width="9"class="smallGreyTitle" >|</td>
                            <td width="48" align="center" class="smallGreyTitle"><a href="<?php echo $this->config->site_url();?>common/common_logout" class="link05">Logout</a></td>
                            <td width="4">                          
                          </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>


<?
/*
//******************Alex
$agency_id1=$this->session->userdata('id');
$agency_type1=$this->session->userdata('type');
if (isset($_COOKIE['cookie_agency_id1']))
        $agency_id1 = ($_COOKIE['cookie_agency_id1']);
else
  if ($agency_id1 > 0)
   setcookie("cookie_agency_id1", $agency_id1);
//   else 
 //  echo "agency_id1 not set in - agency_agencyAdmin_editAgentProfile.php";
if (isset($_COOKIE['cookie_agency_type1']))
        $agency_type1 = ($_COOKIE['cookie_agency_type1']);
else
   if ($agency_type1 == 0)
   setcookie("cookie_agency_type1", $agency_type1);
   else 
   echo "agency_type1 not set in - agency_agencyAdmin_editAgentProfile.php";

//******************Alex
*/
//***********Swap agency_id with agent_id
$dummy=$agency_id;
$agency_id=$agent_id;
$agent_id=$dummy;

echo "HHHHHHHagency_id=".$agency_id.'<br />';
echo "IIIIIIIWagent_id=".$agent_id.'<br />';
echo "JJJJJJJagencyName=".$agencyName.'<br />';



?>
              <tr>
    <td class="bodytext style1">
<!--	<form enctype="multipart/form-data" name="editAgentProfile" action="<?php echo $this->config->secure_site_url();?>admin/agency/agency_update_AgentProfile_mod/<?php echo $agent_id.'/'; echo $agency_id.'/'; echo $agent_type;?> "><?php if(isset($_POST['agent_id']))echo $_POST['agent_id']; else echo $agent_id;?>" method="post" onSubmit="return editAgentProfileValid()"> -->
	<form accept-charset="utf-8" enctype="multipart/form-data" name="editAgentProfile" action="<?php echo $this->config->secure_site_url();?>admin/agency/agency_update_AgentProfile_mod/<?php if(isset($_POST['agent_id']))echo $_POST['agent_id']; else echo $agent_id; echo '/'; if(isset($_POST['agency_id']))echo $_POST['agency_id']; else echo $agency_id; echo '/'; if(isset($_POST['agencyName'])) echo $_POST['agencyName']; else echo $agencyName;?>" method="post" onSubmit="return editAgentProfileValid()">
	<table width="100%" border="0" cellspacing="7" cellpadding="0">
	<tr>
	
	<td class="bodytext">&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
                <td><table width="500%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>

                                                <td width="35%" class="agency_register_spacing">Agent's Country, State, and City are same as the agency's one</td>
                                                </tr>
                 </td></table>
                                                <tr>
<tr>&nbsp;</tr>	
	<tr>
	<td width="13%" class="agency_register_spacing"><label class="mandatory">*</label>Name:</td>
	<td width="26%"><label>
	<input class="textbox_blue_witdh85"  name="agentName" type="text" id="agentName" size="30" value="<?php 
$base_url="http://www.golden-fleece-international.com/";
	if(isset($_POST['agentName']))
	echo $_POST['agentName'];
	else 
	echo $formValueName ;?> " />
	</label></td>
	<td width="14%" class="bodytext">&nbsp;</td>
	<td width="47%" class="bodytext">&nbsp;</td>
	</tr>

	<tr>
	<td class="agency_register_spacing"><label class="mandatory">*</label>Address:</td>
	<td><input class="textbox_blue_witdh85" name="address1" type="text" id="address1" size="30"  value="<?php 
	if(isset($_POST['address1']))
	echo $_POST['address1'];
	else 
	echo $formValueAddress1 ;?>" /></td>
	<td class="bodytext">&nbsp;</td>
	<td class="bodytext">&nbsp;</td>
	</tr>
	<tr>
	<td class="agency_register_spacing">&nbsp;</td>
	<td><input class="textbox_blue_witdh85" name="address2" type="text" id="address2" size="30" value="<?php if(isset($_POST['address1']))
	echo $_POST['address2'];
	else 
	echo $formValueAddress2;?>"  /></td>
	<td class="bodytext">&nbsp;</td>
	<td class="bodytext">&nbsp;</td>
	</tr>
	<tr>
<!--	<td class="agency_register_spacing"><label class="mandatory">*</label>Suburb List:</td> -->
<!--	<td><select  class="textbox_blue2 listbox_size_big1" name="suburb_name" id="suburb_name"> -->
       <input type="hidden" class="textbox_blue2 listbox_size_big1" name="suburb_name" id="suburb_name"> 
<!--  	  <option value="0">select</option> -->

	<?php 
//		for ($i = 0 ; $i < count($suburb_list); $i++){
//			if($us_suburb_id == $suburb_list[$i]['suburb_id'] || 
//			(isset( $_POST['suburb_name'] )&& $_POST['suburb_name'] == $suburb_list[$i]['suburb_id'] ))
//				echo '<option value="'.$suburb_list[$i]['suburb_id'].'" selected="selected">'.$suburb_list[$i]['sb_name'].'</option>';
	//		else
//				echo '<option value="'.$suburb_list[$i]['suburb_id'].'">'.$suburb_list[$i]['sb_name'].'</option>';
//		}
	?>
<!--    </select></td> -->
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	</tr> 

	<tr>
	  <td class="agency_register_spacing">Image:</td>
	  <td class="agency_register_spacing" width="68" valign="middle"><input type="hidden" name="image_text" value="<?php if(isset($_POST['image_text']))
	echo $_POST['image_text'];
	else echo $us_image_id_2;?>"/><img src="<?php 
	if(isset($_POST['image_text']))
	echo $this->config->slash_item('base_url').$_POST['image_text'];
	else 
/*****	echo $this->config->slash_item('base_url').$us_image_id_2;?>" /> </td> */
	echo $base_url.$us_image_id_2;?>" /> </td>
	  <td class="errorClass"></td>
	  <td>&nbsp;</td>
	  </tr>
	<tr>
	  <td class="agency_register_spacing">&nbsp;</td>
	  <td class="agency_register_spacing"> <input class="textbox_blue_witdh85" type="file" name="image" id="image" size="30" /></td>
	  <td class="errorClass"></td>
	  <td>&nbsp;</td>
	</tr>
	<tr>
	<td class="agency_register_spacing"><label class="mandatory">*</label>Phone number:</td>
	<td><input class="textbox_blue_witdh85" name="phone" type="text" id="phone" size="30"   value="<?php if(isset($_POST['address1']))
	echo $_POST['phone'];
	else 
	echo $formValuePhn;?>"    /></td>
	<td>&nbsp;</td>
	<td></td>
	</tr>
	<tr>
	<td class="agency_register_spacing"><label class="mandatory"></label>
	Mobile number:</td>
	<td><input class="textbox_blue_witdh85" name="mobile" type="text" id="mobile" size="30"  value="<?php if(isset($_POST['address1']))
	echo $_POST['mobile'];
	else 
	echo $formValueMobile;?>"   /></td>
	<td>&nbsp;</td>
	<td></td>
	</tr>
	<tr>
	<td class="agency_register_spacing"><label class="mandatory"></label>
	  Fax number:</td>
	<td><input class="textbox_blue_witdh85" name="fax" type="text" id="fax" size="30"  value="<?php if(isset($_POST['address1']))
	echo $_POST['fax'];
	else 
	echo $formValueFax;?>"  /></td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td class="agency_register_spacing"><label class="mandatory">*</label>Email:</td>
	<td><input class="textbox_blue_witdh85" readonly="true" name="email" type="text" id="email" size="30" value="<?php if(isset($_POST['email']))
	echo $_POST['address1'];
	else 
	echo $formValueEmail ;?>"    /></td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td>&nbsp;</td>
	<td colspan="2" class="bodytext">Would you like to change your password? <a id="passfieldShow" href="javascript:passChange();">Yes</a></td>
	<td>&nbsp;</td>
	</tr>
	<tr> 
<td colspan="3">
<div id="passChangeDiv" style="width: 350px; display:none;" class="bodytext">
<div class="bodytext">
<div  class="hideShowDiv2"><span class="bodytext">OLD Password:</span></div>
<div class="hideShowDiv"><input class="bodytext" name="old_password" type="password" id="old_password" size="30" /></div>
</div>

<div style="clear: both;" class="bodytext">
<div class="hideShowDiv2"><span class="bodytext">New password:</span></div>
<div class="hideShowDiv"><input class="bodytext" name="new_password" type="password" id="new_password" size="30" /></div>
</div>
<div style="clear: both;" class="bodytext">
<div class="hideShowDiv2" ><span class="bodytext">Confirm password:</span></div>
<div class="hideShowDiv"><input class="bodytext" name="password" type="password" id="password" size="30" /></div>
</div>
<div style="clear: both;" class="bodytext">
<div class="bodytext" style="width:100%" ><p class="bodytext">Must be at least 6 characters &amp; consist of 1 numerical character.</p></div>
</div>
</div></td>
<td colspan="5" class="bodytext"></td>
</tr>

	<tr>
	<td>&nbsp;</td>
	<td colspan="2" class="bodytext"><label class="mandatory bodytext"><?php if(isset($message))
  			echo $message;?></label>&nbsp;	</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td>&nbsp;</td>
	<td colspan="2" class="bodytext"><input name="image" type="image" src="<?php echo $this->config->slash_item('base_url'); ?>system/application/css/images/submit_changes.jpg" alt="submit_changes" />	&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td>&nbsp;</td>
	<td colspan="2" class="bodytext"></td>
	<td>&nbsp;</td>
	</tr>
	</table>
</form></td>
                      </tr>
                      <tr>
                        <td valign="top"><p>&nbsp;</p>
                            <p>&nbsp;</p>
                          <p>&nbsp;</p>
                          <p>&nbsp;</p>
                          <p>&nbsp;</p></td>
                      </tr>
                    </table>
                      <p>&nbsp;</p>
                    <p>&nbsp;</p></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
      