Server : nginx/1.22.1
System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/www.jkmold.com/phpcms/modules/guestbook/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/phpcms/modules/guestbook/index.php
<?php

defined('IN_PHPCMS') or exit('No permission resources.');

class index {



	

	function __construct() {

		pc_base::load_app_func('global');

		$this->_userid = param::get_cookie('_userid');

		$this->_username = param::get_cookie('_username');

		$this->_groupid = param::get_cookie('_groupid');

		$siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid();

  		define("SITEID",$siteid);

	}

	

	public function init() {



		if($_SERVER['REQUEST_METHOD']=="POST"){

			$guestbook_db = pc_base::load_model(guestbook_model);



			 /*添加用户数据*/

			 $lang= 'zh-cn';$l=LL($lang);

			 $typeid=safe_replace($_POST['typeids']);

			 $name=safe_replace($_POST['name']);

		              // $sex=safe_replace($_POST['sex']);

			 $email=safe_replace($_POST['email']);

			 $tel=safe_replace($_POST['tel']);

			// $address=safe_replace($_POST['address']);

			 $content=safe_replace($_POST['content']);

//			 if($name==""){

//				echo  $this->tips($l['names_tips'],4000,2);die;

//			 }

//			 if($shouji==""){

//				echo  $this->tips($l['tels_tips'],4000,2);die;

//			 }

//			 if($email==""){

//				echo  $this->tips($l['emails_tips'],4000,2);die;

//			 }

//			 if($adderss==""){

//				echo  $this->tips($l['countrys_tips'],4000,2);die;

//			 }

//			 if($introduce==""){

//				echo  $this->tips($l['contents_tips'],4000,2);

//				die;

//			 }



 			$sql = array(

			'siteid'=>SITEID,

			'typeid'=>$typeid?$typeid:0,

			'name'=>$name,

			//'adderss'=>$address,

			'email'=>$email,

			'shouji'=>$tel,

			  // 'sex'=>$sex,

			'introduce'=>$content,

					//'lxqq'=>$title,

			'addtime'=>time()

			);



 			if($guestbook_db->insert($sql)){



				$email_cfg=file_get_contents('./caches/configs/email.php');

					$email_con=json_decode(str_replace('\\"','"',$email_cfg),1);

					$cfg['host']=$email_con['mail_server'];

					$cfg['port']=$email_con['mail_port'];

					$cfg['username']=$email_con['mail_user'];

					$cfg['password']=$email_con['mail_password'];

					$from= $email_con['mail_user'];

					$toemail=$email_con['mail_user'];



					$message=<<<yiran

					<style type="text/css">

						.yr_table tr td{

							border:1px solid #142134;



						}

					</style>

					<table style="width:100%" id="yr_table" border="1">

					<tr>

						<th>姓名</th>

						<th>电话</th>





						<th>内容</th>

					</tr>



						<tr>



							<td>{$name}</td>

							<td>{$email}</td>





							<td>{$content}</td>

						</tr>





					</table>





yiran;





					/*数据*/







					$status=yr_send_email($toemail, $name, $message, $from,$cfg);

					echo $this->tips('Submitted successfully');

			}else{

				echo  $this->tips('Submission Failed');

			}



		}else{

			if(isset($_GET['siteid'])) {

				$siteid = intval($_GET['siteid']);

			} else {

				$siteid = 1;

			}

			$siteid = $GLOBALS['siteid'] = max($siteid,1);

			//define('SITEID', $siteid);

			$_userid = $this->_userid;

			$_username = $this->_username;

			$_groupid = $this->_groupid;

			//SEO



			$sitelist  = getcache('sitelist','commons');

			$default_style = $sitelist[$siteid]['default_style'];

			$CATEGORYS = getcache('category_content_'.$siteid,'commons');

			$catid = intval($_GET['catid'])?intval($_GET['catid']):5;

			$page = $_GET['page'];

			$setting = getcache('guestbook', 'commons');

			$SEO = seo(SITEID, '', L('guestbook'), '', '');

			include template('guestbook', 'index');

		}

	}



      //手机表单提交;

