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

//HTML 시작

?>
<style>
table {
        background: #f5f5f5;
        border-collapse: separate;
        box-shadow: inset 0 1px 0 #fff;
        font-size: 12px;
        line-height: 15px;
        margin: 30px auto;
        text-align: left;
        width: 1000px;
}

th {
        background: linear-gradient(#777, #444);
        border-left: 1px solid #555;
        border-right: 1px solid #777;
        border-top: 1px solid #555;
        border-bottom: 1px solid #333;
        box-shadow: inset 0 1px 0 #999;
        color: #fff;
  font-weight: bold;
        padding: 10px 15px;
        position: relative;
        text-shadow: 0 1px 0 #000;
}

th:after {
        background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.08));
        content: '';
        display: block;
        height: 25%;
        left: 0;
        margin: 1px 0 0 0;
        position: absolute;
        top: 25%;
        width: 100%;
}

th:first-child {
        border-left: 1px solid #777;
        box-shadow: inset 1px 1px 0 #999;
}

th:last-child {
        box-shadow: inset -1px 1px 0 #999;
}

td {
        border-right: 1px solid #fff;
        border-left: 1px solid #e8e8e8;
        border-top: 1px solid #fff;
        border-bottom: 1px solid #e8e8e8;
        padding: 10px 15px;
        position: relative;
        transition: all 300ms;
}
td:first-child {
        box-shadow: inset 1px 0 0 #fff;
}

td:last-child {
        border-right: 1px solid #e8e8e8;
        box-shadow: inset -1px 0 0 #fff;
}


tr:nth-child(odd) td {
        background: #f1f1f1;
}

tr:last-of-type td {
        box-shadow: inset 0 -1px 0 #fff;
}

tr:last-of-type td:first-child {
        box-shadow: inset 1px -1px 0 #fff;
}

tr:last-of-type td:last-child {
        box-shadow: inset -1px -1px 0 #fff;
}
</style>
<?
$ipsearch = $_GET[data];
$query = "select servicedb.client_code, servicedb.service_code, servicedb.server_code,servicedb.service_ip,servicedb.service_sw,servicedb.service_note, clientdb.Client_Code, clientdb.Client_Name, clientdb.Client_Phone1, clientdb.Client_EMail1 from servicedb INNER JOIN clientdb ON clientdb.Client_Code = servicedb.client_code where servicedb.service_ip like \"%$ipsearch%\" order by Client_Name asc";
$result = @mysql_query($query, $db_connect) or die($db_q_error);
$num = mysql_num_rows($result);
?>
<div align="center">
[ <a href="http://<?$_SERVER['HTTP_HOST']?>:6752/DefaultPage.cli">돌아가기</a> ]

<form method=get>
IP 입력 : <input type=text name=data>
<input type=submit value="검색">
</form>
</div>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th style="text-align:center;width:40px;">CODE</th>
<th style="text-align:center;width:60px;">NAME</th>
<th style="text-align:center;width:60px;">SERVER</th>
<th style="text-align:center;width:80px;">IP</th>
<th style="text-align:center;width:80px;">SW</th>
<th style="text-align:center;">NOTE</th>
<th style="text-align:center;width:80px;">TEL</th>
<th style="text-align:center;width:80px;">MAIL</th>
</tr>
</thead>
<tbody>
<?
for ($i = 0; $i < $num; $i++) {
    $data = mysql_fetch_assoc($result);

    ?>

<tr>
<td><?=$data[client_code]?></td>
<td><?=$data[Client_Name]?></td>
<td><?=$data[server_code]?></td>
<td><?=$data[service_ip]?></td>
<td><?=$data[service_sw]?></td>
<td><?=$data[service_note]?></td>
<td><?=$data[Client_Phone1]?></td>
<td><?=$data[Client_EMail1]?></td>
</tr>
<?}?>
</tbody>

<tfoot></tfoot>
</table>


<?
//DB닫기
mysql_close($db_connect);
?>
