PHP Classes

File: add.php

Recommend this page to a friend!
  Classes of Michael J. Fuhrman   Appointment Calendar   add.php   Download  
File: add.php
Role: Application script
Content type: text/plain
Description: adds an item to the ladder tree
Class: Appointment Calendar
Manage scheduled appointments
Author: By
Last change:
Date: 14 years ago
Size: 2,168 bytes
 

Contents

Class file image Download
<?
function dirPath() { return ("../../"); }

Include_Once (
dirPath() . "Shared/Classes/Ladder/Ladder_Ladder.cls");
Include_Once (
"Common_Panel.cls");
Include_Once (
"Time_Length.cls");
Include_Once (
"Time_Start.cls");
Include_Once (
"Calendar_Week.cls");
Include_Once (
"Common_Appointment.cls");
Include_Once (
"Appointment_Edit.cls");
Include_Once (
dirPath() . "Shared/_app.inc");

Function
php_Main ()
{
   
$nFolderID = 0;
    if (isset (
$_REQUEST ['nFolderID']))
       
$nFolderID = $_REQUEST ['nFolderID'];

   
// ==========================================
    // Validations

   
if ($nFolderID == 0) return;

   
// =======================================
    // Classes

   
$clsCommon_Appointment = gblLadder()->getClass ("Common_Appointment")->ID();

   
// ==========================================
    // Get Appointments Folder

   
$fldrTarget = gblLadder()->getItem ($nFolderID);

   
// ==========================================
    // Get Item

   
$itmAppointment = $fldrTarget->Create_Item ("Appointment", "Test Appointment", $clsCommon_Appointment);

   
// ==========================================
    // Panels

   
$pnlApt = new ENetArch_Panels_Common_Appointment();

   
$pnlTime_Start = new ENetArch_Panels_Common_Time_Start();
   
$pnlTime_Lengths = new ENetArch_Panels_Common_Time_Lengths();

   
$pnlCalendar = new ENetArch_Panels_Common_Calendar_Week();

   
// ==========================================
    // View

   
$pnlCalendar->setPanelName ("ENetArch.Calendar");
   
$pnlCalendar->getSession ();

   
$pnlApt->setPanelName ("ENetArch.Appointments");
   
$pnlApt->setPanelTimes ($pnlTime_Start);
   
$pnlApt->setPanelLengths ($pnlTime_Lengths);
   
$pnlApt->getPOST();

   
$pnlApt->updateObject ($itmAppointment);
   
$itmAppointment->setField ("dTarget", $pnlCalendar->getDate());
   
$itmAppointment->Store();

   
header ("Location:list.php?nFolderID=" . $nFolderID . "&");

    return;

   
// ==========================================
    // for testing

   
print ("<HR>");
    foreach (
$_REQUEST as $key => $value)
        print (
$key . " = " . $value . "<BR>\n");

    print (
"<table>\n");
   
$pnlApt->drawHeader();
   
$pnlApt->drawPanel();
    print (
"</table>");

}
?>