$status_message = WEB::_error('Record couldn\'t be viewed. Check ID #!', null); } // Handle Post Request if (WEB::_req('POST')) { $msg = WEB::_imageUpload($_FILES['image']); if (!array_key_exists('error', $msg)) { $band_id = WEB::_post('band_id'); $record_current_value = WEB::_post('record_current_value'); $record_size = WEB::_post('record_size'); $record_original_price = WEB::_post('record_original_price'); $record_release_date = WEB::_post('record_release_date'); $record_name = WEB::_post('record_name'); $record_description = WEB::_post('record_description'); $record_condition = WEB::_post('record_condition'); $record_length = WEB::_post('record_length'); $genre_id = WEB::_post('genre_id'); $record_artwork = $msg['file_path']; // array($band_id, $record_current_value, $record_size, $record_original_price, $record_release_date, // $record_name, $record_description, $record_condition, $record_length, $genre_id, $record_artwork) $form_error = $r->validateParams(array($band_id, $record_current_value, $record_size, $record_original_price, $record_release_date, $record_name, $record_description, $record_condition, $record_length, $genre_id, $record_artwork)); $updateStatus = true; if (is_null($form_error)) { if (!is_null($band_id)) { $updateStatus = $r->updateBandId($band_id); } if ($updateStatus && !is_null($record_current_value)) { $updateStatus = $r->updateRecordCurrentValue($record_current_value); } if ($updateStatus && !is_null($record_size)) { $updateStatus = $r->updateRecordSize($record_size); }
// Status messages, default to nothing $form_error = null; $p = new Performer(); $p->auth(null); $b = new Bandmate(); $bandmateList = $b->getBandmateAsSelectWithPerformerId($p->getPerformerId()); $bd = new Band(); $bandList = $bd->getBandAsSelect(); // Handle Post Request if (WEB::_req('POST')) { $msg = WEB::_imageUpload($_FILES['image']); if (!array_key_exists('error', $msg)) { // $performer_name, $performer_date_of_birth, $performer_bio, $performer_cover $performer_name = WEB::_post('performer_name'); $performer_date_of_birth = WEB::_post('performer_date_of_birth'); $performer_bio = WEB::_post('performer_bio'); $performer_cover = $msg['file_path']; // Passed as: array($performer_name, performer_date_of_birth, performer_bio, performer_cover) $form_error = $p->validateParams(array($performer_name, $performer_date_of_birth, $performer_bio, $performer_cover)); if (is_null($form_error) && !is_null($performer_name) && !is_null($performer_date_of_birth) && $p->createPerformer($performer_name, $performer_date_of_birth, $performer_bio, $performer_cover)) { $status_message = WEB::_success('Performer Successfully Created!'); } else { $status_message = WEB::_error('There is an error when you were creating the Performer. Please review the form below!', $form_error); } // Handle adding multiple Bands if ($b->updateBandsWithPerformerId($p->getPerformerId(), WEB::_select('band_ids'))) { $bandmateList = $b->getBandmateAsSelectWithPerformerId($p->getPerformerId()); $status_message = WEB::_success('Bands Updated Successfully!'); } else { $status_message = WEB::_error('There is an error when you were updating the Bands.', null); }
$u->auth(null); $u->init(WEB::_get('id')); if (!$u->valid()) { $status_message = WEB::_error('User couldn\'t be viewed. Check ID #!', null); } if (WEB::_action('generate_new_api_key')) { if (!$u->generateNewApiKey()) { $status_message = WEB::_error('Failed to Genereate New API Key!', null); } } // Handle Post Request if (WEB::_req('POST')) { $user_name = WEB::_post('user_name'); $user_email = WEB::_post('user_email'); $user_password = WEB::_post('user_password'); $user_notify = WEB::_post('user_notify'); $form_error = $u->validateParams(array($user_name, $user_email, $user_password)); $updateStatus = true; if (is_null($form_error)) { if (!is_null($user_name)) { $updateStatus = $u->updateUserName($user_name); } if ($updateStatus && !is_null($user_email)) { $updateStatus = $u->updateUserEmail($user_email); } if ($updateStatus && !is_null($user_email)) { $updateStatus = $u->updateUserPassword($user_password); } if ($updateStatus) { $updateStatus = $u->updateUserNotify($user_notify); }
$bandmateList = $b->getBandmateAsSelectWithBandId(null); $p = new Performer(); $performerList = $p->getPerformerAsSelect(); // Populate Genre Select List $l = new Label(); $labelList = $l->getLabelAsSelect(); // Handle Post Request if (WEB::_req('POST')) { $msg = WEB::_imageUpload($_FILES['image']); if (!array_key_exists('error', $msg)) { $band_name = WEB::_post('band_name'); $band_formed_date = WEB::_post('band_formed_date'); $band_break_up_date = WEB::_post('band_break_up_date'); $band_cover = $msg['file_path']; $band_bio = WEB::_post('band_bio'); $label_id = WEB::_post('label_id'); // array($band_name, $band_formed_date, $band_break_up_date, $band_cover, $band_bio) $form_error = $bd->validateParams(array($band_name, $band_formed_date, $band_break_up_date, $band_cover, $band_bio, $label_id)); if (is_null($form_error) && !is_null($band_name) && !is_null($band_formed_date) && $bd->createBand($band_name, $band_formed_date, $band_break_up_date, $band_cover, $band_bio, $label_id)) { $status_message = WEB::_success('Band Successfully Created!'); } else { $status_message = WEB::_error('There is an error when you were creating the Band. Please review the form below!', $form_error); } // Handle adding multiple performers if ($b->updatePerformersWithBandId($bd->getBandId(), WEB::_select('performer_ids'))) { $bandmateList = $b->getBandmateAsSelectWithBandId($bd->getBandId()); $status_message = WEB::_success('Band Successfully Created!'); } else { $status_message = WEB::_error('There is an error when you were updating the Performers.', null); } } else {
<?php require __DIR__ . "/../bourbon/genre.php"; $status_message = ''; // Status messages, default to nothing $g = new Genre(); $g->auth(null); $g->init(WEB::_get('id')); if (!$g->valid()) { $status_message = WEB::_error('Genre couldn\'t be viewed. Check ID #!', null); } // Handle Post Request if (WEB::_req('POST')) { $genre_name = WEB::_post('genre_name'); // array($genre_name) $form_error = $g->validateParams(array($genre_name)); if (is_null($form_error)) { if (!is_null($genre_name)) { $updateStatus = $g->updateGenre($genre_name); } if ($updateStatus) { $g->refresh(); $status_message = WEB::_success('Genre Successfully updated!'); } else { $status_message = WEB::_error('There is an error when you were updating the Genre. Please make sure you\'re not adding duplicates!', $form_error); } } else { $status_message = WEB::_error('There is an error when you were updating the Genre. Please review the form below!', $form_error); } } ?>
<?php require __DIR__ . "/../bourbon/label.php"; $status_message = ''; // Status messages, default to nothing $form_error = null; $l = new Label(); $l->auth(null); // Handle Post Request if (WEB::_req('POST')) { $label_name = WEB::_post('label_name'); $label_founded_year = WEB::_post('label_founded_year'); $label_parent_company = WEB::_post('label_parent_company'); $label_bio = WEB::_post('label_bio'); $form_error = $l->validateParams(array("{$label_name}", "{$label_founded_year}", "{$label_parent_company}", "{$label_bio}")); if (is_null($form_error) && !is_null($label_name) && !is_null($label_founded_year) && !is_null($label_parent_company) && $l->createLabel($label_name, $label_founded_year, $label_parent_company, $label_bio)) { $status_message = WEB::_success('Label Successfully Created!'); } else { $status_message = WEB::_error('There is an error when you were creating the Label. Label you are trying to create may already exist. Please review the form below!', $form_error); } } ?> <?php include __DIR__ . "/../bourbon/template/header.php"; ?> <div class="page-header"> <h1>Create a New Label<small></small></h1>