Skip to content

PHP classes designed for monitoring and evaluation data by The Hunger Project

License

Notifications You must be signed in to change notification settings

thpglobal/thpclasses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classes -- thpclasses has been deprecated

PHP classes designed for monitoring and evaluation data by The Hunger Project but is made public for anyone to easily and quickly establish database apps, on any platform but especially on Google App Engine. It's big advantage is the clever way it uses $_COOKIE variables to make dropdown filter selections sticky.

Latest refactoring - December 2022

These classes have been replaced by those in the Classes repository to be compatible with PHP8.1 and to be utilized using composer (composer require thpglobal/classes) rather than a git submodule.

/includes/thpsecurity

// Any code that is special to your app, like connecting to a database or setting variables used throughout
$today=date("Y-m-d");
$user=$_SESSION["user"]; // set in the built in login scripts
if($user doesn't meet YOUR logical condition) Die("Not authorized, sorry"); 
$admin=if($user meets YOUR logical condition);
$can_edit=if($user meets YOUR logical condition for write permission);
$db = new PDO("mysql:unix_socket=/cloudsql/YOUR_PROJ:YOUR_REGION:YOUR_INSTANCE","YOUR_USER","YOUR_PWD")

/includes/menu.php

include("../thpclasses/includes/menu.php"); // copy the demo menu from the classes

/app.yaml

runtime: php8.1
entrypoint: /app/index.php
handlers:

- url: /static
  static_dir: static

- url: /favicon.ico
  static_files: static/tst.png
  upload: static/tst.png

- url: .*
  script: auto
  secure: always

To automatically create dropdown menus linking to your scripts

  • change includes/menu.php to include("../thpclasses/includes/auto.php");
  • create folders like /app/apples /app/berries
  • create scripts like /app/apples/bartlet.php, /app/apples/green.php, /app/berries/blue.php, /app/berries/goose.php

When deployed, you'll have a runnable app that looks like this:

About

PHP classes designed for monitoring and evaluation data by The Hunger Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •