Commit 99349321 authored by reynaldi adriantama's avatar reynaldi adriantama

commit vendor dan public

parent 841aa202
...@@ -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://useranalyticgiw.giw/api/loadmacaddress", url: "http://useranalytics.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://useranalyticgiw.giw/api/loadtoken", url: "http://useranalytics.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://useranalyticgiw.giw/api/loadipaddress", url: "http://useranalytics.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://useranalyticgiw.giw/api/keyval', url : 'http://useranalytics.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://useranalyticgiw.giw/api/savetojson', url: 'http://useranalytics.giw/api/savetojson',
data: {'myData':results}, data: {'myData':results},
async:false, async:false,
// ContentType: application/javascript, // ContentType: application/javascript,
......
// 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",
...@@ -31,12 +27,9 @@ function getdatavisitor(tokeni){ ...@@ -31,12 +27,9 @@ function getdatavisitor(tokeni){
token : tokeni token : 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);
// }
// }
// });
$(document).ready(function(){ $(document).ready(function(){
document.title = "Login"; document.title = "Login";
}); });
\ No newline at end of file
function changetype() {
var x = document.getElementById("passwd");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
\ No newline at end of file
...@@ -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
...@@ -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",
......
...@@ -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({
......
...@@ -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);
......
...@@ -15,7 +15,7 @@ window.setInterval(function(){ ...@@ -15,7 +15,7 @@ window.setInterval(function(){
changedata(country, province, city); changedata(country, province, city);
},6000); },600000);
function loaddatabrowser(tokeni){ function loaddatabrowser(tokeni){
dates = new Date(); dates = new Date();
......
...@@ -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(){
......
...@@ -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 */
......
// 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(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment