-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_traff2.php
executable file
·103 lines (93 loc) · 3.35 KB
/
create_traff2.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
<!DOCTYPE html>
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<title>Create Traffic</title>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<title>Scenario Testing Builder</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/easyui.css">
<link rel="stylesheet" type="text/css" href="js/icon.css">
<link rel="stylesheet" type="text/css" href="js/demo.css">
<script type="text/javascript" src="js/jquery-1.6.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script src="selecttraff1.js"></script>
<script>
function foo() {
var checkbox01 = document.getElementsByName("checkbox01");
if(checkbox01[0].checked && checkbox01[1].checked) {
checkbox01[0].checked = false ;
var p = document.createElement("p");
var tp = document.createTextNode("createTextNode");
p.appendChild(tp);
document.body.appendChild(p);
alert("only one box can be selected!");
}
}
function appendtxt(value){
var div = document.createElement("div");
div.innerText=value;
document.body.appendChild(div);
}
function showiframe(str){
alert(str);
var options = str;
if(str == "bps") {
var file = create_bpstraffic.php;
} else if(str == "ixiaewf") {
var file = create_ewftraffic.php;
} else if(str == "ixiascreen") {
var file = create_screentraffic.php;
} else if(str == "testcenter") {
var file = create_tctraffic.php;
}
document.getElementById("iframe").src = file;
}
function foo() {
var checkbox01 = document.getElementsByName("checkbox01");
if(checkbox01[0].checked && checkbox01[1].checked) {
checkbox01[0].checked = false ;
var p = document.createElement("p");
var tp = document.createTextNode("createTextNode");
p.appendChild(tp);
document.body.appendChild(p);
alert("only one box can be selected!");
}
}
</script>
</head>
<body>
<?php include 'navigators3.php'; ?>
<br>
<h3 style="background-color:#EEEEEE;text-align:left;height:5%;width:80%">Step3:Select Traffic</h3>
<table id="devs" border="1" width="400" cellpadding="10">
<tr>
<th>Traffic Type</th>
<th></th>
</tr>
<?php
$doc = new DOMDocument();
$doc->load( 'traff.xml' );
$traffs = $doc->getElementsByTagName( "traff" );
foreach( $traffs as $traff )
{
echo "<tr>";
$name = $traff->getAttribute("name");
$type = $traff->getAttribute("type");
# $serverip = $job->getAttribute("serverip");
# $scriptname = $job->getAttribute("scriptname");
# $params = $job->getElementsByTagName( "param" );
echo "<td nowarp>" . $name . "<br>" . "</td>";
echo "<td nowarp>" . "<input type='button' name='$type' value='Use' onclick='showtraff(this.name)' />" . "</td>";
# echo "<td nowarp>" . "<input type='button' name='$type' value='Use' onclick='showiframe(this.name)' />" . "</td>";
echo "</tr>";
}
?>
</table>
<br>
<iframe id="iframe" src="create_tctraffic.php" frameborder="0" width="600" height="480"></iframe>
</body>
</html>