Giter Site home page Giter Site logo

elogy / kki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fsi-tue/kki

0.0 0.0 0.0 418 KB

PHP tools for managing the FSI "Kneipen- und Kulturinterface"

Home Page: https://kki.fsi.uni-tuebingen.de/

License: GNU Affero General Public License v3.0

PHP 69.38% Hack 9.38% JavaScript 21.23%

kki's Introduction

Kneipen- und Kulturinterface (PHP files)

Introduction

This PHP script uses an SQL-based RDBMS like MariaDB to manage bars, restaurants, fastfood places etc. across Tübingen. New items can be supplied by users and have to be activated by an admin or moderator before they are displayed. Items can be fully modified prior to activation or deleted.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Installation

Clone the entire repository and upload the contents to a PHP-enabled directory of your choice. Then, enter the credentials to MariaDB inside the file credentials.in in the following format:

[db]
mysql_user=<mysql-username>
mysql_server=<mysql-server>
mysql_db=<database-name>
mysql_pw=<mysql-password>
mysql_table=<table-name>

[pw]
backend=<password hash created using password_hash()>

To create the database schema, navigate your browser to the file _initdb.php.

All activated items are shown in a table in index.php. New entries can be created with create.php or by clicking the button "Neuen Eintrag anlagen".

Creation

The information for a location can be entered via a simple form. The user can supply the following information:

  • name of the location
  • address
  • category (bar, fast food, restaurant, club/disco)
  • price for a "Halbe"
  • price for a large softdrink
  • URL
  • phone number
  • a short description of the location

Additionally, the user can answer the following questions with (yes/no/don't know):

  • Is there food on the menu?
  • Is there a takeaway option?
  • Is beer on the menu?
  • Are cocktails on the menu?
  • Is there a room for smokers?
  • Is there a room for non-smokers?
  • Is there free wifi?

These fields are shown as small icons and marked with either "✔", "×" or "?".

Administration

To review new entries supplied by users or to edit details of a specific location, navigate your browser to index_admin.php. Here you can view all entries as well as edit and delete specific entries. (The user has to be logged in to do that, store the password hash for the corresponding login password inside credentials.ini.

CSV Export

The information inside the database schema can be dumped into a CSV file to be used inside the FSI Anfiheft (or for other purposes). The export can be triggered by clicking "CSV-Export" inside admin.php, which dumps a CSV output into the browser. This is the same as calling dump.php or dump.php?type=echo. If the CSV file should be downloaded instead, call dump.php?type=file and your browser will download the CSV file instead.

Delimiter

The CSV delimiter is set to | per default. To use another delimiter, edit the file dump.php:

$db->dumpToCSV('|'); // change `|` to the delimiter you want to use
[…]
$db->dumpToCSV('|', $filename); // change `|` to the delimiter you want to use

WIP

This project explicitly is a work in progress. Issues that still need to be adressed:

  • Encapsulate handling of POST parameters to avoid code duplications inside create.php and store.php

Acknowledgements

The sorting function uses TableSort.js by Jürgen Berkheimer, released under CC BY-SA 4.0.

kki's People

Contributors

elogy avatar luoe avatar phictionalone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.