$query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $json_return['form_extra'] .= createDatalistInput($get_row['ammunitionType'], $_POST['form'], "ammunitionType", "Ammunition type:", $required, $query_results, "ammunitionType", $L_DATALIST_HINT . '<br>' . $L_DAMAGE_TYPE_HINT); } $sql = "SELECT * FROM property WHERE appliesTo='weapon'"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $json_return['form_extra'] .= createDatalistInput($get_row['property'], $_POST['form'], "property", "Property:", NULL, $query_results, "property", $L_DATALIST_HINT . '<br>' . $L_DAMAGE_TYPE_HINT); $json_return['form_extra'] .= createDiceInput($get_row['damage'], $_POST['form'], "damage", "Damage:", $required, $L_DICE_HINT . '<br>' . $L_DAMAGE_HINT); $sql = "SELECT * FROM damageType"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $json_return['form_extra'] .= createDatalistInput($get_row['damageType'], $_POST['form'], "damageType", "Damage type:", $required, $query_results, "damageType", $L_DATALIST_HINT . '<br>' . $L_DAMAGE_TYPE_HINT); $json_return['form_extra'] .= createDiceInput($get_row['secondaryDamage'], $_POST['form'], "secondaryDamage", "Secondary Damage:", NULL, $L_DICE_HINT . '<br>' . $L_SECONDARY_DAMAGE_HINT); $json_return['form_extra'] .= createDatalistInput($get_row['secondaryDamageType'], $_POST['form'], "secondaryDamageType", "Secondary damage type:", NULL, $query_results, "damageType", $L_DATALIST_HINT . '<br>' . $L_SECONDARY_DAMAGE_TYPE_HINT); } else { $json_return['status'] = "FAILED"; $json_return['message'] = 'Not a recognized type.'; } } } } } } } } catch (PDOException $e) { $json_return['status'] = "FAILED"; $json_return['message'] = $e->getMessage(); } // send json
<?php // assumes $mode is set // variables $folder_ext = '../../'; $singular_tag_cap = 'Skill'; $table_name = 'skill'; $unique_id = 'name'; $paragraph_desc_edit = ""; $paragraph_desc_create = 'Skills are active actions that a player/creature can perform. This is usually done outside of combat. Skill success is determined by a d20 roll against a DM defined difficulty. Skills have modifiers that can modify the d20 roll.'; // assumes $mode is set require_once $folder_ext . 'php/form_helper_start.php'; $html_form .= createDatalistInput($get_row['attribute'], $form_id, "attribute", "Attribute:", $required, array('STR', 'DEX', 'INF', 'WIS'), NULL, $L_DATALIST_HINT . '<br>' . $L_ATTRIBUTE_HINT); $sql = "SELECT * FROM skill GROUP BY type"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistAnyInput($get_row['type'], $form_id, "type", "Type:", $required, $query_results, "type", $L_DATALIST_ANY_HINT . '<br>' . $L_SKILL_TYPE_HINT); $html_form .= createTextareaInput($get_row['description'], $form_id, "description", "Description:", "7", $required, $L_DESCRIPTION_HINT); require_once $folder_ext . 'php/form_helper_end.php';
// assumes $mode is set // variables $folder_ext = '../../'; $singular_tag_cap = 'Ability'; $table_name = 'ability'; $unique_id = 'name'; $paragraph_desc_edit = ""; $paragraph_desc_create = 'Abilities are passive actions that are automatically applied or active actions that a player/creature can perform.'; // assumes $mode is set require_once $folder_ext . 'php/form_helper_start.php'; // get ability types from server $sql = "SELECT * FROM abilityType"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['type'], $form_id, "type", "Type of ability:", $required, $query_results, "type", $L_DATALIST_HINT . '<br>' . $L_TYPE_ABILITY_HINT); $sql = "SELECT * FROM target"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['target'], $form_id, "target", "Target:", $required, $query_results, "target", $L_DATALIST_HINT . '<br>' . $L_TARGET_HINT); $html_form .= createNumberInput($get_row['targetNum'], $form_id, "targetNum", "Number of targets:", "200", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_NUM_TARGET_HINT); $html_form .= createNumberInput($get_row['range'], $form_id, "range", "Range (ft):", "10000", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_RANGE_HINT); $html_form .= createNumberInput($get_row['radius'], $form_id, "radius", "Radius (ft):", "10000", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_RADIUS_HINT); $sql = "SELECT * FROM radiusType"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['radiusType'], $form_id, "radiusType", "Radius type:", NULL, $query_results, 'radiusType', $L_DATALIST_HINT . '<br>' . $L_RADIUS_TYPE_HINT); $html_form .= createTextareaInput($get_row['description'], $form_id, "description", "Description:", "7", $required, $L_DESCRIPTION_HINT); require_once $folder_ext . 'php/form_helper_end.php';
$statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistAnyInput($get_row['components'], $form_id, "components", "Components:", NULL, $query_results, "components", $L_DATALIST_ANY_HINT . '<br>' . $L_COMPONENTS_HINT); $sql = "SELECT * FROM spell GROUP BY duration"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistAnyInput($get_row['duration'], $form_id, "duration", "Duration:", NULL, $query_results, "duration", $L_DATALIST_ANY_HINT . '<br>' . $L_DURATION_HINT); $sql = "SELECT * FROM target"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['target'], $form_id, "target", "Target:", $required, $query_results, "target", $L_DATALIST_HINT . '<br>' . $L_TARGET_HINT); $html_form .= createNumberInput($get_row['targetNum'], $form_id, "targetNum", "Number of targets:", "200", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_NUM_TARGET_HINT); $html_form .= createNumberInput($get_row['range'], $form_id, "range", "Range (ft):", "10000", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_RANGE_HINT); $html_form .= createNumberInput($get_row['radius'], $form_id, "radius", "Radius (ft):", "10000", "0", NULL, $L_NUMBER_HINT . '<br>' . $L_RADIUS_HINT); $sql = "SELECT * FROM radiusType"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['radiusType'], $form_id, "radiusType", "Radius type:", NULL, $query_results, 'radiusType', $L_DATALIST_HINT . '<br>' . $L_RADIUS_TYPE_HINT); $html_form .= createDiceInput($get_row['damage'], $form_id, "damage", "Damage:", NULL, $L_DICE_HINT . '<br>' . $L_DAMAGE_HINT); $sql = "SELECT * FROM damageType"; $statement = $database->prepare($sql); $statement->execute(); $query_results = $statement->fetchAll(PDO::FETCH_ASSOC); $html_form .= createDatalistInput($get_row['damageType'], $form_id, "damageType", "Damage type:", NULL, $query_results, "damageType", $L_DATALIST_HINT . '<br>' . $L_DAMAGE_TYPE_HINT); $html_form .= createDiceInput($get_row['secondaryDamage'], $form_id, "secondaryDamage", "Secondary Damage:", NULL, $L_DICE_HINT . '<br>' . $L_SECONDARY_DAMAGE_HINT); $html_form .= createDatalistInput($get_row['secondaryDamageType'], $form_id, "secondaryDamageType", "Secondary damage type:", NULL, $query_results, "damageType", $L_DATALIST_HINT . '<br>' . $L_SECONDARY_DAMAGE_TYPE_HINT); $html_form .= createTextareaInput($get_row['description'], $form_id, "description", "Description:", "7", $required, $L_DESCRIPTION_HINT); require_once $folder_ext . 'php/form_helper_end.php';