<style>
  .pwbtn{
    width:50px;
	cursor:pointer;
	margin-left:15px;
  }
  .tblfont{
    font-size:40px;
  }
	
  .tblpage{
    width: 100%;
	height: 100%;
  }
  .tblborder{
    border-style:double;
	width: 250px;
  }
  .tbltable{
    width:100%;
	font-family:Arial;
	text-align:center;
  }
  .ipttext{
    text-align:center;
  }
  .errmsg{
    color:#FF0000; 
	font-size:18px;
  }

	.spaninput{
		margin: 0px 0px 10px 10px;
	}
	
	.btnSubmit{
		width: 100px;
		height: 30px;
		font-size: 20px;
	}
</style>

<script>
  var loadImage = function(event){
	  var myphoto = document.getElementById('myphoto');
	  myphoto.src = URL.createObjectURL(event.target.files[0]);
	  myphoto.onload = function(){
		  URL.revokeObjecjtURL(myphoto.src)
	  }
  };
  
  function goBack(){
    window.location.href = "main.php?pg=pdt";
  }
  
  function peformDel(){
    document.getElementById("frmDel").submit();
  }
</script>

<?php
  $pid = $_GET["pid"];
  $myprod = new PRODUCT();
  $myprod->setProduct("id",$pid);
//  print_r($myprod);
?>

<form id="frmDel" action="pg_product_del.php" method="post">
  <input type="hidden" name="pid" value="<?= $pid ?>" />
</form>

<table class="tblpage"><tr><td align="center">

	<input type="hidden" name="pid" value="<?= $myprod->id ?>" />
	<table class="tblborder"><tr><td align="center">
	<table class="tbltable">
	  <tr>
	    <th colspan="2" style="background-color:#FF0000; color:#FFFFFF">DELETE/ 删除 <?= $myprod->name . " " . $myprod->ename ?></th>
	  </tr>
	  <tr>
	    <td><img src="../img/<?= $myprod->photo ?>" height="150px">
		</td>
		  
		  
		<td>
			<table width="200px">
				<tr>
					<td>NAME : </td>
				</tr>
				<tr>
					<td><span class="spaninput"><?= $myprod->ename ?></span></td>
				</tr>
				<tr>
					<td>名称 : </td>
				</tr>
				<tr>
					<td><span class="spaninput"><?= $myprod->name ?></span></td>
				</tr>
				<tr>
					<td>PRICE 卖价 : </td>
				</tr>
				<tr>
					<td><span class="spaninput"><?= $myprod->getRinggit($myprod->price) ?></span></td>
				</tr>
			</table>
			
		</td>
	  </tr>
	  <tr>
	    <th colspan="2" style="background-color:#FF0000; color:#FFFFFF">
		  <button class="btnSubmit" onclick="goBack()">CANCEL</button>
		  <button class="btnSubmit" onclick="peformDel()" style="background-color:#FF0000; color:#FFFFFF">DELETE</button>
		</th>
	  </tr>
		
	</table>
	</td></tr></table>

</td></tr></table>