Giter Club home page Giter Club logo

the-harvest-club's Introduction

The Harvest Club

This is a contact management system designed for The Harvest Club by a group of students in IN4MATX 117 at UC, Irvine. We have permission to open source our code, but we do not offer support so use at your own risk.

Config

You will need to create a file called include/config.inc.php and define some constants in there. Here is an example:

<?php
define('PAGE_TITLE', 'The Harvest Club');
define('PAGE_QUOTE', 'Share the Bounty');

define('MYSQL_SERVER', 'localhost');
define('MYSQL_USER', 'nyan');
define('MYSQL_PASS', 'd4x9S0Pyo');
define('MYSQL_DB', 'harvest');

define('MAIL_FROM', '[email protected]');
define('MAIL_TO', '[email protected]');
define('MAIL_REPLYTO', '[email protected]');

define('SESSION_MAX_LENGTH', 3600); // logout after inactive for x seconds
?>

Issues

Look at issues to find out what you need to work on

Getting started with git

git clone [email protected]:styfle/The-Harvest-Club.git
git add some-file.php
git commit -m "Added some-file.php that is used for something."
git push origin master

This will clone the repo. Then you add your file to the repo. Commit changes. Then you can push all your changes to github (origin) from your master branch.

the-harvest-club's People

Contributors

dth1112 avatar frozenflare avatar sgtraccoon avatar styfle avatar tilucsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

the-harvest-club's Issues

Handle form submission

You will need to write a separate PHP file or put it at the top of each registration form that handles POST request. Look at examples using PHP's $_POST array.

To see what happens when you submit a form, try using echo print_r($_POST) to see the contents of the array.

Change Password Page

Are we going to allow the user that's logged in to change his/her password? If yes, make a page for it.

Test daily usage

Add/edit/remove stuff. Make sure all the basic functionality is working so a user who has never seen the system doesn't run into any problems.

Truncate notes, smaller fonts

Update columns so they fit properly

  • Truncate notes to x characters (maybe 15?)
  • Smaller font for Email, Phone, and Signed Up
  • Active status: Y or N
  • Standardize row height

Import THC Data

Get the latest data from Google Docs and convert it to SQL inserts. Then insert into the production DB.

Then double check using the CPanel and ensure everything matches up with what was in Google Docs.

Update Exports

update what columns are written on exports for modified tabs (distribution sites, and others?)

Phone Numbers

Format the phone number regular expression for add/edit form inputs and add regex to any other inputs that require it.

Update Registration Forms

Grower Registration Form

  • It looks like the grower still needs to fill out the number of trees and the tree height in order to submit the form. I think we came to the conclusion that these should not be required because if they are registering their vegetables, these questions would not apply.
  • Entering their email also shouldn't be required, as some of our growers are older and do not have email addresses.
  • Under Tree Information, it should say, "How many different types of trees (or other kinds or produce) would you like to register?"
  • Under "Tree Type 1" and before "Tree Type*" should include the line, "Produce other than tree fruits can be registered by selecting "Other" below."

Volunteer Registration Form

  • In italics under "Preferred Days to Volunteer," it should read, "Note: Harvest Events are usually two hours and generally take place over the weekends."

Write a class for sending bulk email

This should be fun. I'm not sure which email addresses to use for testing so if you have a junk address, let me know. I want to do a batch of at least 50. Hopefully site88 has a mailserver we can use.

Tree harvest months need checkboxes

The add/edit form needs to use checkboxes, not a select box for the harvest months. See the registration-grower.php file to see how I did it. Also, remove None as an option from the DB since selecting 0 checkboxes is the same as none.

Change Grower Registration Form

I just got off the phone with Gillian and we decided to make "Number of trees of this type" and "Tree Height" optional. This means the only required field is "Tree Type" and allows the grower to register vegetables (select "other" then enter information in the field for varietal).

Prevent SQL Injection

We need to escape every string from the user that is appended to a SQL query. Anywhere you see $sql there should be no concatenation with $_REQUEST strings as they may contain apostrophes or other SQL queries.

