Skip to content

Commit 8dfbaaf

Browse files
author
unknown
committed
Merge branch 'master' of 115.29.37.1:opencobub
Conflicts: web/application/models/redis_service/clientdata.php
2 parents 514126e + 59acc8e commit 8dfbaaf

File tree

83 files changed

+3159
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3159
-663
lines changed

web/application/config/database.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@
1212
| EXPLANATION OF VARIABLES
1313
| -------------------------------------------------------------------
1414
|
15-
| ['hostname'] The hostname of your database server.
16-
| ['username'] The username used to connect to the database
17-
| ['password'] The password used to connect to the database
18-
| ['database'] The name of the database you want to connect to
19-
| ['dbdriver'] The database type. ie: mysql. Currently supported:
20-
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21-
| ['dbprefix'] You can add an optional prefix, which will be added
22-
| to the table name when using the Active Record class
23-
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24-
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25-
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
26-
| ['cachedir'] The path to the folder where cache files should be stored
27-
| ['char_set'] The character set used in communicating with the database
28-
| ['dbcollat'] The character collation used in communicating with the database
29-
| NOTE: For MySQL and MySQLi databases, this setting is only used
30-
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
31-
| (and in table creation queries made with DB Forge).
32-
| There is an incompatibility in PHP with mysql_real_escape_string() which
33-
| can make your site vulnerable to SQL injection if you are using a
34-
| multi-byte character set and are running versions lower than these.
35-
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
36-
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
37-
| ['autoinit'] Whether or not to automatically initialize the database.
38-
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
39-
| - good for ensuring strict SQL while developing
15+
| ['hostname'] The hostname of your database server.
16+
| ['username'] The username used to connect to the database
17+
| ['password'] The password used to connect to the database
18+
| ['database'] The name of the database you want to connect to
19+
| ['dbdriver'] The database type. ie: mysql. Currently supported:
20+
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
21+
| ['dbprefix'] You can add an optional prefix, which will be added
22+
| to the table name when using the Active Record class
23+
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
24+
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
25+
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
26+
| ['cachedir'] The path to the folder where cache files should be stored
27+
| ['char_set'] The character set used in communicating with the database
28+
| ['dbcollat'] The character collation used in communicating with the database
29+
| NOTE: For MySQL and MySQLi databases, this setting is only used
30+
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
31+
| (and in table creation queries made with DB Forge).
32+
| There is an incompatibility in PHP with mysql_real_escape_string() which
33+
| can make your site vulnerable to SQL injection if you are using a
34+
| multi-byte character set and are running versions lower than these.
35+
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
36+
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
37+
| ['autoinit'] Whether or not to automatically initialize the database.
38+
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
39+
| - good for ensuring strict SQL while developing
4040
|
4141
| The $active_group variable lets you choose which connection group to
4242
| make active. By default there is only one group (the 'default' group).

web/application/controllers/report/eventlist.php

Lines changed: 79 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,22 @@ function getEventListData($version = '')
8888
* @param int $event_sk event_sk
8989
* @param int $version version
9090
* @param string $event_name event name
91+
* @param string $event_identifier event_identifier
9192
*
9293
* @return void
9394
*/
94-
function getEventDeatil($event_sk, $version, $event_name)
95-
{
96-
$this->common->loadHeaderWithDateControl();
97-
$productId = $this->common->getCurrentProduct();
98-
$productId = $productId->id;
99-
$this->data['event_sk'] = $event_sk;
100-
$this->data['event_version'] = $version;
101-
$this->data['event_name'] = $event_name;
102-
$fromTime = $this->common->getFromTime();
103-
$toTime = $this->common->getToTime();
104-
$this->data['reportTitle'] = array('timePase' => getTimePhaseStr($fromTime, $toTime),'eventMsgNum' => lang("v_rpt_el_eventNum"),'eventMsgNumActive' => lang("v_rpt_el_eventNumA"),'eventMsgNumSession' => lang("v_rpt_el_eventNumS"));
105-
$this->load->view('events/eventchartdetailview', $this->data);
95+
function getEventDeatil($event_sk, $version, $event_name,$event_identifier) {
96+
$this -> common -> loadHeaderWithDateControl();
97+
$productId = $this -> common -> getCurrentProduct();
98+
$productId = $productId -> id;
99+
$this -> data['event_sk'] = $event_sk;
100+
$this -> data['event_version'] = $version;
101+
$this -> data['event_name'] = urldecode($event_name);
102+
$this -> data['event_identifier'] = $event_identifier;
103+
$fromTime = $this -> common -> getFromTime();
104+
$toTime = $this -> common -> getToTime();
105+
$this -> data['reportTitle'] = array('timePase' => getTimePhaseStr($fromTime, $toTime), 'eventMsgNum' => lang("v_rpt_el_eventNum"), 'eventMsgNumActive' => lang("v_rpt_el_eventNumA"), 'eventMsgNumSession' => lang("v_rpt_el_eventNumS"));
106+
$this -> load -> view('events/eventchartdetailview', $this -> data);
106107
}
107108

108109
/**
@@ -142,5 +143,71 @@ function getChartDataAll($event_sk, $version)
142143
$result['trend'] = $trendresult;
143144
echo json_encode($result);
144145
}
146+
147+
/*
148+
* Export resolution data to excel
149+
*/
150+
function exportEvent($version = 'all',$eventname='') {
151+
152+
$this -> load -> library('export');
153+
154+
$productId = $this -> common -> getCurrentProduct();
155+
$productId = $productId -> id;
156+
$productName = $this -> common -> getCurrentProduct() -> name;
157+
$fromTime = $this -> common -> getFromTime();
158+
$toTime = $this -> common -> getToTime();
159+
$eventname = urldecode($eventname);
160+
if($eventname==''){
161+
$data = $this->event->getEventListInfo($productId, $version, $fromTime, $toTime);
162+
}
163+
else{
164+
$data = $this -> event -> getSearchEventInfo($productId, $version, $eventname,$fromTime,$toTime);
165+
}
166+
167+
if($data != null && count($data) > 0 )
168+
{
169+
$export = new Export();
170+
////set file name
171+
$titlename = getExportReportTitle($productName, lang('m_rpt_eventlist'), $fromTime, $toTime);
172+
$title = iconv("UTF-8", "GBK", $titlename);
173+
$export -> setFileName($title);
174+
////set title name
175+
$excel_title = array (iconv("UTF-8", "GBK", lang("v_rpt_el_eventID")),
176+
iconv("UTF-8", "GBK", lang("v_rpt_el_eventName")),
177+
iconv("UTF-8", "GBK", lang("v_rpt_el_messages")) );
178+
$export->setTitle ($excel_title );
179+
////set content
180+
181+
foreach ($data as $row){
182+
$rowadd['eventidentifier'] = $row['eventidentifier'];
183+
$rowadd['eventname'] = $row['eventname'];
184+
$rowadd['count'] = $row['count'];
185+
$export->addRow ( $rowadd );
186+
}
187+
$export -> export();
188+
die();
189+
}
190+
else{
191+
$this->load->view("usage/nodataview");
192+
}
193+
}
194+
195+
/*
196+
* search event by ID or Name
197+
*/
198+
function getSearchEventData($version = '',$eventname='') {
199+
$productId = $this -> common -> getCurrentProduct();
200+
$productId = $productId -> id;
201+
$fromTime = $this -> common -> getFromTime();
202+
$toTime = $this -> common -> getToTime();
203+
$eventname = urldecode($eventname);
204+
if($eventname==''){
205+
$result['event'] = $this->event->getEventListInfo($productId, $version, $fromTime, $toTime);
206+
}
207+
else{
208+
$result['event'] = $this -> event -> getSearchEventInfo($productId, $version, $eventname,$fromTime,$toTime);
209+
}
210+
echo json_encode($result);
211+
}
145212
}
146213

