	<script type="text/javascript" src="../functions/cleanhtml.js"></script>
	<?php	
	$regForm = $_REQUEST["regForm"];
	$idContent = $_REQUEST["id"];	

	if ($regForm == "Submit Data") {
		?>
		<p></p>
		<div align="center">
			<img src="images/loading.gif" border="0"><br>
			<strong>Updating on progress</strong>. <br>
		</div>
		<p></p>
		<?php
		$max = $_POST["max"];
		$i=1;
		foreach ($max as $arr) {
			$sql =  "update adds_position set max='$arr' where id='$i' ";
			mysql_query($sql);
			$i++;
		}
		
		$alamat  = '<script language=JavaScript>';
		$alamat .= ' location.href = "?menu='.$menu.'&tipe='.$tipe;
		$alamat .= ' "; ';
		$alamat .= '</script>';
		echo $alamat;
	} else {
		?>
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr><td><strong>MENU SELECTED >> <?php echo strtoupper($nama_menu); ?></strong></td></tr>
			<tr valign="top">
				<td>
					<form method="post" action="<?php echo '?menu='.$menu.'&action='.$action;?>" enctype="multipart/form-data" name="form1" onSubmit="submitForm(); cleanHTML();">
						<table width="100%" cellpadding="7" cellspacing="1" bgcolor="#CCCCCC">
							<tr bgcolor="#e7e7e7">
								<td align="right" width="49%"><strong>POSITION</strong></td>
								<td align="left"><strong>MAX ADS</strong></td>
							</tr>
							<?php
							$query="select * from adds_position ";
							if ($hasil=mysql_query($query)) {
								while($data=mysql_fetch_array($hasil)){													
									?>
									<tr bgcolor="#FFFFFF">
										<td align="right"><?php echo $data["position"]; ?></td>
										<td align="left">
											<input <?php // if($data["position"]!="top right") echo ' readonly="true" '; ?> type="text" name="max[]" size="5" value="<?php echo $data["max"]; ?>">
										</td>
									</tr>
									<?php
								}
							}
							?>
							<tr bgcolor="#ffffff">
								<td align="center" colspan="2">
									<div id="spasi1"></div>
									<input type="submit" name="regForm" value="Submit Data">
									<input type="hidden" name="old_gambar1" value="<?php echo $gambar1; ?>">
									<input type="hidden" name="tanggal" value="<?php echo $tanggal; ?>">
									<input type="hidden" name="tahun" value="<?php echo $tahun; ?>">
									<input type="hidden" name="bulan" value="<?php echo $bulan; ?>">
									<input type="hidden" name="id" value="<?php echo $idContent; ?>">
									<input type="hidden" name="curtitle" value="<?php echo $curtitle; ?>">
									<input type="hidden" name="targetPage" value="<?php echo $targetPage; ?>">
									<input type="hidden" name="tipe" value="<?php echo $tipe; ?>">
									<div id="spasi1"></div>
								</td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>				
		<?php
	}
	?>
