summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/pChart2.1.2/examples/imageMap/index.php
blob: 21f2e70da5130421905524f770ba0185f6c852c0 (plain) (blame)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php if ( isset($_GET["Action"]) && $_GET["Action"] == "ViewPHP") { $Script = $_GET["Script"]; highlight_file($Script); exit(); } ?>
<?php if ( isset($_GET["Action"]) && $_GET["Action"] == "ViewHTML") { $Script = $_GET["Script"]; writeHTML($Script); exit(); } ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 <script src='imagemap.js' type="text/javascript"></script>
 <title>pChart 2.x - Image map</title>
 <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
 <style>
  body       { background-color: #F0F0F0; font-family: tahoma; font-size: 14px;}
  td  	     { font-family: tahoma; font-size: 11px; }
  div.txt    { font-family: tahoma; font-size: 11px; width: 660px; padding: 15px; }
  div.folder { cursor: hand; cursor: pointer; }
  a.smallLink:link    { text-decoration: none; color: #6A6A6A; }
  a.smallLink:visited { text-decoration: none; color: #6A6A6A; }
  a.smallLink:hover   { text-decoration: underline; color: #6A6A6A; }
  a.smallLinkGrey:link     { text-decoration: none; color: #6A6A6A; }
  a.smallLinkGrey:visited  { text-decoration: none; color: #6A6A6A; }
  a.smallLinkGrey:hover    { text-decoration: underline; color: #6A6A6A; }
  a.smallLinkBlack:link    { text-decoration: none; color: #000000; }
  a.smallLinkBlack:visited { text-decoration: none; color: #000000; }
  a.smallLinkBlack:hover   { text-decoration: underline; color: #000000; }
  a.pChart { text-decoration: none; color: #6A6A6A; }
  a img, img { border: none; }
 </style>
</head>
<body>
<?php
 /* Files that we don't want to see in the tree */
 $Exclusion = array(".","..");

 /* Determine the current package version */
 $FileHandle  = fopen("../../readme.txt", "r");
 for ($i=0; $i<=5; $i++) { $buffer = fgets($FileHandle, 4096); }
 fclose($FileHandle);
 $Values  = preg_split("/:/",$buffer);
 $Values  = preg_split("/ /",$Values[1]);
 $Version = strip_tags($Values[1]);

 /* Build a list of the examples & categories */
 $DirectoryHandle = opendir("scripts");
  {
   $Tree = "";
   while (($FileName = readdir($DirectoryHandle)) !== false)
   {
    if ( !in_array($FileName,$Exclusion))
     $Tree[] = str_replace(".php","",$FileName);
   }
  }
?>

 <table style='border: 2px solid #FFFFFF;'><tr><td>
  <div style='font-size: 11px; padding: 2px; color: #FFFFFF; background-color: #666666; border-bottom: 3px solid #484848;'>&nbsp;Navigation</div>
  <table style='padding: 1px; background-color: #E0E0E0; border: 1px solid #D0D0D0; border-top: 1px solid #FFFFFF;'><tr>
   <td width=16><img src='../resources/application_view_tile.png' width=16 height=16 alt=''/></td>
   <td width=100>&nbsp;<a class=smallLinkGrey href='../'>Examples</a></td>
   <td width=16><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
   <td width=100>&nbsp;<a class=smallLinkGrey href='../sandbox/'>Sandbox</a></td>
   <td width=16><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
   <td width=100>&nbsp;<a class=smallLinkGrey href='../delayedLoader/'>Delayed loader</a></td>
   <td width=16><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
   <td width=100>&nbsp;<b>Image Map</b></td>
  </tr></table>
 </td></tr></table>

 <br/>

 <table><tr><td valign='top'>
  <table style='border: 2px solid #FFFFFF;'><tr><td>
   <div style='font-size: 11px; padding: 2px; color: #FFFFFF; background-color: #666666; border-bottom: 3px solid #484848; width: 222px;'>&nbsp;Release <?php echo $Version; ?></div>
   <div style='border: 3px solid #D0D0D0; border-top: 1px solid #FFFFFF; background-color: #FAFAFA; width: 220px; overflow: auto'>
   <div style='padding: 1px; padding-bottom: 3px; color: #000000; background-color:#D0D0D0;'>
    <table><tr>
     <td><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
     <td>&nbsp;Examples folder contents</td>
    </tr></table>
   </div>
<?php
  foreach($Tree as $Key => $Element)
   {
    if ( $Key == count($Tree)-1 ) { $Icon = "../resources/dash-explorer-last.png"; } else { $Icon = "../resources/dash-explorer.png"; }

    echo "<table noborder cellpadding=0 cellspacing=0>\r\n";
    echo " <tr valign=middle>\r\n";
    echo "  <td><img src='".$Icon."' width=16 height=20 alt=''/></td>\r\n";
    echo "  <td><img src='../resources/application_view_tile.png' width=16 height=16 alt=''/></td>\r\n";
    echo "  <td><div class=folder onclick='showExample(".chr(34).$Element.chr(34).");'>&nbsp;".$Element."</div></td>\r\n";
    echo " </tr>\r\n";
    echo "</table>\r\n";
   }
?>

   </div>
  </td></tr></table>
 </td><td width=20></td><td valign='top' style='padding-top: 5px; font-size: 12px;'>
  <table><tr>
   <td><img src='../resources/chart_bar.png' width=16 height=16 alt=''/></td>
   <td>&nbsp;Rendering area</td>
   </tr></table>

   <div style='display:table-cell; padding: 10px; border: 2px solid #FFFFFF; vertical-align: middle; overflow: auto; background-image: url("resources/dash.png");'>
    <div style='font-size: 10px;' id=render>
     <table><tr><td><img src='../resources/accept.png' width=16 height=16 alt=""/></td><td>Click on an example to render it!</td></tr></table>
    </div>
   </div>

   <br/><br/>

   <table><tr>
    <td><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
    <td>&nbsp;HTML Source area</td>
   </tr></table>

   <div style='display:table-cell; padding: 10px;  border: 2px solid #FFFFFF; vertical-align: middle; overflow: auto; background-image: url("resources/dash.png");'>
    <div id=htmlsource style='width: 700px; font-size: 13px; font-family: Lucida Console'>

     &lt;html&gt;<br/>
     &lt;head&gt;<br/>
     &nbsp;&nbsp; &lt;style&gt;<br/>
     &nbsp;&nbsp;&nbsp;&nbsp;   div.pChartPicture { border: 0px; }<br/>
     &nbsp;&nbsp; &lt;/style&gt;<br/>
     &lt;/head&gt;<br/>
     &lt;body&gt;<br/>
     &nbsp;&nbsp; &lt;script src="imagemap.js" type="text/javascript"&gt;&lt;/script&gt;<br/>
     &nbsp;&nbsp;  &lt;img src="draw.php" id="testPicture" alt="" class="pChartPicture"/&gt;<br/>
     &lt;/body&gt;<br/>
     &lt;script&gt;<br/>
     &nbsp;&nbsp;  addImage("testPicture","pictureMap","draw.php?ImageMap=get");<br/>
     &lt;/script&gt;<br/>

    </div>
   </div>

   <br/><br/>

   <table><tr>
    <td><img src='../resources/application_view_list.png' width=16 height=16 alt=''/></td>
    <td>&nbsp;PHP Source area</td>
   </tr></table>

   <div style='display:table-cell; padding: 10px;  border: 2px solid #FFFFFF; vertical-align: middle; overflow: auto; background-image: url("resources/dash.png");'>
    <div style='font-size: 10px;' id=source style='width: 700px;'>
     <table><tr><td><img src='../resources/accept.png' width=16 height=16 alt=""/></td><td>Click on an example to get its source!</td></tr></table>
    </div>
   </div>

</td></tr></table>
</body>
</html>
<script>
 function showExample(FileName)
  {
   document.getElementById("render").innerHTML = "<img src='scripts/"+FileName+".php?Seed="+Math.random(100)+"' id='testPicture' alt='' class='pChartPicture'/>";
   viewPHP("scripts/"+FileName+".php");
   // viewHTML("scripts/"+FileName+".php");

   addImage('testPicture','pictureMap','scripts/'+FileName+'.php?ImageMap=get');
  }

 function viewPHP(URL)
  {
   var xmlhttp=false;   
   /*@cc_on @*/  
   /*@if (@_jscript_version >= 5)  
    try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }  
   @end @*/  
  
   URL = "index.php?Action=ViewPHP&Script=" + URL;

   if (!xmlhttp && typeof XMLHttpRequest!='undefined')   
    { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } }   
  
   if (!xmlhttp && window.createRequest)   
    { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } }   
  
   xmlhttp.open("GET", URL,true);

   xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { Result = xmlhttp.responseText; document.getElementById("source").innerHTML = Result.replace("/\<BR\>/");  } }   
   xmlhttp.send(null)   
  }

 function viewHTML(URL)
  {
   var xmlhttp=false;   
   /*@cc_on @*/  
   /*@if (@_jscript_version >= 5)  
    try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }  
   @end @*/  
  
   URL = "index.php?Action=ViewHTML&Script=" + URL;

   if (!xmlhttp && typeof XMLHttpRequest!='undefined')   
    { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } }   
  
   if (!xmlhttp && window.createRequest)   
    { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } }   
  
   xmlhttp.open("GET", URL,true);

   xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { Result = xmlhttp.responseText; document.getElementById("htmlsource").innerHTML = Result.replace("/\<BR\>/");  } }   
   xmlhttp.send(null)   
  }
</script>
<?php
 function writeHTML($Script)
  {
   echo $Script;
  }
?>