Login   Register  
PHP Classes
elePHPant
Icontem

File: new.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  >  People  >  new.php  >  Download  
File: new.php
Role: Example script
Content type: text/plain
Description: Draws a form to allow new People to be added to the People Folder
Class: People
Manage user contacts
Author: By
Last change:
Date: 2010-07-09 16:56
Size: 3,536 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 (
"Panel_Panel.cls");
Include_Once (
"Common_People.cls");
Include_Once (
"Common_Person.cls");
Include_Once (
"Common_ContactTypes.cls");
Include_Once (
"Common_ContactTypes_Ref.cls");
Include_Once (
"Panel_Person.cls");
Include_Once (
"Panel_Name.cls");
Include_Once (
"Panel_Address.cls");
Include_Once (
"Panel_Contacts.cls");
Include_Once (
"Panel_Contact.cls");
Include_Once (
"Panel_ContactTypes.cls");
Include_Once (
"Panel_ContactMethod.cls");
Include_Once (
dirPath() . "Shared/_app.inc");

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

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

    
if ($nFolderID == 0) return;

    
// ==========================================
    // Get Person Folder

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

    
// =======================================
    // Set Person Folder

    
$fldrPeople = New ENetArch_Common_People();
    
$fldrPeople->setState ($fldrTarget);
    
$fdlrContactTypes $fldrPeople->get_ContactTypes();

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

    
$pnlPerson = new ENetArch_Panels_Common_Person();
    
$pnlName = new ENetArch_Panels_Common_Name();
    
$pnlAddress = new ENetArch_Panels_Common_Address();
    
$pnlContacts = new ENetArch_Panels_Common_Contacts();
    
$pnlContact = new ENetArch_Panels_Common_Contact();
    
$pnlContactTypes = new ENetArch_Panels_Common_ContactTypes();
    
$pnlContactMethod = new ENetArch_Panels_Common_ContactMethod();

    
$pnlContactTypes->setFolder ($fdlrContactTypes);

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

    
$pnlPerson->setPanelName ("ENetArch.Person");
    
$pnlPerson->setPanel_Name ($pnlName);
    
$pnlPerson->setPanel_Address ($pnlAddress );
    
$pnlPerson->setPanel_Contacts ($pnlContacts);
    
$pnlContacts->setPanel_Contact ($pnlContact );
    
$pnlContact->setPanel_Type ($pnlContactTypes);
    
$pnlContact->setPanel_Method ($pnlContactMethod);

?>
    <style>    @import url("styles.css");    </style>
    <script src="jquery_lite.js"></script>
    <script src="trgrs_People.js"></script>
    <script>
        ENetArch.People.nFolderID = <?= $nFolderID ?>;
    </script>
<?
?>
    <div ID="ENetArch_Navigation">
    <a href="javascript:void(0);" onClick="ENetArch.People.List ();">List</a> |
    <a href="javascript:void(0);" onClick="ENetArch.People.New ();">New</a> |
    <a href="javascript:void(0);" onClick="ENetArch.People.View ();">View</a> |
    <a href="javascript:void(0);" onClick="ENetArch.People.Edit ();">Edit</a> |
    <a href="javascript:void(0);" onClick="ENetArch.People.Delete ();">Delete</a>
    </div>
<?
    
print ("<div ID=\"ENetArch_People\">\n");
    print (
"<form name=\"ENetArch_Person_Form\" ID=\"ENetArch_Person_Form\"
        onSubmit =\"ENetArch.People.AddNew(this)\" >\n"
);
    print (
"<table ID=\"" $pnlPerson->getPanelID() . "\">\n");
    
$pnlPerson->drawHeader();
    
$pnlPerson->drawPanel_Edit();
    print (
"</table>\n");
    print (
"<input type=\"submit\" name=\"submit\" value=\"submit\">\n");
    print (
"</form>\n");
    print (
"</div>\n");
?>
    <script>
        $("ENetArch_Navigation").style.width = $("ENetArch_People").offsetWidth - 6;
    </script>
<?
}
?>