} } if ($action == 'install' && $id) { $server = new server($id); $server->install(); $return = message::success(lang::get('server_install')); } if (ajax::is()) { if ($action == 'start' && $id) { $server = new server($id); $server->start(); $return = message::success(lang::get('server_started')); } if ($action == 'stop' && $id) { $server = new server($id); $server->stop(); $return = message::success(lang::get('server_stopped')); } ajax::addReturn($return); } $table = new table(); $table->addCollsLayout('25, 32%, *, 70, 170'); $table->addRow()->addCell("\n\t\t\t<input type='checkbox' id='all'>\n\t\t\t<label for='all'></label>\n\t\t", ['class' => 'checkbox'])->addCell(lang::get('name'))->addCell(lang::get('game'))->addCell(lang::get('port'))->addCell(lang::get('status')); $table->addSection('tbody'); $table->setSql('SELECT * FROM ' . sql::table('server')); if ($table->numSql()) { while ($table->isNext()) { $id = $table->get('id'); $server = new server($id); $status = $server->status($table->get('status')); $table->addRow()->addCell("\n\t\t\t\t\t<input type='checkbox' name='ids[]' value='" . $id . "' id='id" . $id . "'>\n\t\t\t\t\t<label for='id" . $id . "'></label>\n\t\t\t\t", ['class' => 'checkbox'])->addCell($table->get('name'))->addCell($table->get('gameID'))->addCell($table->get('port'))->addCell($status, ['class' => 'toggleState']);