<?php
$id = $_REQUEST["id"];
$detailID = $_REQUEST["detailID"];
$where = $PHP_SELF.urlencode("?id=$id&detailID=$detailID");
include("../common.php");
include("common.php");
include("../include/security.php");
$Blog = new Blog();
$is_member = false;
//access right check ================================================
$t = mysql_query("select * from $table_details where ID=$detailID");
$row = mysql_fetch_array($t);
$user = $row["user"];
if($_POST["st"]=="update" && strtolower($user)==strtolower($hotnetUser) || $sys["isAdmin"] || $sys["isSuperMaster"] || $sys["isMaster"]){
//================================================================	
	$is_member = true;
	if($_POST["st"]=="update"){
		$subject = norm($subject);		
		$content = norm($content);
		$tags = norm($tags);	
		if(mysql_query("update $Blog->table set subject='$subject',content='$content',tags='$tags' where ID=$detailID")){						
			$msg = "<font class=red>You have updated successfully!</font>";
		}
	}
}
else{
	$msg = "<a class=red href='javascript:history.go(-1)'>Access is denied</a>";
}
$user = $sys["user"];
$t = mysql_query("select * from $table_details where ID='$id'");
if($row_root=mysql_fetch_array($t)){
	$subject1 = $row_root["subject"];
	$subjectStr = $row_root["subject"];
	$catID = $row_root["catID"];
	$t1 = mysql_query("select * from $table_cats where ID='$catID'");
	$row1 = mysql_fetch_array($t1);
	$catTitle = $row1["title"];
	$nav = "Home &gt;&gt; ".$this_section." &gt;&gt;</a> $catTitle";
}
if($is_member){
$t = mysql_query("select * from $table_details where ID=$detailID");
if($row=mysql_fetch_array($t)){
	$subject = $row["subject"];
	$content = $row["content"];
	$tags = $row["tags"];
}
}
$titleHeader = $this_section;
?>
<!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">
<head>
<meta http-equiv="Pragma" content="no-cache" />
<META name="description" content="PR, BEAUTY PR AGENCIES IN NY,PR NEW YORK, PR IN NY,JANE OWEN,JANE MORTON OWEN,JANEOWENPR,OWEN/XAVIER,HOLLYWOOD GIFTING SUITES, GREEN GIFT SUITES, GIFT SUITE, SWAGS, CHARITY SPONSORSHIP,sponsorship, marketing, celebrity guestlists, red carpet, charity events, a-list parties, production, fashion pr, beauty pr, hollywood parties">
<META name="keywords" content="">
<meta name="geo.country" content="AU" />
<meta name="dc.language" content="en" />
<meta name="robots" content="follow,index">
<title>practically perfect pr</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/<?=$this_section?>/include/style.css" type="text/css">
<script language=javascript>
function check(thisForm){
  var subject =thisForm.subject;  
  var fields = new Array(subject);
   //don't need to change the following lines 
  var error = false;
  var focusObj = null;
  var color1 = "#FF9900";
  var color2 = "#FFFFFF";
  
  for(i=0;i<fields.length;i++){
  	fields[i].style.background=color2;
	if(fields[i].value==""){
		fields[i].style.background=color1;
		if(!error)
			focusObj = fields[i];
		error=true;		
	}
  }  
  if(error){
  	focusObj.focus();
    alert("Please enter the required info in the highlight field.");
    return false;
  }
  else{
  	thisForm.auth.value="<?=passEncode($pDateC)?>";
    thisForm.Submit.value = "submitting ..."
  	thisForm.Submit.disabled = true;
    return true;
  }  
}
function remind(){
		var agree=confirm("Are you sure to delete this info? ");
		if (agree)
			return true ;
		else
			return false ;		
}
function add_tag(thisField){
	var tagField = document.form1.tags;
	if(tagField.value=="")
		tagField.value = thisField.value;
	else{
		if(tagField.value.indexOf(thisField.value)==-1)	
			tagField.value = tagField.value +" "+thisField.value;
	}	
}
function act(page,w,h){
	var win;   
   	win = open(page,"","location=no,directories=no,top=0, left=0,width="+w+",height="+h+",scrollbars=1,toolbar=0,resizable=1,status=1");
   	win.focus();		
}
function check_all(mode){
	with (document.forms["form3"]){
		if(mode==1){
			for (var n=0; n<elements.length; n++) {
				elements[n].checked = true;
			}
		}
		else if(mode==0){
			for (var n=0; n<elements.length; n++) {
				elements[n].checked = false;
			}
		}	
	}
}
var user = "";
function set_user(obj){
	if(obj.checked==true){
		user = document.form1.user.value;
		document.form1.user.value='Guest';
	}
	else{
		document.form1.user.value = user;
	}
}
</script>

