Skip to content

Commit

Permalink
First pass of English translation
Browse files Browse the repository at this point in the history
Replaced latin1_german_ci to latin1_general_ci in table collations
Added a commented out statement for default Admin user in inc/database.sql
ZugBahnHof#3
  • Loading branch information
apmuthu committed Jun 27, 2020
1 parent f365417 commit 3a049b6
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 112 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Dies wird ein Kassensystem, basierend auf *Material Design* mit dem Framework *Materialize*.
This will be a POS system based on *[Material Design](https://material.io/)* with the *[Materialize](https://materializecss.com/)* framework.

## Vorraussetzungen:
* Einen Webserver mit **MySQL** und **PHP5+**
* A Webserver with **MySQL** and **PHP5+**

## Setup:
* In MySQL den SQL-Code aus der Datei `database.sql` ausführen, ggf. eigenen Nutzer erstellen.
* Im Ordner `inc` die Datei `config.example.php` in `config.inc.php` umbenennen und mit der Verbindung zur Datenbank ausfüllen.
* Execute the SQL code from the file `inc/database.sql` in MySQL; create your own DB *user* if necessary.
* In the `inc` folder, copy the `config.example.php` file to `config.inc.php` and fill it in with the connection details of the desired MPOS database.
* A default Admin user is available (commented out) in the `inc/database.sql` file with *user* as `[email protected]` and *password* as `password`
* Register a new user at `register.php`
6 changes: 3 additions & 3 deletions inc/config.example.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$db_host = "";
$db_name = "";
$db_user = "";
$db_host = "localhost";
$db_name = "mpos";
$db_user = "root";
$db_pass = "";
$pdo = new PDO( "mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass );
?>
50 changes: 28 additions & 22 deletions inc/database.sql
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
-- 1. Eine Datenbank anlegen, welche mit latin1_german1_ci kollatiert ist!
-- 2. Folgende Codeblöcke nacheinander in dieser Datenbank ausführen
-- 1. Create a latin1 database that is collated with latin1_general_ci for English or utf8 database with utf8_unicode_ci!
-- 2. Execute the following SQL statements in succession in this database
-- 3. Default Admin account is "[email protected]" with password as "password" - commented out
-- 4. Register custom user at register.php

CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`passwort` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`vorname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`nachname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) NOT NULL,
`passwort` varchar(255) NOT NULL,
`vorname` varchar(255) NOT NULL,
`nachname` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL,
`passwortcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`passwortcode` varchar(255) DEFAULT NULL,
`passwortcode_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`), UNIQUE (`email`)
PRIMARY KEY (`id`),
UNIQUE (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


CREATE TABLE `securitytokens` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
`user_id` int(10) NOT NULL,
`identifier` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`securitytoken` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`identifier` varchar(255) NOT NULL,
`securitytoken` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Expand All @@ -30,32 +33,35 @@ CREATE TABLE `money` (
`balance` double NOT NULL,
`updated_by` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;


CREATE TABLE IF NOT EXISTS `articles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`description` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`barcode` int(10) unsigned NOT NULL,
`price` double NOT NULL,
`quantity` int(10) unsigned DEFAULT NULL,
`color` VARCHAR( 7 ) NOT NULL,
PRIMARY KEY (`id`), UNIQUE (`barcode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `company` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`street` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`name` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`number` int(10) unsigned NOT NULL,
`postcode` int(10) unsigned NOT NULL,
`city` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`state` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`email` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`city` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`tel` int(10) unsigned NOT NULL,
`logo` varchar(255) COLLATE latin1_german1_ci NOT NULL,
`logo` varchar(255) NOT NULL,
PRIMARY KEY (`id`), UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

INSERT INTO `MPOS`.`company` (`id`, `name`, `street`, `number`, `postcode`, `city`, `state`, `email`, `tel`, `logo`) VALUES (NULL, 'Name', 'Street', '0', '12345', 'City', 'Singapore', '[email protected]', '1234567890', 'logo/logo.svg');

-- INSERT INTO `users` (`id`, `email`, `passwort`, `vorname`, `nachname`, `created_at`, `updated_at`, `passwortcode`, `passwortcode_time`) VALUES (NULL,'[email protected]','$2y$10$Lao5kA4bLUeNZIOC0HSK2.z8v4lUL3tYQ0Uq6f0YUH1w2UF0JkNVm','System','Administrator','2020-06-26 22:06:59',NULL,NULL,NULL);

INSERT INTO `MPOS`.`company` (`id`, `name`, `street`, `number`, `postcode`, `city`, `state`, `email`, `tel`, `logo`) VALUES (NULL, 'Name', 'Straße', '0', '12345', 'Stadt', 'Deutschland', '[email protected]', '1234567890', 'logo/logo.svg');
13 changes: 5 additions & 8 deletions inc/footer.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3"
href="https://www.php-einfach.de/experte/php-codebeispiele/loginscript/">Loginsystem von Nils
Reimers</a></li>
<li><a class="grey-text text-lighten-3" href="https://next.materializecss.com">Framework
Materialize</a></li>
<li><a class="grey-text text-lighten-3" href="https://github.com/ZugBahnHof/MPOS">Diese Projekt auf
GitHub</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 4</a></li>
href="https://www.php-einfach.de/experte/php-codebeispiele/loginscript/">Login system from Nils Reimers</a></li>
<li><a class="grey-text text-lighten-3" href="https://next.materializecss.com">Framework Materialize</a></li>
<li><a class="grey-text text-lighten-3" href="https://github.com/apmuthu/MPOS">Fork Project on GitHub</a></li>
<li><a class="grey-text text-lighten-3" href="https://github.com/ZugBahnHof/MPOS">German version on GitHub</a></li>
</ul>
</div>

</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2018 by Julian Leucker
© 2018 by Julian Leucker<br>© 2020 by Ap.Muthu
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions inc/header.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,24 @@
<a href="index.php" class="brand-logo">MPOS</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Verkaufen"
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Sales"
href="shop_form.php">
<i class="material-icons">shopping_cart</i>
</a>
</li>
<li>
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Artikel" href="articles.php">
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Item" href="articles.php">
<i class="material-icons">widgets</i>
</a>
</li>
<li>
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Kontostand"
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Cash Balance"
href="money.php">
<i class="material-icons">attach_money</i>
</a>
</li>
<li>
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Einstellungen"
<a class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Settings"
href="settings.php">
<i class="material-icons">settings</i>
</a>
Expand Down
10 changes: 3 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?php
$site_title = "Startseite";
$site_title = "Home";
include 'inc/header.inc.php';
?>
<h1 class="<?= $site_color_accent_text ?>">Herzlich Willkommen bei MPOS!</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h1 class="<?= $site_color_accent_text ?>">Cordial Welcome to MPOS!</h1>
<p>MPOS is a mobile centric Point of Sale application running on a PHP/MySQL enabled Web Server.</p>
<?php
include 'inc/footer.inc.php';
?>
8 changes: 4 additions & 4 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
$result = $statement->execute( array( 'email' => $email ) );
$user = $statement->fetch();

//Überprüfung des Passworts
//Checking the password
if ( $user !== false && password_verify( $passwort, $user['passwort'] ) ) {
$_SESSION['userid'] = $user['id'];
$_SESSION['site'] = "mpos";

//Möchte der Nutzer angemeldet beleiben?
//Does the user want to stay logged in and be remembered for the session?
if ( isset( $_POST['angemeldet_bleiben'] ) ) {
$identifier = random_string();
$securitytoken = random_string();
Expand Down Expand Up @@ -70,14 +70,14 @@

<div class="input-field col s12">
<input type="password" name="passwort" id="inputPassword" class="validate" required>
<label for="inputPassword">Passwort</label>
<label for="inputPassword">Password</label>
</div>

<p>
<label>
<input type="checkbox" value="remember-me" id="remember-me" name="angemeldet_bleiben" value="1"
checked="checked"/>
<span>Angemeldet bleiben?</span>
<span>Remain signed in?</span>
</label>
</p>

Expand Down
Loading

0 comments on commit 3a049b6

Please sign in to comment.