Custom Searches

We need to add a feature for custom searches (things that cannot be searched using the jquery datatable). This will actually need to send an ajax request which will query the DB. I suggest making a search.php with search cases in it similar to ajax. Maybe just include search.php in ajax.php to simplify.

trees - search by harvest months
distrib sites - search city, zip code
events - search date, city

Hide all foreign keys

Hide all fields that have "_id" in the name. Also make sure that all foreign keys in the db have "_id" in the name. For example "source" should be "source_id" in the volunteers table.

Email System and Auto Responses

We need to create an email system that allows for mass emails to be sent "simultaneously" in order to inform volunteers of future events and such. It was mentioned that we may utilize blind-carbon-copies or queued messaging in order to do this efficiently.

Need to implement auto responses. See Auto Responses GWP.doc

Add/Edit/View Forms

We need forms to popup when a record is clicked in the table in order to edit the record (same form is used for adding). Just make a

and give it an id, for example

<form id="volunteer">
<input type="text" name="first_name" required="required" />
<input type="text" name="last_name" required="required" />
</form>

You can add these to their own file and we can merge them later when we have a working backend.

Volunteer Registration Form

Need to complete this html form and save a demo to gh-pages branch.

  • git clone [email protected]:styfle/The-Harvest-Club.git
  • git checkout gh-pages
  • git add volunteer-registration.html
  • git commit -m "Added volunteer registration form."
  • git push origin gh-pages

That should do it!

Complete First Revision DB Schema

It will eventually be changed but for now, we need to write a complete SQL DDL and maybe add some temporary inserts for debugging. Please append to the file I have already uploaded called createTables.sql and write well written comments.

Remember we are going to merge the admins table into the volunteers table and make sure to give them all permissions. Of course, standard volunteers will have no permissions and will have a NULL password.

Export Database

The export function needs to be added to allow Harvest club volunteers and employees with sufficient permissions to export information in the database into Excel. We decided to use CSV in order to accomplish this.

Event Updates

Table

  • Add event number as first field in event table. Probably call the column "Number" or "Event Number"

Dialog

  • Change the field that says "Tree | Number | lbs" to "Tree | Number | Total lbs"
  • Adding a new event without a time doesn't refresh the table for some reason.

Distributions Need Day/Time field

Distributions needs Delivery Days/Hours in addition to Notes.

I would just add a new field at the end of distributions table to avoid breaking anything. Then just add a textarea on the form called "Delivery Day/Hours" and make sure the ajax.php can handle both add and update with the new field.

Update submit forms - use $db object

The Database class has a nice feature to escape your query for you. I haven't tested so tell me if it breaks.

include('include/Database.inc.php');
// say you get $tablename and $first_name from $_POST array
// make sure they are set first. if not die and tell the user why
$sql = "SELECT * FROM %s WHERE first_name = '%s';";
$r = $db->q($sql, array($tablename, $first_name));
// now do whatever you need to with result

That should get you started. See ajax.php for more.

Secondly, I think these can actually be included in the top of the form files by using require_once('include/submit-grower.php') and such. This will perform the checks and print the message on the current page. First fix the $db issue, then we can look at including it.

Select boxes need to use ajax

I found a huge flaw. Since the volunteers and growers are pre-processed, they never get updated unless you do a page refresh. So after adding a new grower...you can't add a tree for them! We need to fix this ASAP!

The forms affected by this are Trees and Events since they both have select boxes!

Add checkboxes to each row

Each row needs a checkbox so users can select multiple rows and perform operations like email and export selected rows.

Update Permissions Table

  1. Exec
    • add/delete users
    • change permissions
    • add/edit/delete donor
    • only ones who can delete
  2. Admin
    • view/add/edit/approve growers volunteers
  3. Harvest Captain
    • add/edit/view events distribution
    • view growers volunteers
    • export growers volunteers
    • notified when grower or volunteer approved by admin (not email, but notification table)
  4. Volunteer
    • none

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.