Example #1
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';
Example #2
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);
?>
Example #3
0
<?php
include("world_data_parser.php");

$file = "world_data.csv";

$myParser = new WorldDataParser();
$array = $myParser->parseCSV($file);
$value = $myParser->saveXML($array);

if($value == FALSE)
	echo "XML Savestatus: nicht erfolgreich ($value)";
else
	echo "XML Savestatus: erfolgreich ($value)";



?>
Example #4
0
File: print.php Project: Ohiris/WME
         <div class="data_table_container_2">
              <div class="show_hide_buttons">
              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
Example #5
0
<pre>
<?php
include("world_data_parser.php");
$file = "world_data.csv";

$myParser = new WorldDataParser();
print_r($myParser->parseCSV($file));

?>
</pre>
Example #6
0
<html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <title>WME Course Exercise HTML</title>
  <meta name="description" content="WME Übung 1 Gruppe#21">
  <meta name="keywords" content="HTML,CSS,JavaScript">
  <meta name="author" content="Jan Bickel, Radzhiv Khayretdinov">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

  <script src="js/script.js"></script>
</head>
<body>
<?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");
if ($rv == true) {
    print "Speichern erfolgreich: {$rv}";
} else {
    print "Speichern nicht erfolgreich: {$rv}";
}
?>
</body>
</html>
Example #7
0
File: save.php Project: Ohiris/WME
<?php 
include "world_data_parser.php";
?>

<html>
<head>
         <meta charset="UTF-8">
         <meta name="description" content="WME Aufgabe 2">
         <meta name="keywords" content="PHP">
         <meta name="author" content="Andre Kuehnert">
         <meta name="author" content="Fabian Boltz">

         <title>Aufgabe 2 - Save</title>
</head>
<body>


<?php 
$parser = new WorldDataParser();
$parsed = $parser->parseCSV(WORLD_DATA_PATH);
$save_result = $parser->saveXML($parsed);
if ($save_result) {
    echo "<p style=\"color: green\">Writing XML file was succesful</p>";
} else {
    echo "<p style=\"color: red\">Error while writing XML file</p>";
}
?>


</body>
</html>
Example #8
0
<?php

define('XML_FILE_PATH', 'world_data.xml');
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) {
    echo 'XML wurde erfolgreich gespeichert.';
} else {
    echo 'Fehler beim Speichern der XML-Datei.';
}
Example #9
0
<!DOCTYPE html>
<html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <title>WME Course Exercise HTML</title>
  <meta name="description" content="WME Übung 1 Gruppe#21">
  <meta name="keywords" content="HTML,CSS,JavaScript">
  <meta name="author" content="Jan Bickel, Radzhiv Khayretdinov">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

  <script src="js/script.js"></script>
</head>
<body>
<?php 
require_once "class/world_data_parser.php";
$parser = new WorldDataParser();
$d_array = $parser->parseCSV("res/world_data_v1.csv", 1000, ',');
print "<pre>";
print_r($d_array);
print "</pre>";
?>
</body>
</html>
Example #10
0
<?php

require_once 'world_data_parser.php';
$csvPath = 'world_data_v1.csv';
$parser = new WorldDataParser();
$rows = $parser->parseCSV($csvPath);
?>
<pre>
<?php 
print_r($rows);
?>
</pre>
Example #11
0
File: parse.php Project: Ohiris/WME
<!DOCTYPE html>
<?php 
include "world_data_parser.php";
?>

<html>
<head>
         <meta charset="UTF-8">
         <meta name="description" content="WME Aufgabe 2">
         <meta name="keywords" content="PHP">
         <meta name="author" content="Andre Kuehnert">
         <meta name="author" content="Fabian Boltz">

         <title>Aufgabe 2 - Parse</title>
</head>
<body>

        <pre>
<?php 
$parser = new WorldDataParser();
$parsedCSV = $parser->parseCSV(WORLD_DATA_PATH);
echo var_dump($parsedCSV);
?>
        </pre>

</body>
</html>