Пример #1
0
</h3>
			</div>
			<?php 
    echo $table->show();
    ?>
		</div>
        
    </div>

</div>

<?php 
} elseif ($action == 'add') {
    if (ajax::is()) {
        if (type::post('id')) {
            $config = games::getConfig(type::post('id'));
            $return = '';
            foreach ($config['vars'] as $key => $var) {
                $return .= '<div class="input row">';
                $return .= '<label class="col-sm-5">' . $var['name'] . '</label>';
                $return .= '<div class="col-sm-7">';
                if (strpos($var['type'], ',') !== false) {
                    $values = explode(',', $var['type']);
                    $return .= '<select name="var[' . $key . ']">';
                    foreach ($values as $option) {
                        $return .= '<option value="' . $option . '">' . $option . '</option>';
                    }
                    $return .= '</select>';
                } else {
                    $return .= '<input type="text" name="var[' . $key . ']">';
                }