Jelajahi Sumber

interval update

Jad Meouchy 9 tahun lalu
induk
melakukan
d52504bbcd
2 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 3 0
      www/js/init.js
  2. 4 0
      www/js/routes.js

+ 3 - 0
www/js/init.js

@@ -11,6 +11,7 @@ function loadApp()
 {
 	initializeRoutes();
 
+
 	
 	if(!user)
 		router('/');
@@ -35,6 +36,8 @@ function loadApp()
 	{
 		window.open('api/downloadCSV.php?id=' + $(this).data('id_company'));
 	});
+	
+	setInterval(loadAllData, 60*1000);
 }
 
 function login(e)

+ 4 - 0
www/js/routes.js

@@ -76,9 +76,13 @@ function showPage(page)
 
 function loadAllData()
 {
+	console.log('requesting data');
+	
 	$.post('api/getRows.php', 'json')
 	.done(function(companies)
 	{
+		console.log('received data');
+		
 		//go through each company and add a tab if one isn't present
 		
 		if(!companies.length)