Bläddra i källkod

Added Admin Page

PabloPuig1 2 år sedan
förälder
incheckning
bf998b1492
36 ändrade filer med 953 tillägg och 48716 borttagningar
  1. 0
    14
      .gitignore
  2. 0
    94
      App.js
  3. Binär
      LogoSidename.png
  4. 57
    0
      TPMG.php
  5. 93
    0
      about.php
  6. 35
    0
      addEvent.php
  7. 33
    0
      addUser.php
  8. 0
    33
      app.json
  9. Binär
      assets/adaptive-icon.png
  10. Binär
      assets/favicon.png
  11. Binär
      assets/icon.png
  12. Binär
      assets/logo.png
  13. Binär
      assets/splash.png
  14. 0
    11
      babel.config.js
  15. 28
    0
      deleteEvent.php
  16. 28
    0
      deleteUser.php
  17. 211
    0
      eventsTable.php
  18. 81
    0
      eventslist.php
  19. 80
    0
      joinslist.php
  20. 37
    0
      loginUserAdd.php
  21. 0
    36387
      package-lock.json
  22. 0
    44
      package.json
  23. 0
    16
      routes/drawer.js
  24. 0
    37
      routes/homeStack.js
  25. 0
    69
      screens/about.js
  26. 0
    18
      screens/account.js
  27. 0
    17
      screens/calendar.js
  28. 0
    17
      screens/donar.js
  29. 0
    121
      screens/eventSearch.js
  30. 0
    17
      screens/gallery.js
  31. 0
    24
      screens/solicitar.js
  32. 0
    44
      shared/header.js
  33. 0
    35
      shared/routes.js
  34. 190
    0
      usersTable.php
  35. 80
    0
      userslist.php
  36. 0
    11718
      yarn.lock

+ 0
- 14
.gitignore Visa fil

@@ -1,14 +0,0 @@
1
-node_modules/
2
-.expo/
3
-dist/
4
-npm-debug.*
5
-*.jks
6
-*.p8
7
-*.p12
8
-*.key
9
-*.mobileprovision
10
-*.orig.*
11
-web-build/
12
-
13
-# macOS
14
-.DS_Store

+ 0
- 94
App.js Visa fil

@@ -1,94 +0,0 @@
1
-import * as React from 'react';
2
-import { Button, View, Image} from 'react-native';
3
-import { createDrawerNavigator } from '@react-navigation/drawer';
4
-import { NavigationContainer } from '@react-navigation/native';
5
-import About from './screens/about';
6
-import Gallery from './screens/gallery';
7
-import Calendario from './screens/calendar';
8
-import Donate from './screens/donar';
9
-import Solicitar from './screens/solicitar';
10
-import Account from './screens/account';
11
-import Header from './shared/header';
12
-import EventSearch from './screens/eventSearch';
13
-
14
-const screens = {
15
-  About: {
16
-      screen: About,
17
-      navigationOptions: ({navigation}) => {
18
-          return {
19
-              headerTitle: () => <Header navigation={navigation}/>,
20
-          }
21
-      }
22
-  },
23
-}
24
-
25
-function HomeScreen({ navigation }) {
26
-  return (
27
-    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
28
-      <Button
29
-        onPress={() => navigation.navigate('Notifications')}
30
-        title="Go to notifications"
31
-      />
32
-    </View>
33
-  );
34
-}
35
-
36
-function NotificationsScreen({ navigation }) {
37
-  return (
38
-    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
39
-      <Button onPress={() => navigation.goBack()} title="Go back home" />
40
-    </View>
41
-  );
42
-}
43
-
44
-
45
-
46
-const Drawer = createDrawerNavigator();
47
-
48
-export default function App() {
49
-  return (
50
-    <NavigationContainer >
51
-      <Drawer.Navigator initialRouteName="Home">
52
-        <Drawer.Screen name="Sobre nosotros" component={About} options={({navigation}) => {
53
-          return {
54
-              headerTitle: () => <Header navigation={navigation}/>,
55
-          }
56
-        }}/>
57
-        <Drawer.Screen name="Calendario" component={Calendario} options={({navigation}) => {
58
-          return {
59
-              headerTitle: () => <Header navigation={navigation}/>,
60
-          }
61
-        }}/>
62
-        <Drawer.Screen name="Galeria" component={Gallery} options={({navigation}) => {
63
-          return {
64
-              headerTitle: () => <Header navigation={navigation}/>,
65
-          }
66
-        }}/>
67
-        <Drawer.Screen name="Donar" component={Donate} options={({navigation}) => {
68
-          return {
69
-              headerTitle: () => <Header navigation={navigation}/>,
70
-          }
71
-        }}/>
72
-        <Drawer.Screen name="Solicitar ayuda" component={Solicitar} 
73
-        options={({navigation}) => {
74
-          return {
75
-              headerTitle: () => <Header navigation={navigation}/>,
76
-          }
77
-        }}/>
78
-
79
-        <Drawer.Screen name="Mi cuenta" component={Account} 
80
-        options={({navigation}) => {
81
-          return {
82
-              headerTitle: () => <Header navigation={navigation}/>,
83
-          }
84
-        }}/>    
85
-        <Drawer.Screen name="Event Search" component={EventSearch} 
86
-        options={({navigation}) => {
87
-          return {
88
-              headerTitle: () => <Header navigation={navigation}/>,
89
-          }
90
-        }}/> 
91
-      </Drawer.Navigator>
92
-    </NavigationContainer>
93
-  );
94
-}

Binär
LogoSidename.png Visa fil


+ 57
- 0
TPMG.php Visa fil

@@ -0,0 +1,57 @@
1
+<!-- Home Page for TPMG -->
2
+
3
+<!-- http://https://ada.uprrp.edu/~pablo.puig1/TPMG/TPMG.php -->
4
+
5
+<body style="background-color:#6cd1f4">
6
+
7
+<!--Navigation Bar-->
8
+
9
+<!doctype html>
10
+<html lang="en">
11
+  <head>
12
+    <meta charset="utf-8">
13
+    <meta name="viewport" content="width=device-width, initial-scale=1">
14
+    <title>TPMG admin</title>
15
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
16
+  </head>
17
+    <body>
18
+    <nav class="navbar navbar-expand-lg bg-light">
19
+        <div class="container-fluid">
20
+          <!-- <a class="navbar-brand" href="/">TPMG</a> -->
21
+          <img src="LogoSidename.png" alt="logo" width="200"/>
22
+          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
23
+            <span class="navbar-toggler-icon"></span>
24
+          </button>
25
+          <div class="collapse navbar-collapse" id="navbarSupportedContent">
26
+            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
27
+              <li class="nav-item">
28
+                <a href="TPMG.php" class="nav-link active" aria-current="page">Home</a>
29
+              </li>
30
+              <li class="nav-item">
31
+                <a href="usersTable.php" class="nav-link">Users</a>
32
+              </li>
33
+              <li class="nav-item">
34
+                <a href="eventsTable.php" class="nav-link">Events</a>
35
+              </li>
36
+              <li class="nav-item">
37
+                <a href="about.php" class="nav-link">About</a>
38
+              </li>
39
+            </ul>          
40
+          </div>
41
+        </div>
42
+    </nav>
43
+
44
+<!--Text for the HOME PAGE-->
45
+<br>
46
+<h2>Write text here:</h2>
47
+</br>
48
+
49
+<br/>
50
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
51
+        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
52
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
53
+    </body>
54
+</html>
55
+
56
+
57
+

