index.php

Go to the documentation of this file.
00001 <?php
00002     /**
00003         \file satellite_server/pdf_generator/index.php
00004     */
00005     
00006     Make_List ( );
00007     
00008     /**
00009         \brief This function actually gets the CSV data from the root server, and creates a PDF file from it, using FPDF.
00010     */
00011     function Make_List ( )
00012         {
00013         $in_http_vars = array_merge_recursive ( $_GET, $_POST );
00014         
00015         if ( isset ( $in_http_vars['dir'] ) )
00016             {
00017             $dir = preg_replace ( "#[\\:/]#",'',$in_http_vars['dir']).'/';  // Just to make sure no one is trying to pull a fast one... 
00018             }
00019         else
00020             {
00021             $dir = 'pdf_generator/';
00022             }
00023         
00024         $class_name = preg_replace ( "#[\\:/]#",'',$in_http_vars['list_type']).'_napdf';
00025 
00026         if ( file_exists ( dirname ( __FILE__ )."/../$dir$class_name.class.php" ) )
00027             {
00028             require_once ( dirname ( __FILE__ )."/../$dir$class_name.class.php" );
00029             $class_instance = new $class_name ( $in_http_vars );
00030 
00031             if ( ($class_instance instanceof $class_name) && method_exists ( $class_instance, 'AssemblePDF' ) && method_exists ( $class_instance, 'OutputPDF' ) )
00032                 {
00033                 if ( $class_instance->AssemblePDF() )
00034                     {
00035                     $class_instance->OutputPDF();
00036                     }
00037                 }
00038             else
00039                 {
00040                 echo "Cannot instantiate $class_name";
00041                 }
00042             }
00043         else
00044             {
00045             echo "Cannot find ".dirname ( __FILE__ )."/../$dir$class_name.class.php";
00046             }
00047         }
00048 ?>
 All Data Structures Files Functions Variables Enumerations