public static function _inquirePrompt($id) { if (!WEB::_loggedIn()) { echo "<a href=\"view/inquire.php?id={$id}\" role=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#inquireModal\">Inquire</a>"; } else { echo ''; } }
" /> <div class="desc"> <p class="view_more">More Details</p> <p class="big_name"><?php echo $performerList[$i]['performer_name']; ?> </p> </div> </div> </a> </li> <?php } ?> </ul> <?php } ?> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">Close</button> <?php WEB::_deletePrompt('band', $bd->getBandId(), "You will be deleting just a band."); ?> <?php WEB::_updatePrompt('band', $bd->getBandId()); ?> </div> <?php }
?> </td> <td><?php echo $u->getUserEmail(); ?> </td> <td><?php echo $u->getUserNotify() == 1 ? 'Notify' : ''; ?> </td></td> <td><?php echo $u->getApiKey(); ?> </td> </tr> </tbody> </table> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">Close</button> <?php WEB::_deletePrompt('user', $u->getUserId(), "You will be deleting only a user."); ?> <?php WEB::_updatePrompt('user', $u->getUserId()); ?> </div> <?php }
echo 'selected'; } ?> ><?php echo $bandList[$i]['band_name']; ?> </option> <?php } ?> </select> </div> <div class="form-group <?php WEB::_ferror('record_artwork', $form_error); ?> "> <label for="record_artwork">Artwork</label> <input type="file" class="form-control" placeholder="Enter Artwork" id="image" name="image" value="<?php echo $r->getRecordArtwork(); ?> "> <p class="help-block"><i><?php echo ($r->getRecordArtwork() !== '' ? "File - <strong>" . str_replace("uploads/", "", $r->getRecordArtwork()) : '') . "</strong></i>"; ?> </p> </div> <button type="submit" class="btn btn-default">Submit</button> </form>
" required> </div> <div class="form-group <?php WEB::_ferror('performer_bio', $form_error); ?> "> <label for="performer_bio">Performer Biography</label> <textarea class="form-control" rows="3" placeholder="Enter Performer Biography (Optional)" id="performer_bio" name="performer_bio"><?php echo $p->getPerformerBio(); ?> </textarea> </div> <div class="form-group <?php WEB::_ferror('band_ids', $form_error); ?> "> <label for="band_ids">Bands</label> <select class="cs form-control sp" id="band_ids" name="band_ids[]" multiple="multiple" size="5"> <?php for ($i = 0; $i < sizeof($bandList); $i++) { ?> <option value="<?php echo $bandList[$i]['band_id']; ?> "<?php if (!is_null($bandmateList) && array_key_exists($bandList[$i]['band_id'], $bandmateList)) { echo 'selected'; } ?>
<?php require __DIR__ . "/bourbon/login.php"; $status_message = ''; // Status messages, default to nothing // List View $l = new Login(); if (isset($_GET['auth'])) { if (!$l->authAccount()) { $status_message = WEB::_error('Authentication Failed! Check Email or Password!', null); } } ?> <!-- // Begin Genre Template (List View) --> <?php include __DIR__ . "/bourbon/template/header.php"; ?> <div class="row"> <div class="col-md-6"> <div class="page-header"> <h1>Login<small></small></h1> </div> <?php echo $status_message;
<?php require_once __DIR__ . "/../bourbon/record.php"; $r = new Record(); $r->init(WEB::_get('id')); ?> <?php if (!$r->valid()) { ?> <!-- // Invalid Record --> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Invalid Record Inquiry</h4> </div> <div class="modal-body"> <p>It looks like you were trying to inquire about a record that we no longer have.</p> </div> <?php } else { ?> <!-- // Valid Record --> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title"> <strong><?php echo $r->getRecordName(); ?> </strong> by <?php echo $r->getBandName();
?> </ul> <?php WEB::_pageinate($page, $numOfBands); ?> </div> <?php if (WEB::_loggedIn()) { ?> <div class="col-lg-3 col-md-1"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('band'); ?> ">Add a New Band</a></li> </ul> </div> <?php } ?> </div> <?php include __DIR__ . "/bourbon/template/footer.php"; ?>
" required> </div> <div class="form-group <?php WEB::_ferror('label_parent_company', $form_error); ?> "> <label class="control-label" for="label_parent_company">Parent Company *</label> <input type="text" class="form-control" placeholder="Enter Label Parent Company" id="label_parent_company" name="label_parent_company" value="<?php echo $l->getLabelParentCompany(); ?> " required> </div> <div class="form-group <?php WEB::_ferror('label_bio', $form_error); ?> "> <label for="label_bio">Label Biography</label> <textarea class="form-control" rows="3" placeholder="Enter Label Biography (Optional)" id="label_bio" name="label_bio"><?php echo $l->getLabelBio(); ?> </textarea> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> </div>
?> </ul> <?php WEB::_pageinate($page, $numOfPerformers); ?> </div> <?php if (WEB::_loggedIn()) { ?> <div class="col-lg-3 col-md-1"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('performer'); ?> ">Add a New Performer</a></li> </ul> </div> <?php } ?> </div> <?php include __DIR__ . "/bourbon/template/footer.php"; ?>
</td> <td><?php echo $r->getRecordCondition(); ?> </td> <td><?php echo $r->getRecordLength(); ?> </td> <td><?php echo $r->getGenreName(); ?> </td> </tr> </tbody> </table> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">Close</button> <?php WEB::_deletePrompt('record', $r->getRecordId(), "You will be deleting only a record."); ?> <?php WEB::_updatePrompt('record', $r->getRecordId()); ?> <?php WEB::_inquirePrompt($r->getRecordId()); ?> </div> <?php }
<?php } ?> </ul> <?php WEB::_pageinate($page, $numOfRec); ?> </div> <?php if (WEB::_loggedIn()) { ?> <div class="col-lg-3 col-md-1"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('record'); ?> ">Add a New Record</a></li> </ul> </div> <?php } ?> </div> <?php include __DIR__ . "/bourbon/template/footer.php";
<?php } ?> </tbody> </table> <?php WEB::_pageinate($page, $numOfLabels); ?> </div> <?php if (WEB::_loggedIn()) { ?> <div class="col-md-4"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('label'); ?> ">Add a New Label</a></li> </ul> </div> <?php } ?> </div> <?php include __DIR__ . "/bourbon/template/footer.php";
<?php require_once __DIR__ . "/../bourbon/libs/bourbon.php"; $details = WEB::_get('d'); $id = WEB::_get('id'); $path = WEB::_get('p'); $url = BOURBON_URL . $path . ".php?delete={$id}"; ?> <!-- // Delete Id --> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title"> <strong>Are You Sure?</strong> </h4> </div> <div class="modal-body delete-view"> <p><?php echo $details; ?> </p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">No, Close</button> <a href="<?php echo $url; ?> " class="btn btn-danger right" role="button">Yes, Delete</a> </div>
$updateStatus = $p->updateUserEmail($user_email); } if ($updateStatus) { $updateStatus = $p->updateUserPassword($user_password); } if ($updateStatus) { $updateStatus = $p->updateUserNotify($user_notify); } if ($updateStatus) { $p->refresh(); $status_message = WEB::_success('Profile Updated Successfully!'); } else { $status_message = WEB::_error('There is an error when you were updating your profile.', $form_error); } } else { $status_message = WEB::_error('There is an error when you were updating your profile. Please review the form below!', $form_error); } } ?> <!-- // Begin Genre Template (List View) --> <?php include __DIR__ . "/bourbon/template/header.php"; ?> <div class="row"> <div class="col-md-6"> <div class="page-header">
<?php require_once __DIR__ . '/libs/bourbon.php'; $b = new Bourbon(); function cidr_match($ip, $range) { list($subnet, $bits) = explode('/', $range); $ip = ip2long($ip); $subnet = ip2long($subnet); $mask = -1 << 32 - $bits; $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned return ($ip & $mask) == $subnet; } // Make sure either an authenticated user or GitHub is running this script if (!WEB::_req('POST')) { $b->auth(null); } else { if (!cidr_match($_SERVER['REMOTE_ADDR'], '192.30.252.0/22')) { header('Location: ' . realpath() . '/index.php'); } } /** * GIT DEPLOYMENT SCRIPT * * Used for automatically deploying websites via github or bitbucket, more deets here: * * https://gist.github.com/1809044 */ // The commands $commands = array('echo $PWD', 'whoami', 'git pull', 'git status', 'git submodule sync', 'git submodule update', 'git submodule status', 'mysqladmin -uroot -proot -f drop bourbon', 'mysqladmin -uroot -proot -f create bourbon', 'mysql -uroot -proot bourbon < /srv/cpsc471-bourbon/sql/latest.sql');
</table> <?php WEB::_pageinate($page, $numOfGenres); ?> </div> <div class="col-md-2"></div> <?php if (WEB::_loggedIn()) { ?> <div class="col-md-4"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('genre'); ?> ">Create a New Genre</a></li> </ul> </div> <?php } ?> </div> <?php include __DIR__ . "/bourbon/template/footer.php"; ?>
?> </a></td> </tr> <?php } ?> </tbody> </table> <?php WEB::_pageinate($page, $numOfUsers); ?> </div> <div class="col-md-3"> <h2>Options</h2> <ul class="nav nav-pills nav-stacked"> <li role="presentation"><a href="<?php WEB::_create('user'); ?> ">Create a New User</a></li> </ul> </div> </div> <?php include __DIR__ . "/bourbon/template/footer.php"; ?>
// Send Email $message = new stdClass(); $message->html = "Hi!<br><br><strong>{$name}</strong> just inquired about: <strong>{$recName}</strong>.<br><br>Email them at: {$email}."; $message->subject = "[Bourbon] New Record Inquiry - {$recName}"; $message->from_email = "{$email}"; $message->from_name = "{$name}"; $message->to = array(array("email" => "{$user_email}")); $message->track_opens = false; $response = $mandrill->messages->send($message); } } catch (Exception $e) { $status_message = WEB::_error('Email failed to dispatch! Mandrill might be down.', null); } $status_message = WEB::_success('Email Dispatched Successfully!', null); } else { $status_message = WEB::_error('Invalid Email Address! Try again!.', null); } ?> <?php include __DIR__ . "/bourbon/template/header.php"; ?> <div class="page-header"> <h1>Inquiry</h1> </div> <?php echo $status_message;
" required> </div> <div class="form-group <?php WEB::_ferror('user_email', $form_error); ?> "> <label class="control-label" for="user_email">User Email *</label> <input type="email" class="form-control" placeholder="Enter User Email" id="user_email" name="user_email" value="<?php echo $u->getUserEmail(); ?> " required> </div> <div class="form-group <?php WEB::_ferror('user_password', $form_error); ?> "> <label class="control-label" for="user_password">User Password *</label> <input type="password" class="form-control" placeholder="Enter User Password" id="user_email" name="user_password" value=""> </div> <div class="checkbox"> <label> <input type="checkbox" name="user_notify" <?php echo $u->getUserNotify() == 1 ? 'checked' : ''; ?> > Notify </label> </div>
if (!is_null($bandmateList) && array_key_exists($bandList[$i]['band_id'], $bandmateList)) { echo 'selected'; } ?> ><?php echo $bandList[$i]['band_name']; ?> </option> <?php } ?> </select> </div> <div class="form-group <?php WEB::_ferror('performer_cover', $form_error); ?> "> <label for="image">Cover Photo (URL)</label> <input type="file" class="form-control" placeholder="Enter Performer Cover" id="image" name="image" value="<?php echo $p->getPerformerCover(); ?> "> <p class="help-block"><i><?php echo ($p->getPerformerCover() !== '' ? "File - <strong>" . str_replace("uploads/", "", $p->getPerformerCover()) : '') . "</strong></i>"; ?> </p> </div> <button type="submit" class="btn btn-default">Submit</button>
</p> <p class="big_name"><?php echo $recordList[$i]['record_name']; ?> </p> </div> </div> </a> </li> <?php } ?> </ul> <?php WEB::_pageinateSearch($page, $numOfRec, $s->pageinate()); ?> <?php } ?> </div> <div class="col-lg-3 col-md-1"> <h2>Search Options</h2> <form action="search.php" role="search"> <div class="form-group"> <label for="r">By Record</label> <input type="text" class="form-control" name="r" placeholder="Maybe Love by The Beatles?" value="<?php echo $s->getRecordParam(); ?>
<?php echo $status_message; ?> <div class="row"> <div class="col-md-6"> <div class="form-header"> <h2>Update <strong><?php echo $g->getGenreName(); ?> </strong></h2> </div> <form role="form" method="post"> <p><i>* Required Field</i></p> <div class="form-group <?php WEB::_ferror('genre_name', $form_error); ?> "> <label for="genre_id">Genre Name *</label> <input type="text" class="form-control" placeholder="Enter Genre Name" id="genre_name" name="genre_name" value="<?php echo $g->getGenreName(); ?> " required> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> </div> <?php include __DIR__ . "/../bourbon/template/footer.php";
<p class="view_more">More Details</p> <p class="big_name"><?php echo $bandList[$i]['band_name']; ?> </p> </div> </div> </a> </li> <?php } ?> </ul> <?php } ?> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">Close</button> <?php WEB::_deletePrompt('performer', $p->getPerformerId(), "You will be deleting only a performer. You will be only allowed to delete a performer if they don't have an associated band"); ?> <?php WEB::_updatePrompt('performer', $p->getPerformerId()); ?> </div> <?php }
public function getRecordAsListWithApi() { $list = array(); $query = "SELECT *\n\t \t\t\tFROM record\n\t\t\t\tJOIN band\n\t\t\t\tJOIN genre\n\t\t\t\tON record.band_id=band.band_id AND record.genre_id = genre.genre_id\n\t\t\t\tORDER BY record.record_id DESC LIMIT " . NUM_OF_RESULTS; $result = mysqli_query(parent::getDb(), $query); if ($result) { while ($data = $result->fetch_assoc()) { $single_record = array(); $single_record["record_id"] = $data["record_id"]; $single_record["name"] = $data["record_name"]; $single_record["band"] = $data["band_name"]; // Comes from Band $single_record["current_value"] = $data["record_current_value"]; $single_record["vinyl_size"] = $data["record_length"]; $single_record["original_price"] = $data["record_original_price"]; $single_record["release_date"] = $data["record_release_date"]; $single_record["description"] = $data["record_description"]; $single_record["album_condition"] = $data["record_condition"]; $single_record["genre"] = $data["genre_name"]; $single_record["artwork_image"] = WEB::_image($data["record_artwork"]); $list[] = $single_record; } } return $list; }
echo 'selected'; } ?> ><?php echo $labelList[$i]['label_name']; ?> </option> <?php } ?> </select> </div> <div class="form-group <?php WEB::_ferror('band_cover', $form_error); ?> "> <label for="image">Cover Photo (URL)</label> <input type="file" class="form-control" placeholder="Enter Band Cover" id="image" name="image" value="<?php echo $bd->getBandCover(); ?> "> <p class="help-block"><i><?php echo ($bd->getBandCover() !== '' ? "File - <strong>" . str_replace("uploads/", "", $bd->getBandCover()) : '') . "</strong></i>"; ?> </p> </div> <button type="submit" class="btn btn-default">Submit</button>
<table class="table"> <thead> <tr> <th>Founded Year</th> <th>Parent Company</th> </tr> </thead> <tbody> <tr> <td><?php echo WEB::_date($l->getLabelFoundedYear()); ?> </td> <td><?php echo $l->getLabelParentCompany(); ?> </td> </tbody> </table> </div> <div class="modal-footer"> <button type="button" class="btn btn-default left" data-dismiss="modal">Close</button> <?php WEB::_deletePrompt('label', $l->getLabelId(), "You will be only deleting a label."); ?> <?php WEB::_updatePrompt('label', $l->getLabelId()); ?> </div> <?php }
<?php } else { ?> <li><a href="<?php WEB::_path('login'); ?> ">Login</a></li> <?php } ?> </ul> <form action="search.php" class="navbar-form navbar-inverse navbar-right" role="search"> <div class="form-group"> <input type="text" class="form-control" name="s" placeholder="Search" required> </div> </form> <ul class="nav navbar-nav navbar-right"> <li class="<?php WEB::_active('search'); ?> "><a href="<?php WEB::_path('search'); ?> ">Advanced Search</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container" role="main">
"><\/script>'); } </script> <!--// Need to have a local copy of jQuery if google not avail --> <script src="<?php WEB::_root('template/bootstrap/dist/js/bootstrap.min.js'); ?> "></script> <script src="<?php WEB::_root('template/js/bootstrap-datepicker.js'); ?> "></script> <script src="<?php WEB::_root('template/js/chosen.jquery.min.js'); ?> "></script> <script> $('.dp').datepicker({ format: 'yyyy-mm-dd' }); // Force a refresh when using the view modal $(document.body).on('hidden.bs.modal', function () { $('.modal').removeData('bs.modal') }); $(".cs").chosen({ placeholder_text_multiple: "Select from (Multiple Selects Allowed)",