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
<?php
$sid = $_GET['id'];
if (checkserver($sid)) { ?>
	<table border="0" cellpadding="0" cellspacing="0">
	 <form id="form2" name="Remote Control" method="post" action="?p=remote&id=<?php echo $sid; ?>">
	 <tr><td>Status:</td><td><?php $_SESSION['state']=server_status("localhost",$_SESSION['curserv']['port']);?></td></tr>
<label><tr><td><input type="radio" name="radio" <? if ($_SESSION['state']!=0){echo "DISABLED";} ?> value="1" /></td><td>Start Server</td></tr></label>
<label><tr><td><input type="radio" name="radio" <? if ($_SESSION['state']!=2){echo "DISABLED";} ?> value="2" /></td><td>Stop Server (Soft Stop)</td></tr></label>
<label><tr><td><input type="radio" name="radio" <? if ($_SESSION['state']!=1){echo "DISABLED";} ?> value="3" /></td><td>Stop Server (Hard Stop)</td></tr></label>
<label><tr><td><input type="radio" name="radio" <? if ($_SESSION['state']!=2){echo "DISABLED";} ?> value="4" /></td><td>Restart Server (Soft Restart)</td></tr></label>
<label><tr><td><input type="radio" name="radio" <? if ($_SESSION['state']!=2){echo "DISABLED";} ?> value="5" /></td><td>Mapchange to de_dust</td></tr></label>
<label><tr><td colspan="2" align="center"><input type="submit" name="send" id="send" value="Execute" /></td></tr></label>
</form>
	</table>
<?php
	$radio = $_POST['radio'];
	$meta='<meta http-equiv="refresh" content="1; URL=?p=remote&id='.$sid.'"';
	if ($radio == 1) {
		$exec = "exec ".$_SESSION['curserv']['dir']."cs2d_dedicated.exe -name ".$_SESSION['curserv']['name']." -port ".$_SESSION['curserv']['port']." -maxplayers ".$_SESSION['curserv']['maxpl'];
		exec($exec);
		echo "Server started!";
		echo $meta;
	} elseif ($radio == 2) {
		send_command("localhost",$_SESSION['curserv']['port'],$_SESSION['curserv']['rcon'],"quit");
		echo "Server stoped!";
		echo $meta;
	} elseif ($radio == 3) {
		exec("taskkill /IM cs2d_dedicated.exe");
		echo "Server killed!";
		echo $meta;
	} elseif ($radio == 4) {
		send_command("localhost",$_SESSION['curserv']['port'],$_SESSION['curserv']['rcon'],"quit");
		$exec = "exec ".$_SESSION['curserv']['dir']."cs2d_dedicated.exe -name ".$_SESSION['curserv']['name']." -port ".$_SESSION['curserv']['port']." -maxplayers ".$_SESSION['curserv']['maxpl'];
		exec($exec);
		echo "Server restarted!";
		echo $meta;
	} elseif ($radio == 5) {
		send_command("localhost",$_SESSION['curserv']['port'],$_SESSION['curserv']['rcon'],"changemap de_dust");
		echo "Server changed map to de_dust!";
		echo $meta;
	}
}
?>