//    
//    if ( $_GET['action'] == 'search' ) {
//        $_clean = array();
//        $_clean['stype'] = _check($_POST['stype']);
//        $_clean['key'] = _check($_POST['key']);
//
//        if ( $_clean['stype'] == 'companyId' ) {
//            _page("SELECT goodsId FROM tb_goods WHERE companyId = '{$_clean['key']}'",10);
//
//            $_sql = "SELECT * FROM tb_goods WHERE companyId = '{$_clean['key']}' LIMIT $_pagenum,$_pagesize";
//        } elseif ( $_clean['stype'] == 'goodsName' ) {
//            _page("SELECT goodsId FROM tb_goods WHERE goodsName = '{$_clean['key']}'",10);
//
//            $_sql = "SELECT * FROM tb_goods WHERE goodsName = '{$_clean['key']}' LIMIT $_pagenum,$_pagesize";
//        } elseif ( $_clean['stype'] == 'goodsDeliveryArea' ) {
//            _page("SELECT goodsId FROM tb_goods WHERE goodsDeliveryArea = '{$_clean['key']}'",10);
//
//            $_sql = "SELECT * FROM tb_goods WHERE goodsDeliveryArea = '{$_clean['key']}' LIMIT $_pagenum,$_pagesize";
//        }
//    }
//    
//    $_result = _query($_sql);
    
    if ( isset($_GET['goodsId']) && $_GET['action'] = 'delete' ) {
        $_sql1 = "DELETE FROM tb_goods WHERE goodsId = '{$_GET['goodsId']}'";
        _query($_sql1);

if ( _affected_rows() == 1 ) {
            _close();
            _alert_back('删除成功!');
        } else {
            _close();
            _alert_back('删除失败!');
        }
    }
    
    if ( $_GET['action'] == 'deleteAll' && isset($_POST['ids']) ) {
        $_clean['ids'] = _mysql_string(implode(',',$_POST['ids']));

$_sql2 = "DELETE FROM tb_goods WHERE goodsId IN ({$_clean['ids']})";
        _query($_sql2);

if( _affected_rows() ){
            _close();
            _alert_back('删除成功!');
        }else{
            _close();
            _alert_back('删除失败!');
        }
    }

//if($_POST["countyId"]>0){
//        $_clean['areaId'] = _check($_POST['countyId']);
//        $rs=_query("select * from tb_area where id='{$_POST['countyId']}'");
//        $row = _fetch_array($rs);
//        $areaName=$row["areaName"];
//        _free_result($rs);
//        $_clean['goodsDeliveryArea'] = "仅".$areaName;
//    }else{
//        $_clean['areaId'] = _check($_POST['cityId']);
//        $rs=_query("select * from tb_area where id='{$_POST['cityId']}'");
//        $row = _fetch_array($rs);
//        $areaName=$row["areaName"];
//        _free_result($rs);
//        $_clean['goodsDeliveryArea'] = "全".$areaName;
//    }

$_clean['code'] = _check($_POST['code']);
        if ($_clean['code'] !=$_SESSION["code"])
        {
        echo "<script>alert('验证码不正确,请重新登陆');location.href='login.php';</script>";
        exit;
        }

require 'includes/common.inc.php';
      session_start();
    if ( $_GET['action'] == 'login' ) {
        $_clean = array();
        $_clean['username'] = _check($_POST['username']);
        $_clean['password'] =md5(_check($_POST['password']));
        $_sql = "SELECT * FROM tb_easyadmin WHERE username = '{$_clean['username']}' AND password = '{$_clean['password']}' LIMIT 1";
        $_result = _query($_sql);
        $_rows = _fetch_array($_result);
        if ( !!$_rows ) {
            _close();
            $_SESSION['id'] = $$_rows['id'];
            $_SESSION['password'] = $_clean['password'];
            _location(null,'index.php');
        } else {
            _close();
            _location('用户名密码不正确','login.php');
        }
    }

<?php
                        if( $_html3['county'] > 0 ){
                            $_sql3 = "SELECT id,areaName FROM tb_earea WHERE areaType = 4 AND areaId = '{$_html3['county']}' AND state = 0";
                            $_result3 = _query($_sql3);
                            while( $_rowsRegion = _fetch_array($_result3) ){
                    ?>
                        <option value="<?php echo $_rowsRegion['id'] ?>" <?php if($_html3["region"]==$_rowsRegion['id']){?> selected="selected"<?php }?>><?php echo $_rowsRegion['areaName'] ?></option>
                        <?php
                            }
                            _free_result($_result3);
                        }
                    ?>

