PHP Classes

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

Recommend this page to a friend!
  Classes 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: 9 years ago
Size: 1,755 bytes


Class file image Download
require_once dirname(__FILE__).'/include/';

$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();?>
  <!-- End filter section -->
  <br /><br />
  <br /><br />
  <!-- Start data section -->
  <div id="data">
    <?php if(!isset($_GET['op'])){ ?>
    <?php } else {?>
<h3> Edit Table Content</h3>
    <?php } ?>
if(isset($_GET['row_key']) && isset($_GET['row_val'])){
$rowData->drawAddressBookRows("Addresses", $_GET['row_key'],$_GET['row_val']);
    } else {
<?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>
  <!-- End data section -->
  <br /><br />
  <br /><br />
  <!-- Start insert section -->
  <div id="insert">
  <h3>Insert new row in Address Book table</h3>
->openForm('results', 'insertRow.php', 'POST');
  <?php } ?>
  <!-- End insert section -->
<?php require_once ROOT.'/view/include/';?>