web/application/controllers/report/market.php

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,19 @@ function viewMarket()
7676
$data['count'] = $todayData->num_rows();
7777
$data['todayData'] = $todayData;
7878
$data['yestodayData'] = $yestodayData;
79+
$data['channel'] = $this->product->getChannelData($productId);
80+
7981
$this->common->loadHeaderWithDateControl();
8082
$this->load->view('overview/productmarket', $data);
8183
}
84+
85+
function getchanneldata() {
86+
$channel = $_POST['channel'];
87+
$fromTime = $this->common->getFromTime();
88+
$toTime = $this->common->getToTime();
89+
$marketdata = $this->product->getMarketDataBychannelid($channel,$fromTime, $toTime);
90+
echo json_encode($marketdata);
91+
}
8292

8393
/**
8494
* Addchannelmarketreport function
@@ -125,15 +135,15 @@ function getMarketData($type = '')
125135

126136
$ret = array();
127137
if ($markets != null && $markets->num_rows() > 0) {
128-
foreach ($markets->result() as $row) {
138+
// foreach ($markets->result() as $row) {
129139
if ($type == "monthrate") {
130140
$data = $this->product->getActiveNumbers($productId, $fromTime, $toTime, 1);
131141
} else if ($type == "weekrate") {
132142
$data = $this->product->getActiveNumbers($productId, $fromTime, $toTime, 0);
133143
} else {
134-
$data = $this->product->getAllMarketData($row->channel_id, $fromTime, $toTime);
144+
$data = $this->product->getAllMarketData(0, $fromTime, $toTime);
135145
}
136-
}
146+
// }
137147
if ($type == "monthrate" || $type == "weekrate") {
138148
if ($data == null || count($data) == 0) {
139149
$content_arr['VersionIsNullActiveRate'] = array();
@@ -171,6 +181,68 @@ function getMarketData($type = '')
171181
// end load markevents
172182
echo json_encode($result);
173183
}
184+
185+
/*
186+
* Export page data to excel
187+
*/
188+
function exportPage($channel) {
189+
190+
$channel = urldecode($channel);
191+
$this -> load -> library('export');
192+
193+
$productId = $this -> common -> getCurrentProduct();
194+
$productId = $productId -> id;
195+
$productName = $this -> common -> getCurrentProduct() -> name;
196+
$fromTime = $this -> common -> getFromTime();
197+
$toTime = $this -> common -> getToTime();
198+
$productName=str_replace(" ", "_", $productName);
199+
200+
$alldata = $this->product->getMarketDataBychannelid($channel,$fromTime, $toTime);
201+
$data = $alldata['content'];
202+
if($data != null && count($data) > 0 )
203+
{
204+
$export = new Export();
205+
////set file name
206+
$titlename = getExportReportTitle($productName, lang('v_rpt_mk_channelList'), $fromTime, $toTime);
207+
$title = iconv("UTF-8", "GBK", $titlename);
208+
$export -> setFileName($title);
209+
////set title name
210+
$excel_title = array (
211+
iconv("UTF-8", "GBK", lang("v_man_au_channelName")),
212+
iconv("UTF-8", "GBK", lang("g_date")),
213+
iconv("UTF-8", "GBK", lang("t_newUsers")),
214+
iconv("UTF-8", "GBK", lang("t_activeUsers")),
215+
iconv("UTF-8", "GBK", lang("t_sessions")),
216+
iconv("UTF-8", "GBK", lang("t_averageUsageDuration")),
217+
iconv("UTF-8", "GBK", lang("t_accumulatedUsers"))
218+
);
219+
$export->setTitle ($excel_title );
220+
////set content
221+
222+
foreach ($data as $row){
223+
$rowadd['channel_name'] = $row['channel_name'];
224+
$rowadd['datevalue'] = $row['datevalue'];
225+
$rowadd['newusers'] = $row['newusers'];
226+
$rowadd['startusers'] = $row['startusers'];
227+
$rowadd['sessions'] = $row['sessions'];
228+
if($row['sessions']){
229+
$rowadd['usingtime'] = round(floatval($row['usingtime']*1.0/$row['sessions']),2).lang('g_s');
230+
}
231+
else {
232+
$rowadd['usingtime'] = 0;
233+
}
234+
$rowadd['allusers'] = $row['allusers'];
235+
$export->addRow ( $rowadd );
236+
}
237+
$export -> export();
238+
die();
239+
}
240+
else{
241+
$this->load->view("usage/nodataview");
242+
}
243+
}
244+
245+
174246
}
175247

176248
?>

web/application/controllers/report/pagevisit.php

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,80 @@ function getTopLevelData($query)
231231
*
232232
* @return encode json
233233
*/
234-
function getPageInfo($version = "all", $pageIndex = 0, $fromDate = '', $toDate = '')
234+
function getPageInfo($version = "all", $fromDate = '', $toDate = '')
235235
{
236236
$currentProduct = $this->common->getCurrentProduct();
237237
$fromTime = $this->common->getFromTime();
238238
$toTime = $this->common->getToTime();
239239
$rowArray = $this->page->getVersionBasicData($fromTime, $toTime, $currentProduct->id);
240240
echo json_encode($rowArray);
241241
}
242+
243+
/**
244+
* SearchPageInfo fucntion
245+
*
246+
* @param string $version version
247+
* @param int $pageIndex page index
248+
* @param string $fromDate from date
249+
* @param string $toDate to date
250+
*
251+
* @return encode json
252+
*/
253+
function searchPageInfo()
254+
{
255+
$version = $_POST['version'];
256+
$weburl = $_POST['weburl'];
257+
258+
$currentProduct = $this->common->getCurrentProduct();
259+
$fromTime = $this->common->getFromTime();
260+
$toTime = $this->common->getToTime();
261+
$rowArray = $this->page->searchPageInfo($fromTime, $toTime, $currentProduct->id,$weburl);
262+
echo json_encode($rowArray);
263+
}
264+
265+
/*
266+
* Export page data to excel
267+
*/
268+
function exportPage($version,$name='') {
269+
$this -> load -> library('export');
270+
271+
$productId = $this -> common -> getCurrentProduct();
272+
$productId = $productId -> id;
273+
$productName = $this -> common -> getCurrentProduct() -> name;
274+
$fromTime = $this -> common -> getFromTime();
275+
$toTime = $this -> common -> getToTime();
276+
//$name = urldecode($name);
277+
278+
$data = $this->page->exportPageInfo($fromTime, $toTime,$productId,$version,$name);
279+
280+
if($data != null && count($data) > 0 )
281+
{
282+
$export = new Export();
283+
////set file name
284+
$titlename = getExportReportTitle($productName, lang('v_rpt_pv_page'), $fromTime, $toTime);
285+
$title = iconv("UTF-8", "GBK", $titlename);
286+
$export -> setFileName($title);
287+
////set title name
288+
$excel_title = array (iconv("UTF-8", "GBK", lang("v_rpt_pv_page")),
289+
iconv("UTF-8", "GBK", lang("t_numberOfPageViews")),
290+
iconv("UTF-8", "GBK", lang("t_averageRetentionTime")."(".lang("g_s").")"),
291+
iconv("UTF-8", "GBK", lang("t_bounceRate"))
292+
);
293+
$export->setTitle ($excel_title );
294+
////set content
295+
296+
foreach ($data as $row){
297+
$rowadd['activity_name'] = $row['activity_name'];
298+
$rowadd['accesscount'] = $row['accesscount'];
299+
$rowadd['avertime'] = round(floatval($row['avertime']/1000),2);
300+
$rowadd['exitcount'] = $row['exitcount'];
301+
$export->addRow ( $rowadd );
302+
}
303+
$export -> export();
304+
die();
305+
}
306+
else{
307+
$this->load->view("usage/nodataview");
308+
}
309+
}
242310
}

0 commit comments

Comments
 (0)