PHP Classes
elePHPant
Icontem

File: update.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  >  Contact Types  >  update.php  >  Download  
File: update.php
Role: Example script
Content type: text/plain
Description: Updates the Contact Type after being edited
Class: Contact Types
Manage a list of types of people contacts
Author: By
Last change:
Date: 4 years ago
Size: 1,947 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 (
"Common_ContactTypes.cls");
Include_Once (
"Panel_ContactType.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) header ("Location:List.php");

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

   
$clsCommon_ContactTypes = gblLadder()->getClass ("Common_ContactType")->ID();

   
// ==========================================
    // Get ContactTypes Folder

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

   
// =======================================
    // Set ContactTypes Folder

   
$fldrContactTypes = New ENetArch_Common_ContactTypes();
   
$fldrContactTypes->setState ($fldrTarget);

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

   
$pnlContactTypes = new ENetArch_Panels_Common_ContactTypes();

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

   
$itmContactTypes = $fldrContactTypes->Item ($nPos, Array (1=>$clsCommon_ContactTypes));

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

   
$pnlContactTypes->setPanelName ("ENetArch.ContactTypes");
   
$pnlContactTypes->getPOST();

   
$pnlContactTypes->updateObject ($itmContactTypes);
   
$itmContactTypes->Store();

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

    return;
}
?>