<? ob_start();
session_start();
require_once("../dbconnect.php");
if(isset($_POST['submit']) )
  {


  $query="Update store SET  description='".$_POST['message']."' where stid=".$_POST['stid'];
  mysql_query($query) or die("Query failed in updating aboutus: " . mysql_error());
  
  header("location:mystore.php?sec=sec");
  
  }


?>
<!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="Content-Type" content="text/html; charset=iso-8859-1" />
<?php include_once("title.php");?>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="ajaxvalid.js"></script>

<script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce_src.js"></script>
<script type='text/javascript'>

      tinyMCE.init({mode : "exact",theme : "advanced",width: 550, height:400,
      theme_advanced_toolbar_align : "justify",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,fontselect,fontsizeselect",
      elements : "message",theme_advanced_toolbar_location : "top"});
</script>


<style type="text/css">
<!--
.style2 {
	color: #21262A;
	font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><? require_once("header.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="30" class="cate_pro">My Store</td>
                    <td>&nbsp;</td>
                    <td class="index_text" align="right">&nbsp;</td>
                    <td width="20">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="39%" valign="top" style="padding-right:1px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="35" colspan="5"><table border="0" cellpadding="2" cellspacing="0" width="100%">
                          <tr class="dataTableHeadingRow">
                            <td width="41" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">Id</td>
                            <td width="338" align="left" bgcolor="#D7D6CC" class="dataTableHeadingContent">Name</td>
                            </tr>
                          <? 
			$QUERY="Select * from store"; 
			$sqlexe=mysql_query($QUERY);
										
			while($storerow=mysql_fetch_array($sqlexe))
		      {
					 ?>
						  
                      
                          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
                            <td width="41" height="30" align="ledt" class="dataTableContent" >
							<a href="mystore.php?id=<? echo $storerow['stid']; ?>" class="lax">
							<? echo $storerow['stid'];  ?>
							</a></td>
                            <td align="left" class="dataTableContent">
							<a href="mystore.php?id=<? echo $storerow['stid']; ?>" class="lax">
							<? echo $storerow['storename'];  ?>
							</a>
							</td>
                            </tr>
                         
                          <? } ?>
                        </table></td>
                      </tr>
                      <tr>
                        <td width="22%" height="35">&nbsp;</td>
                        <td width="16%" align="center"></td>
                        <td width="16%" align="center"></td>
                        <td width="23%">&nbsp;</td>
                        <td width="23%">&nbsp;</td>
                      </tr>
                    </table></td>
                    <td width="61%" valign="top">
					<? if($_GET['id']!="") {?>
					
					<? $QUERYDIS="SELECT * FROM store WHERE stid=".$_GET['id'];
						     $EXEDIS=mysql_query($QUERYDIS);
							 $row=mysql_fetch_array($EXEDIS);
						  ?>
					<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
                   
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent"><span class="style2"><? echo $row['storename'];  ?></span></td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
						      <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
						 <tr>
                          <td align="center" style="padding-left:5px;">
						  
						  
						  			 <form name='form1' action="" method="post" enctype="multipart/form-data">
									 <input type="hidden" name="stid" value="<? echo  $row['stid']; ?>" />
			<textarea id="message" name="message" rows="20" cols="75"><? echo $row['description']; ?></textarea>
		<input type="submit" value="Modify" id="submit" name="submit" /></form>
						  
						  </td>
                        </tr>
						
						      <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
                    
                     
                    </table>
					<? }else if($_GET['sec']){?>
					<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">
                   
                        <tr>
                          <td height="17" align="center" bgcolor="#D7D6CC" class="dataTableHeadingContent"><span class="style2">successfully</span></td>
                        </tr>
                        <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
						      <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
						 <tr>
                          <td align="center" style="padding-left:5px;"><span class="style2"><img src="images/tick.gif" /> Modified successfully</span></td>
                        </tr>
						
						      <tr>
                          <td align="center" style="padding-left:5px;">&nbsp;</td>
                        </tr>
                    
                     
                    </table>
					
					<? } ?>
					</td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><? require_once("footer.php"); ?></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
