GIF89a;
Direktori : /home/serb/www/admin/ |
Current File : /home/serb/www/admin/add_categoryprice.php |
<? include("sessionout.php"); include("../lib/globals.php"); include("../lib/common.php"); include("../lib/functions.php"); require_once('../fckeditor/fckeditor.php'); $id=$_POST["id"]; $sb=$_POST["Submit"]; if($sb=="Process") { $stateid=$_POST['state']; $sql_state="SELECT * FROM states where id='".$_POST['state']."'"; $res_state=execute_query($sql_state); $row_state=mysql_fetch_array($res_state); $statename=$row_state['name']; $categoryid=$_POST['cateGory']; $sql_catname="SELECT * FROM ad_catagory where id='".$_POST['cateGory']."'"; $res_catname=execute_query($sql_catname); $row_catname=mysql_fetch_array($res_catname); $categoryname=$row_catname['name']; $cate_price=$_POST['catPrice']; $sql_chk="SELECT * from ad_category_price where state_id='".$_POST['state']."' AND category_id='".$_POST['cateGory']."'"; $res_chk=execute_query($sql_chk); $num_chk=mysql_num_rows($res_chk); if($num_chk>0) { ?> <script> alert('This Category Price Already Added in This City'); window.location.href="list_ad_category_price.php"; </script> <? } else { $insert_sql="insert into ad_category_price(id,state_id,state_name,category_id,category_name,cat_price) values('','$stateid','$statename','$categoryid','$categoryname','$cate_price')"; //print $insert_sql; execute_query($insert_sql); ?> <script> window.location.href="list_ad_category_price.php"; </script> <? } } ?> <!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" /> <title>:: Adult Rubs | Admin ::</title> <link href="../style.css" rel="stylesheet" type="text/css" /> <script language="javascript" src="../validator/frm_validator.js"></script> <script> function validate4() { if(frmValidate('f1','page_title','Page Title','YES','')== false) { return false; } if(frmValidate('f1','page_name','Page Name','YES','')== false) { return false; } } </script> </head> <body> <table width="790" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top"><table width="790" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="td1"><table width="790" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="343" align="left" valign="top"> </td> <td width="447" align="left" valign="top"> </td> </tr> <tr> <td height="38" align="right" valign="middle" class="topnav"><p style="margin-left:23px;"><img src="img/logo.png" alt="" /></p></td> <td align="center" valign="middle" class="footer-link">Administrator Control Panel</td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" class="td2"> </td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="5"></td> </tr> <tr> <td align="center" valign="top" class="td4"><table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="6"></td> </tr> <tr> <td align="center" valign="top" class="td5"> </td> </tr> <tr> <td align="center" valign="top" class="td9"><table width="751" border="0" align="center" class="bordermain"> <tr> <td><? include("menu.php");?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <form action="<? print $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="f1" onSubmit="return validate4()" > <table width="735" border="0" align="center" cellspacing="1" class="Table4"> <tr> <td colspan="2" align="center" class="tblHeader2">Add New Category Price </td> </tr> <tr class="mouseOver"> <td width="41%" align="right"><strong>State Id: </strong></td> <td width="59%" align="left"><select name="state" id="state" class="drp_img2"> <? $sql_state="SELECT * FROM states ORDER BY name"; $res_state=execute_query($sql_state); while($row_state=mysql_fetch_array($res_state)) { ?> <option value="<?=$row_state['id'] ?>" name="statename"><?=$row_state['name'] ?></option> <? } ?> </select> </td> </tr> <tr class="mouseOver"> <td width="41%" align="right"><strong>Category Id: </strong></td> <td width="59%" align="left"> <select name="cateGory" id="catname"> <? $sql_adcatecory="SELECT * FROM ad_catagory ORDER BY id"; $res_adcatecory=execute_query($sql_adcatecory); while($row_adcatecory=mysql_fetch_array($res_adcatecory)) { ?> <option value="<?=$row_adcatecory['id'] ?>" name="catname"><?=$row_adcatecory['name'] ?></option> <? } ?> </select> </td> </tr> <tr class="mouseOver"> <td width="42%" align="right"><strong>Price: $</strong></td> <td width="58%" align="left"><input name="catPrice" type="text" class="content" id="page_name" size="50" /></td> </tr> <tr class="mouseOver"> <td width="42%" align="right"> </td> <td width="58%" align="left"> </td> </tr> <tr class="mouseOver"> <td align="right"><input name="Submit" type="submit" class="butn3" value="Process" /> </td> <td align="left" > <input name="Submit2" type="reset" class="butn3" value="Reset" /></td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> </table> </form> </td> </tr> </table> </td> </tr> <tr> <td width="232" align="center" valign="top" class="td5"> </td> </tr> <tr> <td height="6"></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top" class="footer-bac"> <p style="text-align:center; padding:35px 0 5px 0px;"><a href="main.php" class="footer-link">Administrator Control Panel </a></p> <p class="footer-text1" style="text-align:center;">Adult Rubs</p> </td> </tr> </table></td> </tr> </table> </body> </html>