I need some assistance with some mods I've made to dbman. I have setup the description field so that it actively counts the number of characters as they are being entered, through use of JavaScript code, and saves it in $rec{'CharLength'}. I have created a new database field in "default.cfg" called:
CharLength => [13, 'numer', 0, 500, 1, '', '']
The value is placed in that field when the user submits a new record.
I'm not really good with Perl, so here's where I need some help. I'd like to set this up as an Advertisement system, and I'm wanting to charge by the character (like 1 cent per char for instance).
I'd like to have a subroutine executed immediately following "Add a New Record" that will take the CharLength value from the "default.db" file and multiply it by an X Amount and also multiply it by X Number of days (also stored in a field in "default.db), then it'll prompt the user whether they want to accept the cost, or cancel the ad. If accepted, it will then store the computed $ value in an additional field in the current record in "default.db". (I have made the mod that will keep the record for X number of days before auto-deletion.) Then after the amount is computed, it will email the entire contents of the form including the total cost of the Ad.
Also, another item which I need help with. I have also created another field called "Validated" in default.cfg, which is a checkbox field (Yes|No). What I would like to do with that is by default have it so that it's not checked, and therefore the record cannot be viewed by anyone until "admin" modifies the record and checks "Yes" for Validated.
All your help is appreciated. I've learned a lot in the past week through reading up in this area. Keep up the good work!
Frank
CharLength => [13, 'numer', 0, 500, 1, '', '']
The value is placed in that field when the user submits a new record.
I'm not really good with Perl, so here's where I need some help. I'd like to set this up as an Advertisement system, and I'm wanting to charge by the character (like 1 cent per char for instance).
I'd like to have a subroutine executed immediately following "Add a New Record" that will take the CharLength value from the "default.db" file and multiply it by an X Amount and also multiply it by X Number of days (also stored in a field in "default.db), then it'll prompt the user whether they want to accept the cost, or cancel the ad. If accepted, it will then store the computed $ value in an additional field in the current record in "default.db". (I have made the mod that will keep the record for X number of days before auto-deletion.) Then after the amount is computed, it will email the entire contents of the form including the total cost of the Ad.
Also, another item which I need help with. I have also created another field called "Validated" in default.cfg, which is a checkbox field (Yes|No). What I would like to do with that is by default have it so that it's not checked, and therefore the record cannot be viewed by anyone until "admin" modifies the record and checks "Yes" for Validated.
All your help is appreciated. I've learned a lot in the past week through reading up in this area. Keep up the good work!
Frank