<script type="text/javascript" src="../include/bbs_encode.js"></script>
</HEAD>
<BODY>
  <div>
    <table width="620" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td height="10" valign="top"></td>
      </tr>
      <tr> 
        <td height="56" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td width="76%" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr> 
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr> 
                          <td height="18"> 
                            <?=$nav?>
                          </td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr> 
                    <td align="center"> 
                      <?=$msg?>
                    </td>
                  </tr>
                  <tr> 
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr> 
                          <td>&nbsp;</td>
                        </tr>
                        <tr> 
                          <td><table width="100%" border="0" cellspacing="0" cellpadding="5">
                              <tr> 
                                <td height="53"><table width="100%" cellpadding="0" cellspacing="0" >
                                    <tr> 
                                      <td  height="270" valign="top" > <table class="td_white" width="100%"  height="332" cellpadding="0"  cellspacing="0"  style="border-width:1;border-style:solid;border-color:#999999">
                                          <tr> 
                                            <td height="330" valign="top" > <form action="hotnet_bbs_edit" method="post" name="form1" id="form1"  onsubmit="return check(this)">
                                                <table class="td_white" width="100%" border="0" cellpadding="0" cellspacing="0" >
                                                  <tr valign="top"> 
                                                    <td height="26" colspan="3" > 
                                                      <nobr> 
                                                      <table class="td_white" width="100%" border="0" cellpadding="0" cellspacing="0" >
                                                        <tr > 
                                                          <td width="693" height="28" align="center" class="small" style="padding-left:10px">Reply: 
                                                            <?=$row["subject"]?>
                                                          </td>
                                                        </tr>
                                                      </table>
                                                      </nobr></td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td align="right" valign="top" class="td_white_right" >*First 
                                                      line:</td>
                                                    <td colspan="2" valign="top" ><input type="text" size="55" name="subject" value="<?=$subject?>" /></td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td align="right" valign="top" class="td_white_right" >&nbsp;</td>
                                                    <td colspan="2" valign="top" ><table style="width:504px" border="0" cellspacing="0" cellpadding="0" class="td_white">
                                                        <tr > 
                                                          <td width="25%">&nbsp; </td>
                                                          <td width="18%"><a class="black" href="javascript:addimage1('content')"> 
                                                            Photo<img src="/library/htmlarea/images/ed_image.gif" width="18" height="18" align="absmiddle" border="0"  style="cursor: hand;" /></a><strong> 
                                                            </strong></td>
                                                          <td width="57%"><a class="black" href="javascript:addURL1('content')"> 
                                                            Link<img src="/library/htmlarea/images/ed_link.gif" width="18" height="18" border="0" align="absmiddle" /></a><strong> 
                                                            </strong></td>
                                                        </tr>
                                                      </table></td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td width="128" align="right" valign="top" class="td_white_right" > 
                                                      More:</td>
                                                    <td colspan="2" valign="top" ><textarea name="content" style="width:500px; height:150px"><?=$content?></textarea> 
                                                    </td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td align="right" valign="top" class="td_white_right" >Tags:</td>
                                                    <td colspan="2" class="small" ><input name="tags" type="text" class="textField" style="width:500px" value="<?=$tags?>" size="75" maxlength="100" /> 
                                                      <br />
                                                      Multiple tags are separated 
                                                      with commas</td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td align="right" valign="top" class="td_white_right" >&nbsp;</td>
                                                    <td colspan="2" >&nbsp;</td>
                                                  </tr>
                                                  <tr class="td_white"> 
                                                    <td width="128" class="td_white_right" >&nbsp;</td>
                                                    <td width="298" bgcolor="#CCCCCC" class="td_white" > 
                                                      <input type="hidden" name="auth" value="" />
                                                      <input type="hidden" name="detailID" value="<?=$detailID?>" /> 
                                                      <input type="hidden" name="id" value="<?=$id?>" /> 
                                                      <input name="st" type="hidden" id="st" value="update" /> 
                                                      <input type='submit' name='Submit' value='Update'/> 
                                                      <br /> </td>
                                                    <td width="180" bgcolor="#CCCCCC" class="td_white" >&nbsp;</td>
                                                  </tr>
                                                </table>
                                              </form></td>
                                          </tr>
                                        </table></td>
                                    </tr>
                                  </table></td>
                              </tr>
                            </table></td>
                        </tr>
                      </table></td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
</body>
</html>