document.forms[0].s_e.value="元/件";
}
</script>
</head>
<body>
<?php 
$esql = new Dedesql(false);
$query = "select * from #@__staff where id='{$id}'";
$esql->SetQuery($query);
$esql->Execute();
if ($esql->GetTotalRow() == 0) {
    ShowMsg('非法调用参数,请重试', '-1');
    exit;
}
$row = $esql->GetOne($query);
$esql->close();
?>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
  <tr>
    <td id="table_style" class="l_t">&nbsp;</td>
    <td>&nbsp;</td>
    <td id="table_style" class="r_t">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
	<table width="100%" border="0" cellpadding="0" cellspacing="2">
     <tr>
      <td><strong>&nbsp;公司员工资料修改</strong></td>
     </tr>
	 <form action="system_worker_edit.php?action=save" method="post">
		obj.style.display = "block";
	}else{
		obj.style.display = "none";
	}
}
</script>
<base target="main">
<body>
<div class="menu">
<?php 
if (!empty($_COOKIE["VioomaUserID"])) {
    if ($c == '') {
        $c = 1;
    }
    $msql = new Dedesql(false);
    $query = "select name from #@__menu where id='{$c}'";
    $menuinfo = $msql->GetOne($query);
    $menus = "\r\n<dl>\r\n    <dt><a href='###' onclick=showHide('items" . $c . "') target='_self' class='top'>" . $menuinfo['name'] . "</a></dt>\r\n    <dd id='items" . $c . "' style='display:block;'>\r\n\t\t\t<ul>\r\n~Item~\r\n  \t\t\t</ul>\r\n\t\t</dd>\r\n\t</dl>\r\n";
    $msql->Setquery("select name,url from #@__menu where reid='{$c}'");
    $msql->Execute();
    while ($row = $msql->GetArray()) {
        $iteminfo = $iteminfo . "\r\n<li><a href='" . $row['url'] . "' target='main'>" . $row['name'] . "</a></li>\r\n";
    }
    $menus = str_replace("~Item~", $iteminfo, $menus);
    echo $menus . $endmenus;
    $msql->close();
}
?>
</div>
</body>
</html>
    if ($rowcount == 0) {
        echo "<tr><td>&nbsp;还没添加银行账户,请先<a href=bank.php?action=new>添加账户</a>。</td></tr>";
    } else {
        echo "<tr class='row_color_head'><td>ID</td><td>银行名称</td><td>银行账号</td><td>金额</td><td>默认</td><td>备注</td><td>修改</td></tr>";
        while ($row = $csql->GetArray()) {
            if ($row['bank_default'] == 1) {
                $default_yes = "<img src=images/yes.png>";
            } else {
                $default_yes = "&nbsp;";
                $delstring = " | <a href=bank_del.php?id=" . $row['id'] . ">删除</a>";
            }
            echo "<tr><td>ID号:" . $row['id'] . "</td><td>&nbsp;" . $row['bank_name'] . "</td><td>&nbsp;" . $row['bank_account'] . "</td><td>&nbsp;¥" . $row['bank_money'] . "</td><td>&nbsp;" . $default_yes . "</td><td>" . $row['bank_text'] . "</td><td><a href=bank_edit.php?id=" . $row['id'] . ">修改</a>" . $delstring . "</td></tr>";
        }
    }
    echo "</table>";
    $csql->close();
}
?>
	  </td>
     </tr>
    </table>
	</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td id="table_style" class="l_b">&nbsp;</td>
    <td>&nbsp;</td>
    <td id="table_style" class="r_b">&nbsp;</td>
  </tr>
