-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
executable file
·118 lines (107 loc) · 3.97 KB
/
view.php
File metadata and controls
executable file
·118 lines (107 loc) · 3.97 KB
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
<?php
if(array_key_exists('file', $_GET))
$baseFile = $_GET['file'];
else
Header('Location: index.php');
$xskew=0;
$yskew=0;
$mag=1;
$layer = 1;
if($_POST)
{
$controls = array("layer", "mag", "xskew", "yskew");
foreach($controls as $control)
{
if(array_key_exists($control, $_POST))
{
if($_POST[$control] == "+")
$$control = $_POST['cur_' . $control] + 1;
else if($_POST[$control] == "-")
$$control = $_POST['cur_' . $control] - 1;
} else {
$$control = $_POST['cur_' . $control];
}
}
}
if($layer < 1)
$layer = 1;
if($mag < 1)
$mag = 1;
$currentFile = $baseFile . "." . $layer . ".php";
$dirh = opendir("uploads/" . $baseFile );
$layerCount=-2;
while(($file = readdir($dirh)))
{
$layerCount++;
}
?>
<table width="100%" border=1 height="100%">
<tr>
<td>
<iframe class="result_output" width="100%" height="100%" frameborder="0" name="view" src="uploads/<?php echo $baseFile . "/" . $currentFile; ?>?xskew=<?php echo $xskew * (100 / $mag) * -1;?>&yskew=<?php echo $yskew * (100 / $mag) * -1;?>&mag=<?php echo $mag ?>"></iframe>
</td>
<td align="center" width="10%">
<form method="post">
<input type="hidden" name="cur_xskew" value="<?php echo $xskew; ?>">
<input type="hidden" name="cur_yskew" value="<?php echo $yskew; ?>">
<input type="hidden" name="cur_mag" value="<?php echo $mag; ?>">
<input type="hidden" name="cur_layer" value="<?php echo $layer; ?>">
<table border=0>
<tr>
<td>Layer:</td>
</tr>
<tr>
<td><input type=text disabled size="2" value="<?php echo $layer; ?>"></td>
<td>
<?php if($layer >= $layerCount) { ?>
<input type=Submit name="layer" value="+" disabled>
<?php } else { ?>
<input type=Submit name="layer" value="+">
<?php } ?>
</td>
<td>
<?php if($layer <= 1) { ?>
<input type=Submit name="layer" value="-" disabled>
<?php } else { ?>
<input type=Submit name="layer" value="-">
<?php } ?>
</td>
</tr>
<tr>
<td>Zoom:</td>
</tr>
<tr>
<td> </td>
<td>
<input type=Submit name="mag" value="+">
</td>
<td>
<input type=Submit name="mag" value="-">
</td>
</tr>
<tr>
<td>Move:</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="Submit" name="yskew" value="+"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="Submit" name="xskew" value="+"></td>
<td> </td>
<td><input type="Submit" name="xskew" value="-"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="Submit" name="yskew" value="-"></td>
<td> </td>
</tr>
</td>
</table>
</td>
</tr>
</table>