Ejemplo n.º 1
0
    $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);
        }
    } else {
        $status_message = WEB::_error('Unable to upload Performer Cover. ' . $msg['error'], null);
    }
}
?>


<?php 
include __DIR__ . "/../bourbon/template/header.php";
?>
Ejemplo n.º 2
0
    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 {
        $status_message = WEB::_error('Unable to upload Band Cover. ' . $msg['error'], null);
    }
}
?>


<?php 
include __DIR__ . "/../bourbon/template/header.php";
?>