<html dir="rtl">
<style>
td
{
  padding-top:10px
}

</style>
<body>
<?php
include ('dbf.php');
$mode=$_GET["mode"];
if($mode=="update")
{
    $q=$_GET[q2];
	//include ('header.php');

	$fg=mysql_query("select * from `cd` where (cd.id='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
	 <div class="divfieldset">
	    <fieldset style="width:420px"><legend align="right" >ويرايش مشخصات سي دي و نرم افزار </legend>
				<table align="center" border="0" dir="rtl" class="table">
				<form name="uy" method="post" action="index1.php?page=thertysex" enctype="multipart/form-data">
				<input type="hidden" name="city" value="<?php echo $_SESSION[city];?>">
				<input type="hidden" name="id" value="<?php echo $v['id'];?>">
					<tr>
						<td align="right" class="label">
							<span>  	شماره سي دي          :</span>
						</td>
						<td>
							<input tabindex="1" type="text"  name="ip" id="ip" value="<?php echo $v['ip'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>  	موضوع        :</span>
						</td>
						<td>
							<input tabindex="2" type="text" size="30" name="topic" id="topic" value="<?php echo $v['topic'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td height="80" align="right" valign="top" class="label" >
							<span>   	محتويات:</span>
						</td>
						<td  height="30">
							<TEXTAREA tabindex="3" style="font-family:tahoma;font-size:10pt"
							 ID=in name="in" cols="40" rows="5" dir="rtl"><?php echo $v['contents'];?></textarea>
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	صاحب امتياز :</span>
						</td>
						<td >
							<input tabindex="4" type="text" size="30" name="s_emtiaz" id="s_emtiaz" value="<?php echo $v['s_emtiaz'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	قیمت :</span>
						</td>
						<td>
							<input tabindex="5" type="text" size="15" name="price" id="price" value="<?php echo $v['price'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>  	موجودي :</span>
						</td>
						<td>
							<input tabindex="6" type="text"  name="number" id="number" value="<?php echo $v['number'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span >	توضيحات :</span>
						</td>
						<td>
							<input tabindex="7" type="text" size="30" name="tou" id="tou" value="<?php echo $v['tou'];?>" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<input type="hidden"  id="val" name="val" value="" >
					<tr>
						<td colspan="2" align="center">
							<table>
								<tr>
									<td>
										<button tabindex="8" title="اصلاح" name="esla" type="button" onClick="param('ip,topic,in,s_emtiaz,price,number,tou'),update(document.getElementById('val').value,'a_cd.php','<?php echo $q;?>','ip,topic,in,number')"><img src="images/b_edit.png"  name="eslah"  border="0" width="20" height="20" ></button>
									</td>
									</form>
									<form method="post" action="index1.php?page=thertysex">
									<td>
										<button tabindex="9" title="بازگشت" name="cancel" type="button" onClick="ajaxload('cd.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					</form>
				</table>
</fieldset>
</div>
	<?php
	//include ('foteer.php');
}
elseif($mode=="delete")
{
     $q=$_GET[q2];
	//include ('header.php');
	$fg=mysql_query("select * from `cd` where (cd.id='$q')");
	$v=mysql_fetch_assoc($fg);
	?>
    <div class="divfieldset">
	    <fieldset style="width:420px"><legend align="right" >حذف مشخصات سي دي و نرم افزار </legend>
				<table align="center" border="0" dir="rtl" class="table" style="width:420px">
				<form name="uy" method="post" action="index1.php?page=thertysex">
				<input type="hidden" name="id" value="<?php echo $v['id'];?>">
					<tr>
						<td align="right" class="label">
							<span>	شماره سي دي          :</span>
						</td>
						<td>
							<span class="blacktext"><?php echo $v['ip'];?></span><input readonly  type="hidden" size="5" name="ip" value="" style="cursor:hand;font-size: 10pt;font-family:tahoma">
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	موضوع        :</span>
						</td>
						<td>
							<span class="blacktext"><?php echo $v['topic'];?></span>
						</td>
					</tr>
					<tr>
						<td height="80" align="right" valign="middle" class="label">
							<span >	محتويات:</span>
						</td>
						<td  height="30">
						    <span class="blacktext"><?php echo $v['contents'];?></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	صاحب امتياز :</span>
						</td>
						<td >
							<span class="blacktext"><?php echo $v['s_emtiaz'];?></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	قیمت :</span>
						</td>
						<td>
							<span class="blacktext"><?php echo $v['price'];?></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="label">
							<span>	موجودي :</span>
						</td>
						<td>
							<span class="blacktext"><?php echo $v['number'];?></span>
						</td>
					</tr>
					<tr>
						<td align="right"  class="label">
							<span>	توضيحات :</span>
						</td>
						<td>
							<span class="blacktext"><?php echo $v['tou'];?></span>
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<table>
								<tr>
									<td>
										<button tabindex="1" title="حذف" name="dell" type="button" onClick="dele('a_cd.php','<?php echo $q;?>',ajaxload('cd.php'))"><img src="images/b_drop.png"  name="del"  border="0" width="20" height="20" ></button>
									</td>
									</form>
									<form method="post" action="index1.php?page=thertysex">
									<td>
										<button tabindex="2" title="بازگشت" name="cancel" type="button" onClick="ajaxload('cd.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
									</td>
							</tr>
						</table>
					</td>
				</tr>
				</form>
			</table>
</fieldset>
</div>
	<?php

}
elseif ($_GET['new'])
{
?>
  <div class="divfieldset">
	    <fieldset style="width:420px"><legend align="right"> ثبت مشخصات سي دي و نرم افزار </legend>
					<table align="center" border="0" dir="rtl" class="table">
						<form name="uy" method="post"  action="" enctype="multipart/form-data">
							<input name="city" type="hidden" value="<?php echo $_SESSION[city];?>">
								<tr>
									<td align="right" class="label">
										<span>	شماره سي دي          :</span>
									</td>
									<td>
										<input tabindex="1" type="text"  name="ip" id="ip" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span>	موضوع        :</span>
									</td>
									<td>
										<input tabindex="2" type="text" size="30" name="topic" id="topic" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td height="80" align="right" valign="top" class="label">
										<span >	محتويات:</span>
									</td>
									<td  height="30">
										<TEXTAREA tabindex="3" style="font-family:tahoma;font-size:10pt"
										 ID=in name="in" cols="40" rows="5" dir="rtl"></textarea>
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span >	صاحب امتياز :</span>
									</td>
									<td >
										<input tabindex="4" type="text" size="30" name="s_emtiaz" id="s_emtiaz" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
										<span >	قیمت :</span>
									</td>
									<td>
										<input tabindex="5" type="text" size="15" name="price" id="price" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
									<span>	موجودي :</span>
									</td>
									<td>
										<input tabindex="6" type="text"  name="number" id="number" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<tr>
									<td align="right" class="label">
									<span>	توضيحات :</span>
									</td>
									<td>
										<input tabindex="7" type="text" size="30" name="tou" id="tou" style="cursor:hand;font-size: 10pt;font-family:tahoma">
									</td>
								</tr>
								<input type="hidden"  id="val" name="val" value="" >
								<div id="d1"></div>
								<input type="hidden"  id="dval" name="dval" value="" >
								<tr>
									<td colspan="2" align="center">
										<table>
											<tr>
												<td>
													<button tabindex="8" name="ffg" type="button" onClick="param('ip,topic,in,s_emtiaz,price,number,tou'),insert(document.getElementById('val').value,'<?php echo 'a_cd.php' ; ?>','ip,topic,in,number,s_emtiaz,price,tou')" ><img src="images/sabtf2.png"  name="neew"  border="0" width="20" height="20" ></button>
												</td>
												</form>
												<form method="post" action="index1.php?page=thertysex">
												<td>
	          										<button tabindex="9" title="بازگشت" name="cancel" type="button" onClick="ajaxload('cd.php')"><img src="images/r1.png"  name="eslah"  border="0" width="20" height="20" ></button>
	          									</td>
											</tr>
										</table>
									</td>
								</tr>
							</form>
					</table>
			</fieldset>
</div>
<?php

}
?>
</body>
</html>