From 713566ee74a448d4ffa0752d8fcdc4fae71380ec Mon Sep 17 00:00:00 2001 From: xiaowei <870653736@qq.com> Date: Mon, 23 Nov 2020 12:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iframe.php | 707 ++++++++++++++++++++++++++++++++++++ index.html | 67 ++++ index.php | 77 ++++ index/destroySession.php | 37 ++ index/getActivity.php | 66 ++++ index/getUserInfo.class.php | 267 ++++++++++++++ index/index.php | 15 + index/judgeIsLogin.php | 38 ++ index/logOut.php | 32 ++ index/saveActivity.php | 56 +++ index/synLogin.php | 8 + judgeSource.php | 73 ++++ login.php | 31 ++ modified.php | 62 ++++ 14 files changed, 1536 insertions(+) create mode 100644 iframe.php create mode 100644 index.html create mode 100644 index.php create mode 100644 index/destroySession.php create mode 100644 index/getActivity.php create mode 100644 index/getUserInfo.class.php create mode 100644 index/index.php create mode 100644 index/judgeIsLogin.php create mode 100644 index/logOut.php create mode 100644 index/saveActivity.php create mode 100644 index/synLogin.php create mode 100644 judgeSource.php create mode 100644 login.php create mode 100644 modified.php diff --git a/iframe.php b/iframe.php new file mode 100644 index 0000000..7701206 --- /dev/null +++ b/iframe.php @@ -0,0 +1,707 @@ + + + + + + + + +帆軟線上直播培訓開始報名啦! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+
+

FineReport

+

最強大的動態報表與BI商業智慧工具!

+
+ +
+ + +
+
+
+
+

帆軟線上直播課程開始報名啦!

+
+
+

在大多數情況下,我們並不需要報表把資料庫中所有的數據都呈現出來,而是要根據一些條件來過濾出我們想要的數據,這就是參數查詢!
+FineReport報表中就是使用參數來動態的過濾數據的,實現用戶和數據的實時交互。
+幾乎所有的統計報表都會有統計條件,傳統的做法是使用如ext、html等編程實現,工作量大且維護成本高。
+FineReport報表只需要通過參數的定義,參數控制項綁定數據、參數過濾和參數面板樣式四個步驟便可以輕鬆實現參數查詢,零程式碼,維護簡單!

+

參數在報表製作中如此重要,那麼要如何輕鬆快速掌握這一技能呢?參加這場免費線上直播課程就可以!
+帆軟線上直播課程報名開始

+

【課程名稱】FineReport 輕鬆學-專題:「善變的參數 」
+【課程費用】完全免費,報名參加
+【課程時間】2018/4/30 19:00-20:00
+【課程講師】帆軟講師 Sigurd
+【課程大綱】

+

PART 【Ⅰ】 1 HRS

+

● 認識參數種類、參數值類型、參數的表示方式

+

–全域參數
+ –自訂

+

–參數值的型態
+ –字串
+ –整型
+ –雙精度
+ –日期
+ –布林
+ –公式

+

–模板參數
+ –自訂(與全域參數名稱相同時,優先取模板參數值)

+

–系統參數
+ (公式中可取用)
+ –$$page_number
+ –$$totalPage_number
+ –$fr_authority
+ –$fr_username
+ –$fr_userposition
+ –NULL
+ –NOFILTER
+ –reportName
+ –formletName
+ –servletURL
+ –serverSchema
+ –serverName
+ –serverPort
+ –serverURL
+ –contextPath
+ –sessionID
+ –GETUSERDEPARTMENTS()
+ –GETUSERJOBTITLES()

+

(URL中可取用)
+ –op=write,op=page,op=view
+ –format=excel,format=pdf,format=word

+

–查詢參數(控制項)
+ –預設值指定(搭配參數值的型態)
+ –與全局、模板參數同名可繼承值

+

–資料庫連接參數

+

–資料集參數
+ –${paraA}指定參數
+ –${IF(LEN(paraA)>0,” And colA ='”+paraA+”‘”,””)}條件公式指定參數
+ –搭配查詢控制項聯動過濾
+ –檔案資料集參數

+

–圖表參數
+ –CATEGORY
+ –SERIES
+ –VALUE

+

快點擊下方免費報名參加吧!報名成功後會為您發送直播觀看網址!

+
+ +
+
+
+ +
+
+
    +
  • 聯繫我們

  • +
  • 電話:0933-790886
  • +
  • 邮箱:brian.wang@fanruan.com
  • +
  • 地址:300 新竹市學府路40號 (交大育成中心 R302)
  • +
  • 臉書粉絲團 +
  • + +
+
+
+
+ +
+
+
+
+ 帆軟logo +
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+

臉書粉絲團

+
+ 帆軟FineReport臉書官方賬號 +
+
+
+
+
Copyright©2017 Fanruan Software Co.,Ltd. All Rights Reserved. 帆軟軟體有限公司 | 蘇ICP備14031611號-8
+
+
+
+
+

返回頂部

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..52da1e0 --- /dev/null +++ b/index.html @@ -0,0 +1,67 @@ + + + + + 站点创建成功-phpstudy for windows + + + + + + + + + + + + + + + +
+
+

站点创建成功

+
+
目录说明:
+
1:网站目录:/phpstudy安装目录/www/站点域名/
+
2:错误提示页面:/phpstudy安装目录/www/站点域名/error/
+
3:你可以删除或者修改该目录下的所有文件
+
操作注意事项:
+
1:新建站点、数据库、FTP可在phpstudy面板操作,数据库可在环境中下载数据库管理软件等;
+
2:将网站程序放到站点目录时请使用复制,剪切可能造成程序文件权限不正确;
+ +
+
使用手册,视频教程,BUG反馈,官网地址: www.xp.cn
+ +
+
+ + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..17b9ed1 --- /dev/null +++ b/index.php @@ -0,0 +1,77 @@ +0) { + $compare_str = "http://demo.finereport.com/decision/url/login?fine_username=demo&fine_password=123456&validity=-1"; + if($compare_str == $_GET['referrer']) { + session_start(); + echo $_SESSION['uid'] . "=>" . $_SESSION['username']; + echo ""; + } else { + define("FINEREPORT", '100'); + require_once 'index/synLogin.php'; + sleep(0.01); + echo ""; + } +} + +if(!$_G['uid']){ + header("location:/login/login.php"); +} + +$title = '账号中心'; +$tpl->assign('cur',1); +$tpl->template_dir = 'account/tpl/'; + +//获取等级资料 +$get_level = CallInterface(API_URL.'/v1/user/index/?uid='.$_G['uid'],'GET'); +$arr_level = json_decode($get_level,true); + +$position = [1=>'其它',2=>'业务人员',3=>'技术人员',4=>'CIO或CTO等高层人员',6=>'学生',7=>'老师']; + +//实名认证状态 +$realnameauth = CallInterface(API_URL.'/v1/account/realnameauth/getauth/?uid='.$_G['uid'],'GET'); +$realnameauth = json_decode($realnameauth,true); +$tpl->assign('realnameauth',$realnameauth); +//学生认证状态 +$studentauth = CallInterface(API_URL.'/v1/account/studentauth/getauth/?uid='.$_G['uid'],'GET'); +$studentauth = json_decode($studentauth,true); +$tpl->assign('studentauth',$studentauth); +//组织认证状态 +$orgauth = CallInterface(API_URL.'/v1/account/organizationauth/getauth/?uid='.$_G['uid'],'GET'); +$orgauth = json_decode($orgauth,true); +$tpl->assign('orgauth',$orgauth); + +//成员认证状态 +$mem_header = ['authentication:'.base64_encode($ckuserinfo['appid'].'.'.$ckuser['access_token'].'.'.$ckuserinfo['uid'])]; +$memberauth = CallInterface(API_URL.'/v1/account/membermanage/ismember/','GET', '',$mem_header); +$memberauth = json_decode($memberauth,true); +$tpl->assign('memberauth',$memberauth); +//下拉选中 +$myposition = $_G['position'] ? $_G['position']:0; + +//同步登录 +if($_COOKIE["fr_id_onelogin"]){ + setcookie('fr_id_onelogin','',0,'/'); + echo id_synlogin(); +} + +//是否通过组织认证 +$zuzhi_api = CallInterface(API_URL.'/v1/account/organizationauth/getauth/?uid='.$_G['uid'],'GET'); +$zuzhi_arr = json_decode($zuzhi_api,true); +if($zuzhi_arr['message']=='success'){ + $is_zuzhi=1; +}else{ + $is_zuzhi=0; +} +$tpl->assign('is_zuzhi',$is_zuzhi); + +$tpl->assign('title',$title); +$tpl->assign('user',$arr_level['data']); +$tpl->assign('position',$position); +$tpl->assign('myposition',$myposition); + + +$tpl->display('user_info.htm'); \ No newline at end of file diff --git a/index/destroySession.php b/index/destroySession.php new file mode 100644 index 0000000..424e776 --- /dev/null +++ b/index/destroySession.php @@ -0,0 +1,37 @@ + + location.href = '../login/login.php'; + +str;*/ +$script = ""; + +echo $script; \ No newline at end of file diff --git a/index/getActivity.php b/index/getActivity.php new file mode 100644 index 0000000..b133ee8 --- /dev/null +++ b/index/getActivity.php @@ -0,0 +1,66 @@ +prepare($sql); +if( !$stmt ) { + exit('wrong'); +} +$stmt->bind_param('ssssi', $identical, $motivation, $company, $realname, $uid); +$stmt->execute(); +$stmt->store_result(); + +if( $stmt->affected_rows === 0) { + exit('wrong'); +} + + +//设置session为company变量 +$_SESSION['company'] = $company;$_SESSION['realname'] = $realname; + +exit('true'); \ No newline at end of file diff --git a/index/getUserInfo.class.php b/index/getUserInfo.class.php new file mode 100644 index 0000000..2ca2dc2 --- /dev/null +++ b/index/getUserInfo.class.php @@ -0,0 +1,267 @@ +conn = connect(); + /** + * 如果用户在当前站点登录,那么就会有username和password、uid的session;如果当前站点是响应其他的站点进行登录的话,那么就只会有synUid这个session。 + */ + if( isset($_SESSION['username']) ) { + $this->uid = $_SESSION['uid']; + $this->logType = 'current'; + }else if( isset($_SESSION['synUid']) && $_SESSION['synUid'] > 0) { + $this->uid = $_SESSION['synUid']; + $this->logType = 'syn'; + } + } + + public function main() { + //TODO:主函数,分别执行两个获取信息的函数 + $this->getInfoFromUcenterMembers(); + $this->getRestInfoFromProfileTable(); + $this->getUserState(); + + $this->setSession(); + return $this; + } + + public function setSession() { + $allInfo = $this->getInfo(); + foreach ($allInfo as $key=>$value){ + $_SESSION[$key] = $value; + } + } + + public function getInfo() { + //TODO:将从数据库中获取的数据返回给调用者 + return array( + "uid" => $this->uid, + "email"=> $this->email, + "username" => $this->username, + "realName" => $this->realName, + "regDate" => $this->regDate, + "qq" => $this->qq, + #公司以及职能 + "company" => $this->company, + "position" => $this->position, + "demand" => $this->demand, + "mobile" => $this->mobile, + "address" => $this->address, + "level" => $this->level, + "allowadmincp" => $this->allowadmincp, + "groupid" => $this->groupid, + + "frActivityCode" => $this->frActivityCode, + "fbiActivityCode" => $this->fbiActivityCode, + "frActivityTime" => $this->frActivityTime, + "fbiActivityTime" => $this->fbiActivityTime + ); + } + + public function __get($name){ + // TODO: Implement __get() method. + if( isset($this->$name)) { + return $this->$name; + }else{ + return "Invalid variable name"; + } + } + + public function getInfoFromUcenterMembers() { + //TODO:从pre_ucenter_members表中获取email、username、和注册时间的信息 + $sql = "select username, email, regdate from pre_ucenter_members where uid=?"; + //这里需要测试一下如果sql有问题会不会抛出错误 + $this->stmt = $this->conn->prepare($sql); + $this->judgeStmt($sql); + $this->stmt->bind_param('i', $this->uid); + $this->stmt->execute(); + $this->stmt->store_result(); + $this->stmt->bind_result($this->username, $this->email, $this->regDate); + $this->stmt->fetch(); + + $this->freeResult(); + + //将注册时间转换成字符串格式 +// $when = new DateTime(strval($this->regDate)); +// $when->setTimezone(new DateTimeZone('Asia/Shanghai')); +// $this->regDate = $when->format('Y/m/d'); + $this->regDate = date('Y-m-d', $this->regDate); + } + + /** + * 从pre_common_member_profile表中获取realname、qq、mobile、company、finereportActivityCode和finebiActivityCode、以及职位、对fineReport产品的需求的信息 + */ + public function getRestInfoFromProfileTable() { + $sql = "select realname, qq, company, address, mobile, finereport_code, finebi_code, `position`, field4, finereport_activation_time, finebi_activation_time from pre_common_member_profile where uid=?"; + $this->stmt = $this->conn->prepare($sql); + $this->judgeStmt($sql); + $this->stmt->bind_param('i', $this->uid); + $this->stmt->execute(); + $this->stmt->store_result(); + $this->stmt->bind_result($this->realName, $this->qq, $this->company, $this->address, $this->mobile, $this->frActivityCode, $this->fbiActivityCode, $this->position, $this->demand, $this->frActivityTime, $this->fbiActivityTime); + $this->stmt->fetch(); + $this->freeResult(); + + //将数据库中保存的unicode编码转换成中文 + if( strpos($this->company, '[') !== false ) { + $this->company = unicodeToChinese($this->company); + } + + if( strpos($this->realName, '[') !== false ) { + $this->realName = unicodeToChinese($this->realName); + } + + //将数据库中保存的unicode编码转换成中文 + if( strpos($this->demand, '[') !== false ) { + $this->demand = unicodeToChinese($this->demand); + } + } + + /** + * 获取数据库中的公司、职位以及对fineReport产品的需求的信息 + */ + public function getCompany() { + //TODO:获取pre_common_member_profile表中的company字段数据 + $sql = "select company, `position`, field4, realName from pre_common_member_profile where uid=?"; + //这里需要测试一下如果sql有问题会不会抛出错误 + $this->stmt = $this->conn->prepare($sql); + $this->judgeStmt($sql); + $this->stmt->bind_param('i', $this->uid); + $this->stmt->execute(); + $this->stmt->store_result(); + $this->stmt->bind_result($this->company, $this->position, $this->demand, $this->realName); + $this->stmt->fetch(); + + $this->freeResult(); + + //将数据库中保存的unicode编码转换成中文 + if( strpos($this->company, '[') !== false ) { + $this->company = unicodeToChinese($this->company); + } if( strpos($this->realName, '[') !== false ) { $this->realName = unicodeToChinese($this->realName); } + //将数据库中保存的unicode编码转换成中文 + if( strpos($this->demand, '[') !== false ) { + $this->demand = unicodeToChinese($this->demand); + } + } + + public function checkProduceActivationCode() { + //TODO:获取pre_common_member_profile表中的finereport_code, finebi_code字段数据 + $sql = "select finereport_code, finebi_code from pre_common_member_profile where uid=?"; + //这里需要测试一下如果sql有问题会不会抛出错误 + $this->stmt = $this->conn->prepare($sql); + $this->judgeStmt($sql); + $this->stmt->bind_param('i', $this->uid); + $this->stmt->execute(); + $this->stmt->store_result(); + $this->stmt->bind_result($this->frActivityCode, $this->fbiActivityCode); + $this->stmt->fetch(); + + $this->freeResult(); + } + + public function getUserState() { + //TODO:获取pre_common_member表中的用户组、权限信息 + $sql = "select pcm.groupid,allowadmincp,grouptitle from pre_common_member as pcm join pre_common_usergroup as pcu on pcm.groupid = pcu.groupid where uid=?"; + //这里需要测试一下如果sql有问题会不会抛出错误 + $this->stmt = $this->conn->prepare($sql); + $this->judgeStmt($sql); + $this->stmt->bind_param('i', $this->uid); + $this->stmt->execute(); + $this->stmt->store_result(); + $this->stmt->bind_result($this->groupid, $this->allowadmincp, $this->level); + $this->stmt->fetch(); + + $this->freeResult(); + } + + protected function judgeStmt($sql) { + /* + * 判断当前的预处理语句执行之后是否正确 + */ + if( !$this->stmt ) { + throw new Exception('预处理语句有错,请检查——'.$sql); + }else{ + return true; + } + } + + protected function freeResult() { + $this->stmt->free_result(); + } + + public function __destruct(){ + // TODO: Implement __destruct() method. + $this->freeResult(); + $this->conn->close(); + } +} + +//计算两个日期之差,服务器的PHP不支持这个 +function diffTime1($timeStempOne, $timeStempTwo) { +// $first = new DateTime('@'.strval($timeStempOne), new DateTimeZone('Asia/Shanghai')); +// $second = new DateTime('@'.strval($timeStempTwo), new DateTimeZone('Asia/Shanghai')); +// +// $diff = $second->diff($first); +// +// $str = "还有{$diff->format('%a')}天过期"; +// return $str; +} + +function diffTime($timeOne, $timeTwo) { + //需要$timeOne 大于$timeTwo + if( $timeOne < $timeTwo ) { + list( $timeOne, $timeTwo ) = array($timeTwo, $timeOne); + } + $day = intval(($timeOne-$timeTwo) / (3600 * 24)); + + $str = "还有{$day}天过期"; + return $str; +} \ No newline at end of file diff --git a/index/index.php b/index/index.php new file mode 100644 index 0000000..c9c5f7b --- /dev/null +++ b/index/index.php @@ -0,0 +1,15 @@ + + window.location.href = 'http://id.fanruan.com'; + +str; + +echo $str; diff --git a/index/judgeIsLogin.php b/index/judgeIsLogin.php new file mode 100644 index 0000000..eff26bf --- /dev/null +++ b/index/judgeIsLogin.php @@ -0,0 +1,38 @@ +window.location.href='login/login.php';"; + } + + //验证token时效 + // if(time() > $ckuser['expires_time']){ + // //echo '已超时!'; + // id_refresh_token(); + // } + +// //如果其他应用通知了该应用要下线,那么直接跳转到注销的页面 +// if( isset($_SESSION['synLogOut']) && $_SESSION['synLogOut'] === 'yes') { +// echo ""; +// } + +// //其他应用通知当前站点登录 +// if( isset($_SESSION['synUid']) && $_SESSION['synUid']>0 ) { +// $_SESSION['uid'] = $_SESSION['synUid']; +// //设置count的session主要是为了兼容下面的if语句,因为如果用户在当前站点主动登录的话,就会有count这个session +// $_SESSION['count'] = 4; +// } + +// //这是用户直接跳转到index.php页面的情况,重定向到login.php页面让其登录 +// if( !isset($_SESSION['count']) ) { +// echo ""; +// } + +// //处理有count却没uid和username +// if( isset($_SESSION['count']) && ( !isset($_SESSION['uid']) && !isset($_SESSION['username']) && !isset($_SESSION['synUid']) ) ) { +// echo ""; +// } + +// //当用户是注册之后进入首页的,会有一个$_SESSION['clickTimes']的变量,这是用来防范用户在短时间内提交两次注册信息的,在这里将其释放掉 +// if( isset($_SESSION['clickTimes']) ) { +// unset($_SESSION['clickTimes']); +// } \ No newline at end of file diff --git a/index/logOut.php b/index/logOut.php new file mode 100644 index 0000000..6b60ded --- /dev/null +++ b/index/logOut.php @@ -0,0 +1,32 @@ + + function getPar(par){ + var local_url = document.location.href; + var get = local_url.indexOf(par +"="); + if(get == -1){ + return false; + } + var get_par = local_url.slice(par.length + get + 1); + var nextPar = get_par.indexOf("&"); + if(nextPar != -1){ + get_par = get_par.slice(0, nextPar); + } + return get_par; + } + if(getPar('referrer').length>0){ + location.href = decodeURIComponent(getPar('referrer')); + } else { + location.href = '../login/login.php'; + } + +str; + +echo $script; \ No newline at end of file diff --git a/index/saveActivity.php b/index/saveActivity.php new file mode 100644 index 0000000..0cb40f0 --- /dev/null +++ b/index/saveActivity.php @@ -0,0 +1,56 @@ +prepare($sql); + +if( !$stmt ) { + exit('false'); +} + +$stmt->bind_param('sii', $key, $time, $uid); +$stmt->execute(); +if( $stmt->affected_rows !== 1){ + exit('Can not insert into the database'); +} +//发送邮件 + +require_once '../myFunc/clueReceipt.php'; +if( isset($_SESSION['email']) && strlen($_SESSION['email'])>0 ) { + $nameforsend = isset($_SESSION['realname'])? $_SESSION['realname']: '尊敬的用户'; + if($type == 'fineReport') { + $reqresult = send_mail($_SESSION['email'], 'zlwd',$subject='【帆软】这是关于FineReport的更多资料', ARRAY("%key%" => ARRAY($nameforsend))); + } +} + +echo 'true'; + +$stmt->free_result(); +$conn->close(); \ No newline at end of file diff --git a/index/synLogin.php b/index/synLogin.php new file mode 100644 index 0000000..0bfd0e2 --- /dev/null +++ b/index/synLogin.php @@ -0,0 +1,8 @@ + $root . '/tpl/config/', +// 'template_dir' => $root . '/tpl/' +//)); +// +////渲染登录页面 +//display("page/login.php"); \ No newline at end of file diff --git a/modified.php b/modified.php new file mode 100644 index 0000000..265ade1 --- /dev/null +++ b/modified.php @@ -0,0 +1,62 @@ + $root . '/tpl/config/', + + 'template_dir' => $root . '/tpl/' + +)); + + + +#渲染页面 + +display("page/modifies/index.php", array()); \ No newline at end of file