All pastes #941401 Raw Edit

Untitled

public php v1 · immutable
·published 2008-03-13 17:55 UTC
rendered paste body
<? //global_session('counter');include("config.php"); ?><html><head><script src="select.js"></script><link rel="stylesheet" type="text/css" href="admin.css" />	<script>var dropdown_count = 1;function addEvent() {  dropdown_count++;  var ni = document.getElementById('myDiv');  var numi = document.getElementById('theValue');  var num = (document.getElementById("theValue").value -1)+ 2;  numi.value = num;  var divIdName = "my"+num+"Div";  var newdiv = document.createElement('div');  newdiv.setAttribute("id",divIdName);  newdiv.innerHTML = "<? pc_dropdown(); ?> <a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">[X]</a><p><div name=cattag_1_1_"+dropdown_count+">Subcategory info will be listed here. Dropdown#: "+dropdown_count+"</div></p>";  ni.appendChild(newdiv);}function removeElement(divNum) {  var d = document.getElementById('myDiv');  var olddiv = document.getElementById(divNum);  d.removeChild(olddiv);}</script><?function pc_dropdown() {$query="SELECT name,id FROM category WHERE site = 1";$result = mysql_query ($query);echo "<select name=cattag_1_1_\"+ dropdown_count +\" value='' onchange=showUser(this.value,dropdown_count)>CatTag 1</option>";while($nt=mysql_fetch_array($result)){echo "<option value=$nt[id]>$nt[name]</option>";}echo "</select>";}?></head><body><div class="container"><div id="nav"><? include("navigation.php"); ?></div><div id="search">SEARCH & EDIT A SPECIFIC PRODUCT<br><form name="form" action="item_search.php" method="get">  <input type="text" name="q" />  <input type="submit" name="Submit" value="Search" /></form></div><div id="main"><form id="form1" name="form1" method="post" action="insert_item2.php"> Name: <input name="name" type="text" id="name" /><br /><input type="checkbox" name="green" value="green"> <img src="img/greenchem_icon.png" />&nbsp; Green Product<br><input type="checkbox" name="eco" value="eco"> <img src="img/ecocert_icon.png" />&nbsp; ECO Cert<br><input type="checkbox" name="dfe" value="dfe"> <img src="img/DfE_icon.png" />&nbsp; DfE Cert<br><br><br><br><br><table>	<tr>		<td width="37px" background="img/admin_side_PC.jpg"> </td>				<td><u>Personal Care</u><br><br></td><td><input type="hidden" value="0" id="theValue" />	<p><a href="javascript:;" onClick="addEvent();">Add Some Elements</a></p>	<div id="myDiv"> </div>	</td><!--- //end add divs// ---></tr></table><br><br><table>	<tr>		<td width="37px" background="img/admin_side_I.jpg"> </td>				<td><u>Industrial</u><br><br><? $query="SELECT name,id FROM category WHERE site = 2";/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */$result = mysql_query ($query);echo "<select name=cattag_1_2 value='' onchange=showUser2(this.value)>CatTag 1</option>";// printing the list box select commandwhile($nt=mysql_fetch_array($result)){//Array or records stored in $ntecho "<option value=$nt[id]>$nt[name]</option>";/* Option values are added by looping through the array */}echo "</select>";// Closing of list box ?><p><div id="txtHint2"><b>Subcategory info will be listed here.</b></div></p></td></tr></table><br><br><table>	<tr>		<td width="37px" background="img/admin_side_N.jpg"> </td>				<td><u>Cosmeceutical</u><br><br><? $query="SELECT name,id FROM category WHERE site = 3";/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */$result = mysql_query ($query);echo "<select name=cattag_1_3 value='' onchange=showUser3(this.value)>CatTag 1</option>";// printing the list box select commandwhile($nt=mysql_fetch_array($result)){//Array or records stored in $ntecho "<option value=$nt[id]>$nt[name]</option>";/* Option values are added by looping through the array */}echo "</select>";// Closing of list box ?><p><div id="txtHint3"><b>Subcategory info will be listed here.</b></div></p><input type="submit" name="Submit" value="Submit" /></form></td></tr></table></div></div></body></html>