Jump to content


Photo

getting approval


  • Please log in to reply
8 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 June 2006 - 02:21 PM

This is primarily about php, because that is what I need to do this. I need to do the regular, get someone to submit a form, it goes into a database after validation. But I need to add an extra feature and I don't know how, I know how to set up a control panel to let him, add and delete data. but what I don't understand now pretty much is I need to get it to where when someone submits the information(it has 3 text fields, and an attachment), the attachment, could be an email video, or anything, I need to be able to take the whole submission, text fields, attachment and everything, and somehow send an email to the client I have to look over and approve, and then if he approves, then accept, and THEN it goes in the database, if he declines, then it discards it

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 June 2006 - 02:54 PM

For what you want to do is actually a simple process.

All it requires for you to do is have an extra coloumn within the table that stores the attacments which is called approved or something similar, which stores an ENUM value thats stores either Y (for yes) or N (for no) and its formated like so:
approved ENUM('Y', 'N') DEFAULT 'N'

Now what you do is this. When a user submits attachments it goes into the database and by defualt MySQL will set value of of approved for that attement to N for no. Then when you go to display the attachements you use query like so:
SELECT * FROM tableName WHERE approved='Y'
What will happen is, mysql will only select the rows from the table that stores the attaments that have approved field set to Y. It will not select any fileds that have it set to N

Now all you need to do is send a link to the Admin of the site that contains a link which changes the value of the approved field for that attachment to Y allowing it to be deisplayed.

and thats it! It requires very basic programming to achieve. Nothing too advanced. All you are doing is comparing values in a database and updating the values accordingly.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 June 2006 - 02:57 PM

hmm, I will give that a try, is there also a way, to have it not add it at all unless he approves, or is that impossible, if it is then I am going to try the first way. There's limited database space on his server, the company he owns has like 2000 sites all on one massive server, and he has each site in a different folder, and a different url pointing to each folder, so he wants to avoid putting anything that is unnessecary in the database, not saying the database can't handle infinite intries, but He wants to keep only the stuff in the database, that he approves of, completely.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 02 June 2006 - 02:58 PM

Another alternative is, create a temporary table where information submitted will be recorded.

Then, if it's approved you rewrite it to another table.
If it's not approved, remove it from the temporary table.

This way you won't have defunct records ;)

EDIT: What I mean with temporary table is not a table that will be created and deleted, but a table made to hold temporary records.
~ D Kuang

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 June 2006 - 03:00 PM

If he declines then have another link which deletes it out of the database. Therefore it doesnt overload the database with data that is not needed.

#6 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 June 2006 - 04:22 PM

I have an idea.
How about this, is this possible.
I have ok, I think I can time scripts.
So I can do this, for instance, I have it send the information to a page, then I validate it, and send a mail script right then with a url to that page. He clicks the url and goes to the page(I will have something in my script to have php wait until he gets to the site), when he gets to that page, then my script will run an if else statement, he has 2 choices after he looks at it, accept/decline. If he accepts it runs a section of my script and then emails the confirmation the person letting them know, emails the confirmation to my client letting him know it worked, and then it adds the information into the database. If he declines the in just runs a section of the script telling him, the information has been declined, and then kills the script, without doing anything further, I would have to use session or something, any advice, do you think this could work.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#7 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 03 June 2006 - 04:58 AM

[!--quoteo(post=379332:date=Jun 2 2006, 09:21 AM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Jun 2 2006, 09:21 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
This is primarily about php, because that is what I need to do this. I need to do the regular, get someone to submit a form, it goes into a database after validation. But I need to add an extra feature and I don't know how, I know how to set up a control panel to let him, add and delete data. but what I don't understand now pretty much is I need to get it to where when someone submits the information(it has 3 text fields, and an attachment), the attachment, could be an email video, or anything, I need to be able to take the whole submission, text fields, attachment and everything, and somehow send an email to the client I have to look over and approve, and then if he approves, then accept, and THEN it goes in the database, if he declines, then it discards it
[/quote]

you could use a confirmation number system..when it emails it emails a number and then they go to another page on ur site and enetr that code brining you to a accept or decline thing.... if decline it removes the data from the database if its accepted you could add another colum in the datbase and make it like active and make it TRUE if they click accept

[!--quoteo(post=379547:date=Jun 2 2006, 11:56 PM:name=legohead6)--][div class=\'quotetop\']QUOTE(legohead6 @ Jun 2 2006, 11:56 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
you could use a confirmation number system..when it emails it emails a number and then they go to another page on ur site and enetr that code brining you to a accept or decline thing.... if decline it removes the data from the database if its accepted you could add another colum in the datbase and make it like active and make it TRUE if they click accept
[/quote]

or bupass the going to your site and entering a code with a link like www.mysite.com/activate.php?activation=<i>the number</i>
"Syntax error" .. WHERE THE **** IS IT?!

#8 jeremywesselman

jeremywesselman
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts
  • LocationIndependence, KY

Posted 03 June 2006 - 05:11 AM

Any feasible way you do it, you ARE going to have to store the data in the database. You need to stop looking for ways around it and just code it for database storage.

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]

#9 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 June 2006 - 01:02 PM

Ok sounds good I will set that up, and I can just have it remove it from the database automatically if he declines.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users