From 39f90b189749dc6ce6ca7230c2a50dea539c55cb Mon Sep 17 00:00:00 2001
From: weimin <540481002@qq.com>
Date: Fri, 10 Mar 2017 13:26:13 +0000
Subject: [PATCH] Upload all code
---
app.js | 149 +++++++++++++
debug.log | 2 +
index.html | 75 +++++++
pages/admin/admin.html | 3 +
pages/admin/adminCtrl.js | 67 ++++++
pages/admin/header.admin.html | 27 +++
pages/admin/main.admin.html | 50 +++++
pages/admin/main.receipt.html | 43 ++++
pages/admin/sidebar.admin.html | 46 ++++
pages/home/home.css | 353 +++++++++++++++++++++++++++++++
pages/home/home.html | 13 ++
pages/home/homeCtrl.js | 18 ++
pages/login/login.html | 69 ++++++
pages/login/loginCtrl.js | 49 +++++
pages/map/circles.json | 7 +
pages/map/map.css | 3 +
pages/map/map.html | 15 ++
pages/map/mapCtrl.js | 61 ++++++
pages/receipt/receipt.html | 108 ++++++++++
pages/receipt/receiptCtrl.js | 62 ++++++
pages/trader/header.trader.html | 27 +++
pages/trader/main.trader.html | 6 +
pages/trader/sidebar.trader.html | 44 ++++
pages/trader/trader.html | 0
pages/trader/traderCtrl.js | 15 ++
pages/user/header.user.html | 24 +++
pages/user/icon1.png | Bin 0 -> 13465 bytes
pages/user/main.leaderboard.html | 28 +++
pages/user/main.settings.html | 21 ++
pages/user/main.user.html | 90 ++++++++
pages/user/sidebar.user.html | 30 +++
pages/user/user.html | 3 +
pages/user/userCtrl.js | 65 ++++++
services/authService.js | 14 ++
services/chartService.js | 56 +++++
services/uploadReceiptService.js | 6 +
36 files changed, 1649 insertions(+)
create mode 100644 app.js
create mode 100644 debug.log
create mode 100644 index.html
create mode 100644 pages/admin/admin.html
create mode 100644 pages/admin/adminCtrl.js
create mode 100644 pages/admin/header.admin.html
create mode 100644 pages/admin/main.admin.html
create mode 100644 pages/admin/main.receipt.html
create mode 100644 pages/admin/sidebar.admin.html
create mode 100644 pages/home/home.css
create mode 100644 pages/home/home.html
create mode 100644 pages/home/homeCtrl.js
create mode 100644 pages/login/login.html
create mode 100644 pages/login/loginCtrl.js
create mode 100644 pages/map/circles.json
create mode 100644 pages/map/map.css
create mode 100644 pages/map/map.html
create mode 100644 pages/map/mapCtrl.js
create mode 100644 pages/receipt/receipt.html
create mode 100644 pages/receipt/receiptCtrl.js
create mode 100644 pages/trader/header.trader.html
create mode 100644 pages/trader/main.trader.html
create mode 100644 pages/trader/sidebar.trader.html
create mode 100644 pages/trader/trader.html
create mode 100644 pages/trader/traderCtrl.js
create mode 100644 pages/user/header.user.html
create mode 100644 pages/user/icon1.png
create mode 100644 pages/user/main.leaderboard.html
create mode 100644 pages/user/main.settings.html
create mode 100644 pages/user/main.user.html
create mode 100644 pages/user/sidebar.user.html
create mode 100644 pages/user/user.html
create mode 100644 pages/user/userCtrl.js
create mode 100644 services/authService.js
create mode 100644 services/chartService.js
create mode 100644 services/uploadReceiptService.js
diff --git a/app.js b/app.js
new file mode 100644
index 0000000..a8a3593
--- /dev/null
+++ b/app.js
@@ -0,0 +1,149 @@
+var app = angular.module(
+ "FoodLoop",
+ [
+ 'ngRoute',
+ 'ui.router'
+ ]
+);
+
+// calling order
+// 1-> app.config()
+// 2-> app.run()
+// 3-> directive's compile functions (if they are found in the dom)
+// 4-> app.controller()
+// 5-> directive's link functions (again, if found)
+
+
+app.config(function($stateProvider, $urlRouterProvider) {
+ // use $urlRouterProvider to catch all the illeage cases
+ // $urlRouterProvider.otherwise("/login");
+
+ $stateProvider
+ // if loggin as user
+ .state('user',{
+ url:"/user",
+ views:{
+ '': {templateUrl:'pages/home/home.html',controller:'userCtrl'},
+ 'header@user': {templateUrl:'pages/user/header.user.html'}, // nested view
+ 'sidebar@user': {templateUrl:'pages/user/sidebar.user.html'},
+ 'main@user': {templateUrl:'pages/user/main.user.html'},
+ },data:{
+ requireLogin: false
+ }
+ })
+ .state('user.receipt',{
+ url:"",
+ views:{
+ 'main@user': {templateUrl:'pages/receipt/receipt.html',controller:"receiptCtrl"},
+ }
+ })
+ .state('user.leaderboard',{
+ url:"",
+ views:{
+ 'main@user': {templateUrl:'pages/user/main.leaderboard.html'},
+ }
+ })
+ .state('user.settings',{
+ url:"",
+ views:{
+ 'main@user': {templateUrl:'pages/user/main.settings.html'},
+ }
+ })
+ .state('user.help',{
+ url:"",
+ views:{
+ 'main@user': {templateUrl:'pages/user/main.settings.html'},
+ }
+ })
+ .state('admin.view_receipt',{
+ url:"",
+ params: {
+ receipt: null,
+ },
+ views:{
+ 'main@admin': {
+ templateUrl:'pages/admin/main.receipt.html',
+ controller: function($scope,$stateParams){
+ $scope.receipt = $stateParams.receipt;
+ console.log($scope.receipt);
+ }},
+ },data:{
+ requireLogin: false
+ }
+ }
+ )
+ .state('admin',{
+ url:"/admin",
+ controller: 'adminCtrl',
+ views:{
+ '': { templateUrl: 'pages/home/home.html',controller:'adminCtrl'}, // default view}
+ 'header@admin': {templateUrl:'pages/admin/header.admin.html'}, // nested view
+ 'sidebar@admin': {templateUrl:'pages/admin/sidebar.admin.html'},
+ 'main@admin': {templateUrl:'pages/admin/main.admin.html'},
+ },data:{
+ requireLogin: false
+ }
+ })
+ .state('trader',{
+ url:"/trader",
+ views:{
+ '': { templateUrl: 'pages/home/home.html',controller:'traderCtrl'}, // default view}
+ 'header@trader': {templateUrl:'pages/trader/header.trader.html'}, // nested view
+ 'sidebar@trader': {templateUrl:'pages/trader/sidebar.trader.html'},
+ 'main@trader': {templateUrl:'pages/trader/main.trader.html'},
+ },data:{
+ requireLogin: false
+ }
+ })
+
+ .state('map',{
+ url: '/map',
+ templateUrl: 'pages/map/map.html',
+ controller: 'mapCtrl',
+ data: {
+ requireLogin : false
+ }
+ })
+ .state('login',{
+ url: '',
+ templateUrl: 'pages/login/login.html',
+ controller: 'loginCtrl',
+ data: {
+ requireLogin : false
+ }
+ });
+
+});
+
+
+/* redirects to different page based on whether the user is login or not and */
+/* if log on, check user type and redirect/construct a custom dashboard page */
+/* to extend, users may have a custome dashboard with different layout, this */
+/* needs to be handled using HTML page which is specifically constucted by */
+/* page'controller and obtain variable setting from server */
+// /* if not, redirect to login in page */
+app.run(function ($rootScope,$state,authService) { // kickstart the application
+ // listening to the when a state change start
+ console.log("State changes");
+ $rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
+ console.log(toState);
+ // var requireLogin = toState.data.requireLogin;
+ // redirect to login page if satisfy the following conditions
+ // 1. seesion expired and user tries to access a page
+ // if ((requireLogin && typeof $rootScope.currentUser === 'undefined')) {
+ // event.preventDefault();
+ // $state.transitionTo('login');
+ // }
+ });
+ // Testing, configuration to firebase
+ var config = {
+ apiKey: "AIzaSyDypwjmMD818GQTTfyhTpx76ChJpDsZGek",
+ authDomain: "foodloop-666db.firebaseapp.com",
+ databaseURL: "https://foodloop-666db.firebaseio.com",
+ storageBucket: "foodloop-666db.appspot.com",
+ messagingSenderId: "832579459759"
+ };
+ firebase.initializeApp(config);
+
+})
+
diff --git a/debug.log b/debug.log
new file mode 100644
index 0000000..eebd912
--- /dev/null
+++ b/debug.log
@@ -0,0 +1,2 @@
+[0212/144844:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:6004
+[0212/144844:ERROR:node_debugger.cc(86)] Cannot start debugger server
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..a40bae9
--- /dev/null
+++ b/index.html
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+ FoodLoop Login
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/admin/admin.html b/pages/admin/admin.html
new file mode 100644
index 0000000..b3514c6
--- /dev/null
+++ b/pages/admin/admin.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/pages/admin/adminCtrl.js b/pages/admin/adminCtrl.js
new file mode 100644
index 0000000..1fcfdf9
--- /dev/null
+++ b/pages/admin/adminCtrl.js
@@ -0,0 +1,67 @@
+/* this controller specifies the logic layer of the admin page */
+/* including the content to be display, sidebar, header */
+/* functionailities involve for an admin */
+app.controller('adminCtrl', function($scope,$state) {
+ $scope.users;
+ $scope.controllby = "admin";
+ // Initialize Firebase
+ $scope.pending_receipt_sum = 2;
+ $scope.pending_receipt = [
+ {
+ receipt_ref: "r1",
+ submitted_by : "John Lemon",
+ submitted_time: "31",
+ submitted_amount: "8.66",
+ details: "sjadsjoiadsj iasdn aisdn alsdi jadi jasdi ajsdoi ndi snd"
+ }
+ ,
+ {
+ submitted_by : "User007",
+ submitted_time: "21",
+ submitted_amount: "22.22"
+ }
+ ];
+
+
+ /* section for receipt management start * /
+ /* review a pending receipt */
+ /* fetch a list of pending receipt from server */
+ /* fetch a list of approve receipt from server */
+ $scope.reviewReceipt = function(myReceipt){
+ // testing
+ console.log("[DEBUG]: reviewReceipt called");
+ // show page for review this receipt
+ $state.go('admin.view_receipt', {receipt: myReceipt})
+ //
+
+ }
+
+ $scope.approve_receipt = function(receipt_ref){
+ // call api to approve a pending receipt
+ // notify user
+ }
+
+
+ $scope.fetch_pending_receipt = function(){
+
+ }
+
+ $scope.fetch_submitted_receipt = function(){
+
+ }
+ /* section for receipt management end */
+
+
+ // Get a reference to the database service
+ var database = firebase.database();
+ firebase.database().ref('/users/').once('value').then(function(snapshot) {
+ $scope.users = snapshot.val();
+ });
+
+ $scope.test = function(){
+
+ console.log("CLiced ");
+ console.log($scope.users);
+ }
+});
+
diff --git a/pages/admin/header.admin.html b/pages/admin/header.admin.html
new file mode 100644
index 0000000..1ba87f4
--- /dev/null
+++ b/pages/admin/header.admin.html
@@ -0,0 +1,27 @@
+
\ No newline at end of file
diff --git a/pages/admin/main.admin.html b/pages/admin/main.admin.html
new file mode 100644
index 0000000..2a36196
--- /dev/null
+++ b/pages/admin/main.admin.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+ Action |
+ # |
+ From |
+ When |
+ Amount |
+
+
+
+
+
+
+
+ |
+ {{$index + 1}} |
+ {{receipt.submitted_by}} |
+ {{receipt.submitted_time}} minutes ago |
+ £{{receipt.submitted_amount}} |
+
+
+
+
+ {{receipt.details}}
+
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/admin/main.receipt.html b/pages/admin/main.receipt.html
new file mode 100644
index 0000000..cdfa6c0
--- /dev/null
+++ b/pages/admin/main.receipt.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+ # |
+ From |
+ When |
+ Amount |
+
+
+
+
+ {{$index + 1}} |
+ {{receipt.submitted_by}} |
+ {{receipt.submitted_time}} minutes ago |
+ £{{receipt.submitted_amount}} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/admin/sidebar.admin.html b/pages/admin/sidebar.admin.html
new file mode 100644
index 0000000..e8a423a
--- /dev/null
+++ b/pages/admin/sidebar.admin.html
@@ -0,0 +1,46 @@
+
+
diff --git a/pages/home/home.css b/pages/home/home.css
new file mode 100644
index 0000000..6780648
--- /dev/null
+++ b/pages/home/home.css
@@ -0,0 +1,353 @@
+/*
+ * Base structure
+ */
+
+/* Move down content because we have a fixed navbar that is 50px tall */
+body {
+ padding-top: 50px;
+ background-color: whitesmoke;
+}
+
+/*
+ * Typography
+ */
+
+h1 {
+ margin-bottom: 20px;
+ padding-bottom: 9px;
+ border-bottom: 1px solid #eee;
+}
+
+main{
+ background-color: whitesmoke;
+}
+/*
+ * Sidebar
+ */
+
+.sidebar {
+ position: fixed;
+ top: 51px;
+ bottom: 0;
+ left: 0;
+ z-index: 1000;
+ padding: 20px;
+ overflow-x: hidden;
+ overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
+ border-right: 1px solid #eee;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+
+}
+
+/* Sidebar navigation */
+.sidebar {
+ margin-top: -16px;
+ padding-left: 0;
+ padding-right: 0;
+}
+
+.sidebar .nav {
+ margin-bottom: 20px;
+}
+
+.sidebar .nav-item {
+ width: 100%;
+}
+
+.sidebar .nav-item + .nav-item {
+ margin-left: 0;
+}
+
+.sidebar .nav-link {
+ border-radius: 0;
+}
+
+.profile-pic {
+ border-radius: 80%;
+ background-color: transparent;
+ width: 100%;
+ height: 100%;
+ background-color: dodgerblue;
+
+}
+
+
+
+.profilePic{
+ padding: 16px;
+ background-color: transparent;
+ max-width: 100%;
+ height: 130px;
+ background-color: dodgerblue;
+}
+
+.profileInfo{
+ color:white;
+ padding: 16px;
+ padding-top: 30px;
+ height: 130px;
+ background-color: dodgerblue;
+}
+
+.profileTitle{
+ font-size: 0.8em;
+}
+
+/*
+ * Dashboard
+ */
+
+ /* Placeholders */
+.placeholders {
+ padding-bottom: 3rem;
+}
+
+.placeholder img {
+ padding-top: 1.5rem;
+ padding-bottom: 1.5rem;
+}
+.title{
+ color: black;
+}
+.flCard{
+ color:black;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ /*width: 100%;*/
+ height: 110px;;
+ margin-top: 16px;
+ background-color: white;
+ border: green;
+ padding:16px;
+
+}
+
+
+
+
+
+.rankCard{
+ color:black;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ height: 300px;;
+ margin-top: 16px;
+ background-color: white;
+ border: green;
+
+}
+
+.rankCardHeader{
+ border-radius: 3px 3px 0 0;
+ padding: 3px;
+ color:white;
+ height:30px;
+ background-color: dodgerblue;
+}
+
+.chartCardHeader{
+ border-radius: 3px 3px 0 0;
+ padding: 3px;
+ color:white;
+ height:30px;
+ background-color: orangered;
+}
+
+.rankCardContent{
+ padding: 3px;
+ /*color:white;*/
+ /*background-color: dodgerblue;*/
+}
+
+.flCardHeader{
+ height: 25px;
+}
+.flCardMain{
+ margin: -16px;
+ font-size: 3.0em;
+ color: dimgray;
+ text-align: center;
+}
+
+.chartCard{
+ color:black;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ height: 300px;;
+ margin-top: 16px;
+ background-color: white;
+
+}
+.flCardNote{
+ font-size: 0.8em;
+ color: dodgerblue;
+ text-align: right;
+}
+#receiptTable{
+ padding: 16px;
+}
+
+
+/* CSS FOR RECEIPT */
+
+.receiptItem{
+ color:black;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ padding: 16px;
+ background-color: white;
+}
+
+.receiptCard{
+ color:black;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ margin-top: 16px;
+ padding:16px;
+ background-color: white;
+}
+
+.receiptCardHeader{
+ border-radius: 3px 3px 0 0;
+ padding: 3px;
+ color:white;
+ padding: 16px;
+ background-color: dodgerblue;
+}
+
+
+.receiptDetailCard{
+ color:black;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ height: 300px;
+ margin-top: 16px;
+ background-color: lightcyan;
+}
+
+.addButton{
+ background-color: transparent;
+ font-size: 1.0em;
+ margin-left: 50%;
+
+}
+
+.dragImageBox:hover{
+ background-color: whitesmoke;
+}
+.dragImageBox{
+ border: 2px dashed dodgerblue;
+ border-radius: 4px;
+ background-color:white;
+ height: 150px;
+ transition: 0.3s;
+}
+
+
+.thumb{
+ color:black;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ background-color: white;
+ width: 50px;
+ height: 130px;
+}
+
+/* TEMPALTE CSS FOR DISPLAY A CUSTOM CARD */
+
+.pearCard{
+ color:black;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ background-color: white;
+}
+
+/* On mouse-over, add a deeper shadow */
+.pearCard:hover {
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+}
+
+.pearCardFooter{
+ width: 100%;
+ margin-bottom: -16px;
+ background-color: lightcyan;
+}
+.pearAutoHeight{
+ height: auto;
+}
+.pearCardHeader{
+ border-radius: 3px 3px 0 0;
+ padding: 9px;
+ color:white;
+ background-color: dodgerblue;
+}
+
+.pearOrange{
+ background-color: orangered;
+}
+.pearBlue{
+ background-color: dodgerblue;
+}
+.pearGreen{
+ background-color: lawngreen;
+}
+.pearYellow{
+ background-color: yellow;
+}
+.pearPurple{
+ background-color: purple;
+}
+
+.padding16{
+ padding: 16px;
+}
+
+.margin16{
+ margin-top:16px;
+}
+
+
+
+/* LOGIN CSS */
+.mainSection{
+ margin-top: 20%;
+ padding:16px;
+ color:black;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
+ transition: 0.3s;
+ border-radius: 3px;
+ font-size: 1em;
+ /*height: 150px;*/
+ background-color: white;
+}
+
+.mainItem{
+
+ padding: 16px;
+}
+
+.mainItem input[type=text] {
+ /*border: 2px solid ;*/
+ border-radius: 4px;
+}
+
+.mainItem input[type=password] {
+ /*border: 2px solid ;*/
+ border-radius: 4px;
+}
\ No newline at end of file
diff --git a/pages/home/home.html b/pages/home/home.html
new file mode 100644
index 0000000..37db6f8
--- /dev/null
+++ b/pages/home/home.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/home/homeCtrl.js b/pages/home/homeCtrl.js
new file mode 100644
index 0000000..24fa916
--- /dev/null
+++ b/pages/home/homeCtrl.js
@@ -0,0 +1,18 @@
+app.controller('homeCtrl', function($scope) {
+
+ // $stateProvider.state('contacts', {
+ // template: 'My Contacts
'
+ // }) $scope.username = "user";
+ $scope.controllby = "home";
+
+ // $rootScope.userType = "admin";
+ // $scope.getViewByUserType = function(){
+ // return {
+ // '': {templateUrl: 'pages/home/home.html',controller:'adminCtrl'}, // default view
+ // 'header@home-admin': {templateUrl:'pages/admin/header.admin.html'}, // nested view
+ // 'sidebar@home-admin': {templateUrl:'pages/admin/sidebar.admin.html'},
+ // 'main@home-admin': {templateUrl:'pages/admin/main.admin.html'},
+ // }
+ // }
+ // $scope.header = "i m not a header";
+});
diff --git a/pages/login/login.html b/pages/login/login.html
new file mode 100644
index 0000000..903df87
--- /dev/null
+++ b/pages/login/login.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+ Username/Email
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/login/loginCtrl.js b/pages/login/loginCtrl.js
new file mode 100644
index 0000000..29e929c
--- /dev/null
+++ b/pages/login/loginCtrl.js
@@ -0,0 +1,49 @@
+app.controller('loginCtrl', function($scope,$state,$http,$rootScope,authService) {
+ /* login variables */
+ $scope.username = "user";
+ $scope.password = "Doe";
+ $scope.fullName = function() {
+ return $scope.firstName + " " + $scope.lastName;
+ };
+
+
+
+
+ // 1. send request to server to authenticate login information
+ // 2. on succeed, redirect to page
+ // 2.1 on failed, display error message
+ $scope.signin = function(){
+ var foodloop_token_url_login = "http://192.168.2.172:3000/login";
+ var loginData = JSON.stringify({
+ email : this.username,
+ password: this.password
+ });
+ console.log("Attempting to login in");
+
+ $http.post(foodloop_token_url_login,loginData).success(function(repsonse){
+ console.log("Resolving response from server");
+ console.log(repsonse.data);
+ },function(repsonse){
+ console.log("Ooops, Something went wrong");
+ });
+ authService.setUsername($scope.username);
+ // $state.go("user");
+ // if($scope.username === "admin"){
+ // $state.go('admin');
+ // }
+ // else if($scope.username === "user"){
+ // $state.go('user');
+ // }
+ // else{
+ // $state.go('home');
+ // }
+ }
+
+
+
+ $scope.createAccount = function(){
+
+ console.log("Create account button clicked");
+ }
+
+});
diff --git a/pages/map/circles.json b/pages/map/circles.json
new file mode 100644
index 0000000..8f55900
--- /dev/null
+++ b/pages/map/circles.json
@@ -0,0 +1,7 @@
+{"objects":[
+{"circle":{"coordinates":[54.0472, -2.8018]}},
+{"circle":{"coordinates":[-41.29,174.76]}},
+{"circle":{"coordinates":[-41.30,174.79]}},
+{"circle":{"coordinates":[-41.27,174.80]}},
+{"circle":{"coordinates":[-41.29,174.78]}}
+]}
\ No newline at end of file
diff --git a/pages/map/map.css b/pages/map/map.css
new file mode 100644
index 0000000..ecd882d
--- /dev/null
+++ b/pages/map/map.css
@@ -0,0 +1,3 @@
+#mapid { height: 180px; }
+
+#map { width:600px; height: 600px }
\ No newline at end of file
diff --git a/pages/map/map.html b/pages/map/map.html
new file mode 100644
index 0000000..0d15c99
--- /dev/null
+++ b/pages/map/map.html
@@ -0,0 +1,15 @@
+
+
+
\ No newline at end of file
diff --git a/pages/map/mapCtrl.js b/pages/map/mapCtrl.js
new file mode 100644
index 0000000..bd0f2cc
--- /dev/null
+++ b/pages/map/mapCtrl.js
@@ -0,0 +1,61 @@
+app.controller('mapCtrl',function($scope,$http,uploadReceiptService) {
+
+
+ // data
+ var traderGeoData = [
+ { Latitude:54.04,Longitude:2.80,trader:"sample_1" },
+ { Latitude:54.04,Longitude:2.80,trader:"sample_2" },
+ { Latitude:54.01,Longitude:2.78,trader:"sample_3" },
+ ];
+
+ var map = L.map('map').setView([54.0472, -2.8018], 13);
+ mapLink =
+ 'OpenStreetMap';
+ L.tileLayer(
+ 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© ' + mapLink + ' Contributors',
+ maxZoom: 18,
+ }).addTo(map);
+
+var svgLayer = L.svg();
+svgLayer.addTo(map);
+
+var svg = d3.select("#map").select("svg");
+var g = d3.select("#map").select("svg").select('g');
+g.attr("class", "leaflet-zoom-hide");
+
+
+ /* We simply pick up the SVG from the map object */
+ var svg = d3.select("#map").select("svg"),
+ g = svg.append("g");
+
+ d3.json("../pages/map/circles.json", function(collection) {
+ /* Add a LatLng object to each item in the dataset */
+ collection.objects.forEach(function(d) {
+ d.LatLng = new L.LatLng(d.circle.coordinates[0],
+ d.circle.coordinates[1])
+ })
+
+ var feature = g.selectAll("circle")
+ .data(collection.objects)
+ .enter().append("circle")
+ .style("stroke", "black")
+ .style("opacity", .6)
+ .style("fill", "red")
+ .attr("r", 20);
+
+ map.on("viewreset", update);
+ update();
+
+ function update() {
+ console.log("update!");
+ feature.attr("transform",
+ function(d) {
+ return "translate("+
+ map.latLngToLayerPoint(d.LatLng).x +","+
+ map.latLngToLayerPoint(d.LatLng).y +")";
+ }
+ )
+ }
+ })
+})
\ No newline at end of file
diff --git a/pages/receipt/receipt.html b/pages/receipt/receipt.html
new file mode 100644
index 0000000..2ffa42a
--- /dev/null
+++ b/pages/receipt/receipt.html
@@ -0,0 +1,108 @@
+
+
diff --git a/pages/receipt/receiptCtrl.js b/pages/receipt/receiptCtrl.js
new file mode 100644
index 0000000..62d41de
--- /dev/null
+++ b/pages/receipt/receiptCtrl.js
@@ -0,0 +1,62 @@
+app.controller('receiptCtrl',function($scope,$http,uploadReceiptService) {
+
+ // display the list of all exsiting store, validated and not validated
+ $scope.storelist;
+
+ // require param for upload api
+ $scope.microCurrencyValue;
+ $scope.transactionAdditionType;
+ $scope.addValidatedId;
+
+ $scope.storename;
+
+ // photo and path to the photo
+ $scope.receiptPhoto;
+ $scope.receiptPhotoSrc;
+
+ // list of pending reciepts await for approval from admin
+ $scope.pending_list = [
+ {submitted_time: 30 },{submitted_time:20},{submitted_time:10},{submitted_time:5},{submitted_time:1}
+ ];
+
+
+ var foodloop_token_url_search = "http://192.168.2.172:3000/search";
+
+
+ // get the latest store list
+ $scope.getStoreList = function(){
+ var data = {
+ "searchName": "",
+ "searchLocation": ""
+ };
+ $http.post(foodloop_token_url_search,data).then(function(response){
+ console.log(response);
+ });
+
+ // API call to /search to fetch a list of store
+ }
+
+ $scope.storelist = $scope.getStoreList();
+
+ // select the image
+ $scope.getImage = function(element) {
+ var reader = new FileReader();
+ reader.onload = function(event) {
+ $scope.$apply(function($scope) {
+ $scope.receiptPhoto = element.files[0];
+ $scope.receiptPhotoSrc = event.target.result
+ });
+ }
+ reader.readAsDataURL(element.files[0]);
+ }
+
+ // upload the receipt to the server
+ $scope.uploadReceipt = function(){
+ uploadReceiptService.uploadReceipt();
+ }
+
+
+ // test
+ // firebase api to upload an image
+
+});
diff --git a/pages/trader/header.trader.html b/pages/trader/header.trader.html
new file mode 100644
index 0000000..1ba87f4
--- /dev/null
+++ b/pages/trader/header.trader.html
@@ -0,0 +1,27 @@
+
\ No newline at end of file
diff --git a/pages/trader/main.trader.html b/pages/trader/main.trader.html
new file mode 100644
index 0000000..bc6c7e2
--- /dev/null
+++ b/pages/trader/main.trader.html
@@ -0,0 +1,6 @@
+
+
+ i m the main content in trader page
+
+
+
\ No newline at end of file
diff --git a/pages/trader/sidebar.trader.html b/pages/trader/sidebar.trader.html
new file mode 100644
index 0000000..b0eaa4c
--- /dev/null
+++ b/pages/trader/sidebar.trader.html
@@ -0,0 +1,44 @@
+
+
diff --git a/pages/trader/trader.html b/pages/trader/trader.html
new file mode 100644
index 0000000..e69de29
diff --git a/pages/trader/traderCtrl.js b/pages/trader/traderCtrl.js
new file mode 100644
index 0000000..5c09157
--- /dev/null
+++ b/pages/trader/traderCtrl.js
@@ -0,0 +1,15 @@
+app.controller('traderCtrl', function($scope,$location) {
+
+ $scope.content = "I am not a header";
+ $scope.headerContent = "FoodLoop Admin Portal";
+
+
+ /* This block of code handles recepit management */
+ $scope.receiptNumber = 0;
+
+
+ /* This block of code handles user management */
+ /* Including the management of registered user, trader */
+ $scope.registeredUsers = 1;
+
+});
diff --git a/pages/user/header.user.html b/pages/user/header.user.html
new file mode 100644
index 0000000..54f09c2
--- /dev/null
+++ b/pages/user/header.user.html
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/pages/user/icon1.png b/pages/user/icon1.png
new file mode 100644
index 0000000000000000000000000000000000000000..1d6c1828391fc594b6f9de1001494e645eb0a516
GIT binary patch
literal 13465
zcmZvDc|6oz*!Nh6tflOfowAJVW1`41*{KjQj3ryP#u8;LrK}msSi5C#Ps*Bo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MsYnUIPxemM~H3skY8kpwO
z@wZ!o@q?R>wBW>%<~3vP3wS*FvH*6#g1bkL*mf@nfZBXh$0uJ&4VzO5%BkRXLS!(Y
z2*>dDB{C?1lg8aQvKiL17qvW$mZjJ2k3pS_w~8G+w1GVbSOilztGYN~k7k7SHO=&L
zciCDQ>I}c2YM9Jis!}jg(BQ^*Q;H*Y_ldcECOiQ+0QGF*24$7xh1GjLYnbl`oy$p@
zIj`d%x&(V0%P@QaoNOA@5%!-06RFhYZ2c|c0H(-*CoF-f0J!GD2Gf9pJJDM|RVk^Y
z89+7%o}k|rjNO9u1x%VJ89?n?7x%!
zh1s{Ycy#>HOE6DWmO@?U-ZeHsqtMp*`{1qSi23y3-Y3pDC97DAFdLZAS#&jTh}MRC
zNU2iax5c#K?k=rpy+Ehd2O#@KN2Z$#YlU6?q3+r2CA01p?#$HA04_{@1J@E1YjfwB
z)6_=8*~<_hTL}f}dVrQ4%3Wwe$h7bMX4MViT6yJzgN;qbYZhgAL{B~H5j=JuebQaEhcSXZ}q6o1?fgESVYg9
zXOuO~D2|k$T|1+}qCV+PF1{qon+TADGu;NPh`5SyVR{6o4TE>OyzQzgq*%u6qvI#H
z;pZH)mf%43#(lqMKEd4;<6#>I^DRMn8KVnR%=RX>f|Gx%CSrX(1Z`oSjn`;a>8GHz
zyWB0l#|uK(0^P$q^zRB}pH
+
+
+
+
+
+ Position |
+ Name |
+ Pear points |
+ Retailers spent with |
+ Receipt submitted |
+
+
+
+
+ {{$index + 1}} |
+ {{user.name}} |
+ {{user.pear_points}} |
+ {{user.retailer_spent}} |
+ {{user.receipt_submitted}} |
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main.settings.html b/pages/user/main.settings.html
new file mode 100644
index 0000000..d16c56f
--- /dev/null
+++ b/pages/user/main.settings.html
@@ -0,0 +1,21 @@
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main.user.html b/pages/user/main.user.html
new file mode 100644
index 0000000..493713c
--- /dev/null
+++ b/pages/user/main.user.html
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Pending receipt 5
+
+
+ Submit a receipt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # |
+ Username |
+ Points |
+ Receipts submitted |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/sidebar.user.html b/pages/user/sidebar.user.html
new file mode 100644
index 0000000..8f13d7b
--- /dev/null
+++ b/pages/user/sidebar.user.html
@@ -0,0 +1,30 @@
+
+
diff --git a/pages/user/user.html b/pages/user/user.html
new file mode 100644
index 0000000..b18dbfb
--- /dev/null
+++ b/pages/user/user.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/pages/user/userCtrl.js b/pages/user/userCtrl.js
new file mode 100644
index 0000000..4bfa4cc
--- /dev/null
+++ b/pages/user/userCtrl.js
@@ -0,0 +1,65 @@
+app.controller('userCtrl', function($scope,$location) {
+ $scope.user_rank = 1;
+ $scope.controllby = "user";
+ $scope.username = "John Smith";
+ $scope.email = "test007@test.com";
+ $scope.createChart = function(){
+ var ctx = document.getElementById("myChart");
+ var myChart = new Chart(ctx, {
+ type: 'line',
+ data: {
+ labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
+ datasets: [{
+ label: '# of Votes',
+ data: [12, 19, 3, 5, 2, 3],
+ backgroundColor: [
+ 'rgba(255, 99, 132, 0.2)',
+ 'rgba(54, 162, 235, 0.2)',
+ 'rgba(255, 206, 86, 0.2)',
+ 'rgba(75, 192, 192, 0.2)',
+ 'rgba(153, 102, 255, 0.2)',
+ 'rgba(255, 159, 64, 0.2)'
+ ],
+ borderColor: [
+ 'rgba(255,99,132,1)',
+ 'rgba(54, 162, 235, 1)',
+ 'rgba(255, 206, 86, 1)',
+ 'rgba(75, 192, 192, 1)',
+ 'rgba(153, 102, 255, 1)',
+ 'rgba(255, 159, 64, 1)'
+ ],
+ borderWidth: 1
+ }]
+ },
+ options: {
+ responsive: true,
+ scales: {
+ yAxes: [{
+ ticks: {
+ beginAtZero:true
+ }
+ }]
+ }
+ }
+ });
+ }
+
+
+ $scope.displayChart = function(){
+ // chart sample
+ var flData = [{x: 100, y: 100}, {x: 200, y: 200}, {x: 300, y: 300}];
+ var svg = d3.select("flChart").append("svg")
+ .attr("width","300px").attr("height","300px");
+ svg
+ .selectAll("circle").data(flData)
+ .enter().append("circle")
+ .attr("cx", function(d) { return d.x; })
+ .attr("cy", function(d) { return d.y; })
+ .attr("r", 2.5);
+
+ console.log(svg);
+ }
+
+
+
+});
diff --git a/services/authService.js b/services/authService.js
new file mode 100644
index 0000000..e322f0e
--- /dev/null
+++ b/services/authService.js
@@ -0,0 +1,14 @@
+/* this service handles all the authentication between client and server */
+app.service('authService', function ($http) {
+ // send a login information to server
+ // upon success, set sessionToken and store data in dataService
+ // upon failed, return error
+ this.username = "";
+ this.getUsername = function(){
+ return this.username;
+ }
+
+ this.setUsername = function(setTo){
+ this.username = setTo;
+ }
+});
\ No newline at end of file
diff --git a/services/chartService.js b/services/chartService.js
new file mode 100644
index 0000000..ec9d410
--- /dev/null
+++ b/services/chartService.js
@@ -0,0 +1,56 @@
+/* this service handles all the authentication between client and server */
+app.service('chartService', function () {
+ // send a login information to server
+ // upon success, set sessionToken and store data in dataService
+ // upon failed, return error
+ this.username = "";
+ this.getUsername = function(){
+ return this.username;
+ }
+
+ this.setUsername = function(setTo){
+ this.username = setTo;
+ }
+
+
+ this.createChart = function(){
+ var ctx = document.getElementById("myChart");
+ var myChart = new Chart(ctx, {
+ type: 'line',
+ data: {
+ labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
+ datasets: [{
+ label: '# of Votes',
+ data: [12, 19, 3, 5, 2, 3],
+ backgroundColor: [
+ 'rgba(255, 99, 132, 0.2)',
+ 'rgba(54, 162, 235, 0.2)',
+ 'rgba(255, 206, 86, 0.2)',
+ 'rgba(75, 192, 192, 0.2)',
+ 'rgba(153, 102, 255, 0.2)',
+ 'rgba(255, 159, 64, 0.2)'
+ ],
+ borderColor: [
+ 'rgba(255,99,132,1)',
+ 'rgba(54, 162, 235, 1)',
+ 'rgba(255, 206, 86, 1)',
+ 'rgba(75, 192, 192, 1)',
+ 'rgba(153, 102, 255, 1)',
+ 'rgba(255, 159, 64, 1)'
+ ],
+ borderWidth: 1
+ }]
+ },
+ options: {
+ responsive: true,
+ scales: {
+ yAxes: [{
+ ticks: {
+ beginAtZero:true
+ }
+ }]
+ }
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/services/uploadReceiptService.js b/services/uploadReceiptService.js
new file mode 100644
index 0000000..e5948ea
--- /dev/null
+++ b/services/uploadReceiptService.js
@@ -0,0 +1,6 @@
+/* this service handles receipt upload process */
+app.service('uploadReceiptService', function () {
+ this.uploadReceipt = function(){
+ console.log("Upload successful");
+ }
+});
\ No newline at end of file