Difference between revisions of "Hash Cookies"

From nuBuilderForte
Jump to: navigation, search
(Report Labels)
(PHP)
Line 28: Line 28:
 
   $s = "CREATE TABLE #TABLE_ID# SELECT * FROM invoice";
 
   $s = "CREATE TABLE #TABLE_ID# SELECT * FROM invoice";
 
   nuRunQuery($s);
 
   nuRunQuery($s);
 +
 +
'''$nudata''' contains the form field values in Before Save (BS) PHP script that will be inserted / updated by '''nuUpdateDatabase()''' defined in <tt>nudata.php</tt>.
 +
 +
Form fields can be referenced in such PHP scripts as:
 +
[code]
 +
$ssn ="#cus_ssn#";
 +
[/code]
 +
 +
Ref: [https://forums.nubuilder.com/viewtopic.php?f=20&t=10823#p23095 Forum Post]
  
 
==HTML==
 
==HTML==

Revision as of 15:22, 19 February 2021

...What?


  • A cookie helps hold values between Javascript and PHP.
  • A nuBuilder cookie does a similar thing and has hashes around it eg. #USER_ID#.


There are a number of places Hash Cookies can be used...


In each of these situations, nuBuilder does a search and replace with all currently available Hash Cookies and any you use in your code before it is run.

There are 5 Hash Cookies always available.

  1. USER_ID
  2. USER_GROUP_ID
  3. HOME_ID
  4. GLOBAL_ACCESS
  5. ACCESS_LEVEL_CODE

To find what other Hash Cookies are available for use, you can run nuHash() inside your code.


PHP

Hash Cookies allow you to customise your PHP code.

Example of using Hash Cookies in PHP.

  $s = "CREATE TABLE #TABLE_ID# SELECT * FROM invoice";
  nuRunQuery($s);

$nudata contains the form field values in Before Save (BS) PHP script that will be inserted / updated by nuUpdateDatabase() defined in nudata.php.

Form fields can be referenced in such PHP scripts as: [code] $ssn ="#cus_ssn#"; [/code]

Ref: Forum Post

HTML

Hash Cookies allow you to customise your HTML Objects.

The Hash Cookies available to HTML Objects are the same as those available on Before Edit.

Example of using Hash Cookies in HTML.

  <iframe 
    width="560" 
    height="315" 
    src="#cus_youtube#" 
    frameborder="0" allowfullscreen>
  </iframe>

Custom SQL

All Custom SQL used in nuBuilder Forte.


  CREATE TABLE #TABLE_ID# SELECT * FROM customer;


or


  SELECT * FROM customer WHERE cus_group = '#sales_group#';

SQL Builder

Any Clause in the Clauses Subform in the SQL Builder.

   = '#RECORD_ID#'

Report Labels

Using Hash Cookies allows you to have changing titles on Report Labels.

An example of using Hash Cookies in a Report Label.

  Sales Between '#from_date#' And '#to_date#'


The following are specific hash variables available only for Report Labels are...

  • page
  • pages
  • description
  • code
  • year
  • month
  • day
  • hour
  • minute
  • second