Beispiel #1
0
<?php
require("world_data_parser.php");

//get all required files
$xmlPath = "world_data.xml";
$xsltPath = "world_data.xsl";

$file = "world_data.csv";

//execute parse & save
$myParser = new WorldDataParser();
$array = $myParser->parseCSV($file);
$value = $myParser->saveXML($array);

//if save was successfull, execute print
if($value == FALSE)
	echo "XML Savestatus: nicht erfolgreich ($value)";
else
	echo $myParser->printXML($xmlPath, $xsltPath);
?>
Beispiel #2
0
              Show/Hide:
               <!--  <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_1')">ID</Button>   |
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_2')">Country</Button>  |  -->
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_3')">birth rate /1000</Button>    |
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_4')">cellphones /100</Button>    |
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_5')">children / woman</Button>   |
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_6')">electric usage</Button>     |
                 <Button title="hide column" class="hide_column_button" onclick="toggle_column('data_table_col_7')">internet usage</Button>
              </div>

<?php 
//Inserts Data Table
$parser = new WorldDataParser();
$parsed = $parser->parseCSV(WORLD_DATA_PATH);
$save_result = $parser->saveXML($parsed);
$print = $parser->printXML(XML_PATH, XSL_PATH);
echo $print;
?>
         </div>

         <footer id="group_footer">
                 <div class="footer_left_container">
                         Copyright &copy; 2015 world_data <br>
                         Second course exercise PHP and XML of the lecture Web and Multimedia Engineering
                 </div>
                 <div class="footer_right_container">
                         The solution has been created by:<br>
                         Andr&eacute; K&uuml;hnert (s6510611) and Fabian Boltz (s3349388) - Team 45
                 </div>
         </footer>
</body>
Beispiel #3
0
<?php

define('XML_FILE_PATH', 'world_data.xml');
define('XSLT_FILE_PATH', 'generate-table.xsl');
require_once 'world_data_parser.php';
$csvPath = 'world_data_v1.csv';
$parser = new WorldDataParser();
$rowIterator = $parser->parseCSV($csvPath);
$isSuccessful = $parser->saveXML($rowIterator, XML_FILE_PATH);
if (!$isSuccessful) {
    $htmlTemplateContent = 'print-error';
} else {
    $htmlTemplateContent = 'print';
    $htmlTable = $parser->printXML(XML_FILE_PATH, XSLT_FILE_PATH);
}
include 'html-template.php';
Beispiel #4
0
    <p>Show/Hide:</p>
    <ul>
      <li><a onclick="show_hide_col(2)">birth rate </a></li>
      <li><a onclick="show_hide_col(3)">cellphones </a></li>
      <li><a onclick="show_hide_col(4)">children / woman </a></li>
      <li><a onclick="show_hide_col(5)">electric usage </a></li>
      <li><a onclick="show_hide_col(6)">internet usage </a></li>
    </ul>
    <br>
  </div>
<?php 
require_once "class/world_data_parser.php";
$parser = new WorldDataParser();
$d_array = $parser->parseCSV("res/world_data_v1.csv", 1000, ',');
$rv = $parser->saveXML($d_array, "res/world_data.xml");
$rt = $parser->printXML("res/world_data.xml", "res/world_data.xslt");
print_r($rt);
?>
<footer>
    <div class="footer-container">
      <div id="left-footer">
        <div>Copyright &copy; 2015 world_data</div>
        <div>First course exercise <b>HTML, CSS and JS</b> of lecture Web and Multimedia Engeneering. </div>
      </div>
      <div id="right-footer">
        <div>This Solution has been created by: </div>
        <div>Jan Bickel (s5104134), Radzhiv Khayretdinov (s7400249)- Team 21</div>
      </div>
    </div>
  </footer>