Pro PHP and jQuery by Jason Lengstorf & Keith Wald

Pro PHP and jQuery by Jason Lengstorf & Keith Wald

Author:Jason Lengstorf & Keith Wald
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


Start Time: 2016-01-22 17:00:00

End Time: 2016-01-22 19:00:00

Description: Five-course meal with wine pairings at John’s house

After clicking the “Create new event” button, the calendar is updated with the new event, as shown in Figure 5-3.

Figure 5-3.The new event as it appears when hovered over

Adding a Button to the Main View to Create New Events

To make it easier for your authorized users to create new events, add a button to the calendar that takes the user to the form in admin.php. Do this by creating a new private method called _adminGeneralOptions() in the Calendar class:

<?php

declare(strict_types=1);

class Calendar extends DB_Connect

{

private $_useDate;

private $_m;

private $_y;

private $_daysInMonth;

private $_startDay;

public function __construct($dbo=NULL, $useDate=NULL) {...}

public function buildCalendar() {...}

public function displayEvent($id) {...}

public function displayForm() {...}

public function processForm() {...}

private function _loadEventData($id=NULL) {...}

private function _createEventObj() {...}

private function _loadEventById($id) {...}

/**

* Generates markup to display administrative links

*

* @return string markup to display the administrative links

*/

private function _adminGeneralOptions()

{

/*

* Display admin controls

*/

return <<<ADMIN_OPTIONS

<a href="admin.php" class="admin">+ Add a New Event</a>

ADMIN_OPTIONS;

}

}

?>

Note

Checks to ensure that this button is only displayed to authorized users will be added Chapter 6.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.