+ 93
- 0
about.php Visa fil

@@ -0,0 +1,93 @@
1
+<!-- About Page for TPMG -->
2
+
3
+<!-- http://18.212.213.107/~pablo.puig1/about.php -->
4
+
5
+<!-- <html>
6
+<head>
7
+<title>TPMG admin</title>
8
+<div class="header">
9
+  <img src="LogoSideName.png" alt="logo" width="500"/>
10
+</div> -->
11
+
12
+<!--Settings for the page and tables-->
13
+
14
+<!-- <style>
15
+    ul {
16
+        list-style-type: none;
17
+        margin: 0;
18
+        padding: 0;
19
+        overflow: hidden;
20
+    }
21
+
22
+    li {
23
+    float: left;
24
+    }
25
+
26
+    li a {
27
+    display: block;
28
+    padding: 8px;
29
+    }
30
+
31
+    table, th, td {
32
+        border: 1px solid black;
33
+    }
34
+    
35
+    th, td {
36
+        padding: 1px;
37
+    }
38
+</style>
39
+</head> -->
40
+
41
+<!--Page background color-->
42
+
43
+<body style="background-color:#6cd1f4">
44
+
45
+<!--Navigation Bar-->
46
+
47
+<!doctype html>
48
+<html lang="en">
49
+  <head>
50
+    <meta charset="utf-8">
51
+    <meta name="viewport" content="width=device-width, initial-scale=1">
52
+    <title>TPMG admin</title>
53
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
54
+  </head>
55
+    <body>
56
+    <nav class="navbar navbar-expand-lg bg-light">
57
+        <div class="container-fluid">
58
+          <!-- <a class="navbar-brand" href="/">TPMG</a> -->
59
+          <img src="LogoSidename.png" alt="logo" width="200"/>
60
+          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
61
+            <span class="navbar-toggler-icon"></span>
62
+          </button>
63
+          <div class="collapse navbar-collapse" id="navbarSupportedContent">
64
+            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
65
+              <li class="nav-item">
66
+                <a href="TPMG.php" class="nav-link active" aria-current="page">Home</a>
67
+              </li>
68
+              <li class="nav-item">
69
+                <a href="usersTable.php" class="nav-link">Users</a>
70
+              </li>
71
+              <li class="nav-item">
72
+                <a href="eventsTable.php" class="nav-link">Events</a>
73
+              </li>
74
+              <li class="nav-item">
75
+                <a href="about.php" class="nav-link">About</a>
76
+              </li>
77
+            </ul>          
78
+          </div>
79
+        </div>
80
+    </nav>
81
+
82
+<!--Text for the HOME PAGE-->
83
+<br>
84
+<h2>About:</h2>
85
+</br>
86
+
87
+<br/>
88
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
89
+        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
90
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
91
+    </body>
92
+</html>
93
+

+ 35
- 0
addEvent.php Visa fil

@@ -0,0 +1,35 @@
1
+<?PHP
2
+
3
+//---------------
4
+// Connection to server and database
5
+//---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+?>
20
+
21
+<?PHP
22
+$name = $_POST['name'];
23
+$Sdate = $_POST['Sdate'];
24
+$Edate = $_POST['Edate'];
25
+$Pcount = $_POST['Pcount'];
26
+$Plimit = $_POST['Plimit'];
27
+$Desc = $_POST['Desc'];
28
+
29
+$queryAddUser = "INSERT INTO events (name, start_date, end_date, participant_count, participant_limit, description) VALUES ('$name', '$Sdate', '$Edate', '$Pcount', '$Plimit', '$Desc')";
30
+mysqli_query($connection, $queryAddUser);
31
+// $stmtAdd = mysqli_prepare($connection, $queryAddUser);
32
+// mysqli_stmt_execute($stmtAdd);
33
+header("Location: eventsTable.php");
34
+exit();
35
+?>

+ 33
- 0
addUser.php Visa fil

@@ -0,0 +1,33 @@
1
+<?PHP
2
+
3
+//---------------
4
+// Connection to server and database
5
+//---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+?>
20
+
21
+<?PHP
22
+$name = $_POST['username'];
23
+$acc_type = $_POST['ACC'];
24
+$email = $_POST['email'];
25
+$phone_num = $_POST['phone'];
26
+
27
+$queryAddUser = "INSERT INTO users (name, acc_type, email, phone_num) VALUES ('$name', '$acc_type', '$email', '$phone_num')";
28
+mysqli_query($connection, $queryAddUser);
29
+// $stmtAdd = mysqli_prepare($connection, $queryAddUser);
30
+// mysqli_stmt_execute($stmtAdd);
31
+header("Location: usersTable.php");
32
+exit();
33
+?>

+ 0
- 33
app.json Visa fil

@@ -1,33 +0,0 @@
1
-{
2
-  "expo": {
3
-    "name": "TPMG",
4
-    "slug": "TPMG",
5
-    "version": "1.0.0",
6
-    "orientation": "portrait",
7
-    "icon": "./assets/icon.png",
8
-    "userInterfaceStyle": "light",
9
-    "splash": {
10
-      "image": "./assets/splash.png",
11
-      "resizeMode": "contain",
12
-      "backgroundColor": "#ffffff"
13
-    },
14
-    "updates": {
15
-      "fallbackToCacheTimeout": 0
16
-    },
17
-    "assetBundlePatterns": [
18
-      "**/*"
19
-    ],
20
-    "ios": {
21
-      "supportsTablet": true
22
-    },
23
-    "android": {
24
-      "adaptiveIcon": {
25
-        "foregroundImage": "./assets/adaptive-icon.png",
26
-        "backgroundColor": "#FFFFFF"
27
-      }
28
-    },
29
-    "web": {
30
-      "favicon": "./assets/favicon.png"
31
-    }
32
-  }
33
-}

Binär
assets/adaptive-icon.png Visa fil


Binär
assets/favicon.png Visa fil


Binär
assets/icon.png Visa fil


Binär
assets/logo.png Visa fil


Binär
assets/splash.png Visa fil


+ 0
- 11
babel.config.js Visa fil

@@ -1,11 +0,0 @@
1
-module.exports = function(api) {
2
-  api.cache(true);
3
-  return {
4
-    presets: ['babel-preset-expo'],
5
-  };
6
-};
7
-
8
-module.exports = {
9
-  presets: ['module:metro-react-native-babel-preset'],
10
-  plugins: ['react-native-reanimated/plugin'],
11
-};

+ 28
- 0
deleteEvent.php Visa fil

@@ -0,0 +1,28 @@
1
+<?PHP
2
+
3
+//---------------
4
+// Connection to server and database
5
+//---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+?>
20
+
21
+<?PHP
22
+$EID = $_POST['EID'];
23
+
24
+$queryDeleteUser = "DELETE FROM events WHERE EID = $EID";
25
+mysqli_query($connection, $queryDeleteUser);
26
+header("Location: eventsTable.php");
27
+exit();
28
+?>

+ 28
- 0
deleteUser.php Visa fil

@@ -0,0 +1,28 @@
1
+<?PHP
2
+
3
+//---------------
4
+// Connection to server and database
5
+//---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+?>
20
+
21
+<?PHP
22
+$UID = $_POST['UID'];
23
+
24
+$queryDeleteUser = "DELETE FROM users WHERE UID = $UID";
25
+mysqli_query($connection, $queryDeleteUser);
26
+header("Location: usersTable.php");
27
+exit();
28
+?>

+ 211
- 0
eventsTable.php Visa fil

@@ -0,0 +1,211 @@
1
+<!-- Events Page for TPMG -->
2
+
3
+<!-- http://https://ada.uprrp.edu/~pablo.puig1/TPMG/eventsTable.php -->
4
+
5
+<!--Page background color-->
6
+
7
+<body style="background-color:#6cd1f4">
8
+
9
+<!--Navigation Bar-->
10
+
11
+<!doctype html>
12
+<html lang="en">
13
+  <head>
14
+    <meta charset="utf-8">
15
+    <meta name="viewport" content="width=device-width, initial-scale=1">
16
+    <title>TPMG admin</title>
17
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
18
+  </head>
19
+    <body>
20
+    <nav class="navbar navbar-expand-lg bg-light">
21
+        <div class="container-fluid">
22
+          <!-- <a class="navbar-brand" href="/">TPMG</a> -->
23
+          <img src="LogoSidename.png" alt="logo" width="200"/>
24
+          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
25
+            <span class="navbar-toggler-icon"></span>
26
+          </button>
27
+          <div class="collapse navbar-collapse" id="navbarSupportedContent">
28
+            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
29
+              <li class="nav-item">
30
+                <a href="TPMG.php" class="nav-link active" aria-current="page">Home</a>
31
+              </li>
32
+              <li class="nav-item">
33
+                <a href="usersTable.php" class="nav-link">Users</a>
34
+              </li>
35
+              <li class="nav-item">
36
+                <a href="eventsTable.php" class="nav-link">Events</a>
37
+              </li>
38
+              <li class="nav-item">
39
+                <a href="about.php" class="nav-link">About</a>
40
+              </li>
41
+            </ul>          
42
+          </div>
43
+        </div>
44
+    </nav>
45
+
46
+<?PHP
47
+
48
+//---------------
49
+// Connection to server and database
50
+//---------------
51
+
52
+$host = "localhost";
53
+$basedatos = "techos";
54
+$user = "pablo.puig1";
55
+$passw = "9NA3kSExI2fGE6eV";
56
+
57
+try{
58
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
59
+}
60
+catch(Exception $ex){
61
+    print("Error connecting to database: ". $ex->getMessage()) and die();
62
+}
63
+
64
+?>
65
+
66
+<!-- Add User Panel -->
67
+
68
+<div class="container-fluid px-1 py-5 mx-auto">
69
+    <div class="row d-flex justify-content-center">
70
+        <div class="col-xl-7 col-lg-8 col-md-9 col-11 text-center">
71
+            <div class="card">
72
+                <h5 class="text-left mb-4">Enter Information to Add Event:</h5>
73
+                <form class="form-card" method="post" action="./addEvent.php">
74
+                    <div class="row justify-content-between text-left">
75
+                        <div class="row d-flex justify-content-center"> <label class="form-control-label px-3">Event name<span class="text-danger"> *</span></label> <input type="text" id="name" name="name" placeholder="" onblur="validate(1)" style="width: 275px"> </div>
76
+                    </div>
77
+                    <div class="row justify-content-between text-left">
78
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Start date<span class="text-danger"> *</span></label> <input type="text" id="Sdate" name="Sdate" placeholder="YYYY-MM-DD" onblur="validate(2)" > </div>
79
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">End date<span class="text-danger"> *</span></label> <input type="text" id="Edate" name="Edate" placeholder="YYYY-MM-DD" onblur="validate(3)" > </div>
80
+                    </div>
81
+                    <br>
82
+                    <div class="row justify-content-between text-left">
83
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Participant count<span class="text-danger"> *</span></label><input type="int" id="Pcount" name="Pcount" placeholder="" onblur="validate(4)"> </div>
84
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Participant limit<span class="text-danger"> *</span></label> <input type="int" id="Plimit" name="Plimit" placeholder="" onblur="validate(5)"> </div>
85
+                    </div>
86
+                    <br>
87
+                    <div class="row justify-content-between text-left">
88
+                        <div class="row d-flex justify-content-center"> <label class="form-control-label px-3">Event description<span class="text-danger"> *</span></label> <input type="text" id="Desc" name="Desc" placeholder="" onblur="validate(1)" style="width: 900px"> </div>
89
+                    </div>
90
+                    <br>
91
+                    <div class="row justify-content-end">
92
+                        <div class="form-group col-mb-4"> <button type="submit" class="btn btn-primary" value="Add">Add</button> </div>
93
+                    </div>
94
+                </form>
95
+            </div>
96
+        </div>
97
+    </div>
98
+    <br>
99
+<!-- Delete User Panel -->
100
+    <div class="row d-flex justify-content-center">
101
+        <div class="col-xl-7 col-lg-8 col-md-9 col-11 text-center">
102
+            <div class="card">
103
+                <h5 class="text-left mb-4">Enter Event-ID to delete:</h5>
104
+                <form class="form-card" method="post" action="./deleteEvent.php">
105
+                    <div class="row justify-content-between text-left">
106
+                        <div class="row d-flex justify-content-center"> <label class="form-control-label px-3">Event-ID<span class="text-danger"> *</span></label> <input type="int" id="EID" name="EID" placeholder="" onblur="validate(1)" style="width: 275px"> </div>
107
+                    </div>
108
+                    <br>
109
+                    <div class="row justify-content-end">
110
+                        <div class="form-group col-mb-4"> <button type="submit" class="btn btn-primary" value="Delete">Delete</button> </div>
111
+                    </div>
112
+                </form>
113
+            </div>
114
+        </div>
115
+    </div>
116
+  </div>
117
+
118
+<!-- Table  -->
119
+
120
+<style>
121
+
122
+    table{
123
+        border-collapse: collapse;
124
+        width: 75%
125
+    }
126
+    th, td {
127
+        padding: 8px;
128
+        text-align: left;
129
+        border-bottom: 1px solid black;
130
+    }
131
+    rt {
132
+        background-color: #D6EEEE
133
+    }
134
+</style>
135
+<table style="background-color: #ffffff;margin-left:auto;margin-right:auto">
136
+<?PHP
137
+
138
+//---------------
139
+// Table that displays Users in the server
140
+//---------------
141
+
142
+$queryUsers= "SELECT * from events";
143
+$stmt=mysqli_prepare($connection, $queryUsers);
144
+mysqli_stmt_execute($stmt);
145
+
146
+mysqli_stmt_bind_result($stmt, $eid, $name, $start_date, $end_date, $participant_count, $participant_limit, $description);
147
+
148
+//Making table headers
149
+print "<tr>";
150
+print "<td>";
151
+print "Event-ID"; //eid
152
+print "</td>";
153
+print "<td>";
154
+print "Name"; //name
155
+print "</td>";
156
+print "<td>";
157
+print "Start Date"; //start_date
158
+print "</td>";
159
+print "<td>";
160
+print "End Date"; //end_date
161
+print "</td>";
162
+print "<td>";
163
+print "Participant Count"; //participant_count
164
+print "</td>";
165
+print "<td>";
166
+print "Participant Limit"; //participant_limit
167
+print "</td>";
168
+print "<td>";
169
+print "Description"; //description
170
+print "</td>";
171
+print "</tr>";
172
+
173
+while(mysqli_stmt_fetch($stmt)){
174
+    
175
+    print "<tr>";
176
+    print "<td>";
177
+    print $eid; //printing EID
178
+    print "</td>";
179
+    print "<td>";
180
+    print $name; //printing name
181
+    print "</td>";
182
+    print "<td>";
183
+    print $start_date; //printing start_date
184
+    print "</td>";
185
+    print "<td>";
186
+    print $end_date; //printing end_date
187
+    print "</td>";
188
+    print "<td>";
189
+    print $participant_count; //printing participant_count
190
+    print "</td>";
191
+    print "<td>";
192
+    print $participant_limit; //printing participant_limit
193
+    print "</td>";
194
+    print "<td>";
195
+    print $description; //printing description
196
+    print "</td>";
197
+    print "</tr>";
198
+
199
+    print "\n";
200
+}
201
+?>
202
+</table>
203
+
204
+
205
+
206
+<br/>
207
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
208
+        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
209
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
210
+    </body>
211
+</html>

+ 81
- 0
eventslist.php Visa fil

@@ -0,0 +1,81 @@
1
+<?PHP
2
+
3
+// ---------------
4
+// Connection to server and database
5
+// ---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+// //---------------
20
+// // Query and sending results
21
+// //---------------
22
+header('Content-Type: application/json');
23
+
24
+$encodedData=file_get_contents('php://input');
25
+$decodedData=json_decode($encodedData, true);
26
+
27
+$FindEID=$decodedData["FindEID"];
28
+
29
+$query= "SELECT eid, name, start_date, end_date, participant_count, participant_limit, description from events";
30
+$stmt=mysqli_prepare($connection, $query);
31
+mysqli_stmt_execute($stmt);
32
+
33
+mysqli_stmt_bind_result($stmt, $eid, $name, $start_date, $end_date, $participant_count, $participant_limit, $description);
34
+
35
+while(mysqli_stmt_fetch($stmt)){
36
+
37
+    $response[] = array("id"=>$eid, "activityName"=>$name, "subscribed"=> false, "icon"=> 'person-add-outline', "startDate"=>$start_date, "endDate"=>$end_date, "totalSubscribed"=>$participant_count, "maxSubscribed"=>$participant_limit, "activityDescription"=>$description);
38
+
39
+}
40
+
41
+
42
+// if(mysqli_num_rows($stmt)>0)
43
+// {
44
+//     $Row = mysqli_fetch_assoc($stmt);
45
+//     $eid = $Row['eid'];
46
+//     $name = $Row['name'];
47
+//     $start_date = $Row['start_date'];
48
+//     $end_date = $Row['end_date'];
49
+//     $participant_count = $Row['participant_count'];
50
+//     $participant_limit = $Row['participant_limit'];
51
+//     $description = $Row['description'];
52
+// }
53
+// else
54
+// {
55
+//     $eid = "";
56
+//     $name = "";
57
+//     $start_date = "";
58
+//     $end_date = "";
59
+//     $participant_count = "";
60
+//     $participant_limit = "";
61
+//     $description = "";
62
+// }
63
+
64
+
65
+// ----------------------------------------------
66
+// $eid = '1';
67
+// $name = 'testEvent';
68
+// $start_date = '2023-01-07';
69
+// $end_date = '2023-01-23';
70
+// $participant_count = '13';
71
+// $participant_limit = '20';
72
+// $description = 'TEST TEST TEST TEST TEST TEST TEST TEST';
73
+//-----------------------------------------------
74
+
75
+// $response[] = array("eid"=>$eid, "name"=>$name, "Sdate"=>$start_date, "Edate"=>$end_date, "Pcount"=>$participant_count, "Plimit"=>$participant_limit, "description"=>$description);
76
+echo json_encode($response);
77
+// $TPMGJson = json_encode($response);
78
+// file_put_contents('./events.json', $TPMGJson);
79
+// echo $TPMGJson;
80
+
81
+?>

+ 80
- 0
joinslist.php Visa fil

@@ -0,0 +1,80 @@
1
+<?PHP
2
+
3
+// ---------------
4
+// Connection to server and database
5
+// ---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+// //---------------
20
+// // Query and sending results
21
+// //---------------
22
+header('Content-Type: application/json');
23
+
24
+$encodedData=file_get_contents('php://input');
25
+$decodedData=json_decode($encodedData, true);
26
+
27
+$FindUID=$decodedData["FindUID"];
28
+
29
+$query= "SELECT UID, EID from joins";
30
+$stmt=mysqli_prepare($connection, $query);
31
+mysqli_stmt_execute($stmt);
32
+
33
+mysqli_stmt_bind_result($stmt, $uid, $eid);
34
+
35
+while(mysqli_stmt_fetch($stmt)){
36
+
37
+    $response[] = array("uid"=>$uid, "eid"=>$eid);
38
+
39
+}
40
+
41
+// if(mysqli_num_rows($stmt)>0)
42
+// {
43
+//     $Row = mysqli_fetch_assoc($stmt);
44
+//     $eid = $Row['eid'];
45
+//     $name = $Row['name'];
46
+//     $start_date = $Row['start_date'];
47
+//     $end_date = $Row['end_date'];
48
+//     $participant_count = $Row['participant_count'];
49
+//     $participant_limit = $Row['participant_limit'];
50
+//     $description = $Row['description'];
51
+// }
52
+// else
53
+// {
54
+//     $eid = "";
55
+//     $name = "";
56
+//     $start_date = "";
57
+//     $end_date = "";
58
+//     $participant_count = "";
59
+//     $participant_limit = "";
60
+//     $description = "";
61
+// }
62
+
63
+
64
+// ----------------------------------------------
65
+// $eid = '1';
66
+// $name = 'testEvent';
67
+// $start_date = '2023-01-07';
68
+// $end_date = '2023-01-23';
69
+// $participant_count = '13';
70
+// $participant_limit = '20';
71
+// $description = 'TEST TEST TEST TEST TEST TEST TEST TEST';
72
+//-----------------------------------------------
73
+
74
+// $response[] = array("eid"=>$eid, "name"=>$name, "Sdate"=>$start_date, "Edate"=>$end_date, "Pcount"=>$participant_count, "Plimit"=>$participant_limit, "description"=>$description);
75
+echo json_encode($response);
76
+// $TPMGJson = json_encode($response);
77
+// file_put_contents('./events.json', $TPMGJson);
78
+// echo $TPMGJson;
79
+
80
+?>

+ 37
- 0
loginUserAdd.php Visa fil

@@ -0,0 +1,37 @@
1
+<?PHP
2
+
3
+// ---------------
4
+// Connection to server and database
5
+// ---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+// //---------------
20
+// // Query and sending results
21
+// //---------------
22
+header('Content-Type: application/json');
23
+
24
+$encodedData=file_get_contents('php://input');
25
+$decodedData=json_decode($encodedData, true);
26
+
27
+$addName=$decodedData["name"];
28
+$addEmail=$decodedData["email"];
29
+$addPhone=$decodedData["phone"];
30
+
31
+$queryAddUser = "INSERT INTO users (name, email, phone_num) VALUES ('$addName', '$addEmail', '$addPhone')";
32
+mysqli_query($connection, $queryAddUser);
33
+// $stmtAdd = mysqli_prepare($connection, $queryAddUser);
34
+// mysqli_stmt_execute($stmtAdd);
35
+
36
+
37
+?>

+ 0
- 36387
package-lock.json
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 0
- 44
package.json Visa fil

@@ -1,44 +0,0 @@
1
-{
2
-  "name": "tpmg",
3
-  "version": "1.0.0",
4
-  "main": "node_modules/expo/AppEntry.js",
5
-  "scripts": {
6
-    "start": "expo start",
7
-    "android": "expo start --android",
8
-    "ios": "expo start --ios",
9
-    "web": "expo start --web"
10
-  },
11
-  "dependencies": {
12
-    "@emotion/react": "^11.10.5",
13
-    "@emotion/styled": "^11.10.5",
14
-    "@expo/webpack-config": "^0.17.2",
15
-    "@mui/material": "^5.10.15",
16
-    "@react-native-google-signin/google-signin": "^8.2.1",
17
-    "@react-navigation/drawer": "^6.5.1",
18
-    "@react-navigation/native": "^6.0.14",
19
-    "@react-navigation/native-stack": "^6.9.2",
20
-    "body-parser": "^1.20.1",
21
-    "expo": "~47.0.7",
22
-    "expo-dev-client": "~2.0.1",
23
-    "expo-status-bar": "~1.4.2",
24
-    "expo-web-browser": "^12.0.0",
25
-    "express": "^4.18.2",
26
-    "mysql": "^2.18.1",
27
-    "react": "18.1.0",
28
-    "react-dom": "18.1.0",
29
-    "react-native": "0.70.5",
30
-    "react-native-gesture-handler": "^2.8.0",
31
-    "react-native-paper": "^5.0.1",
32
-    "react-native-reanimated": "~2.12.0",
33
-    "react-native-safe-area-context": "4.4.1",
34
-    "react-native-screens": "~3.18.0",
35
-    "react-native-web": "~0.18.9",
36
-    "react-navigation": "^4.4.4",
37
-    "react-navigation-stack": "^2.10.4",
38
-    "yarn": "^1.22.19"
39
-  },
40
-  "devDependencies": {
41
-    "@babel/core": "^7.12.9"
42
-  },
43
-  "private": true
44
-}

+ 0
- 16
routes/drawer.js Visa fil

@@ -1,16 +0,0 @@
1
-import { createDrawerNavigator } from "react-navigation-drawer";
2
-import { createAppContainer } from "react-navigation";
3
-
4
-import HomeStack from './homeStack';
5
-import About from './screens/about';
6
-
7
-const RootDrawerNavigator = createDrawerNavigator ({
8
-    Home: {
9
-        screen: HomeStack,
10
-    },
11
-    About: {
12
-        screen: About,
13
-    }
14
-})
15
-
16
-export default createAppContainer(RootDrawerNavigator);

+ 0
- 37
routes/homeStack.js Visa fil

@@ -1,37 +0,0 @@
1
-import * as React from 'react';
2
-import { createStackNavigator } from "react-navigation-stack";
3
-import { createAppContainer } from "react-navigation";
4
-import About from '../screens/about'
5
-import Gallery from '../screens/gallery'
6
-import Header from '../shared/header';
7
-
8
-const screens = {
9
-    About: {
10
-        screen: About,
11
-        navigationOptions: ({navigation}) => {
12
-            return {
13
-                headerTitle: () => <Header navigation={navigation}/>,
14
-            }
15
-        }
16
-    },
17
-    Gallery: {
18
-        screen: Gallery,
19
-        navigationOptions: ({navigation}) => {
20
-            return {
21
-                headerTitle: () => <Header navigation={navigation}/>,
22
-            }
23
-        }
24
-    },
25
-    Calendar: {
26
-        screen: Calendar,
27
-        navigationOptions: ({navigation}) => {
28
-            return {
29
-                headerTitle: () => <Header navigation={navigation}/>,
30
-            }
31
-        }
32
-    },
33
-}
34
-
35
-const HomeStack = createStackNavigator(screens);
36
-
37
-export default createAppContainer(HomeStack);

+ 0
- 69
screens/about.js Visa fil

@@ -1,69 +0,0 @@
1
-import * as React from 'react';
2
-import { StyleSheet, ScrollView, Text } from 'react-native';
3
-
4
-export default function About() {
5
-    return (
6
-        <ScrollView style={styles.container}>
7
-         <Text style={styles.title}>HISTORIA</Text>
8
-         <Text style={styles.paragraph}>Techos Pa' Mi Gente surgio en el año 2017, luego del huracan Maria. 
9
-         Fue una busqueda por inspirar y apoyar a las comunidades. Que despues de varios meses instalando 
10
-         toldos casi a diario, nuestros voluntarios llegaron a la conclusión de que había que realizar demasiado 
11
-         trabajo de carpintería para instalar un toldo correctamente, pues el daño era muy extenso. Por lo que, 
12
-         se tomó la decisión de comenzar a reparar techos de manera permanente. Para esto, se está siguiendo la: 
13
-         Guía de construcción para casas resistentes a huracanes, creada por el CIAPR Y FEMA luego del huracán Hugo, 
14
-         con actualizaciones en términos de nuevas tecnologías y materiales. Hasta el dia de hoy Techos Pa' Mi Gente 
15
-         se ha converitdo en una organizacion motivada a actuar una base solida de apoyo y compromiso con  las familias 
16
-         afectadas  por desastres naturales.</Text>
17
-         <Text style={styles.title}>MISIÓN, VISIÓN Y VALORES</Text>
18
-         <Text style={styles.subtitle}>Misión</Text>
19
-         <Text style={styles.subtitle}>Techos Pa' Mi Gente</Text>
20
-         <Text style={styles.paragraph}>(TPMG Corp.) es una organización sin fines de lucro dedicada a la construcción 
21
-         de techos dignos y rehabilitación de viviendas en comunidades afectadas por desastres naturales. Contribuye a mejorar 
22
-         la calidad de vida de los individuos que componen estas comunidades. Promueve la autogestión y brinda capacitación en 
23
-         destrezas básicas de construcción para fomentar la resiliencia. </Text>
24
-         <Text style={styles.subtitle}>Visión</Text>
25
-         <Text style={styles.paragraph}>  (TPMG Corp.) como organización del tercer sector aspira a ejercer liderazgo en la 
26
-         construcción de techo dignos, rehabilitación de viviendas y ser promotores de la autogestión, caracterizados por la 
27
-         excelencia en los servicios y la autosuficiencia fiscal.  Se propone a ser uno de los principales  proveedores de 
28
-         recursos para la capacitación y adiestramientos del capital humano que está comprometido con la recuperación a largo 
29
-         plazo ante desastres naturales.</Text>
30
-         <Text style={styles.subtitle}>Valores</Text>
31
-         <Text style={styles.paragraph}>-La solidaridad es nuestro eje. Las necesidades de nuestros compueblanos también son nuestras. </Text>
32
-         <Text style={styles.subtitle}>Empatía</Text>
33
-         <Text style={styles.paragraph}>-Somos sensibles con el prójimo. Fomentamos una cultura de identificamos con el dolor de los 
34
-         más necesitados.</Text>
35
-         <Text style={styles.subtitle}>Transparencia</Text>
36
-         <Text style={styles.paragraph}>-Honradez en nuestros  deberes. Trato honesto y veraz en nuestras operaciones.</Text>
37
-         <Text style={styles.subtitle}>Cuidado al voluntario</Text>
38
-         <Text style={styles.paragraph}>-Los voluntarios son nuestras principales herramientas. Un buen cuidado de nuestros voluntarios 
39
-         significa un trabajo eficiente y eficaz en pro de nuestros beneficiarios.</Text>
40
-         <Text style={styles.subtitle}>Diversidad</Text>
41
-         <Text style={styles.paragraph}>- Somos una entidad abierta sin discrimen de ninguna manera por razón de edad, raza, color, sexo, 
42
-         nacimiento, condición  de veteranos, ideología  politica o religiosa, origen o condición social, orientación sexual o identidad 
43
-         de género, diversidad funcional; ni por ser víctima de violencia doméstica o agresión sexual. En la diversidad está  la inclusión 
44
-         y TPMG es una organización inclusiva.</Text>
45
-        </ScrollView>
46
-    )
47
-}
48
-
49
-const styles = StyleSheet.create({
50
-    container: {
51
-        padding: 24
52
-    },
53
-    title: {
54
-        fontWeight: 'bold',
55
-        fontFamily: "AvenirNext-Bold",
56
-        fontSize: 50
57
-    },
58
-    subtitle: {
59
-        fontWeight: 'bold',
60
-        fontFamily: "Avenir-Black",
61
-        fontSize: 15 
62
-    },
63
-    paragraph: {
64
-        fontWeight: 'normal',
65
-        fontFamily: "Avenir-Black",
66
-        fontSize: 15,
67
-        textAlign: 'justify'
68
-    }
69
-});

+ 0
- 18
screens/account.js Visa fil

@@ -1,18 +0,0 @@
1
-import * as React from 'react';
2
-import {useState} from "react";
3
-import { StyleSheet, View, Text} from 'react-native';
4
-import Header from '../shared/header';
5
-
6
-export default function Account({navigation}) {
7
-    return (
8
-        <View style={styles.container}>
9
-         <Text>Account Screen</Text>
10
-        </View>
11
-    )
12
-}
13
-
14
-const styles = StyleSheet.create({
15
-    container: {
16
-        padding: 24
17
-    }
18
-});

+ 0
- 17
screens/calendar.js Visa fil

@@ -1,17 +0,0 @@
1
-import * as React from 'react';
2
-import { StyleSheet, View, Text } from 'react-native';
3
-import Header from '../shared/header';
4
-
5
-export default function Calendario({navigation}) {
6
-    return (
7
-        <View style={styles.container}>
8
-         <Text>Calendario Screen</Text>
9
-        </View>
10
-    )
11
-}
12
-
13
-const styles = StyleSheet.create({
14
-    container: {
15
-        padding: 24
16
-    }
17
-});

+ 0
- 17
screens/donar.js Visa fil

@@ -1,17 +0,0 @@
1
-import * as React from 'react';
2
-import { StyleSheet, View, Text } from 'react-native';
3
-import Header from '../shared/header';
4
-
5
-export default function Donate({navigation}) {
6
-    return (
7
-        <View style={styles.container}>
8
-         <Text>Donate Screen</Text>
9
-        </View>
10
-    )
11
-}
12
-
13
-const styles = StyleSheet.create({
14
-    container: {
15
-        padding: 24
16
-    }
17
-});

+ 0
- 121
screens/eventSearch.js Visa fil

@@ -1,121 +0,0 @@
1
-import { alignProperty } from '@mui/material/styles/cssUtils';
2
-import React,{Component} from 'react';
3
-import {View, Text, TextInput, Button, StyleSheet} from 'react-native';
4
-
5
-
6
-export default class EventSearch extends Component
7
-{
8
-    constructor(props)
9
-    {
10
-        super(props);
11
-        this.state={UID:'',acc_type:'',name:'',email:'',phone:''};
12
-    }
13
-    SearchEvent=()=>
14
-    {
15
-        var UID=this.state.UID;
16
-
17
-        if(UID.length==0)
18
-        {
19
-            alert('Field is blank');
20
-        }
21
-        else
22
-        { 
23
-            var SearchAPIURL="https://ada.uprrp.edu/~pablo.puig1/TPMG/testusersearch.php";
24
-
25
-            var header={
26
-                    'Accept':'application/json',
27
-                    'Content-Type':'application/json'
28
-            };
29
-
30
-            var Data={
31
-                UID:UID
32
-            };
33
-
34
-            fetch(
35
-                SearchAPIURL,
36
-                {
37
-                    method:'POST',
38
-                    headers:header,
39
-                    body: JSON.stringify(Data)
40
-                }
41
-            )
42
-        
43
-            .then((response)=>response.json())
44
-            // .then(console.log(response))
45
-            .then((response)=>
46
-            {
47
-                this.setState({UID:response[0].id});
48
-                this.setState({acc_type:response[0].acc_type});
49
-                this.setState({name:response[0].name});
50
-                this.setState({email:response[0].email});
51
-                this.setState({phone:response[0].phone});
52
-            })
53
-            .catch((error)=>
54
-            {
55
-                alert("Error: " + error);
56
-            })
57
-        }
58
-
59
-    }
60
-    render()
61
-    {
62
-        return(
63
-            <View style={styles.viewSyle}>
64
-                <TextInput
65
-                    placeholder={"Enter UID"}
66
-                    placeholderTextColor={"red"}
67
-                    keyboardType={"numeric"}
68
-                    style={styles.txtStyle}
69
-                    onChangeText={UID=>this.setState({UID})}
70
-                />
71
-                <Button
72
-                    title={"Find Event"}
73
-                    onPress={this.SearchEvent}
74
-                />
75
-                <Text>{"\n\n"}</Text>
76
-                <TextInput
77
-                    style={styles.txtStyle}
78
-                    value={this.state.UID}
79
-                />
80
-
81
-                <TextInput
82
-                    style={styles.txtStyle}
83
-                    value={this.state.acc_type}
84
-                />
85
-
86
-                <TextInput
87
-                    style={styles.txtStyle}
88
-                    value={this.state.name}
89
-                />
90
-
91
-                <TextInput
92
-                    style={styles.txtStyle}
93
-                    value={this.state.email}
94
-                />
95
-
96
-                <TextInput
97
-                    style={styles.txtStyle}
98
-                    value={this.state.phone}
99
-                />
100
-
101
-            </View>
102
-
103
-        );
104
-    }
105
-}
106
-const styles=StyleSheet.create({
107
-    viewSyle:
108
-    {
109
-        flex:1,
110
-        padding:1,
111
-        marginTop:90
112
-    
113
-    },
114
-    txtStyle:
115
-    {
116
-        borderBottomWidth:1,
117
-        borderBottonColor:'red',
118
-        marginBottom:20
119
-    }
120
-
121
-});

+ 0
- 17
screens/gallery.js Visa fil

@@ -1,17 +0,0 @@
1
-import * as React from 'react';
2
-import { StyleSheet, View, Text } from 'react-native';
3
-import Header from '../shared/header';
4
-
5
-export default function Gallery() {
6
-    return (
7
-        <View style={styles.container}>
8
-         <Text>Gallery Screen</Text>
9
-        </View>
10
-    )
11
-}
12
-
13
-const styles = StyleSheet.create({
14
-    container: {
15
-        padding: 24
16
-    }
17
-});

+ 0
- 24
screens/solicitar.js Visa fil

@@ -1,24 +0,0 @@
1
-import * as React from 'react';
2
-import { StyleSheet, View, Text, Button, Linking } from 'react-native';
3
-import Header from '../shared/header';
4
-// import '../shared/routes.js';
5
-
6
-export default function Solicitar({navigation}) {
7
-    return (
8
-        <View style={styles.container}>
9
-            <Text>Solicitar Screen{"\n\n"}</Text>
10
-                <Button
11
-                    onPress={ () => {Linking.openURL("https://forms.gle/SciwvAdF3TAE6hE97")}}
12
-                    title="Solicita Ayuda"
13
-                    accessibilityLable="Solicitar presionando el botón"
14
-                />
15
-            <Text>{"\n\n"}</Text>
16
-        </View>
17
-    )
18
-}
19
-
20
-const styles = StyleSheet.create({
21
-    container: {
22
-        padding: 24
23
-    },
24
-});

+ 0
- 44
shared/header.js Visa fil

@@ -1,44 +0,0 @@
1
-import React from 'react';
2
-import {StyleSheet, Text, View, Image} from 'react-native';
3
-import { DrawerActions } from 'react-navigation';
4
-import {MaterialIcons} from '@expo/vector-icons';
5
-
6
-export default function Header({navigation}) {
7
-    const openMenu = () => {
8
-        navigation.openDrawer()
9
-    }
10
-    return (
11
-        <View style={styles.header}>
12
-            
13
-            <View>
14
-                <Image 
15
-                style={styles.tinyLogo}
16
-                source={require('../assets/logo.png')} />
17
-            </View>
18
-        </View>
19
-    );
20
-}
21
-
22
-const styles = StyleSheet.create({
23
-    header: {
24
-        width: '100%',
25
-        height: '100%',
26
-        flexDirection: 'row',
27
-        alignItems: 'center',
28
-        justifyContent: 'center',
29
-    },
30
-    headerText: {
31
-        fontweight: 'bold',
32
-        fontSize: 20,
33
-        color: '#333',
34
-        letterSpacing: 1,
35
-    },
36
-    icon: {
37
-        position: 'absolute',
38
-        left: -75
39
-    },
40
-    tinyLogo: {
41
-        width:120,
42
-        height:35,
43
-    },
44
-})

+ 0
- 35
shared/routes.js Visa fil

@@ -1,35 +0,0 @@
1
-var express = require('express');
2
-var app = express();
3
-
4
-var mysql = require('mysql');
5
-var bodyParser = require('body-parser');
6
-
7
-app.use(bodyParser.json({type:'application/json'}));
8
-app.use(bodyParser.urlencoded({extended:true}));
9
-
10
-var con = mysql.createConnectionI({
11
-    host:'ada.uprrp.edu',
12
-    user: 'pablo.puig1',
13
-    password: '9NA3kSExI2fGE6eV',
14
-    database: 'techos'
15
-
16
-});
17
-
18
-var server = app.listen(4545, function(){
19
-    var host = server.address().address
20
-    var host = server.address().port
21
-});
22
-
23
-con.connect(function(error){
24
-    if(error) console.log(error);
25
-    else console.log('connected');
26
-})
27
-
28
-app.get('/users', function(req, res){
29
-    con.query('SELECT * FROM users', function(error, rows, fields){
30
-        if(error) console.log(error)
31
-        else{
32
-            console.log(rows);
33
-        }
34
-    })
35
-})

+ 190
- 0
usersTable.php Visa fil

@@ -0,0 +1,190 @@
1
+<!-- Users table Page for TPMG -->
2
+
3
+<!-- http://https://ada.uprrp.edu/~pablo.puig1/TPMG/userTable.php -->
4
+
5
+<!--Page background color-->
6
+
7
+<body style="background-color:#6cd1f4">
8
+
9
+<!--Navigation Bar-->
10
+
11
+<!doctype html>
12
+<html lang="en">
13
+  <head>
14
+    <meta charset="utf-8">
15
+    <meta name="viewport" content="width=device-width, initial-scale=1">
16
+    <title>TPMG admin</title>
17
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
18
+  </head>
19
+    <nav class="navbar navbar-expand-lg bg-light">
20
+        <div class="container-fluid">
21
+          <!-- <a class="navbar-brand" href="/">TPMG</a> -->
22
+          <img src="LogoSidename.png" alt="logo" width="200"/>
23
+          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
24
+            <span class="navbar-toggler-icon"></span>
25
+          </button>
26
+          <div class="collapse navbar-collapse" id="navbarSupportedContent">
27
+            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
28
+              <li class="nav-item">
29
+                <a href="TPMG.php" class="nav-link active" aria-current="page">Home</a>
30
+              </li>
31
+              <li class="nav-item">
32
+                <a href="usersTable.php" class="nav-link">Users</a>
33
+              </li>
34
+              <li class="nav-item">
35
+                <a href="eventsTable.php" class="nav-link">Events</a>
36
+              </li>
37
+              <li class="nav-item">
38
+                <a href="about.php" class="nav-link">About</a>
39
+              </li>
40
+            </ul>          
41
+          </div>
42
+        </div>
43
+    </nav>
44
+
45
+<?PHP
46
+
47
+//---------------
48
+// Connection to server and database
49
+//---------------
50
+
51
+$host = "localhost";
52
+$basedatos = "techos";
53
+$user = "pablo.puig1";
54
+$passw = "9NA3kSExI2fGE6eV";
55
+
56
+try{
57
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
58
+}
59
+catch(Exception $ex){
60
+    print("Error connecting to database: ". $ex->getMessage()) and die();
61
+}
62
+
63
+?>
64
+
65
+<!-- Add User Panel -->
66
+
67
+<div class="container-fluid px-1 py-5 mx-auto">
68
+    <div class="row d-flex justify-content-center">
69
+        <div class="col-xl-7 col-lg-8 col-md-9 col-11 text-center">
70
+            <div class="card">
71
+                <h5 class="text-left mb-4">Enter Information to Add User:</h5>
72
+                <form class="form-card" method="post" action="./addUser.php">
73
+                    <div class="row justify-content-between text-left">
74
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">First and Last name<span class="text-danger"> *</span></label> <input type="text" id="username" name="username" placeholder="" onblur="validate(1)" > </div>
75
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Account type<span class="text-danger"> *</span></label> <input type="text" id="ACC" name="ACC" placeholder="" onblur="validate(2)" > </div>
76
+                    </div>
77
+                    <br>
78
+                    <div class="row justify-content-between text-left">
79
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Email<span class="text-danger"> *</span></label><input type="text" id="email" name="email" placeholder="" onblur="validate(3)"> </div>
80
+                        <div class="form-group col-sm-6 flex-column d-flex"> <label class="form-control-label px-3">Phone number<span class="text-danger"> *</span></label> <input type="text" id="phone" name="phone" placeholder="" onblur="validate(4)"> </div>
81
+                    </div>
82
+                    <br>
83
+                    <div class="row justify-content-end">
84
+                        <div class="form-group col-mb-4"> <button type="submit" class="btn btn-primary" value="Add">Add</button> </div>
85
+                    </div>
86
+                </form>
87
+            </div>
88
+        </div>
89
+    </div>
90
+    <br>
91
+<!-- Delete User Panel -->
92
+    <div class="row d-flex justify-content-center">
93
+        <div class="col-xl-7 col-lg-8 col-md-9 col-11 text-center">
94
+            <div class="card">
95
+                <h5 class="text-left mb-4">Enter User-ID to delete:</h5>
96
+                <form class="form-card" method="post" action="./deleteUser.php">
97
+                    <div class="row justify-content-between text-left">
98
+                        <div class="row d-flex justify-content-center"> <label class="form-control-label px-3">User-ID<span class="text-danger"> *</span></label> <input type="int" id="UID" name="UID" placeholder="" onblur="validate(1)" style="width: 275px"> </div>
99
+                    </div>
100
+                    <br>
101
+                    <div class="row justify-content-end">
102
+                        <div class="form-group col-mb-4"> <button type="submit" class="btn btn-primary" value="Delete">Delete</button> </div>
103
+                    </div>
104
+                </form>
105
+            </div>
106
+        </div>
107
+    </div>
108
+  </div>
109
+
110
+<!-- Table  -->
111
+
112
+<style>
113
+
114
+    table{
115
+        border-collapse: collapse;
116
+        width: 75%
117
+    }
118
+    th, td {
119
+        padding: 8px;
120
+        text-align: left;
121
+        border-bottom: 1px solid black;
122
+    }
123
+    rt {
124
+        background-color: #D6EEEE
125
+    }
126
+</style>
127
+<table style="background-color: #ffffff;margin-left:auto;margin-right:auto">
128
+<?PHP
129
+
130
+//---------------
131
+// Table that displays Users in the server
132
+//---------------
133
+
134
+$querySeeUsers= "SELECT * from users";
135
+$stmtSee=mysqli_prepare($connection, $querySeeUsers);
136
+mysqli_stmt_execute($stmtSee);
137
+
138
+mysqli_stmt_bind_result($stmtSee, $uid, $acc_type, $name, $email, $phone);
139
+
140
+//Making table headers
141
+print "<tr>";
142
+print "<td>";
143
+print "User-ID"; //User-ID
144
+print "</td>";
145
+print "<td>";
146
+print "Account Type"; //Account type
147
+print "</td>";
148
+print "<td>";
149
+print "Name"; //Name
150
+print "</td>";
151
+print "<td>";
152
+print "Email"; //Email
153
+print "</td>";
154
+print "<td>";
155
+print "Phone"; //Phone
156
+print "</td>";
157
+print "</tr>";
158
+
159
+ //iterating line by line
160
+ while(mysqli_stmt_fetch($stmtSee)){
161
+    
162
+    print "<tr>";
163
+    print "<td>";
164
+    print $uid; //printing UID
165
+    print "</td>";
166
+    print "<td>";
167
+    print $acc_type; //printing account type
168
+    print "</td>";
169
+    print "<td>";
170
+    print $name; //printing name
171
+    print "</td>";
172
+    print "<td>";
173
+    print $email; //printing email
174
+    print "</td>";
175
+    print "<td>";
176
+    print $phone; //printing phone
177
+    print "</td>";
178
+
179
+    print "\n";
180
+}
181
+?>
182
+</table>
183
+
184
+
185
+<br/>
186
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
187
+        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
188
+        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
189
+</body>
190
+</html>

+ 80
- 0
userslist.php Visa fil

@@ -0,0 +1,80 @@
1
+<?PHP
2
+
3
+// ---------------
4
+// Connection to server and database
5
+// ---------------
6
+
7
+$host = "localhost";
8
+$basedatos = "techos";
9
+$user = "pablo.puig1";
10
+$passw = "9NA3kSExI2fGE6eV";
11
+
12
+try{
13
+    $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
14
+}
15
+catch(Exception $ex){
16
+    print("Error connecting to database: ". $ex->getMessage()) and die();
17
+}
18
+
19
+// //---------------
20
+// // Query and sending results
21
+// //---------------
22
+header('Content-Type: application/json');
23
+
24
+$encodedData=file_get_contents('php://input');
25
+$decodedData=json_decode($encodedData, true);
26
+
27
+$FindUID=$decodedData["FindUID"];
28
+
29
+$query= "SELECT UID, acc_type, name, email, phone_num from users";
30
+$stmt=mysqli_prepare($connection, $query);
31
+mysqli_stmt_execute($stmt);
32
+
33
+mysqli_stmt_bind_result($stmt, $uid, $acc_type, $name, $email, $phone);
34
+
35
+while(mysqli_stmt_fetch($stmt)){
36
+
37
+    $response[] = array("id"=>$uid, "accountType"=>$acc_type, "name"=> $name, "email"=> $email, "phone"=>$phone);
38
+
39
+}
40
+
41
+// if(mysqli_num_rows($stmt)>0)
42
+// {
43
+//     $Row = mysqli_fetch_assoc($stmt);
44
+//     $eid = $Row['eid'];
45
+//     $name = $Row['name'];
46
+//     $start_date = $Row['start_date'];
47
+//     $end_date = $Row['end_date'];
48
+//     $participant_count = $Row['participant_count'];
49
+//     $participant_limit = $Row['participant_limit'];
50
+//     $description = $Row['description'];
51
+// }
52
+// else
53
+// {
54
+//     $eid = "";
55
+//     $name = "";
56
+//     $start_date = "";
57
+//     $end_date = "";
58
+//     $participant_count = "";
59
+//     $participant_limit = "";
60
+//     $description = "";
61
+// }
62
+
63
+
64
+// ----------------------------------------------
65
+// $eid = '1';
66
+// $name = 'testEvent';
67
+// $start_date = '2023-01-07';
68
+// $end_date = '2023-01-23';
69
+// $participant_count = '13';
70
+// $participant_limit = '20';
71
+// $description = 'TEST TEST TEST TEST TEST TEST TEST TEST';
72
+//-----------------------------------------------
73
+
74
+// $response[] = array("eid"=>$eid, "name"=>$name, "Sdate"=>$start_date, "Edate"=>$end_date, "Pcount"=>$participant_count, "Plimit"=>$participant_limit, "description"=>$description);
75
+echo json_encode($response);
76
+// $TPMGJson = json_encode($response);
77
+// file_put_contents('./events.json', $TPMGJson);
78
+// echo $TPMGJson;
79
+
80
+?>

+ 0
- 11718
yarn.lock
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil