Tương tác giữa PHP và jQuery - part 19

CHAPTER 5 ■ ADD CONTROLS TO CREATE, EDIT, AND DELETE EVENTS Save this file, and then navigate to http://localhost/ and create a new event with the following information: • • • • Event Title: Dinner Party Start Time: 2010-01-22 17:00:00 End Time: 2010-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 (see 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,. | CHAPTER 5 ADD CONTROLS TO CREATE EDIT AND DELETE EVENTS Save this file and then navigate to http localhost and create a new event with the following information Event Title Dinner Party Start Time 2010-01-22 17 00 00 End Time 2010-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 see 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 181 CHAPTER 5 ADD CONTROLS TO CREATE EDIT AND DELETE EVENTS php 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 class admin Add a New Event a ADMIN OPTIONS 182 CHAPTER 5 ADD CONTROLS TO CREATE EDIT AND DELETE EVENTS Note Checks to ensure that this button is only displayed to authorized users will be added Chapter 6. Next modify the buildCalendar method to call your new _adminGeneralOptions method by inserting the following bold code public function buildCalendar To save space the bulk of this method has been omitted Close the final unordered list html . n t ul n n If logged in display the admin options admin this- _adminGeneralOptions Return the markup for .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.