* @copyright 2017 MyAAC * @link http://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Player editor'; $base = BASE_URL . 'admin/?p=players'; function echo_success($message) { echo '
' . $message . '
'; } function echo_error($message) { global $error; echo '' . $message . '
'; $error = true; } function verify_number($number, $name, $max_length) { if(!Validator::number($number)) echo_error($name . ' can contain only numbers.'); $number_length = strlen($number); if($number_length <= 0 || $number_length > $max_length) echo_error($name . ' cannot be longer than ' . $max_length . ' digits.'); } $skills = array( POT::SKILL_FIST => array('Fist fighting', 'fist'), POT::SKILL_CLUB => array('Club fighting', 'club'), POT::SKILL_SWORD => array('Sword fighting', 'sword'), POT::SKILL_AXE => array('Axe fighting', 'axe'), POT::SKILL_DIST => array('Distance fighting', 'dist'), POT::SKILL_SHIELD => array('Shielding', 'shield'), POT::SKILL_FISH => array('Fishing', 'fish') ); ?> query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote($_REQUEST['search_name'])); if($query->rowCount() == 1) { $query = $query->fetch(); $id = $query['id']; } else { $query = $db->query('SELECT `id`, `name` FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $_REQUEST['search_name'] . '%')); if($query->rowCount() > 0 && $query->rowCount() <= 10) { echo 'Do you mean?