Coder Social home page Coder Social logo

torbengb / toolpool Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 1.58 MB

This is a prototype of a community platform for people to share their tools for DIY home-improvement projects.

License: MIT License

PHP 98.54% CSS 1.44% Batchfile 0.02%
mysql php database diy sharing sharing-platform tools home-improvement

toolpool's People

Contributors

torbengb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

toolpool's Issues

implement login and authentication

  • put a "current user" dropdown on the index page for now.
  • figure out how to remember the user across pages.
  • use this for "loaned to" and for new-tool "owner".

stop using "try ... catch" operators

stop using "try ... catch" operators,
see https://phpdelusions.net/top#try_catch

Catching an exception only to report it is a sure overkill. Simply because uncaught exception is a fatal error already, and it will be reported by itself. Without that blunt try/catch/die sequence, making your code much cleaner.

and https://phpdelusions.net/pdo_examples/insert

Important! You don't have to check the result of execute() (as it is often shown in low-quality tutorials). Such a condition will make no sense, as in case of error, a PDOException will be thrown and the script execution will be terminated, which means such a condition will never reach the else part.
Neither a try ... catch operator should be used, unless you have a specific scenario to handle the error, such as a transaction rollback shown below. Please see the article about error reporting for the details.

Can't add tools: taxonomy cannot be blank?

/tools/new.php

When adding a new item:

  • taxonomy1 is a dropdown so it definitely has some valid value,
  • but taxonomy2..5 must be manually filled with any integer because there is no dropdown implemented.

Integer '1' can be used to indicate '(not specified)', but I can even enter an integer '123456' that is definitely not an existing ID in the taxonomy table.

Tool view is missing an 'edit' link

/tools/view.php?id=7
I see the details of the tool, but there is no 'edit' link even when I am the owner of the item.

To actually edit a tool, I need to go to
/profile/tools.php
and then click the edit link there.

Copy that link into the tool detail screen.

umlauts are displayed wrong

The umlaut characters are wrong.
This is especially seen in the taxonomy.

Perhaps the umlauts are bad in the source files, or the database isn't UTF-8?

register a domain name

toolpool .com is taken, obviously. Find a different name?

alternative TLD's:
.club .community .fun .live .loan .network .one .site .tools .zone

insert as ID=0 not possible

need to revise INIT INSERT SQL statements so they begin from 1, not from 0.
Need to revise code to match this change.

/tools/view.php?id=8 - Fatal error when not logged in

Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 in /home/toolpool_test/domains/toolpool.club/test/tools/view.php:171 Stack trace: #0 /home/toolpool_test/domains/toolpool.club/test/tools/view.php(171): PDOStatement->execute() #1 {main} thrown in /home/toolpool_test/domains/toolpool.club/test/tools/view.php on line 171

improve loan status: reservation | active | overdue | completed

Currently, 'status' is just a BOOL in LOANS that tells that a given loan is active (not returned yet).
Need to change this:

  • Tool itself needs a (redundant?) status [AVAILABLE | LOANED] to indicate whether it's free to loan.

  • If the tool status is AVAILABLE then show the LOAN button.

  • If the tool status is LOANED then show the RESERVE button (waiting list). Perhaps give an indication like MAX(agreedend)?

  • Action LOAN sets the tool status to LOANED, then creates an entry in table LOANS.

  • Action RESERVE creates an entry in table LOANS (#TODO later: the owner should be notified).

  • Action RETURN ends the current loan, then checks for any reservations and picks the one with MIN(agreedstart), then sets that loan to status ACTIVE (#TODO later: the new lender should be notified). If no next loan then set tool status to AVAILABLE.

DHpanel creates databases not in UTF8 format

CREATE DATABASE `foo` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

CREATE TABLE `bar` (
  `baz` int NOT NULL AUTO_INCREMENT
  PRIMARY KEY (`id`)
) DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

DH won't let me run the first statement.

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.