PHP Classes

File: examples/cross.php

Recommend this page to a friend!
  Classes of Everton da Rosa   XtPHP   examples/cross.php   Download  
File: examples/cross.php
Role: Example script
Content type: text/plain
Description: Example script
Class: XtPHP
General purpose library of utility classes
Author: By
Last change:
Date: 9 years ago
Size: 1,000 bytes
 

Contents

Class file image Download
<?php

require '../utils.php';
require
'../store.php';
require
'../mysql.php';
require
'../math.php';

$store = array(
    array(
       
'cod' => '1'
       
,'prod' => 'acucar'
       
,'und' => 'pct'
       
,'quant' => 5
       
,'unit' => 10
       
,'tot' => 50
   
)
    ,array(
       
'cod' => '2'
       
,'prod' => 'acucar'
       
,'und' => 'pct'
       
,'quant' => 3
       
,'unit' => 11
       
,'tot' => 33
   
)
    ,array(
       
'cod' => '3'
       
,'prod' => 'farinha'
       
,'und' => 'sc'
       
,'quant' => 1
       
,'unit' => 5
       
,'tot' => 5
   
)
    ,array(
       
'cod' => '4'
       
,'prod' => 'feijao'
       
,'und' => 'kg'
       
,'quant' => 3
       
,'unit' => 3
       
,'tot' => 9
   
)
    ,array(
       
'cod' => '5'
       
,'prod' => 'farinha'
       
,'und' => 'kg'
       
,'quant' => 2
       
,'unit' => 7
       
,'tot' => 14
   
)
);

$store = XtStore::cross($store, 'prod', 'und', 'tot', 'sum', 'med', 'len');
XtUtils::printr($store);
?>