</table>
<?php 
    //初始状态
    if ($action == 'normal') {
        $csql->SetQuery("select * from #@__saleback where rdh='{$did}'");
    } else {
        $csql->SetQuery("select * from #@__saleback where id<0");
    }
} else {
    if ($action == '' && $did != '') {
        //写入产品记录
        $wsql = new Dedesql(false);
        $writesql = "select * from #@__basic where cp_number='{$pid}'";
        $wsql->Setquery($writesql);
        $wsql->Execute();
        $wrs = $wsql->GetOne();
        $wsql->ExecuteNoneQuery("insert into #@__saleback(productid,number,rdh,dtime,r_text) values('" . $pid . "','" . $num . "','" . $did . "','" . GetDateTimeMk(time()) . "','" . $r_text . "')");
        $wsql->close();
    }
    $csql->SetQuery("select * from #@__saleback where rdh='{$did}'");
}
$csql->Execute();
$rowcount = $csql->GetTotalRow();
if ($rowcount == 0) {
    echo "<tr><td>&nbsp;</td></tr>";
} else {
    echo "<tr class='row_color_head'><td>货号</td><td>名称</td><td>规格</td><td>分类</td><td>单位</td><td>售价</td><td>退回原因<td>退回数量</td><td>删除</tr>";
    while ($row = $csql->GetArray()) {
        $nsql = new dedesql(false);
        $query1 = "select * from #@__basic where cp_number='" . $row['productid'] . "'";
        $nsql->setquery($query1);
        $nsql->execute();
        $row1 = $nsql->getone();
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员删除</title>
</head>
<body>
<?php 
require_once dirname(__FILE__) . "/include/config_base.php";
require_once dirname(__FILE__) . "/include/config_rglobals.php";
if ($id == '') {
    ShowMsg('非法的执行操作', 'guest_group.php');
}
//检测分类的等级
$username = str_replace($cfg_cookie_encode, '', $_COOKIE["VioomaUserID"]);
$dsql = new Dedesql(false);
$query = "select * from #@__group where id='{$id}'";
$dsql->Setquery($query);
$dsql->Execute();
$rowcount = $dsql->GetTotalRow();
if ($rowcount == 0) {
    //非法ID
    ShowMsg('执行了非法的操作', '-1');
} else {
    $dsql->ExecuteNoneQuery("delete from #@__group where id='{$id}'");
    WriteNote('成功删除会员分组资料(ID为' . $id . ')', getdatetimemk(time()), getip(), $username);
    ShowMsg('成功删除会员分组资料', 'guest_group.php');
}
$dsql->close();
?>
</body>
</html>
    $username = str_replace($cfg_cookie_encode, '', $_COOKIE['VioomaUserID']);
    WriteNote('修改产品基本信息' . $cp_name . ' 成功', $logindate, $loginip, $username);
    $bsql->close();
    exit;
}
$seekrs = new Dedesql(falsh);
$squery = "select * from #@__basic where id='{$id}'";
$seekrs->SetQuery($squery);
$seekrs->Execute();
$rowcount = $seekrs->gettotalrow();
if ($rowcount == 0) {
    Showmsg('非法的参数', '-1');
    exit;
}
$row = $seekrs->GetOne();
$seekrs->close();
?>
<body onload="form1.cp_tm.focus()">
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
  <tr>
    <td id="table_style" class="l_t">&nbsp;</td>
    <td>&nbsp;</td>
    <td id="table_style" class="r_t">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
	<table width="100%" border="0" cellpadding="0" cellspacing="2">
     <tr>
      <td><strong>&nbsp;产品基本信息管理</strong>(注:橙色背景为必填选项)&nbsp;&nbsp;- <a href="system_basic_cp.php">新产品登记</a> - <a href="system_basic_cp.php?action=seek">产品基本信息查询</a></td>
     </tr><form action="system_basic_edit.php?action=save" method="post" name="form1">
    $bsql = new Dedesql(false);
    $query = "select * from #@__mainkc where p_id='{$pid}'";
    $bsql->SetQuery($query);
    $bsql->Execute();
    $rowcount = $bsql->GetTotalRow();
    if ($rowcount == 0) {
        ShowMsg('非法参数或没有此产品信息!', '-1');
        exit;
    } else {
        $bsql->executenonequery("update #@__mainkc set number='{$kc_number}',l_id='{$labid}' where p_id='" . $pid . "'");
        $loginip = getip();
        $logindate = getdatetimemk(time());
        $username = str_replace($cfg_cookie_encode, '', $_COOKIE['VioomaUserID']);
        WriteNote('修改产品' . get_name($pid, 'name') . '资料成功', $logindate, $loginip, $username);
        ShowMsg('产品信息已成功修改', 'system_kc.php');
        $bsql->close();
        exit;
    }
} else {
    if ($pid == '' || $lid == '') {
        echo "<script language='javascript'>alert('非法参数');history.go(-1);</script>";
        exit;
    }
    ?>
<body onload="form1.seek_text.focus()">
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
  <tr>
    <td id="table_style" class="l_t">&nbsp;</td>
    <td>&nbsp;</td>
    <td id="table_style" class="r_t">&nbsp;</td>
  </tr>
function getadid($id)
{
    $s = new Dedesql(false);
    $query = "select * from #@__staff";
    $s->SetQuery($query);
    $s->Execute();
    $rowcount = $s->GetTotalRow();
    if ($rowcount == 0) {
        echo "<a href='system_worker.php?action=new'>请先添加员工</a>";
    } else {
        echo "<select name=\"staff\"><option value=''>=请选择业务员=</option>";
        while ($row1 = $s->GetArray()) {
            if ($id == '' || $row1['id'] != $id) {
                echo "<option value='" . $row1['s_name'] . "'>" . $row1['s_name'] . "</option>";
            } else {
                echo "<option value='" . $row1['s_name'] . "' selected>" . $row1['s_name'] . "</option>";
            }
        }
        echo "</select>";
    }
    $s->close();
}
            echo "<tr id='rk_subinfo" . $row['id'] . "' style='display:none;'><td colspan='6'><br><table width=\"98%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" id=\"table_border\" align=\"center\">";
            $csql1 = new Dedesql(false);
            $csql1->SetQuery("select * from #@__sale where rdh='" . $row['r_dh'] . "'");
            $csql1->Execute();
            $rowcount = $csql1->GetTotalRow();
            echo "<tr class='row1_color_head'><td>货号</td><td>名称</td><td>规格</td><td>分类</td><td>单位</td><td>售价</td><td>供应商<td>入库数量</td><td>操作</tr>";
            while ($row = $csql1->GetArray()) {
                $nsql = new dedesql(false);
                $query1 = "select * from #@__basic where cp_number='" . $row['productid'] . "'";
                $nsql->setquery($query1);
                $nsql->execute();
                $row1 = $nsql->getone();
                echo "<tr onMouseMove=\"javascript:this.bgColor='#EBF1F6';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"><td>" . $row['productid'] . "</td><td>&nbsp;" . $row1['cp_name'] . "</td><td>" . $row1['cp_gg'] . "</td><td>" . get_name($row1['cp_categories'], 'categories') . ">" . get_name($row1['cp_categories_down'], 'categories') . "</td><td>" . get_name($row1['cp_dwname'], 'dw') . "</td><td>¥" . $row1['cp_sale'] . "</td><td>" . $row1['cp_gys'] . "</td><td>" . $row['number'] . "</td><td><a href=''></a></td></tr>";
                $nsql->close();
            }
            $csql1->close();
            echo "</table><br></td></tr>\r\n";
        }
        $csql->close();
        echo "<tr><td colspan='6'>&nbsp;" . $dlist->GetPageList($cfg_record) . "</td></tr></table>\r\n </td></tr></table>\r\n </td></tr>  <tr>\r\n    <td id=\"table_style\" class=\"l_b\">&nbsp;</td>\r\n    <td>&nbsp;</td>\r\n    <td id=\"table_style\" class=\"r_b\">&nbsp;</td>\r\n  </tr>\r\n</table>";
    } else {
        ?>
<body onload="form1.seek_text.focus()">
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
  <tr>
    <td id="table_style" class="l_t">&nbsp;</td>
    <td>&nbsp;</td>
    <td id="table_style" class="r_t">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    if ($atext == '') {
        ShowMsg('请输入财务进出原因', '-1');
        exit;
    }
    if ($amoney == '' || !is_numeric($amoney) || $amoney < 0) {
        ShowMsg('请确保输入了正确的金额', '-1');
        exit;
    }
    $loginip = getip();
    $logindate = getdatetimemk(time());
    $username = str_replace($cfg_cookie_encode, '', $_COOKIE['VioomaUserID']);
    $addsql = "insert into #@__accounts(atype,amoney,abank,dtime,apeople,atext) values('{$atype}','{$amoney}','{$abank}','{$logindate}','{$username}','{$atext}')";
    $message = "手动添加账务成功";
    $asql = new Dedesql(false);
    $asql->ExecuteNoneQuery($addsql);
    $asql->close();
    WriteNote($message, $logindate, $loginip, $username);
    showmsg('成功添加了账务', 'system_money.php');
    exit;
}
?>
<!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=gb2312" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php 
echo $cfs_softname;
?>
账户管理</title>
</head>