The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I achieve this with userspice?
#2
Hi Antonio! You can definitely achieve this with UserSpice and the best thing about it is, you can do anything you want with it! We actually use UserSpice in the Customer Service Department of the company I work for, very heavily. We have it integrated with complex APIs and simple tasks for our agents, and it works excellent!

Might I suggest instead of having a static budget field, you use a ledger table instead, where you use positive and negative entries to balance a users budget.

My proposal:
-Negative is good, if a member deposits 1000 Euros to their budget, their displayed budget is -1000.00. So the entry on the add form would be -1000.
-Entries that are positive are contra-assets so they decrease the amount.
-Table structure:
CREATE TABLE IF NOT EXISTS ledger (
id int(11) NOT NULL,
users_id int(11) NOT NULL,
amount decimal(15,2) NOT NULL,
note varchar(500) NULL);

Any other columns you want to add just plug in there. You should also make a primary key and AI on the table.

Your overview page can use this query:
SELECT users_id, SUM(amount) amount FROM ledger GROUP BY users_id

Your drilldown page would just use SELECT id,amount,note FROM ledger WHERE users_id = ?,[USER ID HERE]

Your user drilldown page would just pre-fill the User ID.

The report I would recommend using the build in messaging system that has email notifications enabled.

Your event system you will need to do a bit more planning on how you want your structure to work.

Heres some documentation on the DB class:
https://userspice.com/documentation-db-class/

I also suggest taking the time to watch through these two playlists Dan created, as they provide a lot of information:
https://www.youtube.com/channel/UCxSAht_..._polymer=1
  Reply


Messages In This Thread
Can I achieve this with userspice? - by Antoh - 02-05-2018, 10:13 AM
Can I achieve this with userspice? - by Brandin - 02-05-2018, 11:14 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)