View file File name : tags-storecategory-addf.php Content :<?php session_start(); include("../include/config.php"); include("../include/functions.php"); validate_admin(); if($_REQUEST['id']!=''){ $storesql=$obj->query("select distinct(tbl_store_zip.city) from tbl_store_zip inner join tbl_city on tbl_city.city=tbl_store_zip.city where tbl_store_zip.storeid='".$_REQUEST['id']."'"); $cityarr=array(); while($resultsqlstore=$obj->fetchNextObject($storesql)){ array_push($cityarr,$resultsqlstore->city); } $cityarr=array_values(array_filter($cityarr)); //remove empty array /* $content=mysql_real_escape_string($_POST['content']); $title=mysql_real_escape_string($_POST['title']); $meta_title=mysql_real_escape_string($_POST['meta_title']); $meta_keywords=mysql_real_escape_string($_POST['meta_keywords']); $meta_description=mysql_real_escape_string($_POST['meta_description']);*/ if($_REQUEST['submitForm']=='yes'){ //metatitle start $h_onearr=$_REQUEST['h1']; $meta_titlearr=$_REQUEST['metatitle']; $meta_keyarr=$_REQUEST['metakeyword']; $meta_descriptionarr=$_REQUEST['metadescription']; for($x=0; $x<count($cityarr); $x++){ $sql_meta=$obj->query("select id from tbl_meta where city='$cityarr[$x]' and storeid='".$_REQUEST['id']."' and filename='store-detail.php'"); if($obj->numRows($sql_meta)){ $result_meta=$obj->fetchNextObject($sql_meta); $obj->query("update tbl_meta set meta_title='$meta_titlearr[$x]',meta_key='$meta_keyarr[$x]',meta_description='$meta_descriptionarr[$x]',h1='$h_onearr[$x]' where id='$result_meta->id'"); }else{ $obj->query("insert into tbl_meta set catid=0, storeid='".$_REQUEST['id']."', pagetitle='Store detail page', filename='store-detail.php', city='$cityarr[$x]', meta_title='$meta_titlearr[$x]',meta_key='$meta_keyarr[$x]',meta_description='$meta_descriptionarr[$x]',h1='$h_onearr[$x]', status=1, canonical='self'"); } //$obj->numRows($sql_meta) } // for $_SESSION['sess_msg']='Content updated successfully'; } // submit=yes }else{ header("location:welcome.php"); } ?> <!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> <title><?php echo SITE_TITLE; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/admin.css" rel="stylesheet" type="text/css" /> <script src="../js/jquery-1.5.1.min.js"></script> <script type="text/javascript" language="javascript"> function validate(obj) { if(obj.title.value==''){ alert("Please enter title"); obj.title.focus(); return false; } } </script> <script type="text/javascript" src="../include/ckeditor/ckeditor.js"></script> </head> <body> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <?php include("header.php") ?> <tr> <td align="right" class="paddRtLt70" valign="top"> <table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" class="headingbg bodr text14"> <em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: Update Content <span style="float:right; margin-right:100px"><a href="tags-storecategory-addf.php"><span style="color:#0066CC; font-size:15px">Update Category Metas</span></a></span></td> </tr> <tr> <td height="100" align="left" valign="top" bgcolor="#f3f4f6" class="bodr"> <form name="frm" method="POST" enctype="multipart/form-data" action="" onsubmit="return validate(this)"> <input type="hidden" name="submitForm" value="yes" /> <input type="hidden" name="id" value="<?php echo $_REQUEST['id'];?>" /> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center" colspan="2" class="paddRt14 paddBot11"> <font color="#FF0000"><strong><?php echo $_SESSION['sess_msg']; $_SESSION['sess_msg']='';?></strong></font></td> </tr> <tr> <td width="18%" align="right" class="paddBot11 paddRt14"> </td> <td width="82%" align="left" class="paddBot11"></td> </tr> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Store Name :</strong></td> <td align="left" class="paddBot11"><strong><?php if($_REQUEST['id']){ echo ucwords(getFieldWhere('storename','stores','storeid',$_REQUEST['id'])); } ?></strong></td> </tr> <!-- <tr> <td align="right" class="paddRt14 paddBot11"><strong>Content :</strong></td> <td align="left" class="paddBot11"><textarea name="content" rows="20" cols="60" class="ckeditor" id="content"><?php echo stripslashes($result->content);?></textarea></td> </tr>--> <?php for($x=0; $x<count($cityarr); $x++){ $sql=$obj->query("select h1 from tbl_meta where storeid='".$_REQUEST['id']."' and city='$cityarr[$x]' and filename='store-detail.php'"); $result=$obj->fetchNextObject($sql); ?> <tr> <td align="right" class="paddBot11 paddRt14"><strong>H1 For <?php echo ucwords($cityarr[$x]); ?>:</strong></td> <td align="left" class="paddBot11"><input type="text" name="h1[]" value="<?php echo stripslashes($result->h1); ?>" style="width:500px" /></td> </tr> <?php } ?> <?php for($x=0; $x<count($cityarr); $x++){ $sql=$obj->query("select meta_title from tbl_meta where storeid='".$_REQUEST['id']."' and city='$cityarr[$x]' and filename='store-detail.php'"); $result=$obj->fetchNextObject($sql); ?> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Meta Title For <?php echo ucwords($cityarr[$x]); ?>:</strong></td> <td align="left" class="paddBot11"><input type="text" name="metatitle[]" value="<?php echo stripslashes($result->meta_title); ?>" style="width:500px" /></td> </tr> <?php } ?> <?php for($x=0; $x<count($cityarr); $x++){ $sql=$obj->query("select meta_key from tbl_meta where storeid='".$_REQUEST['id']."' and city='$cityarr[$x]' and filename='store-detail.php'"); $result=$obj->fetchNextObject($sql); ?> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Meta Keywords <?php echo ucwords($cityarr[$x]); ?>:</strong></td> <td align="left" class="paddBot11"><textarea name="metakeyword[]" rows="5" cols="40"><?php echo stripslashes($result->meta_key); ?></textarea></td> </tr> <?php } ?> <?php for($x=0; $x<count($cityarr); $x++){ $sql=$obj->query("select meta_description from tbl_meta where storeid='".$_REQUEST['id']."' and city='$cityarr[$x]' and filename='store-detail.php'"); $result=$obj->fetchNextObject($sql); ?> <tr> <td align="right" class="paddBot11 paddRt14"><strong>Meta Description <?php echo ucwords($cityarr[$x]); ?>:</strong></td> <td align="left" class="paddBot11"><textarea name="metadescription[]" rows="5" cols="60"><?php echo stripslashes($result->meta_description); ?></textarea></td> </tr> <?php } ?> <tr> <td width="18%" align="right" class="paddRt14 paddBot11"> </td> <td width="82%" align="left" class="paddBot11"> <input type="submit" name="submit" value="Submit" class="submit" border="0"/> <input name="Reset" type="reset" id="Reset" value="Reset" class="submit" border="0" /> </td> </tr> </table></form> </td> </tr> </table> </td> </tr> </table> </td> </tr> <?php include('footer.php'); unset($_SESSION['sess_msg']); ?> </table> </body> </html>