<?
// 기본 설정 로딩
require_once 'config.php';
require_once 'function.php';
require_once 'lib.php';

//HTML 시작

?>

<?
$ipsearch = $_GET[data];
$query = "select * from serverdb where server_use_status like 'y' and gear_ready like'y' order by gear_ready_os asc";
$result = @mysql_query($query, $db_connect) or die($db_q_error);

//$query1 = "select server_process, server_hdd, server_use_status,gear_ready,gear_ready_os, count(*) from serverdb where server_use_status like 'y' and gear_ready like 'y' group by server_process,gear_ready_os order by gear_ready_os,server_process asc";
//$query1 = "select server_process, server_hdd, server_use_status,gear_ready,gear_ready_os, count(*) from serverdb where server_use_status like 'y' and gear_ready like 'y' group by server_process,gear_ready_os order by gear_ready_os,server_process asc";
$query1 = "select server_process, server_hdd, server_use_status,gear_ready,gear_ready_os, count(*) from serverdb where server_use_status like 'y' and gear_ready like 'y' group by server_process,gear_ready_os, server_hdd order by gear_ready_os,server_process asc";
$result1 = @mysql_query($query1, $db_connect) or die($db_q_error);
$total = @mysql_num_rows(mysql_query($query, $db_connect)) or die($db_q_error);
$totalcounter = @mysql_num_rows(mysql_query($query1, $db_connect)) or die($db_q_error);
?>
[ <a href="http://<?$_SERVER['HTTP_HOST']?>:6752/DefaultPage.cli">돌아가기</a> ]
<table border=1>
<tr>
	<td>CPU</td>
	<td>HDD</td>
        <td>OS</td>
        <td>수량</td>
</tr>
<?
for ($i = 0; $i < $totalcounter; $i++) {
    $counter = mysql_fetch_assoc($result1);
    ?>
<tr>
	<td><?=$counter["server_process"];?></td>
	<td><?=$counter["server_hdd"];?></td>
        <td><?=$counter["gear_ready_os"];?></td>
        <td><?=$counter["count(*)"];?> 대</td>
</tr>
<?}?>
</table>
<form method=post action="http://<?=$_SERVER['HTTP_HOST']?>/gear_ready_up.php">
장비번호 : <input type=text name=server_code>
<input type=hidden name=gear_ready value=y>
OS : <select name=gear_ready_os>
<option value="Windows 2008 32bit">Windows 2008 32bit</option>
<option value="Windows 2008 64bit">Windows 2008 64bit</option>
<option value="Windows 2008 32bit+SQL2008">Windows 2008 32bit+SQL2008</option>
<option value="Windows 2008 64bit+SQL2008">Windows 2008 64bit+SQL2008</option>
<option value="Windows 2008 R2">Windows 2008 R2</option>
<option value="Windows 2008 R2+SQL2008R2">Windows 2008 R2+SQL2008R2</option>
<option value="Windows 2008 R2-게임윙전용">2008 R2-게임윙전용</option>
<option value="Windows 7 32bit">Windows 7 32bit</option>
<option value="Windows 7 64bit">Windows 7 64bit</option>
<option value="Windows 2003+SQL2005">Windows 2003+SQL2005</option>
<option value="기타">기타</option>
</select>
작업자 : <input type=text name=gear_ready_admin>
<input type=submit value="등록">
</form>

<table border=1>
<tr>
<td>가용</td>
<td>장비번호</td>
<td>CPU</td>
<td>RAM</td>
<td>HDD</td>
<td>BRAND</td>
<td>포맷보류</td>
<td>recieve</td>
<td>release</td>
<td>비고</td>
<td>DISUSE</td>
<td>현재</td>
<td>이전</td>
<td>READY</td>
<td>READY</td>
<td>READY</td>
</tr>
<?
for ($i = 0; $i < $total; $i++) {
    $data = mysql_fetch_assoc($result);

    ?>
<tr>
<td><?=$data[server_use_status]?></td>
<td><?=$data[server_code]?></td>
<td><?=$data[server_cpuname]?></td>
<td><?=$data[server_ram]?></td>
<td><?=$data[server_hdd]?></td>
<td><?=$data[server_brand]?></td>
<td><?=$data[server_format_date]?></td>
<td><?=$data[server_recieve_date]?></td>
<td><?=$data[server_release_date]?></td>
<td><?=$data[server_note]?></td>
<td><?=$data[server_disuse_date]?></td>
<td><?=$data[server_now_user]?></td>
<td><?=$data[server_before_user]?></td>
<td><?=$data[gear_ready]?></td>
<td><?=$data[gear_ready_os]?></td>
<td><?=$data[gear_ready_admin]?></td>
</tr>
<?}?>
</table>

<!-- End Container -->
<!-- Start Footer -->
<div id='footer'></div>
<!-- End Footer -->
</div>
<!-- End Base -->
<?
//DB닫기
mysql_close($db_connect);
?>
<!--<div id='exec_time'><?=sprintf('%0.3f', getmicrotime() - $MK_start)?> sec</div>-->
