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
|
<html>
<head>
<title>Admin Panel</title>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"/>
<script src="ajaxcore.js" type="text/javascript">
1var ajaxrqt=null;
2
3
4function getXMLHTTP(){
5 var xhr=null;//firefox
6 if (window.XMLHttpRequest) {
7 xhr = new XMLHttpRequest();
8
9 // Handling Safari bug :
10 if (xhr.overrideMimeType) {
11 xhr.overrideMimeType("text/xml");
12 }
13
14 } else {
15
16 if (window.ActiveXObject) {
17
18 try { // IE IE
19 xhr = new ActiveXObject("Msxml2.XMLHTTP");
20 } catch (e) {
21 try { // Others IE
22 xhr = new ActiveXObject("Microsoft.XMLHTTP");
23 } catch (e) {
24 window.alert("Your navigator doesn't handle AJAX, please use Internet explorer, Safari or firefox");
25 } // try-catch
26 } // try-catch
27
28 }
29
30 } // if-else
31
32 return xhr;
33}
34
35
36
37function ajaxquery(page,params,divid,sync)
38{
39 // alert(params);
40 if(sync==null) { sync = true;}
41 ajaxrqt=getXMLHTTP();
42 ajaxrqt.onreadystatechange = function() {
43 if(ajaxrqt.readyState == 4) {
44 document.getElementById(divid).innerHTML=ajaxrqt.responseText;
45 }
46 }
47 ajaxrqt.open("POST", page, sync);
48 ajaxrqt.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
49 ajaxrqt.send(params);
50
51}
52
53
</script>
</head>
<body>
<div id="divLstServers">
<form class="frmEditServers" action="/admin.php" method="post" name="frmEditServers">
<input type="radio" value="1" name="EDITID" onclick="ajaxquery('rc/ajGraphs.php','action=getlist&serverid=1','divLstGraphs',false);ajaxquery('rc/ajScripts.php','action=getlist&serverid=1','divLstScripts',false);"/>
server1
<br/>
<input type="submit" value="Edit server"/>
</form>
</div>
<div id="divLstGraphs">
<input type="radio" value="1" name="graphid"/>
Week graph
<input type="radio" value="21" name="graphid"/>
My graph
</div>
<div id="divLstScripts">
<div id="divInstScts" class="divScripts">
<form action="/rc/ajScripts.php" method="post" name="frmInstalledScripts">
<input type="hidden" value="uninst" name="action"/>
<table id="tabInstScripts" class="tableScripts">
<tbody>
<tr>
<td>
<input type="checkbox" name="CInstScripts"/>
</td>
<td>sample_single</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Uninstall selected"/>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="divNotInstScts" class="divScripts">
<form action="/rc/ajScripts.php" method="post" name="frmNotInstalledScripts">
<input type="hidden" value="inst" name="action"/>
<table id="tabNotInstScripts" class="tableScripts">
<tbody>
<tr>
<td>
<input type="checkbox" name="CNotInstScripts"/>
</td>
<td>sample_multi</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Install selected"/>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="divInstScts" class="divScripts">All scripts installed seem to be valid</div>
</div>
</body>
</html> |
Partager