diff options
author | nielmishra | 2016-01-04 15:14:57 +0530 |
---|---|---|
committer | nielmishra | 2016-01-04 15:14:57 +0530 |
commit | c39feead6b8a792b86e43e18fdf7c13ddaaf0387 (patch) | |
tree | 948cc46433e39d8e650da0d1294b73facd2f2c42 /simulation.php | |
parent | 769fcf719320e5b9c740f455630aeb44b3deb575 (diff) | |
download | eSIM-webapp-master.tar.gz eSIM-webapp-master.tar.bz2 eSIM-webapp-master.zip |
Diffstat (limited to 'simulation.php')
-rwxr-xr-x | simulation.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/simulation.php b/simulation.php new file mode 100755 index 0000000..2050970 --- /dev/null +++ b/simulation.php @@ -0,0 +1,42 @@ +<?php + +if (isset ($_POST["netlist"])) +{ + $netlistval1 = $_POST["netlist"]; // for ajax + //$netlistval = "CONTENT"; // without ajax + $myfile = fopen("netlist.txt", "w") or die("Unable to open file!"); + fwrite($myfile, $netlistval1); + fclose($myfile); + +} + +else + +{ + + $output=shell_exec('cd /var/www/html/eSIM/; ngspice /var/www/html/eSIM/netlist.txt 2>&1' ); + $output=shell_exec('cd /var/www/html/eSIM/;python /var/www/html/eSIM/__main__.py /var/www/html/eSIM/dumpv.txt /var/www/html/eSIM/dumpi.txt 2>&1' ); + // $output1=shell_exec('cd /var/www/html/eSIM/;python /var/www/html/eSIM/__main__.py /var/www/html/eSIM/dump1.txt 2>&1' ); + + $imagepath = '/eSIM/dumpi/'; + $images = glob('/var/www/html/eSIM/dumpi/*.{jpeg,gif,png}', GLOB_BRACE);//glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE); + foreach ($images as $value) { + echo " <img src=".$imagepath.basename($value)."><br> "; + + } + + $imagepath = '/eSIM/dumpv/'; + $images1 = glob('/var/www/html/eSIM/dumpv/*.{jpeg,gif,png}', GLOB_BRACE); + foreach ($images1 as $value) { + echo " <img src=".$imagepath.basename($value)."><br> "; + + } + +//$images1 = glob('/var/www/html/eSIM/dump1*.{jpeg,gif,png}', GLOB_BRACE); + // var_dump($images.'-----------'. $images1);die; + //echo json_encode($images); + echo "<pre>$output</pre>"; + } + +//} +?> |