Login   Register  
PHP Classes
elePHPant
Icontem

File: delete.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael J. Fuhrman  >  Appointment Calendar  >  delete.php  >  Download  
File: delete.php
Role: Application script
Content type: text/plain
Description: Deletes an appiontment from the Ladder Tree
Class: Appointment Calendar
Manage scheduled appointments
Author: By
Last change:
Date: 2010-03-08 06:08
Size: 1,896 bytes
 

Contents

Class file image Download
<?
/*    =======================================
    Copyright 1998 - 2010 - E Net Arch
    This program is distributed under the terms of the GNU
    General Public License (or the Lesser GPL).
    ======================================= */

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_Appointments.cls");
Include_Once (
"Appointment_Edit.cls");
Include_Once (
dirPath() . "Shared/_app.inc");

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

    
$nPos 0;
    if (isset (
$_REQUEST ['nPos']))
        
$nPos $_REQUEST ['nPos'];

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

    
if ($nFolderID == 0) return;
    if (
$nPos == 0) return;

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

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

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

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

    
// =======================================
    // Set Appointments Folder

    
$fldrApts = New ENetArch_Common_Appointments();
    
$fldrApts->setState ($fldrTarget);

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

    
$pnlCalendar = new ENetArch_Panels_Common_Calendar_Week();

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

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

    
$itmAppointment $fldrApts->Item ($nPos, Array (1=>$clsCommon_Appointment));

    
$itmAppointment->Delete();

    
header ("Location:List.php?nFolderID=" $nFolderID "&");
}
?>