$(function() {

$advertisingType = $('#advertisingType');
    
    $advertisingType.click(function() {
    
        value = $advertisingType.val();
    
        if ( value == 4 ) {
            $('.tr').hide();
        }
        
        if ( value != 4 ) {
            $('.tr').show();
        }
    
    });
    
});

<select name="smallClassId" id="smallClassId" >
                        <option value="0">请选择小类</option>
                        <?php
                            if( $_html3['bigClassId'] > 0 ){
                                $_sql5 = "SELECT id,categoryName FROM tb_ecategory WHERE grade = 1 AND categoryId = '{$_html3['bigClassId']}' AND state = 0";
                                $_result5 = _query($_sql5);
                                while( $_rows5 = _fetch_array($_result5) ){
                        ?>
                        <option value="<?php echo $_rows5['id']?>" <?php if($_html3['smallClassId'] == $_rows5['id']){?> selected="selected"<?php }?>><?php echo $_rows5['categoryName']?></option>
                        <?php    
                                }
                                _free_result($_result5);
                            }
                        ?>
                      </select>

user

<?php
    require 'includes/common.inc.php';
    session_start();
    if ( !isset($_SESSION['username']) ) {
        _location('请先登录!','login.php');
    }
?>
<!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>
<style type="text/css">
<!--
*{
margin:0;
padding:0;
}
body {
    background-color: #F8F9FA;
}
-->
</style>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="data:images/left-top-right.gif" width="17" height="29" /></td>
    <td height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
        <tr>
          <td height="31"><div class="titlebt">会员管理</div></td>
        </tr>
      </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="data:images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><div>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="20"><div style="font-size:12px;line-height:25px;">查看: <a href='user.php'>全部</a> <a href="?userType=1">个人会员</a> <a href="?userType=2">企业会员</a></div>
              <div align="center" style="margin-top:-10px;">
                <form action="?action=search" method="post" name="user" id='user' onsubmit="return test();">
                  <label for="stype"></label>
                  <select name="stype" id="stype">
                    <option value="regName">账号名称</option>
                  </select>
                  <input name="key" type="text" id="key" />
                  <input id='btn' type="submit" value="搜素" />
                </form>
              </div>
              <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" >
              </table></td>
          </tr>
          <tr><td height="10"></td></tr>
          <tr>
            <td>
                <table width="100%" height="74" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                  <tr align="center" bgcolor="#F2F2F2">
                    <td class="left_txt2">账号名称</td>
                    <td class="left_txt2">会员类型</td>
                    <td class="left_txt2">会员等级</td>
                    <td class="left_txt2">易币数</td>
                    <td class="left_txt2">现金数</td>
                    <td class="left_txt2">真实姓名</td>
                    <td class="left_txt2">状态</td>
                    <td class="left_txt2"></td>
                  </tr>
                  <?php
                    define('SCRIPT','user');
                    global $_pagesize,$_pagenum;
                    if ($_GET['userType']=="") {
                        _page('SELECT id FROM tb_user',10);
                        $_sql = "SELECT * FROM tb_user LIMIT $_pagenum,$_pagesize";
                    }else{
                        _page("SELECT id FROM tb_user WHERE identity = '{$_GET['identity']}' && state = '{$_GET['state']}'",10);
                        $_sql = "SELECT * FROM tb_user WHERE identity = '{$_GET['identity']}' && state = '{$_GET['state']}' LIMIT $_pagenum,$_pagesize";
                    }    
                    if ( $_GET['action'] == 'search' ) {
                        $_clean = array();
                        $_clean['stype'] = _check($_POST['stype']);
                        $_clean['key'] = _check($_POST['key']);
                    
                    if ( $_clean['stype'] == 'regName' ) {
                        $_sql = "SELECT * FROM tb_user WHERE regName = '{$_clean['key']}'";
                        }
                        }
                    $_result = _query($_sql);
                      $_row = _num_rows($_result);
                    if ( $_row > 0 ) {
                        while ( $_rows = _fetch_array($_result) ) {
                            $_html = array();
                            $_html['id'] = $_rows['id'];
                            $_html['regName'] = $_rows['regName'];
                            $_html['totalSyJf'] = $_rows['totalSyJf'];
                            $_html['cash'] = $_rows['cash'];
                            $_html['realName'] = $_rows['realName'];
                            switch ( $_rows['state'] ) {
                                case 0:
                                    $_html['state'] = '正常';
                                    break;
                                case 1:
                                    $_html['state'] = '冻结';
                                    break;
                                case 10:
                                    $_html['state'] = '未激活';
                                    break;
                            }
                            $_sql1 = "SELECT levelName FROM tb_level WHERE id = '{$_rows['level']}'";
                            $_result1 = _query($_sql1);
                            $_rows1 = _fetch_array($_result1);
                            $_html['level'] = $_rows1['levelName'];
                            
                            switch ( $_rows['identity'] ) {
                                case 1:
                                    $_html['identity'] = '个人会员';
                                    break;
                                case 2:
                                    $_html['identity'] = '企业会员';
                                    break;
                            }
                            $_html = _html($_html);
                          ?>
                  <tr align="center" bgcolor="#F2F2F2">
                    <td  class="left_txt2"><?php echo $_html['regName']?></td>
                    <td  class="left_txt2"><?php echo $_html['identity']?></td>
                    <td  class="left_txt2"><?php echo $_html['level']?></td>
                    <td  class="left_txt2"><?php echo $_html['totalSyJf']?></td>
                    <td  class="left_txt2"><?php echo $_html['cash']?></td>
                    <td  class="left_txt2"><?php echo $_html['realName']?></td>
                    <td  class="left_txt2"><?php echo $_html['state']?></td>
                    <td width="13%"  class="left_txt2">
                        <a href='user_edit.php?id=<?php echo $_html['id']?>'>修改</a>
                    </td>
                  </tr>
                   <?php
                    }
                    ?>
                <?php
                    } else {
                    ?>
                <tr bgcolor="#F2F2F2" class="left_txt2" align="center" >
                  <td colspan="9">暂无信息</td>
                </tr>
                <?php    
                    }
                    _free_result($_result);
                    _close();
                    ?>
                <tr bgcolor="#F2F2F2" class="left_txt2" align="center" >
                  <td colspan="9">
                 <?php
                    _paging(2);
                    ?>
              </table></td>
          </tr>
        </table>
      </div></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="data:images/buttom_left2.gif" width="17" height="17" /></td>
    <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="data:images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="data:images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
