<?php // parsing posted data: if (isset($_POST['dovenueedit'])) { $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'editvenue', 'id' => $request_parameters[0], 'name' => $_POST['venue_name'], 'city' => $_POST['venue_city'], 'region' => $_POST['venue_region'], 'country' => $_POST['venue_country'], 'address1' => $_POST['venue_address1'], 'address2' => $_POST['venue_address2'], 'postalcode' => $_POST['venue_postalcode'], 'url' => $_POST['venue_url'], 'phone' => $_POST['venue_phone']), 'venueeditattempt'); } $current_venue_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'getvenue', 'venue_id' => $request_parameters[0]), 'getvenue'); $current_venue = $current_venue_response['payload']; if (is_array($current_venue)) { $cash_admin->page_data = array_merge($cash_admin->page_data, $current_venue); } $cash_admin->page_data['form_state_action'] = 'dovenueedit'; $cash_admin->page_data['venue_button_text'] = 'Edit the venue'; $cash_admin->page_data['country_options'] = AdminHelper::drawCountryCodeUL($current_venue['country']); $cash_admin->setPageContentTemplate('calendar_venues_details');
<label for="venue_region">State / Provence / Region</label><br /> <input type="text" id="venue_region" name="venue_region" value="<?php echo $current_venue['region']; ?> " /> </div> <div class="row_seperator">.</div> <div class="col_oneoftwo"> <label for="venue_postalcode">Postal Code</label><br /> <input type="text" id="venue_postalcode" name="venue_postalcode" value="<?php echo $current_venue['postalcode']; ?> " /> </div> <div class="col_oneoftwo lastcol"> <label for="venue_country">Country</label><br /> <select id="venue_country" name="venue_country"> <?php echo AdminHelper::drawCountryCodeUL($current_venue['country']); ?> </select> </div> <div class="row_seperator">.</div><br /> <input class="button" type="submit" value="Edit The Venue" /> </form> <?php }
$addvenue_address1 = ''; $addvenue_address2 = ''; $addvenue_postalcode = ''; $addvenue_url = ''; $addvenue_phone = ''; if (isset($_POST['venue_address1'])) { $addvenue_address1 = $_POST['venue_address1']; } if (isset($_POST['venue_address2'])) { $addvenue_address2 = $_POST['venue_address2']; } if (isset($_POST['venue_postalcode'])) { $addvenue_postalcode = $_POST['venue_postalcode']; } if (isset($_POST['venue_url'])) { $addvenue_url = $_POST['venue_url']; } if (isset($_POST['venue_phone'])) { $addvenue_phone = $_POST['venue_phone']; } $add_response = $cash_admin->requestAndStore(array('cash_request_type' => 'calendar', 'cash_action' => 'addvenue', 'name' => $_POST['venue_name'], 'city' => $_POST['venue_city'], 'region' => $_POST['venue_region'], 'country' => $_POST['venue_country'], 'address1' => $addvenue_address1, 'address2' => $addvenue_address2, 'postalcode' => $addvenue_postalcode, 'url' => $addvenue_url, 'phone' => $addvenue_phone)); if ($add_response['payload']) { AdminHelper::formSuccess('Success. Venue added.', '/calendar/venues/edit/' . $add_response['payload']); } else { AdminHelper::formFailure('Error. Something just didn\'t work right.', '/calendar/venues/add/'); } } $cash_admin->page_data['form_state_action'] = 'dovenueadd'; $cash_admin->page_data['venue_button_text'] = 'Add the venue'; $cash_admin->page_data['country_options'] = AdminHelper::drawCountryCodeUL(); $cash_admin->setPageContentTemplate('calendar_venues_details');
</div> <div class="col_oneoftwo lastcol"> <label for="venue_region">State / Provence / Region</label><br /> <input type="text" id="venue_region" name="venue_region" value="" placeholder="Region" /> </div> <div class="row_seperator">.</div> <div class="col_oneoftwo"> <label for="venue_postalcode">Postal Code</label><br /> <input type="text" id="venue_postalcode" name="venue_postalcode" value="" placeholder="Postal Code" /> </div> <div class="col_oneoftwo lastcol"> <label for="venue_country">Country</label><br /> <select id="venue_country" name="venue_country"> <?php echo AdminHelper::drawCountryCodeUL(); ?> </select> </div> <div class="row_seperator">.</div><br /> <input class="button" type="submit" value="Add That Venue" /> </form> <?php } else { $add_venue_response = $cash_admin->getStoredResponse('venueaddattempt'); if ($add_venue_response['status_uid'] == 'calendar_addvenue_200') { ?> <h3>Success</h3>