    public function inita() {



        if($_SERVER['REQUEST_METHOD']=="POST"){

            $guestbook_db = pc_base::load_model(guestbook_model);



            /*添加用户数据*/

            $lang= 'zh-cn';$l=LL($lang);

            $typeid=safe_replace($_POST['typeids']);

            $namea=safe_replace($_POST['namea']);

            //$sex=safe_replace($_POST['item']);

            $emaila=safe_replace($_POST['emaila']);

            $tela=safe_replace($_POST['tela']);

            //$company=safe_replace($_POST['company']);

            $contenta=safe_replace($_POST['contenta']);

//			 if($name==""){

//				echo  $this->tips($l['names_tips'],4000,2);die;

//			 }

//			 if($shouji==""){

//				echo  $this->tips($l['tels_tips'],4000,2);die;

//			 }

//			 if($email==""){

//				echo  $this->tips($l['emails_tips'],4000,2);die;

//			 }

//			 if($adderss==""){

//				echo  $this->tips($l['countrys_tips'],4000,2);die;

//			 }

//			 if($introduce==""){

//				echo  $this->tips($l['contents_tips'],4000,2);

//				die;

//			 }



            $sql = array(

	  'siteid'=>SITEID,

	  'typeid'=>$typeid?$typeid:0,

	  'name'=>$namea,

	  //'adderss'=>$company,

	  'email'=>$emaila,

	  'shouji'=>$tela,

	  // 'sex'=>$sex,

	  'introduce'=>$contenta,

	  //'lxqq'=>$title,

	  'addtime'=>time()

            );



            if($guestbook_db->insert($sql)){



	  $email_cfg=file_get_contents('./caches/configs/email.php');

	  $email_con=json_decode(str_replace('\\"','"',$email_cfg),1);

	  $cfg['host']=$email_con['mail_server'];

	  $cfg['port']=$email_con['mail_port'];

	  $cfg['username']=$email_con['mail_user'];

	  $cfg['password']=$email_con['mail_password'];

	  $from= $email_con['mail_user'];

	  $toemail=$email_con['mail_user'];



	  $message=<<<yiran

					<style type="text/css">

						.yr_table tr td{

							border:1px solid #142134;



						}

					</style>

					<table style="width:100%" id="yr_table" border="1">

					<tr>

						<th>姓名</th>

						<th>电话</th>





						<th>内容</th>

					</tr>



						<tr>



							<td>{$namea}</td>

							<td>{$tela}</td>





							<td>{$contenta}</td>

						</tr>





					</table>





yiran;





	  /*数据*/







	  $status=yr_send_email($toemail, $name, $message, $from,$cfg);

	  echo $this->tips('成功');

            }else{

	  echo  $this->tips('失败');

            }



        }else{

            if(isset($_GET['siteid'])) {

	  $siteid = intval($_GET['siteid']);

            } else {

	  $siteid = 1;

            }

            $siteid = $GLOBALS['siteid'] = max($siteid,1);

            //define('SITEID', $siteid);

            $_userid = $this->_userid;

            $_username = $this->_username;

            $_groupid = $this->_groupid;

            //SEO



            $sitelist  = getcache('sitelist','commons');

            $default_style = $sitelist[$siteid]['default_style'];

            $CATEGORYS = getcache('category_content_'.$siteid,'commons');

            $catid = intval($_GET['catid'])?intval($_GET['catid']):5;

            $page = $_GET['page'];

            $setting = getcache('guestbook', 'commons');

            $SEO = seo(SITEID, '', L('guestbook'), '', '');

            include template('guestbook', 'index');

        }

    }



    //手机表单提交;

