MINI MINI MANI MO
<?
require "$_SERVER[DOCUMENT_ROOT]/config/config.php";
include ($_SERVER['DOCUMENT_ROOT']."/_common/common.php");
$connect = dbconn();
if($loginUsort != "superadmin" && $loginUsort != "admin"){
movepage("/");
exit;
}
if($idx){
$row = Row_string("SELECT * FROM client_agent WHERE idx='$idx'");
$phone=explode("-",$row[a_phone]);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>거래처담당자</title>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/css/admin.css">
<style>
input { border:1px solid #666666}
</style>
</head>
<body>
<iframe name="HiddenFrm" id="HiddenFrm" style="display:none;"></iframe>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin:20px;">
<tr>
<td height="20" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" align="center" valign="middle">
<input type="button" value="영업사원등록수정" class="buttona33" style="background-color:#0033CC; color:#FFFFFF" onClick="javascript:location.href='popup_04.php'">
<input type="button" value="거래처등록수정" class="buttona33" style="background-color:#0033CC; color:#FFFFFF" onClick="javascript:location.href='popup_05.php'">
<input type="button" value="거래처담당자등록수정" class="button33" style="background-color:#0033CC; color:#FFFFFF" onClick="javascript:location.href='popup_06.php'"> </td>
</tr>
<tr>
<td height="40" align="center" valign="middle"><strong>⊙ 거래처담당자</strong> </td>
</tr>
<tr>
<td height="1" align="left" valign="middle" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="10" align="left" valign="middle" > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20" align="left" ><table width="100%" style="border-collapse:collapse;" border="1" bordercolor="edecec" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" height="35" align="center" bgcolor="#F6F6F6"><strong>거래처명</strong></td>
<td width="15%" align="center" bgcolor="#F6F6F6"><strong>담당자</strong></td>
<td width="22%" align="center" bgcolor="#F6F6F6"><strong>연락처</strong></td>
<td width="42%" align="center" bgcolor="#F6F6F6"><strong>비고</strong></td>
<td width="7%" align="center" bgcolor="#F6F6F6"><strong>관리</strong></td>
</tr>
<form name="join" method="post" action="/admin/sub02/proc.php" target="HiddenFrm">
<input type="hidden" name="agent" value="write" />
<input type="hidden" name="idx" value="<?=$idx?>" />
<input type="hidden" name="popup" value="Y" />
<tr style="cursor:pointer">
<td height="35" align="center" bgcolor="#FFFFFF"><select name="client_idx" >
<option value="" selected="selected">::거래처::</option>
<?
$sql_s=mysql_query("select * from client where c_del!='Y'");
while($data_s=mysql_fetch_array($sql_s)){
?>
<option value="<?=$data_s[idx]?>" <? if($data_s[idx]==$row[client_idx]) echo "selected"; ?>><?=$data_s[c_name]?></option>
<?
}
?>
</select>
</td>
<td height="30" align="center" bgcolor="#FFFFFF"><input type="text" name="a_name" style="width:95%" value="<?=$row[a_name]?>"/></td>
<td height="30" align="center" bgcolor="#FFFFFF"><input type="text" name="a_phone1" style="width:25%" value="<?=$phone[0]?>"/>
-
<input type="text" name="a_phone2" style="width:25%" value="<?=$phone[1]?>"/>
-
<input type="text" name="a_phone3" style="width:25%" value="<?=$phone[2]?>"/></td>
<td align="center" bgcolor="#FFFFFF" style="padding-left:10px;"><input type="text" name="a_etc" style="width:95%" value="<?=$row[a_etc]?>"/></td>
<td align="center" bgcolor="#FFFFFF" ><input type="submit" class="btn_red" value="등록" /></td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td height="20" > </td>
</tr>
<tr>
<td height="50" align="right"><span style="padding-left:5px;">
<form name="search" method="get" >
<select name="client_idx" style="height:28px;" onchange="document.search.submit();">
<option value="">::거래처::</option>
<?
$sql_s=mysql_query("select * from client where c_del!='Y'");
while($data_s=mysql_fetch_array($sql_s)){
?>
<option value="<?=$data_s[idx]?>" <? if($data_s[idx]==$client_idx) echo "selected"; ?>><?=$data_s[c_name]?></option>
<?
}
?>
</select>
<input type="text" name="sear4" value="<?=$sear4?>" style="height:28px;" />
<input type="submit" class="btn_blue" value="검색" />
</form>
</span></td>
</tr>
<tr>
<td height="20" align="left"><table width="100%" style="border-collapse:collapse;" border="1" bordercolor="edecec" cellspacing="0" cellpadding="0">
<tr>
<td width="6%" height="35" align="center" bgcolor="#F6F6F6"><strong>no</strong></td>
<td width="10%" align="center" bgcolor="#F6F6F6"><strong>코드번호</strong></td>
<td width="19%" align="center" bgcolor="#F6F6F6"><strong>거래처명</strong></td>
<td width="9%" align="center" bgcolor="#F6F6F6"><strong>담당자</strong></td>
<td width="12%" align="center" bgcolor="#F6F6F6"><strong>연락처</strong></td>
<td width="31%" align="center" bgcolor="#F6F6F6"><strong>비고</strong></td>
<td width="8%" align="center" bgcolor="#F6F6F6"><strong>관리</strong></td>
</tr>
<?
$tb_name = "client_agent";
$view_article = 10; // 한화면에 나타날 게시물의 총 개수
if (!$page) $page = 1; // 현재 페이지 지정되지 않았을 경우 1로 지정
$start = ($page-1)*$view_article;
$href = "&sear4=$sear4";
$where = " a_del!='Y' ";
if($client_idx){
$where .= " and client_idx='$client_idx' ";
}
if($sear4){
$where .= " and ( a_name like '%$sear4%' or a_phone like '%$sear4%' or a_etc like '%$sear4%') ";
}
$query = "select count(*) from $tb_name where $where ";
$result = mysql_query($query, $connect);
$temp = mysql_fetch_array($result);
$total_article = $temp[0]; // 현재 쿼리한 게시물의 총 개수를 구함
if($total_article > 0){
$Qry = "SELECT * FROM $tb_name WHERE $where order by idx desc LIMIT $start, $view_article";
//echo $Qry;
$arr = Fetch_string($Qry);
for($i=0;$i<count($arr);$i++){
$num = $total_article-$i-(($page-1)*$view_article);
$row_sales = Row_string("SELECT * FROM client WHERE idx='".$arr[$i][client_idx]."'");
?>
<tr style="cursor:pointer; padding:3 0 0 0;" onmouseover="this.bgColor='#d9f3fb'" onmouseout="this.bgColor='#FFFFFF'" bgcolor="#FFFFFF">
<td height="35" align="center" ><?=$num?></td>
<td align="center"><?=$row_sales[client_code]?></td>
<td align="center"><?=$row_sales[c_name]?></td>
<td align="center"><?=$arr[$i][a_name]?></td>
<td align="center"><?=$arr[$i][a_phone]?></td>
<td align="center"><?=$arr[$i][a_etc]?></td>
<td align="center"><input name="button2" type="button" class="btn_red" value="수정" /></td>
</tr>
<?
}
}
?>
</table></td>
</tr>
<tr>
<td height="20" > </td>
</tr>
<tr>
<td height="20" align="center" ><? include "../inc/page.php";?></td>
</tr>
</table>
</body>
</html>
OHA YOOOO