Pas 3.6 > Pas / Events / Mydb.checkRequired.inc.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Pas 3.6

Download:
pas-3.6.zip

Category:
Development Tools

Archive Content:

Pas > Class > Mysql

Pas > Class

Pas > Class > Odbc

Pas > Class > Pgsql

Pas

Pas > Events

Pas > Registry

Pas > Scripts

Pas > Sitetemplate

Pas > Sitetemplate > Includes

Pas > Sitetemplate > Report

Pas > Templates

Pas > Templates > Packagedefaultstructure > Docs > Defaultstructure

Pas > Templates > Packagedefaultstructure

Mydb.checkRequired.inc.php:


<?php 
// Copyright 2001 - 2004 SQLFusion LLC           info <at> sqlfusion <dot> com

/**   Event Mydb.checkRequired
  *
  * Check that all the field set as required are field in.
  * If not it sets the doSave param at "no" to block the save and
  * call the message page.
  * <br>- param array fields that contains the content of the fields to check
  * <br>- param array required indexed on fields name and contains value "yes"
  * <br>Option:
  * <br>- param string errorpage page to display the error message
  * @package PASEvents
  * @author Philippe Lewicki  <phil <at> sqlfusion <dot> com>
  * @copyright  SQLFusion LLC 2001-2004
  * @version 3.0
  */
  /**
  $strRequiredField = "Vous devez remplire to les champs obligatoire" ;
   */
 
global $strRequiredField;
 if (!isset(
$strRequiredField)) {
   
$strRequiredField "You must fill in all the fields that are required." ;
 }
 if (
$submitbutton != "Cancel") {
        if (
is_array($fields)) {
      while (list(
$key,  $val) = each($fields)) {
        if ((
$required[$key]=="yes") && $val == "") {
            if (
strlen($errorpage)>0) {
                
$urlerror $errorpage;
            } else {
                
$urlerror $this->getMessagePage() ;
            }
            
$disp = new Display($urlerror);
            
$disp->addParam("message",  $strRequiredField) ;
            
$this->setDisplayNext($disp) ;
            
$this->updateParam("doSave",  "no") ;
        }
      }
        }
 }
?>


Other Development Tools Scripts:

WebMaster Resources Home

©RingsWorld.com