I have a user account page which runs the following loop of code:
<?php foreach ( $cv_specs as $cv_spec ) : ?>
<div id="document_summary_container">
<div id="document_text_container">
<div id="document_id">ID: MFI<?php echo $cv_spec->id; ?></div>
<div id="document_title"><?php echo $cv_spec->file_mask; ?></div>
<div id="document_version">V1.<?php echo $doc_row['version_of']; ?></div>
<div id="document_specifics_container"><?php if ($doc_row['load_date']) echo "Document Submitted ".$doc_row['load_date']."<br />";?><?php if ($doc_row['review_complete_date']) echo "Document Reviewed ".$doc_row['review_complete_date']."<br />";?><?php if (($doc_row['review_complete_date']) !== "") echo "Document seen by ".$doc_row['num_reviews']." expert";?><?php if (($doc_row['num_reviews']) != 1) echo "s";?>
</div>
</div>
<div id="document_image_container">
<img src="images/system/a4_logo.jpg" width="134" height="190" /></div>
<div id="document_buttons_container"></div>
</div><!--document_summary_container-->
<?php endforeach?>
In effect this generates a summary of files that the logged in user has uploaded which are reviewed by other users of the site.
I want to add a button for each document listing which when clicked would run a number of queries to delete all the information relevant to that document from the database. Without wanting to sound vague, I'm really not sure of the best way to go about it. I thought about using $_GET actions on the button to invoke a stored procedure based on the parameters submitted but thought this would leave it massively open to user manipulation. Any thoughts appreciated.