찾다
php教程PHP源码微信 codeigniter
微信 codeigniter May 22, 2016 pm 06:24 PM

        跳至               

weixin_model->get_openid ( $openid );
		$this->load->view ( 'nwxin/index' );
	}
	function user(){
		$this->load->view ( 'nwxin/user' );
	}
	function from(){
		$this->load->view ( 'nwxin/from' );
	}
	function download() {
		$this->load->view ( 'wxin/header' );
		$this->load->view ( 'wxin/download' );
		$this->load->view ( 'wxin/footer' );
	}
	function tudi() {
		$openid = 'oJ7rwvxBpSfeKX9dOXT_VgbayvQA';
		
		$uid = $this->weixin_model->get_openid ( $openid );
		
		// 获取三级推广总人数及用户信息
		$user = $this->sel_reg_num ( $uid ['id'], true );
		if ($user) {
			$data ['user'] = $user;
		} else {
			$data ['kong'] = true;
		}
		
		$this->load->view ( 'wxin/header' );
		$this->load->view ( 'wxin/jifeng', $data );
		$this->load->view ( 'wxin/footer' );
	}
	function read() {
		$this->load->view ( 'wxin/header' );
		$this->load->view ( 'wxin/read' );
		$this->load->view ( 'wxin/footer' );
	}
	function admin() {
		$this->load->model ( 'weixin_model' );
		$openid = 'uids';
		$data ['result'] = $this->weixin_model->select_all_user ();
		$data ['a_main_content'] = "user_list";
		$this->load->view ( 'wxin/a_template', $data );
	}
	// 关注成功
	function follow() {
		if ($_POST) {
			
			// 注册openid
			$data = array ();
			$data ['openid'] = "extendpopularizegeneralize";
			$data ['bid'] = "1";
			$uid = $this->weixin_model->openid_insert ( $data );
			
			// 注册user
			$db = array ();
			$db ['name'] = "测试关注";
			$db ['img'] = "123";
			$db ['uid'] = $uid;
			$db ['reg_money'] = 2;
			$db ['date_time'] = time ();
			$result = $this->weixin_model->user_insert ( $db );
			
			// 注册签到信息推广信息
			$dbs ['uid'] = $uid;
			$this->weixin_model->sign_insert ( $dbs );
			
			$this->weixin_model->adv_insert ( $dbs );
			
			if ($result) {
				echo $result;
			} else {
				echo "关注失败";
			}
		} else {
			echo "thinkK,plese to psost";
		}
	}
	// 统计uid = 1 的三级分销注册人数
	private function sel_reg_num($uid = 1, $return = false) {
		$channels = $this->weixin_model->select_all_openid ();
		
		$html = array ();
		$this->getChild ( $html, $uid, $channels, 0 );
		if (! $return) {
			return count ( $html );
		} else {
			if ($html) {
				foreach ( $html as $v ) {
					$htmls [] = $this->weixin_model->get_user ( $v ['id'] );
				}
				return $htmls;
			} else {
				return false;
			}
		}
	}
	function getChild(&$html, $parid, $channels, $dep) {
		/*
		 * 查詢數據,查詢三級用戶
		 */
		$t = $dep + 1;
		if ($t < 4) {
			for($i = 0; $i < count ( $channels ); $i ++) {
				if ($channels [$i] [&#39;upid&#39;] == $parid) {
					$html [] = array (
							&#39;id&#39; => $channels [$i] [&#39;id&#39;],
							&#39;upid&#39; => $channels [$i] [&#39;upid&#39;] 
					);
					$this->getChild ( $html, $channels [$i] [&#39;id&#39;], $channels, $t );
				}
			}
		}
	}
	public function er() {
		// $uid = 1;
		// $er = $this->mywechat->getQRCode($uid);
		// print_r($er);
		// $image_url = $this->mywechat->getQRUrl($er[&#39;ticket&#39;]);
		// echo $image_url;
		$this->is_image_article = TRUE;
		$img_name = FCPATH . "208695070736256338.jpg";
		
		$imagepath1 = FCPATH . "showqrcode"; // 水印图片地址
		$img_info = $this->getImageInfos ( $imagepath1 );
		
		$this->_img_resize ( $imagepath1 );
		$this->_img_water ( $img_name );
	}
	function getImageInfos($image) {
		$imageInfo = getimagesize ( $image );
		switch ($imageInfo [&#39;2&#39;]) {
			case 1 :
				$imtype = "gif";
				break;
			case 2 :
				$imtype = "jpeg";
				break;
			case 3 :
				$imtype = "png";
				break;
		}
		$img_size = ceil ( filesize ( $image ) / 1000 );
		$new_img_info = array (
				"width" => $imageInfo [&#39;0&#39;],
				"height" => $imageInfo [&#39;1&#39;],
				"type" => $imtype,
				"size" => $img_size 
		);
		return $new_img_info;
	}
	private function _img_resize($newpath, $imgtype = &#39;jpeg&#39;, $width = 430, $height = 430, $resize = "235", $creatimg = false) {
		$this->load->library ( &#39;image&#39; );
		$imageckqq = $this->image->testckqq ( $newpath );
		
		$this->load->library ( &#39;image/draw/resize&#39; );
		$imageckqq->attach ( $this->resize->resizeckqq ( $width, $height, $resize ) );
		if (! $creatimg) {
			switch ($imgtype) {
				case &#39;png&#39; :
					$imageckqq->imagePng ( $newpath );
					break;
				case &#39;jpeg&#39; :
					$imageckqq->imageJpegs ( $newpath );
				default :
					false;
			}
		} else {
			switch ($imgtype) {
				case &#39;png&#39; :
					$imageckqq->imagePng ( $newpath );
					break;
				case &#39;jpeg&#39; :
					$imageckqq->imageJpegs ( $newpath );
				default :
					false;
			}
		}
	}
	private function _img_water($newpath_img_name, $imgtype = &#39;jpeg&#39;) {
		$this->load->library ( &#39;image&#39; );
		$imageckqq = $this->image->testckqq ( $newpath_img_name );
		
		$this->load->library ( &#39;image/draw/watermark&#39; );
		$imagepath1 = FCPATH . "showqrcode"; // 水印图片地址
		$head_image = $this->image->testckqq ( $imagepath1 );
		$watermarkhead = $this->watermark->watermarkckqq ( $head_image );
		
		// logo图标位置 tl:上左 tm:上中 tr:上右 中左: ml mm lr 下边 bl bm br
		$watermarkhead->setPosition ( "user" );
		$imageckqq->attach ( $watermarkhead );
		
		switch ($imgtype) {
			case &#39;png&#39; :
				$imageckqq->imagePng ( $newpath_img_name );
				break;
			case &#39;jpeg&#39; :
				$imageckqq->imageJpegs ( $newpath_img_name );
			default :
				false;
		}
	}
}
?>

                                   

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

맨티스BT

맨티스BT

Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

DVWA

DVWA

DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는