Jump to content
  • 0

execute function


majussiani

Question

Hello, I'm doing a module and everything is working properly, but I wanted to remove the functions that are on the side and leave only on the panel. When I remove the side button from the "ClientAreaCustomButtonArray" the menu button stops running. How can I call this function?

"I'm newbie". thanks

function *_desligar($params) {
$HOST1 = $params["serverip"]; $PORT = "22"; $USER = $params["serverusername"]; $PASS = $params["serverpassword"];
$command = 'service a3exile stop';
$connection = ssh2_connect($HOST1, $PORT);
ssh2_auth_password($connection, $USER, $PASS);
$stream = ssh2_exec($connection, $command);
return 'success';
}

function *_ligar($params) {
$HOST1 = $params["serverip"]; $PORT = "22"; $USER = $params["serverusername"]; $PASS = $params["serverpassword"];
$command = 'service a3exile start';
$connection = ssh2_connect($HOST1, $PORT);
ssh2_auth_password($connection, $USER, $PASS);
$stream = ssh2_exec($connection, $command);
return 'success';
}

function *_reiniciar($params) {
$HOST1 = $params["serverip"]; $PORT = "22"; $USER = $params["serverusername"]; $PASS = $params["serverpassword"];
$command = 'service a3exile restart';
$connection = ssh2_connect($HOST1, $PORT);
ssh2_auth_password($connection, $USER, $PASS);
$stream = ssh2_exec($connection, $command);
return 'success';
}

function *_ClientAreaCustomButtonArray() { 
   $buttonarray = array( 
		('Ligar') => "ligar",
		('Desligar') => "desligar",
		('Reiniciar') => "reiniciar",
		('Atualizar Arma 3') => "atualizar",
		('Restart 1 hora') => "restart1",
		('Restart 2 horas') => "restart2",
		('Restart 3 horas') => "restart3",
		('Restart 4 horas') => "restart4",
		('Restart 6 horas') => "restart6"
   ); 
   return $buttonarray;
}

function *_ClientArea($params) {
    $code = '
<h3 class="text-center"> Painel </h3>
	<div class="col-xs-12 text-left">
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=ligar" class="btn btn-success btn-xs btn-block"></span> Ligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=desligar" class="btn btn-danger btn-xs btn-block"></span> Desligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=reiniciar" class="btn btn-warning btn-xs btn-block"></span> Reiniciar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=atualizar" class="btn btn-primary btn-xs btn-block"></span> Atualizar Arma 3 </a>
	<br>
	</div>
<br>
    return $code;
}

 

arma.thumb.png.40a7b390f299e855f628d4f76dd21780.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Maybe (maybe) it's just me, maybe you messed up on the C&P, but this is the first thing I see wrong

 

function *_ClientArea($params) {
    $code = '
<h3 class="text-center"> Painel </h3>
	<div class="col-xs-12 text-left">
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=ligar" class="btn btn-success btn-xs btn-block"></span> Ligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=desligar" class="btn btn-danger btn-xs btn-block"></span> Desligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=reiniciar" class="btn btn-warning btn-xs btn-block"></span> Reiniciar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=atualizar" class="btn btn-primary btn-xs btn-block"></span> Atualizar Arma 3 </a>
	<br>
	</div>
<br>
    return $code;
}

This should be

function *_ClientArea($params) {
    $code = '
<h3 class="text-center"> Painel </h3>
	<div class="col-xs-12 text-left">
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=ligar" class="btn btn-success btn-xs btn-block"></span> Ligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=desligar" class="btn btn-danger btn-xs btn-block"></span> Desligar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=reiniciar" class="btn btn-warning btn-xs btn-block"></span> Reiniciar </a>
		  <a href="clientarea.php?action=productdetails&id='.$params['serviceid'].'&modop=custom&a=atualizar" class="btn btn-primary btn-xs btn-block"></span> Atualizar Arma 3 </a>
	<br>
	</div>
<br>';
    return $code;
}

Again, maybe that's just a c&P issue from your code to post (made those mistakes before, too), but the way you have it pasted, it aint gonna work, it'll throw a 500 ISE because it's not syntaxically correct

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated