Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bartjroos committed Feb 21, 2021
0 parents commit 03ed148
Show file tree
Hide file tree
Showing 19 changed files with 914 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore

backend/config.php
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# StoringApp

### Database
In de map `doc` vind je het bestand `storingapp.sql`, deze kun je importeren in phpMyAdmin om de structuur van de database weg te zetten.

### Config
Kopieer voor je begint het bestand `backend/config.example.php` en hernoem de kopie naar `config.php`. De echte config staat in je .gitignore, zodat je databasewachtwoord nooit online komt te staan.

![DeveloperLand](img/logo-big-fill-only.png)
15 changes: 15 additions & 0 deletions backend/config.example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

//IEDER VOOR ZICH:

#### TODO
//Hernoem dit bestand naar 'config.php' en vul jouw eigen database-gegevens in.
//Deze config wordt hierna _niet_ meegestuurd naar je groepsgenoten. Zo kan iedereen zijn eigen wachtwoord, etc. invullen.

$dbHost = 'localhost';
$dbName = 'storingapp';
$dbUser = 'root';
$dbPass = '';

//De url waarop jouw project staat. Géén slash aan het einde.
$base_url = 'http://localhost/storingapp';
8 changes: 8 additions & 0 deletions backend/conn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

//Haal de configuratie op
require_once 'config.php';

//Met behulp van PDO zetten we de connectie op, waarna we met setAttribute de manier van errormeldingen weergeven bepalen.
$conn = new PDO("mysql:host=$dbHost;dbname=$dbName", $dbUser, $dbPass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
17 changes: 17 additions & 0 deletions backend/meldingenController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

//Variabelen vullen
$attractie = $_POST['attractie'];
$capaciteit = $_POST['capaciteit'];
$melder = $_POST['melder'];

echo $attractie . " / " . $capaciteit . " / " . $melder;

//1. Verbinding
require_once 'conn.php';

//2. Query

//3. Prepare

//4. Execute
Loading

0 comments on commit 03ed148

Please sign in to comment.