Login   Register  
PHP Classes
elePHPant
Icontem

File: authRules.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Prakash Khanchandani  >  Table Maintenance  >  authRules.php  >  Download  
File: authRules.php
Role: Example script
Content type: text/plain
Description: 6th level example
Class: Table Maintenance
Manage forms for CRUD MySQL table records
Author: By
Last change:
Date: 1 year ago
Size: 1,217 bytes
 

Contents

Class file image Download
<?php

/**
 * @author Prakash Khanchandani
 * @copyright 2013
 * @program authRules.php 
 * @description authorisation rules maintenance 
 * @specialities    - set constraints
 */


session_start();
require_once (
"classes.php");


function 
createTableObject()
{
    
$obj = new authRulesTable;
    if (
$obj->getListAndColumns() === false)
        return 
false;
    else
        return 
$obj;
}


class 
authRulesTable extends mstrTable
{
    function 
getListAndColumns()
    {
        
$this->tableName 'authRules';

        
/* Initialise the master class with the constraints. Setting bank=412 IS FOR DEMO ONLY.
        In the project in which it is actually used the value comes from the session set at login. */
        
$var = array();
        
$pair[0] = 'bank';
        
$pair[1] = '412';
        
$var[] = $pair;

        
$this->constraints $var;

        
$result parent::getListAndColumns('txnType''slabAmt''nofAuth');
        return 
$result;
    }
}


if (!isset(
$_REQUEST['actn'])) {
    
$obj createTableObject();
} else {
    
/* if the user has taken some action, handle it. */
    
$obj handleRequestOption();
}


$form = new mstrFH($obj);
$form->setDemoNotes(authRulesNotes());
$form->displayForm();
?>