I Was Here – PHP Student Attendance System (Free Download)

I Was Here is an open-source PHP Inventory Management System. Featuring NFC and passwordless login, also allowing students to take attendance by scanning a QR code.

 

TABLE OF CONTENTS

 

DOWNLOAD & INSTALLATION

First, here are the download links and a quick “setup guide” for the impatient folks who don’t want to read through everything.

 

LICENSE & DOWNLOAD

GitHub | SourceForge

I Was here is released under the MIT License. You are free to use it for personal and commercial projects, and modify it as you see fit. On the condition that the software is provided “as-is”. There are no warranties provided and “no strings attached”. Code Boxx and the authors are not liable for any claims, damages, or liabilities.

 

SORRY FOR THE ADS...

But someone has to pay the bills, and sponsors are paying for it. I insist on not turning Code Boxx into a "paid scripts" business, and I don't "block people with Adblock". Every little bit of support helps.

Buy Me A Coffee Code Boxx eBooks

 

REQUIREMENTS

  • LAMP/WAMP/MAMP/XAMPP
  • Apache Mod Rewrite
  • PHP MYSQL PDO Extension
  • PHP OpenSSL Extension
  • At least PHP 8.0

 

 

INSTALLATION

Just copy/unzip into your HTTP folder. Access http://your-site.com in the browser and walk through the installer.

 

HOW TO USE

So far so good? Let us now go through a quick crash course on how to use I Was Here.

 

EQUIPMENT RECOMMENDATIONS

  • NFC tags – 10 pieces of Ntag213 only cost 2-3 bucks. Buy them in bulk, and one piece will only cost a few cents.
  • Label printer – Print QR codes or “student cards” if you want. There are Bluetooth ones that can pair with smartphones.

 

STEP 1) REGISTER USERS

Start by registering the administrators, teachers, and students. You can do it one by one, but the smarter/faster way is to upload a CSV file.

 

 

STEP 2) REGISTER COURSES

Next, register all your available courses – Again, you can do it one by one or upload a CSV file.

 

STEP 3) TIE USERS TO COURSES

Now that the users and courses are registered, tie the users to the respective courses.

 

STEP 4) REGISTER CLASSES

Finally, register the classes for the courses.

 

 

STEP 5) TAKE ATTENDANCE

There are two ways to take attendance:

  • The “old school” way, manually check/uncheck each student.
  • Show a QR code during class – Students will log into the system and scan the QR code.

 

I WAS HERE FAQ

I-Was-Here is “not working”? Here are a few of the common problems and how to “fix” them.

 

I DELETED ALL ADMIN ACCOUNTS

recover.php
require "lib/CORE-Go.php";
$_CORE->load("Users");
$_CORE->Users->save("NAME", "EMAIL", "PASSWORD", "A");

Just create an “account recovery” script to create a new account (or update an existing one). Run and delete this afterward.

 

CHANGED DOMAIN OR PATH

  • Update SITE_NAME and HOST_BASE in lib/CORE-Config.php. Include the path (with a trailing slash) if not deployed at the base URL. E.G. http://site.com/storageboxx/
  • Delete the existing .htaccess file.
  • Create init.php.
    • require "lib/CORE-Go.php";
    • $_CORE->Route->init();
  • Access http://site.com/init.php, this will automatically regenerate .htaccess and update CB-manifest.json.
  • Delete init.php.
  • Clear the service worker, flush the browser cache, and do a hard reload if you want to be “totally safe”.

 

 

PAGES ARE NOT RESOLVING OR SHOWING PROPERLY

  • Make sure that MOD_REWRITE is enabled in Apache.
  • Make sure that AllowOverride is set properly in Apache.
  • If using https://, make sure that your SSL cert and virtual host are properly set.
  • In Mac/Linux, make sure that Apache/PHP has permission to read the files and folders.

Here is a quick “working example” of a test site on my WAMP server:

httpd-vhosts.conf
<VirtualHost site.com:443>
  DocumentRoot "D:\http"
  ServerName site.com:443
  SSLEngine On
  SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
  SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
  <Directory "D:\http">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

 

NOT WORKING. DON’T KNOW WHY.

Open the developer’s console, reload the page, and see the error message.

 

NFC FEATURES ARE “NOT WORKING”!

At the time of writing, Web NFC only works on Android Chrome and Baidu Browser – CanIUse

 

UNABLE TO GENERATE JSON WEB TOKEN KEYS

Make sure that your OpenSSL is properly installed.

  • Linux
    • It is as simple as sudo apt-get install openssl.
    • Or yum install openssl for the CentOS users.
    • Then, php -i | grep -i openssl.
  • Windows – I am using XAMPP and OpenSSL is already included. But a hiccup got me stumped for a while.
    • Start > Search for “system environment” > “Edit the system environment variables” > “Environment variables”.
    • Add a new system variable called OPENSSL_CONF and point it to the openssl.cnf file. By default, it is located at xampp\php\extras\openssl\openssl.cnf.

 

 

FOR THE DEVELOPERS

This section is for the developers, with a couple of development notes for customization.

 

BUILT ON CORE BOXX

 

SUPPORTING MULTIPLE HOST/DOMAIN NAMES

  • In CORE-Config.php, detect the origin and set HOST_BASE accordingly.
  • If you have different paths, you are going to face problems with the manifest. E.G. https://sitea.com and https://siteb.com/storageboxx.
    • You can create multiple CB-manifest.json, each with a different start_url and scope. In TEMPLATE-top.php, point to the “correct manifest” accordingly.
    • Alternatively, generate the manifest dynamically using PHP.

 

 

SETTING TIMEZONES

  • You can change the default timezone in CORE-Config.php, SYS_TZ and SYS_TZ_OFFSET. Beware though, this can mess up the timestamps in the database if you already have entries.
  • If you have to support multiple timezones, it will be wise to keep the system default to UTC. Calculate the offset in PHP or MYSQL queries instead.

 

I WANT TO CHANGE THE DATE FORMAT

  • Login > System Settings > There are 4 “MYSQL date/time format” settings, change them accordingly. These are simply formats for the MYSQL DATE_FORMAT() function.
  • Use the respective date/time format in your SQL – "SELECT DATE_FORMAT(`col`, '".DT_LONG."') FROM `table`".

34 thoughts on “I Was Here – PHP Student Attendance System (Free Download)”

  1. Can you list the number of students in a class and add a note field next to it when the student is away? Add these two functions in the next update

    1. No idea. I have more than 500 tutorials/articles to update on this and other sites. A few features I have in mind – Email/push notifications for absentees, calendar/time table, staff/student card with NFC login, etc…

  2. My site is on HTTPS, but the PWA installer still won’t load. I’m using CRHOME. I believe I have to enable something to work?

    1. I didn’t understand. do you want the data to log into the system or server, or are you asking if I can log into the script normally?

    1. I would just like to know in which file and in which line of your script I add the code to leave the date in Brazilian Portuguese format. Please help me

    2. There are too many to list… Run through all page/PAGE-*.

      P.S. I shall keep this as a feature request, and add a “simple way to update all date formats” in the future. Good luck.

    3. Friend, I know it’s in some PHP script file and there are several, however, I need to know at least what code or command line I need to look for. please be more clear

  3. I’m facing errors in the installation, I already fixed everything that asked for the steps

    could you do the installation for me if i pass my server data?

  4. Hi,
    i’m trying to run this project on a Ubuntu Server 20.04 with Apache2, PHP 8.0 and MySQL.
    The installer finishes without error, but after that, nothing works (404 Not Found for https://…/login)
    The database is populated, so i don’t quite know where to look for the error.
    Any help would be appreciated!
    Thanks in advance!
    Jonas

    1. EDIT – Whoever encounters the same problem in the future, it’s either:

      1) MOD_REWRITE is enabled, but AllowOverride is not properly set.
      2) SSL issues. Apache is not serving the pages and/or static assets properly.

      Will try to add more checks, but fingers crossed. PHP has limited or no access to these Apache settings.

Leave a Comment

Your email address will not be published. Required fields are marked *