<pre>
pwd:

<?php
$command = escapeshellcmd('pwd');
$output = shell_exec($command);
echo $output;
?>

eagle-bom.py:

<?php
$variant = '';
$filetype = '-s';

//$filepath = 'eagle-bom.py/PLPB-0053.sch';
//$csv_filepath = 'eagle-bom.py/PLPB-0053.csv';
//$variant = ' -v SW_USED';

$filepath = 'eagle-bom.py/test/files/technologies.sch';
$csv_filepath = 'eagle-bom.py/test/files/technologies.csv';
$variant = ' -v "8 PARTS ALT"';

//$filepath = 'eagle-bom.py/test/files/blink1_v1a.sch';
//$csv_filepath = 'eagle-bom.py/test/files/blink1_v1a_sch.csv';

//$filepath = 'eagle-bom.py/test/files/blink1_v1a.brd';
//$csv_filepath = 'eagle-bom.py/test/files/blink1_v1a_brd.csv';
//$filetype = '-b';

$command = escapeshellcmd('python eagle-bom.py/eagle-bom.py  ' . $filetype . ' ' . $filepath . ' --variantlist');
$output = shell_exec($command);
echo $command;
echo "\n";
echo $output;
echo "\n";

$command = escapeshellcmd('python eagle-bom.py/eagle-bom.py -c ' . $csv_filepath . ' ' . $filetype . ' ' . $filepath . $variant . ' -t value -q 100');
$output = shell_exec($command);
echo $command;
echo "\n";
echo $output;
echo "\n";

//$lines = explode(PHP_EOL, $output);
//$array = array();
//foreach ($lines as $line) {
//	echo $line;
//	$array = str_getcsv($line);
//	print_r($array);
//	echo "<tr>";
//	foreach ($array as $cell) {
//		//echo "<td>" . htmlspecialchars($cell) . "</td>";
//		//echo "<td>" . $cell . "</td>";
//	}
//	echo "</tr>\n";
//}
//print_r($array);


echo "</pre>\n";
echo "<table border=\"1\">\n";
$f = fopen($csv_filepath, "r");
while (($line = fgetcsv($f)) !== false) {
	echo "<tr>";
	foreach ($line as $cell) {
		echo "<td>" . htmlspecialchars($cell) . "</td>";
	}
	echo "</tr>\n";
}
fclose($f);
echo "\n</table>";
echo "<pre>\n";

echo "\n";
$output = file_get_contents($csv_filepath);
echo $output;
?>

KiCad_BOM_Export:

<?php
$command = escapeshellcmd('python KiCad_BOM_Export/KiCadBomExport.py');
$output = shell_exec($command);
echo $output;
?>

KiCost:

<?php
$command = escapeshellcmd('python KiCost/kicost/kicost.py');
$output = shell_exec($command);
echo $output;
?>

</pre>
