Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
useranalytics
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reynaldi adriantama
useranalytics
Commits
99349321
Commit
99349321
authored
Oct 02, 2020
by
reynaldi adriantama
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit vendor dan public
parent
841aa202
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
123 additions
and
109 deletions
+123
-109
public/action-js/index-js/behavior-users.js
public/action-js/index-js/behavior-users.js
+5
-5
public/action-js/index-js/confdb-action.js
public/action-js/index-js/confdb-action.js
+5
-59
public/action-js/index-js/login-user-action.js
public/action-js/index-js/login-user-action.js
+10
-1
public/action-js/index-js/register-user-action.js
public/action-js/index-js/register-user-action.js
+60
-37
public/template/js/demo/chart-area-demo.js
public/template/js/demo/chart-area-demo.js
+2
-3
public/template/js/demo/chart-bar-demo.js
public/template/js/demo/chart-bar-demo.js
+7
-2
public/template/js/demo/chart-bar2-demo.js
public/template/js/demo/chart-bar2-demo.js
+8
-0
public/template/js/demo/chart-pie-demo.js
public/template/js/demo/chart-pie-demo.js
+1
-1
public/template/js/demo/chart-pie2-demo.js
public/template/js/demo/chart-pie2-demo.js
+15
-0
public/template/js/demo/chart-pie3-demo.js
public/template/js/demo/chart-pie3-demo.js
+8
-0
public/template/js/demo/table-user-browser.js
public/template/js/demo/table-user-browser.js
+2
-1
No files found.
public/action-js/index-js/behavior-users.js
View file @
99349321
...
@@ -59,7 +59,7 @@ var logBehaviorUser = (function(){
...
@@ -59,7 +59,7 @@ var logBehaviorUser = (function(){
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
url
:
"
http://useranalytic
giw
.giw/api/loadmacaddress
"
,
url
:
"
http://useranalytic
s
.giw/api/loadmacaddress
"
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
results
.
user_info
.
mac_address
=
result
.
data
;
results
.
user_info
.
mac_address
=
result
.
data
;
// console.log(result);
// console.log(result);
...
@@ -78,7 +78,7 @@ var logBehaviorUser = (function(){
...
@@ -78,7 +78,7 @@ var logBehaviorUser = (function(){
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
data
:
{
'
myData
'
:
$token
},
data
:
{
'
myData
'
:
$token
},
url
:
"
http://useranalytic
giw
.giw/api/loadtoken
"
,
url
:
"
http://useranalytic
s
.giw/api/loadtoken
"
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
results
.
nameweb
=
result
.
data
;
results
.
nameweb
=
result
.
data
;
...
@@ -93,7 +93,7 @@ var logBehaviorUser = (function(){
...
@@ -93,7 +93,7 @@ var logBehaviorUser = (function(){
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
url
:
"
http://useranalytic
giw
.giw/api/loadipaddress
"
,
url
:
"
http://useranalytic
s
.giw/api/loadipaddress
"
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
results
.
user_info
.
ip_address_public
=
result
.
data
;
results
.
user_info
.
ip_address_public
=
result
.
data
;
// console.log(result);
// console.log(result);
...
@@ -187,7 +187,7 @@ var logBehaviorUser = (function(){
...
@@ -187,7 +187,7 @@ var logBehaviorUser = (function(){
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
'
http://useranalytic
giw
.giw/api/keyval
'
,
url
:
'
http://useranalytic
s
.giw/api/keyval
'
,
data
:
{
'
myData
'
:
settings
.
actionItem
.
token
},
data
:
{
'
myData
'
:
settings
.
actionItem
.
token
},
async
:
false
,
async
:
false
,
// ContentType: application/javascript,
// ContentType: application/javascript,
...
@@ -315,7 +315,7 @@ var logBehaviorUser = (function(){
...
@@ -315,7 +315,7 @@ var logBehaviorUser = (function(){
if
(
settings
.
hasOwnProperty
(
'
processData
'
)){
if
(
settings
.
hasOwnProperty
(
'
processData
'
)){
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
'
http://useranalytic
giw
.giw/api/savetojson
'
,
url
:
'
http://useranalytic
s
.giw/api/savetojson
'
,
data
:
{
'
myData
'
:
results
},
data
:
{
'
myData
'
:
results
},
async
:
false
,
async
:
false
,
// ContentType: application/javascript,
// ContentType: application/javascript,
...
...
public/action-js/index-js/confdb-action.js
View file @
99349321
//
window.setInterval(function(){
window
.
setInterval
(
function
(){
//
savetodb(validasiToken);
savetodb
(
validasiToken
);
getdatavisitor
(
validasiToken
);
getdatavisitor
(
validasiToken
);
// },60000);
},
600000
);
// savetodb(validasiToken);
getdatavisitor
(
validasiToken
);
getdatavisitor
(
validasiToken
);
savetodb
(
validasiToken
);
function
savetodb
(
tokeni
){
function
savetodb
(
tokeni
){
$
.
ajax
({
$
.
ajax
({
...
@@ -20,8 +18,6 @@ function savetodb(tokeni){
...
@@ -20,8 +18,6 @@ function savetodb(tokeni){
})
})
}
}
function
getdatavisitor
(
tokeni
){
function
getdatavisitor
(
tokeni
){
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
...
@@ -32,11 +28,8 @@ function getdatavisitor(tokeni){
...
@@ -32,11 +28,8 @@ function getdatavisitor(tokeni){
},
},
success
:
function
(
result
){
success
:
function
(
result
){
// console.log(result);
let
data
=
result
.
data
;
let
data
=
result
.
data
;
console
.
log
(
data
);
// console.log(data);
$
(
"
#totalvisitor
"
).
html
(
data
[
'
total_visit
'
]);
$
(
"
#totalvisitor
"
).
html
(
data
[
'
total_visit
'
]);
$
(
"
#newvisitor
"
).
html
(
data
[
'
new_visitor
'
]);
$
(
"
#newvisitor
"
).
html
(
data
[
'
new_visitor
'
]);
$
(
"
#numbercities
"
).
html
(
data
[
'
total_cities
'
]);
$
(
"
#numbercities
"
).
html
(
data
[
'
total_cities
'
]);
...
@@ -46,50 +39,3 @@ function getdatavisitor(tokeni){
...
@@ -46,50 +39,3 @@ function getdatavisitor(tokeni){
}
}
// $.ajax({
// type : 'POST',
// dataType : 'JSON',
// url : baseURL + "/api/loadvisitormonth",
// async : false,
// data : {
// year : selectedyear,
// token : validasiToken
// },
// success:function(result){
// let data = result.data;
// var month = [];
// for(x in data){
// month[x] = data[x]['month']
// if(month[x]==1){
// month[x]='Januari';
// }else if(month[x]==2){
// month[x]='Februari';
// }else if(month[x]==3){
// month[x]='Maret';
// }else if(month[x]==4){
// month[x]='April';
// }else if(month[x]==5){
// month[x]='Mei';
// }else if(month[x]==6){
// month[x]='Juni';
// }else if(month[x]==7){
// month[x]='Juli';
// }else if(month[x]==8){
// month[x]='Agustus';
// }else if(month[x]==9){
// month[x]='September';
// }else if(month[x]==10){
// month[x]='Oktober';
// }else if(month[x]==11){
// month[x]='November';
// }else if(month[x]==12){
// month[x]='Desember';
// }
// optionmonth = '';
// optionmonth += `<option val='`+month[x]+`'>`+month[x]+`</option>`;
// $('#selectmonth').html(optionmonth);
// }
// }
// });
public/action-js/index-js/login-user-action.js
View file @
99349321
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
document
.
title
=
"
Login
"
;
document
.
title
=
"
Login
"
;
});
});
function
changetype
()
{
var
x
=
document
.
getElementById
(
"
passwd
"
);
if
(
x
.
type
===
"
password
"
)
{
x
.
type
=
"
text
"
;
}
else
{
x
.
type
=
"
password
"
;
}
}
\ No newline at end of file
public/action-js/index-js/register-user-action.js
View file @
99349321
...
@@ -38,8 +38,18 @@ function isUsernameExist(){
...
@@ -38,8 +38,18 @@ function isUsernameExist(){
return
exist
;
return
exist
;
}
}
function
changetype
()
{
var
x
=
document
.
getElementById
(
"
password
"
);
if
(
x
.
type
===
"
password
"
)
{
x
.
type
=
"
text
"
;
}
else
{
x
.
type
=
"
password
"
;
}
}
function
validateUsername
(){
function
validateUsername
(){
var
validUsername
=
/^
[
a-z0-9_
]{3,
16
}
$/
;
var
validUsername
=
/^
[
a-z0-9_
]{3,
20
}
$/
;
var
username
=
document
.
getElementById
(
"
username
"
).
value
;
var
username
=
document
.
getElementById
(
"
username
"
).
value
;
var
usernameExist
=
10
;
var
usernameExist
=
10
;
var
usernameWrong
=
20
;
var
usernameWrong
=
20
;
...
@@ -83,30 +93,60 @@ function loginDirect(){
...
@@ -83,30 +93,60 @@ function loginDirect(){
window
.
location
.
href
=
"
login
"
;
window
.
location
.
href
=
"
login
"
;
}
}
$
(
'
#btnRegister
'
).
on
(
'
click
'
,
function
(){
$
(
'
#btnRegister
'
).
on
(
'
click
'
,
function
(
e
){
if
(
validateUsername
()
==
false
){
let
$username
=
$
(
'
#username
'
).
val
();
alert
(
"
format username salah
"
);
let
$email
=
$
(
'
#email
'
).
val
();
}
else
if
(
validateEmail
()
==
false
){
let
$password
=
$
(
'
#password
'
).
val
();
alert
(
"
format email salah
"
);
let
$repassword
=
$
(
'
#repassword
'
).
val
();
}
else
if
(
validate
()
==
false
){
alert
(
"
password tidak sesuai
"
);
$
(
'
#wronginput
'
).
html
(
''
);
}
else
if
(
validateUsername
()
==
true
&&
validateEmail
()
==
true
&&
validate
()
==
true
){
if
(
$username
&&
$username
.
length
<
3
){
$
(
'
#wronginput
'
).
html
(
'
Username minimal 3 character
'
);
$
(
'
#repassword
'
).
val
(
''
);
$
(
'
#password
'
).
val
(
''
);
return
false
;
}
else
if
(
$username
&&
$username
.
length
>
20
){
$
(
'
#wronginput
'
).
html
(
'
Username maximum 20 character
'
);
$
(
'
#repassword
'
).
val
(
''
);
$
(
'
#password
'
).
val
(
''
);
return
false
;
}
else
if
(
$username
&&
validateUsername
()
==
false
){
$
(
'
#wronginput
'
).
html
(
'
Username must be contain a-z/0-9/_
'
);
$
(
'
#repassword
'
).
val
(
''
);
return
false
;
}
else
if
(
$email
&&
validateEmail
()
==
false
){
$
(
'
#wronginput
'
).
html
(
'
Email wrong !
'
)
$
(
'
#repassword
'
).
val
(
''
);
$
(
'
#password
'
).
val
(
''
);
return
false
;
}
else
if
(
$repassword
&&
validate
()
==
false
){
$
(
'
#wronginput
'
).
html
(
'
Password not match !
'
)
$
(
'
#repassword
'
).
val
(
''
);
$
(
'
#password
'
).
val
(
''
);
return
false
;
}
else
if
(
$username
&&
validateUsername
()
==
true
&&
validateEmail
()
==
true
&&
validate
()
==
true
){
if
(
isUsernameExist
()){
if
(
isUsernameExist
()){
alert
(
"
username sudah terpakai
"
);
$
(
'
#wronginput
'
)(
"
username is exist
"
);
}
else
{
$
(
'
#repassword
'
).
val
(
''
);
$
(
'
#password
'
).
val
(
''
);
return
false
;
}
else
{
registrasi
();
registrasi
();
}
}
}
}
// if(validate() == true){
// registrasi();
// //window.location.href = baseURL+ "/Useranalytics/template";
// }else{
// alert('password tidak sesuai');
// }
});
});
$
(
document
).
ready
(
function
(){
$
(
'
#password
'
).
on
(
"
cut copy paste
"
,
function
(
e
)
{
e
.
preventDefault
();
});
});
function
registrasi
(){
function
registrasi
(){
let
$username
=
$
(
'
#username
'
).
val
();
let
$username
=
$
(
'
#username
'
).
val
();
...
@@ -156,21 +196,4 @@ function registrasi(){
...
@@ -156,21 +196,4 @@ function registrasi(){
});
});
}
}
//ajax get api user_data_header
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loadusername',
// data: {
// },
// success: function(result){
// console.log(result.data);
// },
// error: function(xhr){
// //alert(xhr.status+'-'+xhr.statusText);
// }
// });
\ No newline at end of file
public/template/js/demo/chart-area-demo.js
View file @
99349321
...
@@ -32,9 +32,8 @@ window.setInterval(function(){
...
@@ -32,9 +32,8 @@ window.setInterval(function(){
if
(
$
(
'
#selectmonth
'
).
val
()
!=
'
all month
'
){
if
(
$
(
'
#selectmonth
'
).
val
()
!=
'
all month
'
){
changemonthfunc
();
changemonthfunc
();
}
}
},
600000
);
},
6000
);
loaddatavisitor
(
validasiToken
);
loaddatavisitor
(
validasiToken
);
function
setnewload
(
token
){
function
setnewload
(
token
){
...
@@ -404,7 +403,7 @@ function loaddatavisitor(token){
...
@@ -404,7 +403,7 @@ function loaddatavisitor(token){
}
}
loadselectfirst
(
validasiToken
);
loadselectfirst
(
validasiToken
);
function
loadselectfirst
(
tokeni
){
x
function
loadselectfirst
(
tokeni
){
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
dataType
:
"
JSON
"
,
dataType
:
"
JSON
"
,
...
...
public/template/js/demo/chart-bar-demo.js
View file @
99349321
...
@@ -26,11 +26,16 @@ function number_format(number, decimals, dec_point, thousands_sep) {
...
@@ -26,11 +26,16 @@ function number_format(number, decimals, dec_point, thousands_sep) {
}
}
return
s
.
join
(
dec
);
return
s
.
join
(
dec
);
}
}
window
.
setInterval
(
function
(){
let
province
=
$
(
'
#selectprovincepage
'
).
val
();
let
country
=
$
(
'
#selectcountrypage
'
).
val
();
let
city
=
$
(
'
#selectcitypage
'
).
val
();
loadDataHalaman
(
validasiToken
);
changedatapage
(
country
,
province
,
city
);
},
600000
);
loadDataHalaman
(
validasiToken
);
function
loadDataHalaman
(
token
){
function
loadDataHalaman
(
token
){
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
.
ajax
({
$
.
ajax
({
...
...
public/template/js/demo/chart-bar2-demo.js
View file @
99349321
...
@@ -27,6 +27,14 @@ function number_format(number, decimals, dec_point, thousands_sep) {
...
@@ -27,6 +27,14 @@ function number_format(number, decimals, dec_point, thousands_sep) {
return
s
.
join
(
dec
);
return
s
.
join
(
dec
);
}
}
window
.
setInterval
(
function
(){
let
country
=
$
(
'
#selectcountrybutton
'
).
val
();
let
province
=
$
(
'
#selectprovincebutton
'
).
val
();
let
city
=
$
(
'
#selectcitybutton
'
).
val
();
changedatabutton
(
country
,
province
,
city
);
},
600000
);
loaddatabutton
(
validasiToken
);
loaddatabutton
(
validasiToken
);
...
...
public/template/js/demo/chart-pie-demo.js
View file @
99349321
...
@@ -15,7 +15,7 @@ window.setInterval(function(){
...
@@ -15,7 +15,7 @@ window.setInterval(function(){
changedata
(
country
,
province
,
city
);
changedata
(
country
,
province
,
city
);
},
6000
);
},
6000
00
);
function
loaddatabrowser
(
tokeni
){
function
loaddatabrowser
(
tokeni
){
dates
=
new
Date
();
dates
=
new
Date
();
...
...
public/template/js/demo/chart-pie2-demo.js
View file @
99349321
...
@@ -3,6 +3,21 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
...
@@ -3,6 +3,21 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
$
(
"
#websiteName
"
).
html
(
websitetitle
);
$
(
"
#websiteName
"
).
html
(
websitetitle
);
window
.
setInterval
(
function
(){
let
country
=
$
(
'
#selectcountryvl
'
).
val
();
let
province
=
$
(
'
#selectprovincevl
'
).
val
();
let
selectyear
=
$
(
'
#selectyearvisit
'
).
val
();
let
selectmonth
=
$
(
'
#selectmonthvisit
'
).
val
();
changevistorbytime
(
selectyear
,
selectmonth
,
country
,
province
);
if
(
province
){
$
(
'
#visitorLocation
'
).
html
(
'
Visitor Location City
'
);
}
else
{
$
(
'
#visitorLocation
'
).
html
(
'
Visitor Location Province
'
);
}
},
600000
);
LoadDadta
(
validasiToken
);
LoadDadta
(
validasiToken
);
function
LoadDadta
(
token
){
function
LoadDadta
(
token
){
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
...
...
public/template/js/demo/chart-pie3-demo.js
View file @
99349321
...
@@ -3,6 +3,14 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
...
@@ -3,6 +3,14 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
Chart
.
defaults
.
global
.
defaultFontColor
=
'
#858796
'
;
$
(
"
#websiteName
"
).
html
(
websitetitle
);
$
(
"
#websiteName
"
).
html
(
websitetitle
);
window
.
setInterval
(
function
(){
let
country
=
$
(
'
#selectcountryimage
'
).
val
();
let
province
=
$
(
'
#selectprovinceimage
'
).
val
();
let
city
=
$
(
'
#selectcityimage
'
).
val
();
changedataimage
(
country
,
province
,
city
);
},
600000
);
LoadDadta
(
validasiToken
);
LoadDadta
(
validasiToken
);
function
LoadDadta
(
token
){
function
LoadDadta
(
token
){
/* save data */
/* save data */
...
...
public/template/js/demo/table-user-browser.js
View file @
99349321
// SAVE
var
tableToExcel
=
(
function
()
{
var
tableToExcel
=
(
function
()
{
var
uri
=
'
data:application/vnd.ms-excel;base64,
'
var
uri
=
'
data:application/vnd.ms-excel;base64,
'
,
template
=
'
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>
'
,
template
=
'
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>
'
...
@@ -11,7 +12,7 @@ var tableToExcel = (function() {
...
@@ -11,7 +12,7 @@ var tableToExcel = (function() {
}
}
})();
})();
loadtablebrowser
(
validasiToken
);
loadtablebrowser
(
validasiToken
);
function
loadtablebrowser
(
token
){
function
loadtablebrowser
(
token
){
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment