summaryrefslogtreecommitdiff
path: root/views/simulation.php
diff options
context:
space:
mode:
authorFahim2016-01-26 10:25:22 +0530
committerFahim2016-01-26 10:25:22 +0530
commit16af7c0f9d5040fdeaf36c8b7d47e62ff4e8d980 (patch)
tree5a541828955b1c164ab62cff491366d1666dca35 /views/simulation.php
downloadeSimWebApp-16af7c0f9d5040fdeaf36c8b7d47e62ff4e8d980.tar.gz
eSimWebApp-16af7c0f9d5040fdeaf36c8b7d47e62ff4e8d980.tar.bz2
eSimWebApp-16af7c0f9d5040fdeaf36c8b7d47e62ff4e8d980.zip
First Commit
Diffstat (limited to 'views/simulation.php')
-rw-r--r--views/simulation.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/views/simulation.php b/views/simulation.php
new file mode 100644
index 0000000..2050970
--- /dev/null
+++ b/views/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>";
+ }
+
+//}
+?>