Location: PHPKode > projects > PAS SiteManager > passitemanager/formrecordedit.php
<?php 
    /***
     *  Display a form to Add / Edit records in a table.
     *  Parameters :
     *  @param string $primarykey in the form of primarykeyvarname=primarykeyvaluetoedit (required only if editing)
     *  @param string $table name of the table to add/edit
     *  @param string $goto name or URL of the next page to display.
     *  @param string $addrecord to display an empty form : $addrecord=yes
     */

  include_once("config.php") ;
  if ($addrecord == "yes") {
    $pageTitle = "Add record in ".$table ;
  } else {
    $pageTitle = "Edit Record from table ".$table." where ".$primarykey ;
  }
  include("includes/header.inc.php") ;
  $form = new ReportForm($conx) ;
  $form->setUrlNext($goto) ;
  $form->setEventControl($cfg_eventcontroler) ;
  if ($primarykey != "") {
    $form->squery = new sqlQuery($conx) ;
    $primarykey = stripslashes($primarykey) ;
    $form->squery->query("select * from $table where ".$primarykey) ;
    $form->setDefault($table) ;
  } else {
    $form->setDefault($table) ;
  }
  if ($addrecord == "yes") {
    $form->setAddRecord() ;
  }
  $form->setForm() ;
  $form->execute() ;
  include("includes/footer.inc.php") ;
?>
Return current item: PAS SiteManager