Commit 99349321 authored by reynaldi adriantama's avatar reynaldi adriantama

commit vendor dan public

parent 841aa202
......@@ -59,7 +59,7 @@ var logBehaviorUser = (function(){
$.ajax({
type: 'POST',
dataType: 'json',
url: "http://useranalyticgiw.giw/api/loadmacaddress",
url: "http://useranalytics.giw/api/loadmacaddress",
success: function(result) {
results.user_info.mac_address=result.data;
// console.log(result);
......@@ -78,7 +78,7 @@ var logBehaviorUser = (function(){
type: 'POST',
dataType: 'json',
data : {'myData':$token},
url: "http://useranalyticgiw.giw/api/loadtoken",
url: "http://useranalytics.giw/api/loadtoken",
success: function(result) {
results.nameweb=result.data;
......@@ -93,7 +93,7 @@ var logBehaviorUser = (function(){
$.ajax({
type: 'POST',
dataType: 'json',
url: "http://useranalyticgiw.giw/api/loadipaddress",
url: "http://useranalytics.giw/api/loadipaddress",
success: function(result) {
results.user_info.ip_address_public=result.data;
// console.log(result);
......@@ -187,7 +187,7 @@ var logBehaviorUser = (function(){
$.ajax({
type : "POST",
url : 'http://useranalyticgiw.giw/api/keyval',
url : 'http://useranalytics.giw/api/keyval',
data : {'myData':settings.actionItem.token},
async : false,
// ContentType: application/javascript,
......@@ -315,7 +315,7 @@ var logBehaviorUser = (function(){
if(settings.hasOwnProperty('processData')){
$.ajax({
type: "POST",
url: 'http://useranalyticgiw.giw/api/savetojson',
url: 'http://useranalytics.giw/api/savetojson',
data: {'myData':results},
async:false,
// ContentType: application/javascript,
......
// window.setInterval(function(){
// savetodb(validasiToken);
window.setInterval(function(){
savetodb(validasiToken);
getdatavisitor(validasiToken);
// },60000);
// savetodb(validasiToken);
},600000);
getdatavisitor(validasiToken);
savetodb(validasiToken);
function savetodb(tokeni){
$.ajax({
......@@ -20,8 +18,6 @@ function savetodb(tokeni){
})
}
function getdatavisitor(tokeni){
$.ajax({
type : "post",
......@@ -31,12 +27,9 @@ function getdatavisitor(tokeni){
token : tokeni
},
success: function(result){
// console.log(result);
let data = result.data;
// console.log(data);
console.log(data);
$("#totalvisitor").html(data['total_visit']);
$("#newvisitor").html(data['new_visitor']);
$("#numbercities").html(data['total_cities']);
......@@ -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.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(){
return exist;
}
function changetype() {
var x = document.getElementById("password");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
function validateUsername(){
var validUsername = /^[a-z0-9_]{3,16}$/;
var validUsername = /^[a-z0-9_]{3,20}$/;
var username = document.getElementById("username").value;
var usernameExist = 10;
var usernameWrong = 20;
......@@ -83,30 +93,60 @@ function loginDirect(){
window.location.href = "login";
}
$('#btnRegister').on('click', function(){
if(validateUsername() == false){
alert("format username salah");
}else if(validateEmail() == false){
alert("format email salah");
}else if(validate() == false){
alert("password tidak sesuai");
}else if(validateUsername() == true && validateEmail() == true && validate() == true){
$('#btnRegister').on('click', function(e){
let $username = $('#username').val();
let $email = $('#email').val();
let $password = $('#password').val();
let $repassword = $('#repassword').val();
$('#wronginput').html('');
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()){
alert("username sudah terpakai");
}else{
$('#wronginput')("username is exist");
$('#repassword').val('');
$('#password').val('');
return false;
}
else{
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(){
let $username = $('#username').val();
......@@ -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(){
if($('#selectmonth').val()!='all month'){
changemonthfunc();
}
},600000);
},6000);
loaddatavisitor(validasiToken);
function setnewload(token){
......@@ -404,7 +403,7 @@ function loaddatavisitor(token){
}
loadselectfirst(validasiToken);
function loadselectfirst(tokeni){x
function loadselectfirst(tokeni){
$.ajax({
type : "post",
dataType : "JSON",
......
......@@ -26,11 +26,16 @@ function number_format(number, decimals, dec_point, thousands_sep) {
}
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){
$(document).ready(function(){
$.ajax({
......
......@@ -27,6 +27,14 @@ function number_format(number, decimals, dec_point, thousands_sep) {
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);
......
......@@ -15,7 +15,7 @@ window.setInterval(function(){
changedata(country, province, city);
},6000);
},600000);
function loaddatabrowser(tokeni){
dates = new Date();
......
......@@ -3,6 +3,21 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
Chart.defaults.global.defaultFontColor = '#858796';
$("#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);
function LoadDadta(token){
$(document).ready(function(){
......
......@@ -3,6 +3,14 @@ Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,Bli
Chart.defaults.global.defaultFontColor = '#858796';
$("#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);
function LoadDadta(token){
/* save data */
......
// SAVE
var tableToExcel = (function() {
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>'
......@@ -11,7 +12,7 @@ var tableToExcel = (function() {
}
})();
loadtablebrowser(validasiToken);
loadtablebrowser(validasiToken);
function loadtablebrowser(token){
$(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