<? 
include("includes/site_config.php");

include("includes/tab_functions.js");

include_once __INCLUDE_CLASS_PATH."/class.DB.php";

$db = new DB();

$area = 'member';




$Sess_UserId=$_SESSION['Sess_UserId'];

if(isset($_REQUEST['Submit'])){
if(isset($_REQUEST['phone'])){
 //$count=$db->get_var("SELECT adv_phone from adverts where adv_userid='$Sess_UserId' AND adv_phone!=''");

$phone=form_get('phone');
$service=form_get('service');


$upd=mysql_query("UPDATE adverts set adv_phone='$phone', phn_provider='$service' where adv_userid='$Sess_UserId'");
	}

}

$sel=mysql_query("SELECT adv_phone, phn_provider from adverts where adv_userid='$Sess_UserId'");
$adv=mysql_fetch_object($sel);

?>

<?=$skin->ShowHeader($area)?>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

function validate_phone() {


   if (document.skype.phone.value.length < 4) {
               alert("Skype name should be more than 4 characters long");
               document.skype.phone.focus();
               return false;
   }
  
}

</script>

<? include("tab_my_account.php");?>
<div class="mainwidth">
<div class="page-header"><div class="page-heading"><?php echo "SMS";?></div></div>
<div class="clear"></div>
<div class="page">
<table width="640" border="0" cellspacing="0" cellpadding="0" class="normal">

  <tr>
    <td class="titlehead">&nbsp;<br /></td>
  </tr>
  <tr>
    <td>
	<table width="100%" border="0" cellspacing="10" cellpadding="0" class="normal">
	<form name="skype" method="post" action="<?=$_SERVER['PHP_SELF']?>" >
  <tr>
    <td width="19%"><strong>My Phone Number: </strong></td>
    <td width="37%"><input type="text" name="phone" value="<?=$adv->adv_phone?>" /></td>
    <td width="44%" rowspan="3" valign="top"><div align="right"></div></td>
  </tr>
  <tr>
    <td><strong>Service Provider: </strong></td>
    <td>
      <select name="service">
       <option <? if($adv->phn_provider=='AT&T') echo "selected" ?>>AT&T</option>
        
      </select>    </td>
    </tr>
  <tr>
    <td>&nbsp;<input type="hidden" name="area" value="sky"</td>
    <td>
      <input type="submit" name="Submit" class = "button" value="Submit" onClick="return validate_phone();">
   
    </td>
    </tr>
  <tr>
    <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <!--<tr>
        <td width="8%" valign="top" class="normal"><strong class="blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="templates/default/images/alert_note.png" alt="" width="25" height="22" /></strong></td>
        <td width="5%">&nbsp;
		</td>
        <td width="87%" valign="top" class="normal">
		In order for skype to work, you will need to login to your Skype account and click on Tools/Options/Privacy. Then you will need to click on Show Advanced Setting and make sure that "Allow my status to be shown on the web" is checked. Once that is checked, click on Save.<br /><br />
		If you don't have skype then you can download it free at <a href="http://www.skype.com"><em><strong>www.Skype.com</strong></em></a><br />
		<br />
		Skype is a free internet communication application.
		
		</td>
      </tr>-->
	   </form>
    </table></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

	</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td></td>
  </tr>
</table>
</div><div class="page-bottom"></div></div>
<?=$skin->ShowFooter($area)?>