    public function initb() {



        if($_SERVER['REQUEST_METHOD']=="POST"){

            $guestbook_db = pc_base::load_model(guestbook_model);



            /*添加用户数据*/

            $lang= 'zh-cn';$l=LL($lang);

            $typeid=safe_replace($_POST['typeids']);

            $namea=safe_replace($_POST['namea']);

            //$sex=safe_replace($_POST['item']);

            //$email=safe_replace($_POST['email']);

            $tela=safe_replace($_POST['tela']);

            //$company=safe_replace($_POST['company']);

            $contenta=safe_replace($_POST['contenta']);

//			 if($name==""){

//				echo  $this->tips($l['names_tips'],4000,2);die;

//			 }

//			 if($shouji==""){

//				echo  $this->tips($l['tels_tips'],4000,2);die;

//			 }

//			 if($email==""){

//				echo  $this->tips($l['emails_tips'],4000,2);die;

//			 }

//			 if($adderss==""){

//				echo  $this->tips($l['countrys_tips'],4000,2);die;

//			 }

//			 if($introduce==""){

//				echo  $this->tips($l['contents_tips'],4000,2);

//				die;

//			 }



            $sql = array(

	  'siteid'=>SITEID,

	  'typeid'=>$typeid?$typeid:0,

	  'name'=>$namea,

	  //'adderss'=>$company,

	  //'email'=>$email,

	  'shouji'=>$tela,

	  // 'sex'=>$sex,

	  'introduce'=>$contenta,

	  //'lxqq'=>$title,

	  'addtime'=>time()

            );



            if($guestbook_db->insert($sql)){



	  $email_cfg=file_get_contents('./caches/configs/email.php');

	  $email_con=json_decode(str_replace('\\"','"',$email_cfg),1);

	  $cfg['host']=$email_con['mail_server'];

	  $cfg['port']=$email_con['mail_port'];

	  $cfg['username']=$email_con['mail_user'];

	  $cfg['password']=$email_con['mail_password'];

	  $from= $email_con['mail_user'];

	  $toemail=$email_con['mail_user'];



	  $message=<<<yiran

					<style type="text/css">

						.yr_table tr td{

							border:1px solid #142134;



						}

					</style>

					<table style="width:100%" id="yr_table" border="1">

					<tr>

						<th>姓名</th>

						<th>电话</th>





						<th>内容</th>

					</tr>



						<tr>



							<td>{$namea}</td>

							<td>{$tela}</td>





							<td>{$contenta}</td>

						</tr>





					</table>





yiran;





	  /*数据*/







	  $status=yr_send_email($toemail, $name, $message, $from,$cfg);

	  echo $this->tips('成功');

            }else{

	  echo  $this->tips('失败');

            }



        }else{

            if(isset($_GET['siteid'])) {

	  $siteid = intval($_GET['siteid']);

            } else {

	  $siteid = 1;

            }

            $siteid = $GLOBALS['siteid'] = max($siteid,1);

            //define('SITEID', $siteid);

            $_userid = $this->_userid;

            $_username = $this->_username;

            $_groupid = $this->_groupid;

            //SEO



            $sitelist  = getcache('sitelist','commons');

            $default_style = $sitelist[$siteid]['default_style'];

            $CATEGORYS = getcache('category_content_'.$siteid,'commons');

            $catid = intval($_GET['catid'])?intval($_GET['catid']):5;

            $page = $_GET['page'];

            $setting = getcache('guestbook', 'commons');

            $SEO = seo(SITEID, '', L('guestbook'), '', '');

            include template('guestbook', 'index');

        }

    }































































	function tips($title,$code=2000,$icon=1,$time=2000, $web=1, $datas=array()){

		$array['title']=$title;

		$array['code']=$code;

		$array['datas']=$datas;

		$array['time']=$time;

		$array['icon']=$icon;

	              $array['app_pc']=$web;



		

		return json_encode($array);

	}

	

	

	

	

	

	 /**

	 *	留言板列表页

	 */

	public function list_type() {

		$siteid = SITEID;

  		$type_id = trim(urldecode($_GET['type_id']));

		$type_id = intval($type_id);

  		if($type_id==""){

 			$type_id ='0';

 		}

   		$setting = getcache('guestbook', 'commons');

		$SEO = seo(SITEID, '', L('guestbook'), '', '');

  		include template('guestbook', 'list_type');

	} 

 	

	 /**

	 *	留言板留言 

	 */

	public function register() { 

 		$siteid = SITEID;

 		if(isset($_POST['dosubmit'])){

 			if($_POST['name']==""){

 				showmessage(L('usename_noempty'),"?m=guestbook&c=index&a=register&siteid=$siteid");

 			}

 			if($_POST['lxqq']==""){

 				showmessage(L('email_not_empty'),"?m=guestbook&c=index&a=register&siteid=$siteid");

 			}

 			if($_POST['email']==""){

 				showmessage(L('email_not_empty'),"?m=guestbook&c=index&a=register&siteid=$siteid");

 			}

			if($_POST['shouji']==""){

 				showmessage(L('shouji_not_empty'),"?m=guestbook&c=index&a=register&siteid=$siteid");

 			}

 			$guestbook_db = pc_base::load_model(guestbook_model);

 			 

			 /*添加用户数据*/

 			$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'name'=>$_POST['name'],'sex'=>$_POST['sex'],'lxqq'=>$_POST['lxqq'],'email'=>$_POST['email'],'shouji'=>$_POST['shouji'],'introduce'=>$_POST['introduce'],'addtime'=>time());

 			 

 			$guestbook_db->insert($sql);

 			showmessage(L('add_success'), "?m=guestbook&c=index&siteid=$siteid");

 		}else {

  			$setting = getcache('guestbook', 'commons');

 			if($setting[$siteid]['is_post']=='0'){

 				showmessage(L('suspend_application'), HTTP_REFERER);

 			}

 			$this->type = pc_base::load_model('type_model');

 			$types = $this->type->get_types($siteid);//获取站点下所有留言板分类

 			pc_base::load_sys_class('form', '', 0);

 			$setting = getcache('guestbook', 'commons');

 			$SEO = seo(SITEID, '', L('application_guestbook'), '', '');

   			include template('guestbook', 'register');

 		}

	} 

	

}

?>