</html>

修改会员
<?php

require 'includes/common.inc.php';
    
    session_start();
    
    if ( !isset($_SESSION['username']) ) {
        _location('请先登录','login.php');
    }
    
    if ( isset($_GET['id']) ) {
        $_sql = "SELECT * FROM tb_user WHERE id = '{$_GET['id']}'";
        $_result = _query($_sql);
        $_rows = _fetch_array($_result);
        $_html = array();
        $_html['regName'] = $_rows['regName'];
        $_html['Email'] = $_rows['Email'];
        $_html['regPwd'] = $_rows['regPwd'];
        $_html['tradingPwd'] = $_rows['tradingPwd'];
        $_html['encryptedQuestion'] = $_rows['encryptedQuestion'];
        $_html['encryptedAnswer'] = $_rows['encryptedAnswer'];
        $_html['userimage'] = $_rows['userimage'];
        $_html['realName'] = $_rows['realName'];
        $_html['province'] = $_rows['province'];
        $_html['theCity'] = $_rows['theCity'];
        $_html['county'] = $_rows['county'];
        $_html['address'] = $_rows['address'];
        $_html['qq'] = $_rows['qq'];
        $_html['phone'] = $_rows['phone'];
        $_html['totalSyJf'] = $_rows['totalSyJf'];
        $_html['cash'] = $_rows['cash'];
        $_html['level'] = $_rows['level'];
        $_html['levelDate'] = $_rows['levelDate'];
        $_html['userType'] = $_rows['userType'];
        $_html['state'] = $_rows['state'];
        
        $_sql2 = "SELECT regName FROM tb_user WHERE id = '{$_rows['isfrom1']}'";
        $_result2 = _query($_sql2);
        $_rows2 = _fetch_array($_result2);
        $_html['isfrom1'] = $_rows2['regName'];
        
        $_sql3 = "SELECT regName FROM tb_user WHERE id = '{$_rows['isfrom2']}'";
        $_result3 = _query($_sql3);
        $_rows3 = _fetch_array($_result3);
        $_html['isfrom2'] = $_rows3['regName'];
        
        $_sqlProvince = "SELECT areaName FROM tb_area WHERE id = '{$_html['province']}'";
        $_resultProvince = _query($_sqlProvince);
        $_rowsProvince = _fetch_array($_resultProvince);
        
        $_sqlCity = "SELECT areaName FROM tb_area WHERE id = '{$_html['theCity']}'";
        $_resultCity = _query($_sqlCity);
        $_rowsCity = _fetch_array($_resultCity);
        
        $_sqlCounty = "SELECT areaName FROM tb_area WHERE id = '{$_html['county']}'";
        $_resultCounty = _query($_sqlCounty);
        $_rowsCounty = _fetch_array($_resultCounty);
        
        $_html = _html($_html);
    }
    if ( isset($_GET['id']) && $_GET['action'] == 'update' ){
        $_clean = array();
        $_clean['regPwd'] = _check($_POST['regPwd']);
        $_clean['tradingPwd'] = _check($_POST['tradingPwd']);
        $_clean['level'] = _check($_POST['level']);
        $_clean['state'] = _check($_POST['state']);
        $_sql1 = "UPDATE
                        tb_user
                     SET
                         regPwd = '{$_clean['regPwd']}',
                        tradingPwd = '{$_clean['tradingPwd']}',
                        level = '{$_clean['level']}',
                        state = '{$_clean['state']}'
                   WHERE
                           id = '{$_GET['id']}'";
        _query($_sql1);
        
        if ( _affected_rows() == 1 ) {
            _close();
            _alert_back('修改成功!');
        } else {
            _close();
            _alert_back('修改失败!');
        }
    }
    
?>
<!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>
<script src="../js/setday.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function(){

var ret = document.getElementById('return');
    
    ret.onclick = function(){
        
        history.back(-1);
    
    };
    
}
</script>
<style type="text/css">
<!--
*{ margin:0;
padding:0;}
body {
    
}
-->
</style>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="data:images/left-top-right.gif" width="17" height="29" /></td>
    <td  valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
        <tr>
          <td height="31"><div class="titlebt">会员管理</div></td>
        </tr>
      </table>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="data:images/nav-right-bg.gif" width="16" height="29" /></td>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif"></td>
    <td valign="top" bgcolor="#F7F8F9"><div>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">                             <tr><td height="10"></td></tr>
          <tr>
            <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                <form name="admin" id="admin" method="POST" action="?action=update&id=<?php echo $_GET['id']?>">
                  <tr bgcolor="#f2f2f2">
                    <td width="34%" align="right" class="left_txt2"> 账号名称:</td>
                    <td width="16%" class="left_txt2"><?php echo $_html['regName']?></td>
                    <td width="14%" align="right" class="left_txt2" >现金余额:</td>
                    <td width="36%" class="left_txt2"><?php echo $_html['cash']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">账号邮箱:</td>
                    <td class="left_txt2"><?php echo $_html['Email']?></td>
                    <td align="right" class="left_txt2">真实名称:</td>
                    <td class="left_txt2"><?php echo $_html['realName']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">密码:</td>
                    <td class="left_txt2"><input type="password" name="regPwd" size="20" id="regPwd"value="<?php echo $_html['regPwd'] ?>" /></td>
                    <td align="right" class="left_txt2">省:</td>
                    <td class="left_txt2"><?php echo $_rowsProvince['areaName']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">交易密码:</td>
                    <td class="left_txt2"><input type="password" name="tradingPwd" size="20" id="tradingPwd" value="<?php echo $_html['tradingPwd'] ?>"/></td>
                    <td class="left_txt2" align="right" >市:</td>
                    <td class="left_txt2"><?php echo $_rowsCity['areaName']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td class="left_txt2" align="right" >密码问题:</td>
                    <td class="left_txt2"><?php echo $_html['encryptedQuestion']?></td>
                    <td class="left_txt2" align="right" >县:</td>
                    <td class="left_txt2"><?php echo $_rowsCounty['areaName']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">密保答案:</td>
                    <td class="left_txt2"><?php echo $_html['encryptedAnswer']?></td>
                    <td class="left_txt2" align="right">详细地址:</td>
                    <td class="left_txt2"><?php echo $_html['address']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td class="left_txt2" align="right" >QQ:</td>
                    <td class="left_txt2"><?php echo $_html['qq']?></td>
                    <td align="right" class="left_txt2">用户等级:</td>
                    <td class="left_txt2"><select name="level" id="level">
                        <option value="">--请选择用户等级--</option>
                        <?php
                                $_sql4 = "SELECT id,levelName FROM tb_level WHERE state = 0";
                                $_result4 = _query($_sql4);
                                while( $_rows4 = _fetch_array($_result4) ){    
                            ?>
                        <option value="<?php echo $_rows4['id'] ?>" <?php if($_html['level'] == $_rows4['id']) echo "selected='selected'"; ?>><?php echo $_rows4['levelName'] ?></option>
                        <?php
                                }
                                _free_result($_result4);
                            ?>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">电话:</td>
                    <td class="left_txt2"><?php echo $_html['phone']?></td>
                    <td class="left_txt2" align="right" >会员有效期:</td>
                    <td class="left_txt2"><?php echo $_html['levelDate']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">易币余额:</td>
                    <td class="left_txt2"><?php echo $_html['totalSyJf']?></td>
                    <td align="right" class="left_txt2">状态:</td>
                    <td class="left_txt2"><select name="state" id="state">
                        <option value="0" <?php if($_html['state'] == 0) echo "selected='selected'"; ?>>正常</option>
                        <option value="1" <?php if($_html['state'] == 1) echo "selected='selected'"; ?>>冻结</option>
                        <option value="10" <?php if($_html['state'] == 10) echo "selected='selected'"; ?>>未激活</option>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">直接推广员:</td>
                    <td class="left_txt2"><?php echo $_html['isfrom1']?></td>
                    <td align="right" class="left_txt2">间接推广员:</td>
                    <td class="left_txt2"><?php echo $_html['isfrom2']?></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">会员图像:</td>
                    <td class="left_txt2" colspan="3"><img src="../<?php echo $_html['userimage']?>" /></td>
                  </tr>
                  <tr>
                    <td colspan="4" align="center" bgcolor="#F2F2F2" class="left_txt2"><input type="submit" name="button" id="button" value="修改" />
                      <input type="button" value="返回" id="return" />
                    </td>
                  </tr>
                </form>
              </table></td>
          </tr>
        </table>
        <!---->
      </div></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="data:images/buttom_left2.gif" width="17" height="17" /></td>
    <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="data:images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="data:images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
</html>

添加会员

<?php

require 'includes/common.inc.php';
    session_start();
    if ( !isset($_SESSION['username']) ) {
        _location('请先登录!','login.php');
    }
    
    
    
    $_now = date('Y-m-d H:i:s',time());
    
    if ( $_GET['action'] == 'add' ) {
        $_clean = array();
        $_clean['regIP'] = $_SERVER["REMOTE_ADDR"];
        $_clean['regName'] = _check($_POST['regName']);
        $_clean['Email'] = _check($_POST['Email']);
        $_clean['regPwd'] = md5(($_POST['regPwd']));
        $_clean['tradingPwd'] = md5(($_POST['tradingPwd']));
        $_clean['encryptedQuestion'] = _check($_POST['encryptedQuestion']);
        $_clean['encryptedAnswer'] = md5(($_POST['encryptedAnswer']));
        $_clean['userimage'] = $_POST['userimage'];
        $_clean['realName'] = _check($_POST['realName']);
        $_clean['province'] = _check($_POST['province']);
        $_clean['theCity'] = _check($_POST['theCity']);
        $_clean['county'] = _check($_POST['county']);
        $_clean['address'] = _check($_POST['address']);
        $_clean['qq'] = _check($_POST['qq']);
        $_clean['phone'] = _check($_POST['phone']);
        $_clean['totalSyJf'] = _check($_POST['totalSyJf']);
        $_clean['cash'] = _check($_POST['cash']);
        $_clean['level'] = _check($_POST['level']);
        $_clean['levelDate'] = _check($_POST['levelDate']);
        $_clean['userType'] = _check($_POST['userType']);
        $_clean['isfrom1'] = _check($_POST['isfrom1']);
        $_clean['lotteryNumber'] = _check($_POST['lotteryNumber']);
        
        $_sql = "SELECT isfrom1 FROM tb_user WHERE id = '{$_clean['isfrom1']}'";
        $_result = _query($_sql);
        $_rows = _fetch_array($_result);
        $_sqlAdd = "INSERT INTO tb_user VALUES (NULL,'{$_clean['regIP']}','$_now','{$_clean['regName']}','{$_clean['Email']}','{$_clean['regPwd']}','{$_clean['tradingPwd']}','{$_clean['encryptedQuestion']}','{$_clean['encryptedAnswer']}','{$_clean['userimage']}','{$_clean['realName']}','{$_clean['province']}','{$_clean['theCity']}','{$_clean['county']}','{$_clean['address']}','{$_clean['qq']}','{$_clean['phone']}','{$_clean['totalSyJf']}','{$_clean['cash']}','{$_clean['level']}',0,1,'{$_clean['isfrom1']}','{$_rows['isfrom1']}',0,'{$_rows['lotteryNumber']}')";
        _query($_sqlAdd);
        
        if ( _affected_rows() == 1 ) {
            _close();
            _location('添加成功!','user.php');
        } else {
            _close();
            _location('添加失败!','user_add.php');
        }
    }
?>
<!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" />
<script src="../js/setday.js" type="text/javascript"></script>
<title>后台管理--添加会员</title>
<style type="text/css">
*{
    margin:0;
    padding:0;
}
body {
    background-color: #F8F9FA;
}
</style>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//市 数据保存到数组
var subvalCity = new Array();
<?php
$rs = _query("select * from tb_area where areaType=2 and state=0 order by sort asc");
$counts = 0;
while( $row = _fetch_array($rs) ){
?>
subvalCity[<?php echo $counts?>] = new Array('<?php echo $row["areaId"]?>','<?php echo $row["id"]?>','<?php echo $row["areaName"]?>')
<?php
$counts = $counts + 1;
}
_free_result($rs);
?>
function provinceChange(locationid)
{
    document.admin.theCity.length = 0;
    document.admin.theCity.options[0] = new Option('--请选择市--','0');
    document.admin.county.length = 0;
    document.admin.county.options[0] = new Option('--请选择区县--','0');
    for (i=0; i<subvalCity.length; i++)
    {
        if (subvalCity[i][0] == locationid) {
            document.admin.theCity.options[document.admin.theCity.length] = new Option(subvalCity[i][2],subvalCity[i][1]);
        }
    }
}

//区 数据保存到数组
var subvalCounty = new Array();
<?php
$rs1 = _query("select * from tb_area where areaType=3 and state=0 order by sort asc");
$counts1 = 0;
while( $row1 = _fetch_array($rs1) ){
?>
subvalCounty[<?php echo $counts1?>] = new Array('<?php echo $row1["areaId"]?>','<?php echo $row1["id"]?>','<?php echo $row1["areaName"]?>')
<?php
$counts1 = $counts1 + 1;
}
_free_result($rs1);
?>
function theCityChange(locationid)
{
    document.admin.county.length = 0;
    document.admin.county.options[0] = new Option('--请选择区县--','0');
    for (i=0; i<subvalCounty.length; i++)
    {
        if (subvalCounty[i][0] == locationid) {
            document.admin.county.options[document.admin.county.length] = new Option(subvalCounty[i][2],subvalCounty[i][1]);
        }
    }
}

function test()
{
    if(document.admin.regName.value=='')
    {
        alert('请输入账号名称');
        return false;
    }
    if(document.admin.Email.value=='')
    {
       alert('请输入账号邮箱');
       return false;
    }
    if(document.admin.regPwd.value=='')
    {
        alert('请输入账号密码');
        return false;
    }
    if(document.admin.tradingPwd.value=='')
    {
        alert('交易密码');
        return false;
    }
    if(document.admin.encryptedQuestion.value=='')
    {
        alert('密码问题');
        return false;
    }
    return true;
}
 </script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
 
  <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="data:images/left-top-right.gif" width="17" height="29" /></td>
  <td  valign="top" background="images/content-bg.gif">
      <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">会员管理</div></td>
      </tr>
    </table>
  <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="data:images/nav-right-bg.gif" width="16" height="29" /></td>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><div>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr><td height="10"></td></tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                <form name="admin" id="admin" method="POST" action="?action=add" onsubmit="return test();">
                  <tr bgcolor="#f2f2f2">
                    <td width="25%" align="right" class="left_txt2" > 账号名称:</td>
                    <td width="21%" class="left_txt2"><input type="text" name="regName" size="30" id="regName" /></td>
                    <td width="11%" align="right" class="left_txt2" >会员图像:</td>
                    <td width="43%"  class="left_txt2"><input type="text" name="userimage" id="userimage" style="width:152px" />
                    <input type="button" value="上传" onClick="window.open('../admin/upload.php?formname=admin&editname=userimage','','status=no,scrollbars=no,top=35,width=650,height=350')"/></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">账号邮箱:</td>
                    <td class="left_txt2"><input type="text" name="Email" size="30" id="Email" /></td>
                    <td align="right" class="left_txt2">真实名称:</td>
                    <td class="left_txt2"><input type="text" name="realName" size="30" id="realName" /></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">密码:</td>
                    <td class="left_txt2"><input type="password" name="regPwd" size="30" id="regPwd" /></td>
                    <td class="left_txt2" align="right">省:</td>
                    <td class="left_txt2"><select id="province" name="province" onchange="provinceChange(this.value) ">
                        <option value="" >请选择省份</option>
                        <?php
                            $_sql = "SELECT id,areaName FROM tb_area WHERE areaType = 1 AND state = 0";
                            $_result = _query($_sql);
                            while( $_rows = _fetch_array($_result) ){
                                $_html = array();
                                $_html['id'] = $_rows['id'];
                                $_html['areaName'] = $_rows['areaName'];
                                $_html = _html($_html);        
                            ?>
                        <option value="<?php echo $_html['id'] ?>" <?php if($_html3['province'] == $_html['id']){?> selected="selected"<?php }?>><?php echo $_html['areaName'] ?></option>
                        <?php
                            }
                            _free_result($_result);
                        ?>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">交易密码:</td>
                    <td class="left_txt2"><input type="password" name="tradingPwd" size="30" id="tradingPwd" /></td>
                    <td class="left_txt2" align="right">市:</td>
                    <td class="left_txt2"><select name="theCity" id="theCity"  onchange="theCityChange(this.value)">
                        <option value="0">-- 请选择市--</option>
                        <?php
                                $_sql = "SELECT id,areaName FROM tb_area WHERE areaType = 2 AND state = 0";
                                $_result = _query($_sql);
                                while( $_rows = _fetch_array($_result) ){
                                    $_html = array();
                                    $_html['id'] = $_rows['id'];
                                    $_html['areaName'] = $_rows['areaName'];
                                    $_html = _html($_html);        
                                ?>
                        <option value="<?php echo $_html['id'] ?>" <?php if($_html3['theCity'] == $_html['id']){?> selected="selected"<?php }?>><?php echo $_html['areaName'] ?></option>
                        <?php
                                }
                                _free_result($_result);
                            ?>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">密码问题:</td>
                    <td class="left_txt2"><input type="text" name="encryptedQuestion" size="30" id="encryptedQuestion" /></td>
                    <td class="left_txt2" align="right">区县:</td>
                    <td class="left_txt2"><select name="county" id="county" onChange="countyChange(this.value)" >
                        <option value="0">--请选择区县--</option>
                        <?php
                                if( $_html3['theCity'] > 0 ){
                                    $_sql2 = "SELECT id,areaName FROM tb_area WHERE areaType = 3 AND areaId = '{$_html3['theCity']}' AND state = 0";
                                    $_result2 = _query($_sql2);
                                    while( $_rowsCounty = _fetch_array($_result2) ){
                            ?>
                        <option value="<?php echo $_rowsCounty['id'] ?>" <?php if($_html3["county"] == $_rowsCounty['id']){?> selected="selected"<?php }?>><?php echo $_rowsCounty['areaName'] ?></option>
                        <?php
                                    }
                                    _free_result($_result2);
                                }
                            ?>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">密保答案:</td>
                    <td class="left_txt2"><input type="password" name="encryptedAnswer" size="30" id="encryptedAnswer" /></td>
                    <td class="left_txt2" align="right" >详细地址:</td>
                    <td class="left_txt2"><input name="address" type="text" id="address" size="30"/></td>
                  </tr>
                  <tr bgcolor="#f2f2f2" >
                    <td align="right" class="left_txt2">QQ:</td>
                    <td class="left_txt2"><input type="text" name="qq" size="30" id="qq" /></td>
                    <td align="right" class="left_txt2">用户等级:</td>
                    <td class="left_txt2"><select name="level" id="level">
                        <option value="">--请选择用户等级--</option>
                        <?php
                                $_sql4 = "SELECT id,levelName FROM tb_level WHERE state = 0";
                                $_result4 = _query($_sql4);
                                while( $_rows4 = _fetch_array($_result4) ){    
                            ?>
                        <option value="<?php echo $_rows4['id'] ?>"><?php echo $_rows4['levelName'] ?></option>
                        <?php
                                }
                                _free_result($_result4);
                            ?>
                      </select>
                    </td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td align="right" class="left_txt2">电话:</td>
                    <td bgcolor="#f2f2f2"><input name="phone" type="text" id="phone" size="30" /></td>
                    <td align="right" class="left_txt2">会员类型:</td>
                    <td class="left_txt2"><select name="userType" id="userType">
                        <option value="">--请选择会员类型--</option>
                        <option value="1">个人会员</option>
                        <option value="2">商家会员</option>
                      </select></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td class="left_txt2" align="right" >易币余额:</td>
                    <td class="left_txt2" ><input name="totalSyJf" type="text" id="totalSyJf" size="30" /></td>
                    <td class="left_txt2" align="right">会员有效期:</td>
                    <td class="left_txt2"><input name="levelDate" type="text" id="levelDate" size="30" onclick="new Calendar().show(this);" readonly="readonly"/></td>
                  </tr>
                  <tr bgcolor="#f2f2f2">
                    <td class="left_txt2" align="right">现金余额:</td>
                    <td class="left_txt2"><input type="text" name="cash" id="cash" size="30" /></td>
                    <td align="right" class="left_txt2">直接推广人ID:</td>
                    <td class="left_txt2"><input type="text" name="isfrom1" id="isfrom1" size="30" /></td>
                  </tr>
                  <tr>
                    <td bgcolor="#f2f2f2" colspan="4" align="center" class="left_txt"><input type="submit" name="button" id="button" value="创建" />
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <input type="reset" name="button2" id="button2" value="重置" /></td>
                  </tr>
                </form>
              </table></td>
          </tr>
        </table>
        <!---->
      </div></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="data:images/buttom_left2.gif" width="17" height="17" /></td>
    <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="data:images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="data:images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
</html>

php杂乱的更多相关文章

  1. Day06 杂乱与4个对象

    1.杂乱 -- 数据库的分页操作 -- 分页使用的是rownum 例1: select rownum,empno,ename from emp ; 结果: 例2: select r,empno,ena ...

  2. 避免让WPF资源字典变得杂乱臃肿

    原文:避免让WPF资源字典变得杂乱臃肿   避免让WPF资源字典变得杂乱臃肿                            周银辉 今天看到项目种的一个XXXResource.xaml文件代码 ...

  3. 利用Python批量重命名一系列文件名杂乱的文件

    假设目录下面有这样一系列命令杂乱的文件: OPENFOAM -TRAINING- PART- #1.pdf OPENFOAM - TRAINING- PART- #2.pdf OPENFOAM- TR ...

  4. python模块引用问题(比较杂乱,懒得整理)

    1 在stackoverflows摘抄 If the import module in the same dir, use e.g: from . import core If the import ...

  5. Linux杂乱小知识点

    1.不同网段的主机不能建立TCP连接 2.TCP客户端可以用bind绑定自己的IP与port(一般情况下不需要绑定,port由系统自动分配) 3.accept() 函数返回一个套接字,send / r ...

  6. 关于QGraphicsScene 和 QGraphicsView 和 QDialog 的杂乱笔记【或说指针复习。。】

    LtCalibrateDlg::~LtCalibrateDlg() { if (m_pIplImageGray) cvReleaseImage(&m_pIplImageGray); MYDEL ...

  7. [百度空间] [原]MFC杂乱笔记

    1. 创建动态菜单 假如ID是动态分配的,那么重载virtual BOOLOnCmdMsg(UINT,int,void*,AFX_CMDHANDLERINFO*); 据MSDN不详细解释,当第二个参数 ...

  8. android Activity的杂乱总结

    android中Activity可以说是四大组件中用的最为广泛,也是最为基本的一个组件.几乎和用户的所有交互都需要通过Activity来实现. 最近在学习过程中,有一些关于Activity的内容,让我 ...

  9. python杂乱有关类与对象

    在python的类中,一般里面的方法和属性默认都是publlic,如果要设为private,即自己访问,主要是根据命名方式来区分的,通过__  两个下划线加在名字前面,即为私有方法和私有属性 构造方法 ...

  10. thinkphp 杂乱笔记(1)

    部署模式可用两个单入口表示前后台thinkphpUploadspublic Home(前台)Admin(后台)index.php(前台入口文件)admin.php(后台入口文件)上面两个项目目录 也可 ...

随机推荐

  1. mysql解决中文乱码问题

    安装文件 my.ini default-character-set=gbk 安装文件 db.opt default-character-set=gbkdefault-collation=gbk_chi ...

  2. Java 反射 调用私有域和方法(setAccessible)

    Java 反射 调用私有域和方法(setAccessible) @author ixenos AccessibleObject类 Method.Field和Constructor类共同继承了Acces ...

  3. hdu_5919_Sequence II(主席树)

    题目链接:hdu_5919_Sequence II 题意: 给你n个数,m个询问,每次问你一个区间中每一种数在区间中第一次出现的位置的中位数,强制在线. 题解: 一看就是主席树搞,不过这里要询问第一次 ...

  4. 异常处理try-catch-finally笔记

    当程序发生异常时,我们期望:返回到一种安全状态,并能够让用户执行一些其他的命令:或者 允许用户保存所有操作的结果,并以适当的方式终止程序. 异常处理机制:程序的执行过程中如果出现异常,会自动生成一个异 ...

  5. CentOS postgresql9.4

    yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm Once t ...

  6. 一步一步学EF系列2【最简单的一个实例】

    整个文章我都会用最简单,最容易让人理解的方式给大家分享和共同学习.(由于live Writer不靠谱 又得补发一篇) 一.安装 Install-Package EntityFramework 二.简单 ...

  7. 华中农业大学新生赛C题

    http://acm.hzau.edu.cn/problem.php?id=1099 题意: 输入两个整数 l 和 n,代表半径和output的保留小数点位数. 输出圆的面积,保留n位小数. 一开始觉 ...

  8. 河南多校联合训练 南阳理工 1261 音痴又音痴的LT

    描述 LT最近一直在无限循环薛之谦的歌,简直都中毒了!可是呢…他的歌LT还是不会唱(其实不止他的歌LT不会唱,所有人的歌LT都不会唱…因为LT是标准的音痴)可是LT又很喜欢唱歌(所以LT不仅是音痴还是 ...

  9. android CTS测试

    CTS认证是获得Google推出的Android系统中Android Market服务的前提 CTS兼容性测试的主要目的和意义在于使得用户在Android系统的应用过程中,有更好的用户体验,并展现出A ...

  10. VC MFC工具栏(CToolBar)控件

    一.工具栏 工具栏控件在控件面板里没有对应的选项(图标),但有一个工具栏控件类CToolBar,所以我们如果要创建一个工具栏控件并显示在窗口里的话,只能用代码来完成,事实上任何一种控件,都可以用代码创 ...