OLD | NEW |
(Empty) | |
| 1 <?php |
| 2 ini_set('display_errors', 1); |
| 3 |
| 4 include_once('config.php'); |
| 5 $link_capacity = 300; //Mb/s |
| 6 $output = shell_exec('rm -rf log_graph/*.log '); |
| 7 |
| 8 if($_SERVER['REQUEST_METHOD'] == "GET"){ |
| 9 $get_request = $_GET; |
| 10 |
| 11 if(strcmp($get_request['x'], '1') == 0 ){ |
| 12 |
| 13 $all_link = $bdd->query("SELECT src_switch, dst_switch FROM topo
logy WHERE event = 'link_up' AND src_switch < dst_switch ORDER BY src_switch "); |
| 14 ················ |
| 15 echo "<h1>See all the link below</h1>"; |
| 16 echo "</br>"."error database: "; |
| 17 if($all_link->errorCode()==0){ |
| 18 echo "no error"; |
| 19 }else{ |
| 20 echo "error: "; |
| 21 print_r($all_link->errorInfo()); |
| 22 } |
| 23 echo "</br>"; |
| 24 echo "<form action=\"draw_link.php\" method=\"post\">"; |
| 25 while ($link = $all_link->fetch()) { |
| 26 $hyperlink = $link['src_switch'] . $link['dst_switch']; |
| 27 echo "<input type=\"checkbox\" name=\"check_list[]\" val
ue=\"".$hyperlink."\"><label>".$hyperlink."</label>". " "; |
| 28 } |
| 29 echo " |
| 30 </br> |
| 31 <input type=\"text\" name=\"time\" placeholder=\"time (m
in)\" /> |
| 32 <input type=\"submit\" value=\"Show\" /> |
| 33 </p> "; |
| 34 |
| 35 } |
| 36 |
| 37 if(strcmp($get_request['x'], '0') == 0 ){ |
| 38 echo " |
| 39 <form action=\"draw_graphs.php\" method=\"post\"> |
| 40 <p> |
| 41 <input type=\"text\" name=\"time\" placeholder=\"time (m
in)\" /> |
| 42 <input type=\"submit\" value=\"Show\" /> |
| 43 </p> "; |
| 44 |
| 45 } |
| 46 |
| 47 |
| 48 } |
| 49 |
OLD | NEW |