02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

value="Nope! Just Kidding!" /><br />

<br />

<br />

<br />

<br />

CONFIRM_DELETE;<br />

}<br />

}<br />

?><br />

private function _loadEventData($id=NULL) {...}<br />

private function _createEventObj() {...}<br />

private function _loadEventById($id) {...}<br />

private function _adminGeneralOptions() {...}<br />

private function _adminEntryOptions($id) {...}<br />

Creating a File to Display the Confirmation Form<br />

CHAPTER 5 ■ ADD CONTROLS TO CREATE, EDIT, AND DELETE EVENTS<br />

In order to call the confirmDelete() method, the file confirmdelete.php needs to be created. This file will<br />

reside in the root level of the public folder (/public/confirmdelete.php), <strong>and</strong> it will be very similar to<br />

index.php. This file accomplishes the following tasks:<br />

• Ensures an event ID was passed <strong>and</strong> stored in the $id variable; sends the user to<br />

the main view otherwise.<br />

• Loads the initialization file.<br />

• Creates a new instance of the Calendar object.<br />

• Loads the return value of confirmDelete() into a variable, $markup.<br />

• Defines the $page_title <strong>and</strong> $css_files variables <strong>and</strong> includes the header.<br />

• Outputs the data stored in $markup.<br />

• Outputs the footer.<br />

195

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!