2009-08-13 06:45:39 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* update the condition&response association
|
|
|
|
*/
|
|
|
|
|
2009-09-01 20:25:18 +00:00
|
|
|
if(!isset($TOPDIR)) { $TOPDIR="..";}
|
2009-08-13 06:45:39 +00:00
|
|
|
|
|
|
|
require_once "$TOPDIR/lib/functions.php";
|
|
|
|
require_once "$TOPDIR/lib/security.php";
|
|
|
|
require_once "$TOPDIR/lib/display.php";
|
|
|
|
require_once "$TOPDIR/js/jsonwrapper.php";
|
|
|
|
|
2009-12-11 02:58:43 +00:00
|
|
|
$xml = docmd("webrun", "", array("lscondresp"));
|
|
|
|
if(getXmlErrors($xml,$errors)) {
|
|
|
|
echo "<p class=Error>",implode(' ', $errors), "</p>";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
//get all the condition&response associations for RMC
|
|
|
|
foreach ($xml->children() as $response) foreach($response->children() as $data) {
|
|
|
|
//get the data from xcatd
|
|
|
|
$record = split('"',$data);
|
|
|
|
echo "<tr>";
|
2009-12-07 09:42:14 +00:00
|
|
|
echo <<<TOS6
|
2009-12-11 02:58:43 +00:00
|
|
|
<td>$record[1]</td>
|
|
|
|
<td>$record[3]</td>
|
|
|
|
<td>$record[5]</td>
|
|
|
|
<td>$record[7]</td>
|
2009-12-07 09:42:14 +00:00
|
|
|
TOS6;
|
2009-12-11 02:58:43 +00:00
|
|
|
//TODO: insert the button here
|
|
|
|
echo "<td>";
|
|
|
|
if($record[7] == "Active") {
|
|
|
|
echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"stop\")'>Disable</button>";
|
|
|
|
}else {
|
|
|
|
echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"start\")'>Enable</button>";
|
2009-08-13 06:45:39 +00:00
|
|
|
}
|
2009-12-11 02:58:43 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
2009-12-07 09:42:14 +00:00
|
|
|
// echo "</tbody></table>";
|
2009-08-13 06:45:39 +00:00
|
|
|
?>
|