Login   Register  
PHP Classes
elePHPant
Icontem

File: dem.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mario Haza  >  Legacy Files  >  dem.php  >  Download  
File: dem.php
Role: Example script
Content type: text/plain
Description: demo
Class: Legacy Files
Manipulate legacy text files on various formats
Author: By
Last change:
Date: 2005-02-02 11:01
Size: 1,002 bytes
 

Contents

Class file image Download
<?

require('LegacyFiles.php');

$Legacy = new LegacyFiles("TDDF0407.TXT","DDTALCALC");
$Legacy->DefineHeaderFormat(
  array(
    array(
'HH1','A',8,0),
    array(
'YYY','Y',9,0),
    array(
'HH2','A',5,0),
    array(
'FFF','N',6,0),
    array(
'HH3','A',1,0),
    array(
'NNN','N',6,0),
    array(
'HH4','A',27,0)
  )
);
$Legacy->DefineFooterFormat(
  array(
    array(
'TT1','A',8,0),
    array(
'YYY','Y',9,0),
    array(
'TT2','A',5,0),
    array(
'FFF','N',6,0),
    array(
'TT3','A',1,0),
    array(
'NNN','N',6,0),
    array(
'TT4','A',27,0)
  )
);
$Legacy->DefineFieldsFormat(
  array(
    array(
'CORP','N',4,0),
    array(
'STORE','N',4,0),
    array(
'SHIP','N',6,0),
    array(
'DEVID','N',11,0),
    array(
'PKG','N',3,0),
    array(
'VALUE','N',9,2),
    array(
'WEIGHT','N',7,3),
    array(
'VOLUME','N',7,3),
    array(
'ZONE','A',1,0),
    array(
'STATUS','N',1,0)
  )
);

$Legacy->ReadFile();

print_r($Legacy->_errors);
print_r($Legacy->_header);
print_r($Legacy->_records);
print_r($Legacy->_footer);


?>