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 WHERE idx='$idx'");
$phone=explode("-",$row[c_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="17%" height="35" align="center" bgcolor="#F6F6F6"><strong>영업사원</strong></td>
<td width="28%" align="center" bgcolor="#F6F6F6"><strong>거래처명</strong></td>
<td width="43%" align="center" bgcolor="#F6F6F6"><strong>비고</strong></td>
<td width="12%" align="center" bgcolor="#F6F6F6"><strong>관리</strong></td>
</tr>
<form name="join" method="post" action="/admin/sub02/proc.php" target="HiddenFrm">
<input type="hidden" name="client" value="write" />
<input type="hidden" name="idx" value="<?=$idx?>" />
<input type="hidden" name="popup" value="Y" />
<tr >
<td height="35" align="center" bgcolor="#FFFFFF"><select name="sales_idx" >
<option value="" selected="selected">::영업사원::</option>
<?
$sql_s=mysql_query("select * from salesperson where s_del!='Y'");
while($data_s=mysql_fetch_array($sql_s)){
?>
<option value="<?=$data_s[idx]?>" <? if($data_s[idx]==$row[sales_idx]) echo "selected"; ?>><?=$data_s[s_name]?></option>
<?
}
?>
</select> </td>
<td height="35" align="center" bgcolor="#FFFFFF"><input type="text" name="c_name" style="width:95%" value="<?=$row[c_name]?>"/></td>
<td align="center" bgcolor="#FFFFFF" style="padding-left:10px;"><input type="text" name="c_etc" style="width:95%" value="<?=$row[c_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="sales_idx" onchange="document.search.submit();">
<option value="" selected="selected">::영업사원::</option>
<?
$sql_s=mysql_query("select * from salesperson where s_del!='Y'");
while($data_s=mysql_fetch_array($sql_s)){
?>
<option value="<?=$data_s[idx]?>" <? if($data_s[idx]==$row[sales_idx]) echo "selected"; ?>>
<?=$data_s[s_name]?>
</option>
<?
}
?>
</select>
<input type="text" name="sear4" value="<?=$sear4?>" style="height:28px;" />
<input type="submit" class="btn_blue" value="검색" />
</span>
</form>
</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="9%" height="35" align="center" bgcolor="#F6F6F6"><strong>no</strong></td>
<td width="14%" align="center" bgcolor="#F6F6F6"><strong>코드번호</strong></td>
<td width="13%" align="center" bgcolor="#F6F6F6"><strong>영업사원</strong></td>
<td width="19%" align="center" bgcolor="#F6F6F6"><strong>거래처명</strong></td>
<td width="34%" align="center" bgcolor="#F6F6F6"><strong>비고</strong></td>
<td width="11%" align="center" bgcolor="#F6F6F6"><strong>관리</strong></td>
</tr>
<?
$tb_name = "client";
$view_article = 10; // 한화면에 나타날 게시물의 총 개수
if (!$page) $page = 1; // 현재 페이지 지정되지 않았을 경우 1로 지정
$start = ($page-1)*$view_article;
$href = "&sear4=$sear4";
$where = " c_del!='Y' ";
if($sales_idx){
$where .= " and sales_idx='$sales_idx' ";
}
if($sear4){
$where .= " and ( c_name like '%$sear4%' or c_phone like '%$sear4%' or c_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 salesperson WHERE idx='".$arr[$i][sales_idx]."'");
?>
<tr style="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"><?=$arr[$i][client_code]?></td>
<td align="center"><?=$row_sales[s_name]?></td>
<td align="center"><?=$arr[$i][c_name]?></td>
<td align="center"><?=$arr[$i][c_etc]?></td>
<td align="center"><input type="button" class="btn_red" value="수정" onclick="location.href='popup_05.php?idx=<?=$arr[$i][idx]?>';" /></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