phpBMS

Show
Ignore:
Timestamp:
04/07/09 11:44:18 (3 years ago)
Author:
nate
Message:
  • Merged Nathan branch back into trunk.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/sample/sampletable_addedit.php

    r384 r485  
    1 <?php  
     1<?php 
    22/* 
    33 $Rev: 258 $ | $LastChangedBy: brieb $ 
     
    4141        include("include/tables.php"); 
    4242        include("include/fields.php"); 
    43          
     43 
    4444        //if you need to ovveride the phpbmsTable class make sure to include the modules file 
    4545        include("modules/[modulename]/include/[tablename].php"); 
    4646 
    4747 
    48         //If the addedit page will be accessd directly from a page other than the  
     48        //If the addedit page will be accessd directly from a page other than the 
    4949        // basic search results page, you may want to grab and pass the previous URL 
    5050        //with the following code 
    5151 
    5252        //=================================================== 
    53         if(!isset($_GET["backurl"]))  
    54                 $backurl = NULL;  
    55         else{  
     53        if(!isset($_GET["backurl"])) 
     54                $backurl = NULL; 
     55        else{ 
    5656                $backurl = $_GET["backurl"]; 
    5757                if(isset($_GET["refid"])) 
     
    6363        //Here you invoke the table class.  If you are going to use the standard phpbmsTable class 
    6464        // for updates and the such you would access it like this 
    65          
     65 
    6666        //              $thetable = new phpbmsTable($db,[table definition id]); 
    67          
    68         //if you are going to overide the class you would instantiate 
    69         // like this 
    70          
    71         //              $thetable = new [tablename]($db,[table definition id],$backurl); 
    72          
     67 
     68        // if you are going to overide the class you would instantiate 
     69        // your overriden class like this 
     70 
     71        //              $thetable = new [tablename]($db,[table definition id]); 
     72 
    7373        //and if you are setting the backurl, make sure you pass that as well 
    7474        // like this: 
    7575        //              $thetable = new [tablename]($db,[table definition id],$backurl); 
    76          
    77          
    78         //Next we process the form (if submitted) and  
     76 
     77 
     78        // Next we process the form (if submitted) and 
    7979        // return the current record as an array ($therecord) 
    8080        // or if this is a new record, it returns the defaults 
     
    8787 
    8888        $pageTitle = "[tablename]"; 
    89          
     89 
    9090        // Next, we set up to include any 
    9191        // additional css or javascript files we will be using 
     
    9393        // as they are automatically icluded when you define the special fields you 
    9494        // will be using below. 
    95         $phpbms->cssIncludes[] = "pages/[tablename].css"; 
     95        $phpbms->cssIncludes[] = "pages/[modulename]/[tablename].css"; 
    9696        $phpbms->jsIncludes[] = "modules/[modulename]/javascript/[tablename].js"; 
    9797 
     98        // DEPRECIATED:  
    9899        // if you need to define a body onlload function, do so with the phpbms property 
    99100        $phpbms->onload[] = "initializePage()"; 
     
    102103        // Next we need to define any special fields that will be used in the form 
    103104        // A list of field objects (with documentation)is available in the /include/fields.php 
    104         // file.   
    105          
     105        // file. 
     106 
    106107        // We need to define them here in the head 
    107108        // so that any necessay javascript is loaded appropriately. 
    108          
     109 
    109110                //Form Elements 
    110111                //============================================================== 
    111                  
     112 
    112113                // Create the form 
    113114                $theform = new phpbmsForm(); 
    114115                //if you need to set specific form vaiables (like enctype, or extra onsubmit 
    115116                // you can set those form properties here. 
    116                  
    117                 // for each field we will use, create the field object and add it to  
     117 
     118                // for each field we will use, create the field object and add it to 
    118119                // the forms list. 
    119120                $theinput = new inputDatePicker("orderdate", $therecord["orderdate"], "order date"); 
    120121                $theform->addField($theinput); 
    121          
     122 
    122123                $theinput = new inputCheckBox("weborder",$therecord["weborder"],NULL, false, false); 
    123124                $theform->addField($theinput); 
     
    136137                $theform->jsMerge(); 
    137138                //============================================================== 
    138                 //End Form Elements      
     139                //End Form Elements 
    139140 
    140         include("header.php");   
    141          
     141        include("header.php"); 
     142 
    142143?><div class="bodyline"> 
    143         <!--  
     144        <!-- 
    144145                Next we start the form.  This also prints the H1 with title, and top save,cancel buttons 
    145146                If you need to have other buttons, or need a specific top, you will need to create your form manually. 
     
    151152                <p> 
    152153                        <label for="id">id</label><br /> 
    153                         <input name="id" id="id" type="text" value="<?php echo $therecord["id"]; ?>" size="5" maxlength="5" readonly="readonly" class="uneditable" />            
     154                        <input name="id" id="id" type="text" value="<?php echo $therecord["id"]; ?>" size="5" maxlength="5" readonly="readonly" class="uneditable" /> 
    154155                </p> 
    155                 <p><?php $theform->showField("inactive");?></p>          
     156                <p><?php $theform->showField("inactive");?></p> 
    156157        </fieldset> 
    157158 
     
    166167                </fieldset> 
    167168        </div> 
    168         <?php  
     169        <?php 
    169170                //Last, we show the create/modifiy with the bottom save and cancel buttons 
    170171                // and then close the form. 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.