PHP Classes

File: complex-example/view/address-book.php

Recommend this page to a friend!
  Packages of none   Raw AJAX Wrapper   complex-example/view/address-book.php   Download  
File: complex-example/view/address-book.php
Role: Example script
Content type: text/plain
Description: Front controller
Class: Raw AJAX Wrapper
Generate JavaScript to send AJAX requests
Author: By
Last change:
Date: 12 years ago
Size: 1,755 bytes
 

 

Contents

Class file image Download
<?php
require_once dirname(__FILE__).'/include/define.inc.php';
require_once ROOT.'/view/include/header.inc.php';

$form    = new PHPClassFormInput();
$rowData = new PHPClassFormAddressBook();
?>
<div id="container">
  <h1>Address Book</h1>
  <!-- Start filter section -->
  <div id="filter">
  <h3>Filter for:</h3>
    <?php $form->openForm('filter', 'address-book.php', 'GET'); ?>
    <?php $form->tagItem('text', 'row_key', $_GET['row_key'], 'Key');?>
    <?php $form->tagItem('text', 'row_val', $_GET['row_val'], 'Value');?>
    <?php $form->closeForm();?>
  </div>
  <!-- End filter section -->
  <br /><br />
  <br /><br />
  <!-- Start data section -->
  <div id="data">
    <?php if(!isset($_GET['op'])){ ?>
    <h3>Addresses:</h3>
    <?php } else {?>
    <h3> Edit Table Content</h3>
    <?php } ?>
    <?php
    if(isset($_GET['row_key']) && isset($_GET['row_val'])){
        $rowData->drawAddressBookRows("Addresses", $_GET['row_key'],$_GET['row_val']);
    } else {
        $rowData->drawAddressBookRows("Addresses");
    }
    ?>
    <?php if(!isset($_GET['op'])){ ?>
    <div style="width:35%;float:left;padding:5px 3px;">
    <h3>Options: </h3>
    <a style="float:left;" href="#" onclick="javascript:location.href='address-book.php?op=edit&row_key=<?php echo $_GET['row_key'];?>&row_val=<?php echo $_GET['row_val'];?>'">Modify Table Content</a>      
    </div>
  </div>
  <!-- End data section -->
  <br /><br />
  <br /><br />
  <!-- Start insert section -->
  <div id="insert">
  <h3>Insert new row in Address Book table</h3>
    <?php 
    $form->openForm('results', 'insertRow.php', 'POST');
    $rowData->insertAddressBookRow();
    $form->closeForm();
    ?>
  </div>
  <?php } ?> 
  <!-- End insert section -->
</div>
<?php require_once ROOT.'/view/include/footer.inc.php';?>