时间:2021-07-01 10:21:17 帮助过:30人阅读
//----------------修改成员数据-------------------------------
public function alterInfo()
{
$strAction = "";
$teamname=$_SESSION['teamname'];
if ($_GET){
$inUserid = $_GET['id'];
$data['userid'] = $inUserid;
}
if($_POST){
// var_dump($_POST);
// die();
$userid = $_POST['userid'];
$mobile = $_POST['mobile'];
$realname = $_POST['realname'];
$zhengjian = trim($this->input->post('zhengjian'));
//$idnumber = $_POST['idnumber'];
$idnumber = trim($this->input->post('idnu'));
$address = $_POST['address'];
$zipcode = $_POST['zipcode'];
$clothsize = $_POST['clothsize'];
$data['strClothOpt'] = $this->Common_model->getClothOpy($clothsize);
$birthday = trim($this->input->post('birthday'));
$passportnu = trim($this->input->post('passportnu'));
$gender = trim($this->input->post('gender'));
if ($_FILES["idnumscan"]["error"] > 0)
{
$data['error'] = $_FILES["idnumscan"]["error"] . "
";
$userpic = $_POST['idnumscans'];
}
else
{
$data['filename'] = $_FILES["idnumscan"]["name"];
$data['filetype'] = $_FILES["idnumscan"]["type"];
$data['filesize'] = ($_FILES["idnumscan"]["size"] / 1024) . " Kb";
$data['filepath'] = $_FILES["idnumscan"]["tmp_name"];
$excelname=iconv("UTF-8","gb2312", $_FILES["idnumscan"]["name"]);
$userpic = $_FILES["idnumscan"]["name"];
move_uploaded_file($_FILES["idnumscan"]["tmp_name"],"upload/image/".$excelname);
}
if($_POST['action']=="add"){
$strAction = $teamname;
$data['userid'] = "";
//倒数第二位是奇数为男性,偶数为女性
$gender = substr($idnumber,16,1)%2;
//var_dump($gender);
$teamid = $_SESSION['clubid'];
$usertype=0;
$this->load->model('Member_model');
$rowIsReg = $this->Member_model->isRegistered($idnumber,$clubid);
if($rowIsReg){
echo "";
//redirect(base_url()."member");
}else{
$res = $this->Member_model->insMember($mobile, $realname, $idnumber, $gender, $address, $zipcode, $clubid, $usertype,$userpic,$clothsize);
if($res){
echo "";
redirect(base_url()."team");
}
}
}
if($_POST['action']=="alert"){
// var_dump($zhengjian);
// die();
$strAction = $teamname;
$data['userid'] = $userid;
if($idnumber!='' and $zhengjian =='1'){ //用身份证增加或修改的
//倒数第二位是奇数为男性,偶数为女性
$gender = substr($idnumber,16,1)%2;
//var_dump($gender);
$clubid = $_SESSION['clubid'];
$usertype=0;
$this->load->model('Member_model');
$rowIsReg = $this->Member_model->isRegisteredtoo($idnumber,$clubid,$userid);
if($rowIsReg){
echo "";
//redirect(base_url()."member");
}else{
$res = $this->Member_model->alertMember($mobile, $realname, $idnumber, $gender, $address, $zipcode, $clubid, $usertype,$userpic,$clothsize,$userid,$birthday,$passportnu);
if($res){
echo "";
redirect(base_url()."team");
}
}
}else{ //用护照增加或修改的
// echo "111111111111";
// die();
$clubid = $_SESSION['clubid'];
$usertype=0;
$res = $this->Member_model->alertMemberpassportnu($mobile, $realname, $idnumber, $gender, $address, $zipcode, $clubid, $usertype,$userpic,$clothsize,$userid,$birthday,$passportnu,$gender);
if($res){
echo "";
redirect(base_url()."team");
}
}
}
$arrMember['userid'] = $userid;
$arrMember['mobile'] = $mobile;
$arrMember['realname'] = $realname;
$arrMember['idnumber'] = $idnumber;
$arrMember['address'] = $address;
$arrMember['zipcode'] = $zipcode;
$arrMember['userpic'] = $userpic;
$arrMember['clothsize'] = $clothsize;
//var_dump($arrMember);
}else{
//-----显示队员信息
$strAction = $_SESSION['teamname'];
$arrMember = $this->Team_model->getMemberInfo($inUserid);
$data['strClothOpt'] = $this->Common_model->getClothOpy($arrMember['clothsize']);
}
$data['straction'] = "alert";
$data['arrMember'] = $arrMember;
$data['strAction'] = $strAction;
$this->load->view('head');
$this->load->view('player',$data);
$this->load->view('foot');
}