-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_process.php
132 lines (101 loc) · 3.05 KB
/
post_process.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/* optimizasyon çalışmaları :(
session_start();
if(isset($_SESSION['screen_width']) AND isset($_SESSION['screen_height'])){
$_SESSION['leftpanel_width'] = 600;
$_SESSION['rightpanel_width'] = $_SESSION['screen_width']*0.40;
} else if(isset($_REQUEST['width']) AND isset($_REQUEST['height'])) {
$_SESSION['screen_width'] = $_REQUEST['width'];
$_SESSION['screen_height'] = 400;
header('Location: ' . $_SERVER['PHP_SELF']);
} else {
echo '<script type="text/javascript">
var varWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var varHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
window.location = "' . $_SERVER['PHP_SELF'] . '?width="+varWidth+"&height="+varHeight;</script>';
}
*/
session_start();
$_SESSION['leftpanel_width'] = 600;
$_SESSION['rightpanel_width'] = 400;
$_SESSION['screen_width'] = 1000;
$_SESSION['screen_height'] = 600;
?>
<html>
<head>
<title> 2D Frame Analysis Post-Processor</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
</head>
<body>
<div id="container">
<div id="left-panel">
<?php
if(isset($_GET["id"])) {
$id = htmlspecialchars($_GET["id"]);
}
?>
<?php
if(isset($_GET["suppreacs"])) {
echo '<img class="render" src="drawing.php?nodes&members&suppreacs&loads&id='.$id.'"/>';
}
?>
</div>
<div id="right-panel">
<div class="clear"></div>
<p id="info">
Analysis had been completed. Support reactions are as shown in the figure.
</p>
<div class="clear"></div>
<br><br>
<h3> Displacements </h3>
<?php
if(isset($_GET["disps"])) {
if(file_exists("analysis/outputs/dsorted.csv")) {
$fp = fopen('analysis/outputs/dsorted.csv', 'a');
$handle = fopen("analysis/outputs/dsorted.csv", "r");
$i=1;
echo '<table border="1" cellpadding="5" cellspacing="20">';
echo '<tr>
<td><b>Node #</b></td>
<td><b>X (mm)</b></td>
<td><b>Y (mm)</b></td>
<td><b>Rotation (rad)</b></td>
</tr>
';
while ($disp = fgetcsv($handle, ",")) {
echo '<tr>';
echo '<td><b>'.$i.'</b></td>';
echo '<td>'.$disp[0].'</td>';
echo '<td>'.$disp[1].'</td>';
echo '<td>'.$disp[2].'</td>';
echo '</tr>';
$i++;
}
echo "</table>";
fclose($fp);
}
}
/* For undo button
$filename = 'input_files/nodes_1390223988.csv';
$arr = file($filename);
if ($arr === false) {
die('Failed to read ' . $filename);
}
array_pop($arr);
file_put_contents($filename, implode(PHP_EOL, $arr));
*/
?>
<form action="pre_process.php">
<input type="submit" value="New Analysis" />
</form>
</div>
</div>
<div class="clear"></div>
<footer>
<a href="about.php">About</a>
</footer>
</body>
</html>