Browse Source

Merge remote-tracking branch 'origin/efe' into yigit

old
Yiğit Çolakoğlu 6 years ago
parent
commit
8c9138777b
17 changed files with 163 additions and 529 deletions
  1. +1
    -8
      MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java
  2. +0
    -109
      MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java
  3. +7
    -0
      MyCity/app/src/main/res/layout/fragment_layout.xml
  4. +0
    -4
      MyCity/app/src/main/res/menu/activity_main_drawer.xml
  5. +55
    -0
      client_side/interface/UserData/denunciation_map.html
  6. +0
    -31
      client_side/interface/UserData/index.html
  7. +0
    -4
      client_side/interface/UserData/index.js
  8. +0
    -333
      client_side/interface/UserData/package-lock.json
  9. +49
    -0
      client_side/interface/UserData/qr_info.html
  10. +24
    -14
      client_side/modules/qr/user_data.py
  11. BIN
      server_side/api/images/muhtarlik.jpg
  12. BIN
      server_side/api/images/park.jpg
  13. +6
    -0
      server_side/api/modules/databases/bus_locations.json
  14. +2
    -2
      server_side/api/modules/databases/denunciations.json
  15. +1
    -1
      server_side/api/modules/databases/users.json
  16. +17
    -20
      server_side/api/modules/databases/votings.json
  17. +1
    -3
      server_side/api/modules/user_info.py

+ 1
- 8
MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java View File

@ -26,7 +26,6 @@ import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import gq.yigit.mycity.navigation.MapsFragment;
import gq.yigit.mycity.navigation.TransitFragment;
import gq.yigit.mycity.tools.*;
import gq.yigit.mycity.tools.WebRequest.responseListener;
@ -49,7 +48,6 @@ public class MainActivity extends AppCompatActivity
OnListFragmentInteractionListener,
MainFragment.OnFragmentInteractionListener,
RateFragment.OnFragmentInteractionListener,
MapsFragment.OnFragmentInteractionListener,
UtilityMain.OnFragmentInteractionListener,
TransitFragment.OnFragmentInteractionListener,
OnFragmentInteractionListener,
@ -176,12 +174,7 @@ public class MainActivity extends AppCompatActivity
fragmentTransaction.replace(R.id.app_bar_main, fragment);
fragmentTransaction.commit();
fragmentTransaction.addToBackStack(null);
} else if (id == R.id.navigation) {
MapsFragment fragment = new MapsFragment();
fragmentTransaction.replace(R.id.app_bar_main, fragment);
fragmentTransaction.commit();
fragmentTransaction.addToBackStack(null);
} else if (id == R.id.rating) {
} else if (id == R.id.rating) {
RateFragment fragment = new RateFragment();
fragmentTransaction.replace(R.id.app_bar_main, fragment);
fragmentTransaction.commit();


+ 0
- 109
MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java View File

@ -1,109 +0,0 @@
package gq.yigit.mycity.navigation;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import gq.yigit.mycity.R;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link MapsFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link MapsFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class MapsFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public MapsFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment MapsFragment.
*/
// TODO: Rename and change types and number of parameters
public static MapsFragment newInstance(String param1, String param2) {
MapsFragment fragment = new MapsFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_maps, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
}

+ 7
- 0
MyCity/app/src/main/res/layout/fragment_layout.xml View File

@ -0,0 +1,7 @@
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment" />

+ 0
- 4
MyCity/app/src/main/res/menu/activity_main_drawer.xml View File

@ -9,10 +9,6 @@
android:id="@+id/transit"
android:icon="@drawable/subway"
android:title="Public Transit"/>
<item
android:id="@+id/navigation"
android:icon="@drawable/navigation"
android:title="Navigation"/>
<item
android:id="@+id/parking"
android:icon="@drawable/parking"


+ 55
- 0
client_side/interface/UserData/denunciation_map.html View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Denunction Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
#map {
height: 100%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 39.92, lng: 32.85},
zoom: 13
});
}
</script>
<script>
var markers = [];
setInterval(function() {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(null);
}
$.get("https://127.0.0.1:5000/denunciations", function(data, status){
if (status == "success") {
data.forEach(function(element) {
var marker = new google.maps.Marker({
position: { lat: element["location"]["latitude"], lng: element["location"]["longitude"]},
map: map,
label: element["priority"].toString(),
title: element["info"]
});
markers.push(marker);
});
}
});
}, 5000);
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBuOC03IHPA_6TPnfk18b0SAgD1uge4-dk&callback=initMap"
async defer></script>
</body>
</html>

+ 0
- 31
client_side/interface/UserData/index.html View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UserInterface</title>
<link rel="stylesheet" href="style.css">
<script src="socket.io/dist/socket.io.js"></script>
<script src = "index.js"></script>
</head>
<body>
<div id = "basics">
<span class="inline"><img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.ELnJq_JhiyfewhCMKOkNfwHaHa%26pid%3DApi&f=1" id="userpic" alt=""></span>
<span class="inline">
<table>
<tr>
<td class="table-header"><solid>Name:</solid></td>
<td id = "name"></td>
<td class="table-header"><solid>TC:</solid></td>
<td id = "tc"></td>
<td class="table-header"><solid>Status:</solid></td>
<td id = "status"></td>
</tr>
<tr>
<td class="table-header"><solid>Health info:</solid></td>
<td id = "health"></td>
</tr>
</table>
</span>
</div>
</body>
</html>

+ 0
- 4
client_side/interface/UserData/index.js View File

@ -1,4 +0,0 @@
var exampleSocket = new WebSocket("ws://localhost:3000", "protocolOne");
exampleSocket.onmessage = function (event) {
console.log(event.data);
}

+ 0
- 333
client_side/interface/UserData/package-lock.json View File

@ -1,333 +0,0 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"accepts": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "2.1.23",
"negotiator": "0.6.1"
}
},
"after": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
},
"arraybuffer.slice": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz",
"integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog=="
},
"async-limiter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
},
"backo2": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
"integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc="
},
"base64-arraybuffer": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
"integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg="
},
"base64id": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
"integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY="
},
"better-assert": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
"integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=",
"requires": {
"callsite": "1.0.0"
}
},
"blob": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
"integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig=="
},
"callsite": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
"integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA="
},
"component-bind": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
"integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E="
},
"component-emitter": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
"integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY="
},
"component-inherit": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
"integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM="
},
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"requires": {
"ms": "2.1.1"
}
},
"engine.io": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.3.2.tgz",
"integrity": "sha512-AsaA9KG7cWPXWHp5FvHdDWY3AMWeZ8x+2pUVLcn71qE5AtAzgGbxuclOytygskw8XGmiQafTmnI9Bix3uihu2w==",
"requires": {
"accepts": "1.3.5",
"base64id": "1.0.0",
"cookie": "0.3.1",
"debug": "3.1.0",
"engine.io-parser": "2.1.3",
"ws": "6.1.4"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"engine.io-client": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.3.2.tgz",
"integrity": "sha512-y0CPINnhMvPuwtqXfsGuWE8BB66+B6wTtCofQDRecMQPYX3MYUZXFNKDhdrSe3EVjgOu4V3rxdeqN/Tr91IgbQ==",
"requires": {
"component-emitter": "1.2.1",
"component-inherit": "0.0.3",
"debug": "3.1.0",
"engine.io-parser": "2.1.3",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
"ws": "6.1.4",
"xmlhttprequest-ssl": "1.5.5",
"yeast": "0.1.2"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"engine.io-parser": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz",
"integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==",
"requires": {
"after": "0.8.2",
"arraybuffer.slice": "0.0.7",
"base64-arraybuffer": "0.1.5",
"blob": "0.0.5",
"has-binary2": "1.0.3"
}
},
"has-binary2": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
"integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==",
"requires": {
"isarray": "2.0.1"
}
},
"has-cors": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
"integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk="
},
"indexof": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
"integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10="
},
"isarray": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
"integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4="
},
"mime-db": {
"version": "1.39.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.39.0.tgz",
"integrity": "sha512-DTsrw/iWVvwHH+9Otxccdyy0Tgiil6TWK/xhfARJZF/QFhwOgZgOIvA2/VIGpM8U7Q8z5nDmdDWC6tuVMJNibw=="
},
"mime-types": {
"version": "2.1.23",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.23.tgz",
"integrity": "sha512-ROk/m+gMVSrRxTkMlaQOvFmFmYDc7sZgrjjM76abqmd2Cc5fCV7jAMA5XUccEtJ3cYiYdgixUVI+fApc2LkXlw==",
"requires": {
"mime-db": "1.39.0"
}
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"negotiator": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
},
"object-component": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
"integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE="
},
"parseqs": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
"integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=",
"requires": {
"better-assert": "1.0.2"
}
},
"parseuri": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
"integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=",
"requires": {
"better-assert": "1.0.2"
}
},
"socket.io": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz",
"integrity": "sha512-wxXrIuZ8AILcn+f1B4ez4hJTPG24iNgxBBDaJfT6MsyOhVYiTXWexGoPkd87ktJG8kQEcL/NBvRi64+9k4Kc0w==",
"requires": {
"debug": "4.1.1",
"engine.io": "3.3.2",
"has-binary2": "1.0.3",
"socket.io-adapter": "1.1.1",
"socket.io-client": "2.2.0",
"socket.io-parser": "3.3.0"
}
},
"socket.io-adapter": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz",
"integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs="
},
"socket.io-client": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.2.0.tgz",
"integrity": "sha512-56ZrkTDbdTLmBIyfFYesgOxsjcLnwAKoN4CiPyTVkMQj3zTUh0QAx3GbvIvLpFEOvQWu92yyWICxB0u7wkVbYA==",
"requires": {
"backo2": "1.0.2",
"base64-arraybuffer": "0.1.5",
"component-bind": "1.0.0",
"component-emitter": "1.2.1",
"debug": "3.1.0",
"engine.io-client": "3.3.2",
"has-binary2": "1.0.3",
"has-cors": "1.1.0",
"indexof": "0.0.1",
"object-component": "0.0.3",
"parseqs": "0.0.5",
"parseuri": "0.0.5",
"socket.io-parser": "3.3.0",
"to-array": "0.1.4"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"socket.io-parser": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz",
"integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==",
"requires": {
"component-emitter": "1.2.1",
"debug": "3.1.0",
"isarray": "2.0.1"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"to-array": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz",
"integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA="
},
"ws": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
"integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
"requires": {
"async-limiter": "1.0.0"
}
},
"xmlhttprequest-ssl": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
"integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4="
},
"yeast": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
"integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk="
}
}
}

+ 49
- 0
client_side/interface/UserData/qr_info.html View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<meta charset="UTF-8">
<title>UserInterface</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id = "basics">
<span class="inline"><img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.ELnJq_JhiyfewhCMKOkNfwHaHa%26pid%3DApi&f=1" id="userpic" alt=""></span>
<br>
<span class="inline">
<table>
<tr>
<td class="table-header"><solid>Name:</solid></td>
<td id = "name"></td>
<td class="table-header"><solid>TC:</solid></td>
<td id = "tc"></td>
</tr>
<tr>
<td class="table-header"><solid>Phone Number:</solid></td>
<td id = "number"></td>
<td class="table-header"><solid>E-Mail:</solid></td>
<td id = "email"></td>
</tr>
<tr>
<td class="table-header"><solid>Health info:</solid></td>
<td id = "health"></td>
</tr>
</table>
</span>
<script>
setInterval(function() {
$.get("http://127.0.0.1:3000/get", function(data, status){
if (status == "success") {
document.getElementById("userpic").src = "https://0.0.0.0:5000" + data["avatar"];
document.getElementById("name").innerHTML = data["realname"];
document.getElementById("tc").innerHTML = data["TC"];
document.getElementById("health").innerHTML = data["health"].join(", ");
document.getElementById("number").innerHTML = data["tel"];
document.getElementById("email").innerHTML = data["email"];
}
});
}, 2000);
</script>
</div>
</body>
</html>

+ 24
- 14
client_side/modules/qr/user_data.py View File

@ -1,6 +1,15 @@
from flask import Flask, jsonify, request, abort
from multiprocessing import Process
import requests
import reader
import json
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
app = Flask(__name__)
user = {}
class Reader():
def __init__(self):
@ -8,23 +17,24 @@ class Reader():
p1 = Process(target=read.detect)
p1.start()
def received(self,data):
print(data)
qr_reader = Reader()
while 1:
continue
def received(self, data):
r = requests.get('https://0.0.0.0:5000/users/{}'.format(data), verify=False)
requests.get('http://0.0.0.0:3000/set', data={'data': r.text})
qr_reader = Reader()
@app.route('/set')
def set_data():
global user
user = json.loads(request.form['data'])
return ''
@app.route('/get')
def get_qr():
if user == {}:
abort(404)
return jsonify(user)
app.run(host='0.0.0.0', port=3000)

BIN
server_side/api/images/muhtarlik.jpg View File

Before After
Width: 600  |  Height: 400  |  Size: 117 KiB

BIN
server_side/api/images/park.jpg View File

Before After
Width: 1024  |  Height: 675  |  Size: 202 KiB

+ 6
- 0
server_side/api/modules/databases/bus_locations.json View File

@ -0,0 +1,6 @@
{
"bus_1": {
"latitude": 39.9404,
"longitude": 32.9101
}
}

+ 2
- 2
server_side/api/modules/databases/denunciations.json View File

@ -15,8 +15,8 @@
"info": "Vandalism",
"priority": "3",
"location": {
"latitude": "35.3",
"longitude": "37.7"
"latitude": 39.95,
"longitude": 32.87
}
}
]

+ 1
- 1
server_side/api/modules/databases/users.json View File

@ -2,7 +2,7 @@
"efe": {
"id": "9vard12ty0ad2yvwp3q53rsf3h43r2vq",
"realname": "Efe Aydın",
"avatar": "/img/user1.png",
"avatar": "/img/9vard12ty0ad2yvwp3q53rsf3h43r2vq.png",
"password": "827ccb0eea8a706c4c34a16891f84e7b",
"email": "efeaydin@mycity.com",
"TC": "11111111111",


+ 17
- 20
server_side/api/modules/databases/votings.json View File

@ -1,43 +1,40 @@
[
{
"id": 1,
"name": "Test Voting",
"desc": "Sample voting description",
"img": "/img/voting.jpg",
"name": "Muhtarl\u0131k Se\u00e7imi",
"desc": "Emek Mahallesi Muhtarl\u0131k Se\u00e7imi",
"img": "/img/muhtarlik.jpg",
"voters": [
"9vard12ty0ad2yvwp3q53rsf3h43r2vq"
],
"votes": {
"1": {
"name": "Sample Vote 1",
"desc": "Sample description",
"votes": 3
"name": "Efe Ayd\u0131n",
"desc": "Mahallenizin gen\u00e7 muhtar aday\u0131...",
"votes": 4
},
"2": {
"name": "Sample Vote 2",
"desc": "Sample description",
"votes": 0
"name": "Zeynep T\u00fcfek\u00e7i",
"desc": "Tecr\u00fcbe ve bilgi sahibi muhtar...",
"votes": 5
}
}
},
{
"id": 2,
"name": "wooting",
"desc": "wooting desc",
"img": "/img/voting.jpg",
"voters": [
"9vard12ty0ad2yvwp3q53rsf3h43r2vq"
],
"name": "Park Ad\u0131 Oylamas\u0131",
"desc": "Mahallemizin yeni park\u0131n\u0131n ad\u0131",
"img": "/img/park.jpg",
"voters": [],
"votes": {
"1": {
"name": "woote 1",
"desc": "woote desc",
"name": "Mutlu Park",
"desc": "Mutlu park, mutlu isimlerle olur.",
"votes": 3
},
"2": {
"id": 1,
"name": "woote 2",
"desc": "woote 3",
"name": "Yi\u011fit \u00c7olako\u011flu Park\u0131",
"desc": "Mahallemizin say\u0131n destek\u00e7isinin ad\u0131",
"votes": 0
}
}


+ 1
- 3
server_side/api/modules/user_info.py View File

@ -3,8 +3,6 @@ import copy
import json
import base64
from api.modules import utils
from flask import Flask, request
@ -53,7 +51,7 @@ class Users(Resource):
class User(Resource):
def get(self, user_id):
try:
user = utils.find_by_id( users.values(), user_id )
user = copy.deepcopy(utils.find_by_id( users.values(), user_id ))
if not user:
raise Exception('User not found!')
del user['password']


Loading…
Cancel
Save