<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" href="bootstrap/css/base.css">
<link rel="stylesheet" href="bootstrap/css/skeleton.css">
<link rel="stylesheet" href="bootstrap/css/layout.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="bootstrap/js/jquery-1.6.1.min.js" type="text/javascript"></script>
<link type"text/css" rel="Stylesheet" href="bootstrap/css/bootstrap.css" />
<meta charset="UTF-8">
<link rel="stylesheet" href="bootstrap/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<script src="bootstrap/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
				$(document).ready(function(){
					$("area[rel^='prettyPhoto']").prettyPhoto();
					
					$("a[rel^='prettyPhoto']").prettyPhoto({ animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: true });
					$("a[rel^='prettyPhoto']").prettyPhoto({ animation_speed:'fast',slideshow:3000, hideflash: true });
			
				});
				$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
social_tools:false,
});
});
			</script>
<title>AFM ASS</title>
		<style type="text/css" media="screen">

			ul li { display: inline; }

		</style>
</head>

<body>
	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
    	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
    	<div class="row clearfix">
		<div class="col-md-12 column">
		</div>
	</div>
<div class="container">
  <div class="row clearfix">
	  <div class="col-md-12 column">
			<div class="page-header">
				<h1>
					AFM Asset Management <small>ระบบการจัดการสินทรัพย์บริษัท เอ เอฟ เอ็ม จำกัด</small>
				</h1>
			</div>
			<?php include("navbartop.php"); ?>
        
  <?php include("connect.php");
			$strSQL = " SELECT * FROM tb_gadget,tb_department,tb_gadgettype
where
tb_gadget.Gadgettype_id = tb_gadgettype.Gadgettype_id
AND
tb_gadget.Department_user = tb_department.Department_id
AND tb_gadget.Gadget_id = '".$_GET["view_id"]."' ";
$result_show = mysql_query($strSQL) or die(mysql_error());
$row_show = mysql_fetch_array($result_show);
			?>
	    <table class="table table-bordered">
				<tbody>
                <tr>
                  <td colspan="5">
                  <?php
		$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
		$objDB = mysql_select_db("afm_ass");

		$strSQL = "SELECT * FROM album WHERE AlbumID = '".$_GET["view_id"]."' ";
		$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
		$objResult = mysql_fetch_array($objQuery);
?>
<div class="form-inline">
<div class="form-group"><h1><?php echo $objResult["AlbumName"];?></h1></div>
<div class="form-group"><h5>&nbsp;</h5>
</div>
</div>
<?php

		$strSQL2 = "SELECT * FROM gallery WHERE Gadget_id = '".$_GET["view_id"]."' ORDER BY GalleryID ASC ";
		$objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]");

		echo"<table border=\"1\" class=\"table\" cellspacing=\"1\" cellpadding=\"1\"><tr>";
		$intRows = 0;
		while($objResult2 = mysql_fetch_array($objQuery2))
		{
			echo "<td>"; 
			$intRows++;
	?>
    		
			<center>
				<a href="myfile/<?php echo $objResult2["GalleryShot"];?>" rel="prettyPhoto[gallery]" title="<?php echo $objResult2["Galleryname"];?>"><img src="myfile/<?php echo $objResult2["GalleryShot"];?>" width="100" height="100"></a><br>
                <span class="label label-default">
					<?php 
                    $noname = 'ยังไม่มีชื่อภาพ' ;
					$mename	=  $objResult2["Galleryname"] ;
                    if	($objResult2["Galleryname"] == '')
					{	echo $noname ;}
					else
					{ 	echo $mename;}
                    ;?>
                </span>
				<br>
			</center>
	<?php
			echo"</td>";
			if(($intRows)%4==0)
			{
				echo"</tr>";
			}
		}
		echo"</tr></table>";
	?>
    <a href="addimg.php?img_id=<?php echo $_GET["view_id"];?>">
     <button type="button" class="btn">
     <img src="img/add-icon.png" width="40" height="40" align="absmiddle" />
     </button>
     </a>
     <a href="editimg.php?img_id=<?php echo $_GET["view_id"];?>">
     <button type="button" class="btn">
     <img src="img/edit-icon.png" width="40" height="40" align="absmiddle" />
     </button>
     </a>                     
     		</td>
                </tr>
				  <tr>
					  <th width="24%" class="active">รายละเอียด</th>
                      <th colspan="4"><?php echo $row_show['Gadgettype'] ?> <?php echo $row_show['Brand'] ?> <?php echo $row_show['Model'] ?></th>
				  </tr>
                <tr>
                	<th class="active">วันที่ซื้อ</th>
                	<td width="20%"><?php echo $row_show['Date_purchase'] ?></td>
                    <th class="active">จำนวน </th>
                    <td width="16%"><?php echo $row_show['Amount'] ?></td>
                    <th width="18%" class="active">เครื่อง</th>
                </tr>
                <tr>
                  <th class="active">ซีเรียลนัมเบอร์</th>
                  <td><?php echo $row_show['Serial'] ?></td>
                  <th class="active">จำนวนซ่อม </th>
                  <td><?php echo $row_show['Number_repair'] ?></td>
                  <th class="active">ครั้ง</th>
                </tr>
                <tr>
                  <th class="active">ผู้ใช้งาน</th>
                  <td><?php echo $row_show['Gadget_user'] ?></td>
                  <th width="22%" class="active">แผนก</th>
                  <td colspan="2"><?php echo $row_show['Department'] ?></td>
                  </tr>
                <tr>
                  <th colspan="5" class="active">รายละเอียด</th>
                </tr>
                <tr>
                  <td colspan="5"><?php echo $row_show['Detail'] ?></td>
                </tr>
                <tr>
                  <td colspan="5">
                  <div class="form-inline">
                  <div class="form-group">
           <a href="editgadget.php?edit_id=<?php echo $_GET["view_id"];?>"><button type="submit" class="btn btn-warning">
           <span class="glyphicon glyphicon-wrench"></span>
           แก้ไขข้อมูล</button></a>
    		</div>                 
     
            	<div class="form-group">
                 <a href="delgadget.php?del_id=<?php echo $_REQUEST['view_id'];?> ">
                <button type="button" class="btn btn-danger">
                <span class="glyphicon glyphicon-trash"></span>
              ลบข้อมูล</button>
  		        </div>
                </div> </td>
                  </tr>
			  </tbody>
		  </table>
		  <p align="right">&nbsp;</p>
	  </div>
	</div>
<?php include("footer.php"); ?>
</div>
<script src="js/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
</body>
</html>