Login   Register  
PHP Classes
elePHPant
Icontem

File: view.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  >  view.php  >  Download  
File: view.php
Role: Example script
Content type: text/plain
Description: View the Person data
Class: People
Manage user contacts
Author: By
Last change:
Date: 2010-07-09 17:11
Size: 3,987 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_Name.cls");
Include_Once (
"Common_Address.cls");
Include_Once (
"Common_Contacts.cls");
Include_Once (
"Common_Contact.cls");
Include_Once (
"Common_ContactType.cls");
Include_Once (
"Common_ContactMethod.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'];

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

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

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

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

    
$clsCommon_Person gblLadder()->getClass ("Common_ContactType")->ID();
    
$clsCommon_People gblLadder()->getClass ("Common_People")->ID();

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

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

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

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

    
$fldrPerson $fldrPeople->get_Person ($nPos);

    
// ==========================================
    // 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);

    
$pnlPerson->setPanel ($fldrPerson);

?>
    <style>    @import url("styles.css");    </style>
    <script src="jquery_lite.js"></script>
    <script src="trgrs_People.js"></script>
    <script>
        ENetArch.People.nFolderID = <?= $nFolderID ?>;
        ENetArch.People.nPos = <?= $nPos ?>;
    </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 (
"<table ID=\"" $pnlPerson->getPanelID() . "\">\n");
    
$pnlPerson->drawHeader();
    
$pnlPerson->drawPanel();
    print (
"</table>\n");
    print (
"</div>\n");
?>
    <script>
        $("ENetArch_Navigation").style.width = $("ENetArch_People").offsetWidth - 6;
    </script>
<?
}
?>