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
| <html>
<head>
<title>
<?php
$args = array();
$busy = 0;
$status = exec("bash status.bash", $args, $busy);
echo "test Machine: $status"
?>
</title>
</head>
<body>
<?php
$status = exec("bash status.bash", $args, $busy);
?>
<TABLE BORDER=1 style=text-align:right>
<TR>
<TD>Status
<TD><?php echo "$status";?></TD>
</TR>
<?php
if ($busy==0)
{
?> <TR style=text-align:center>
<TD COLSPAN=2 >
<form action="index.php" method="post">
<input type="submit" name="start" value="start">
<?php /* si on appuie sur le bouton star et que busy est a zero on doit lancer le script test .bash et afficher test in progress
mais vue que lors de l'envoit du formulaire la page est actualiser automatiquement on recommence du debut
et on n'affiche pas test in progress*/
?> </form>
</TD>
</TR>
</TABLE>
<?php
if (!$busy)
{
if (isset($_POST["start"]))
{
$command = "start /b test.exe test.bash";
pclose(popen($command, 'r'));
echo "initiating process...";
while($busy==1)
{
echo " test 3 test in progress";
}
?> <META HTTP-EQUIV=Refresh CONTENT="4">
<?php }
else
{
?> <META HTTP-EQUIV=Refresh CONTENT="20">
<?php }
}
else
{
echo "test 2 test already started...";
?> <META HTTP-EQUIV=Refresh CONTENT="5"><?php
}
}
else
{
?> <TR>
<TD COLSPAN=2 style=text-align:center>
test 1 test already started...!!!</br>please wait !!!</TD>
</TR>
</TABLE>
<META HTTP-EQUIV=Refresh CONTENT="5">
<?php
}
?>
</body>
</html> |