Skip to content

Most Stupid PHP script to create vouchers and show it in a HTML page (with Controller 7.2.39)

Notifications You must be signed in to change notification settings

aroundmyroom/UnifiVoucher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Unifi Voucher with cloudkey & controller

tested with php 7.3 and Controller 7.2.93 Most Stupid PHP script to create vouchers and show it in a HTML page (with Controller 7.2.39)

This script relies on the PHP Unifi-API class https://github.com/Art-of-WiFi/UniFi-API-client

Make sure that the Unifi-API-Client is installed on your system and make sure you can use the create_vouchers.php and config.php Without that, this stupid PHP script will not work

What does this script

  1. Being stupid as I am totally no coder
  2. Check in the folder if there is a voucher.json if not: create one
  3. for this to work: make sure the folder these scripts are in is writable and you can use php create_vouchers.php (outputting Json)

Modify the create_vouchers.php to your needs and modify the latest lines

//echo json_encode($vouchers, JSON_PRETTY_PRINT);

file_put_contents('/var/www/html/voucher.json', json_encode($vouchers));

disable the json output and make sure it is being written as file as above.

the index.php is the only file being used. Alter to your needs. Changes appreciated the index.php is reading the json file and putting it in a simple HTML table.

Help to modify, clean, adjust, improve is much appreciated a lot of things are not working as I would like it

Caching should not be used, when the voucher is marked as used the file must be removed and the page reloaded automatically ot the index.php etc.

About

Most Stupid PHP script to create vouchers and show it in a HTML page (with Controller 7.2.39)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages