本文整理汇总了PHP中MemberModel::add_member方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberModel::add_member方法的具体用法?PHP MemberModel::add_member怎么用?PHP MemberModel::add_member使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberModel
的用法示例。
在下文中一共展示了MemberModel::add_member方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addgr
/**
* 添加工人
*/
public function addgr()
{
parent::_initalize();
$this->assign("systemConfig", $this->systemConfig);
$is_qx = $this->getqx($_SESSION['my_info']['role']);
$cmod = new CityModel();
if ($is_qx == 1) {
#地区管理员
$c_id = $_SESSION['my_info']['cityid'];
$p_id = $_SESSION['my_info']['proid'];
$qlist = $cmod->getcity($c_id);
$this->assign("qlist", $qlist);
$this->assign("c_id", $c_id);
$this->assign("p_id", $p_id);
} else {
#省
$plist = $cmod->getprovince(1);
$this->assign("plist", $plist);
}
$this->assign("is_qx", $is_qx);
if (IS_POST) {
$a_name = trim($_POST['a_name']);
//用户登录信息
$status = $_POST['status'];
//状态
$pwd = trim($_POST['pwd']);
$confirm_pwd = trim($_POST['confirm_pwd']);
if (empty($a_name)) {
$this->error("请填写登录名!");
exit;
}
if (empty($pwd)) {
$this->error("请填写密码!");
exit;
}
if (empty($confirm_pwd)) {
$this->error("确认密码不能为空!");
exit;
}
if ($confirm_pwd != $pwd) {
$this->error("两次输入的密码不一致!");
exit;
}
#检测用户名是否存在
$memMod = M("Member");
$res = $memMod->where("a_type=2 and a_name='" . $a_name . "'")->count();
if ($res > 0) {
$this->error("登录名已经存在!");
exit;
}
//登录信息接受结束
$picName = trim($_POST['picName']);
//logo
$truename = trim($_POST['truename']);
$ruzhitime = trim($_POST['ruzhitime']);
#身份证
if (!empty($_FILES['sfz_img']['name'])) {
$path = "/Uploads/shangjia/";
$sfzimg = $this->upload("." . $path);
if (!empty($sfzimg[0]['savename'])) {
$sfz_img = $path . $sfzimg[0]['savename'];
}
}
$content = trim($_POST['content']);
$movphone = trim($_POST['movphone']);
$sex = $_POST['sex'];
$email = trim($_POST['email']);
$gongling = trim($_POST['gongling']);
$qq = trim($_POST['qq']);
$orders = trim($_POST['orders']);
$is_tj = $_POST['is_tj'];
$p_id = $_POST['p_id'];
$c_id = $_POST['c_id'];
$q_id = $_POST['q_id'];
$address = trim($_POST['address']);
$jingdu = $_POST['jingdu'];
$weidu = $_POST['weidu'];
$aid = $_POST['aid'];
$maindata = array("a_name" => $a_name, "a_pwd" => encrypt($pwd), "a_type" => 5, "status" => $status);
$fjdata1 = array("truename" => $truename, "ruzhitime" => $ruzhitime, "logo" => $picName, "sfz_img" => $sfz_img, "content" => $content, "movphone" => $movphone, "sex" => $sex, "email" => $email, "gongling" => $gongling, "address" => $address, "qq" => $qq, "orders" => $orders, "is_tj" => $is_tj, "p_id" => $p_id, "c_id" => $c_id, "q_id" => $q_id, "jingdu" => $jingdu, "weidu" => $weidu);
$memmod = new MemberModel();
$res1 = $memmod->add_member($maindata, $fjdata1);
if ($res1) {
$this->success("操作成功!", U("Member/grlist"));
exit;
} else {
$this->error("操作失败!");
exit;
}
}
$this->display();
}