示例#1
0
 /**
  * A temporary method of generating test data.  Will be
  * refactored out once all services have been implemented.
  * @param bean the EventSUmmaryPage bean
  * @return bean the EventSUmmaryPage bean w/ stubbed data
  */
 private function loadDemoSummaryData($model)
 {
     global $logger;
     $logger->debug(get_class($this) . '::loadTestSummaryData()');
     // Test Venues
     require_once WEB_INF . '/beans/Venue.php';
     $v1 = new Venue();
     $v1->setName('Hurd Gallery');
     $v1->setOid(48);
     $v2 = new Venue();
     $v2->setName('Taube Courtyard');
     $v2->setOid(24);
     $v3 = new venue();
     $v3->setName('Main Lobby');
     $v3->setOid(17);
     $venues = array($v1, $v2, $v3);
     // Test Audience
     require_once WEB_INF . '/beans/Audience.php';
     $a1 = new Audience();
     $a1->setName('All Age Groups');
     $a2 = new Audience();
     $a2->setName('Adults');
     $a3 = new Audience();
     $a3->setName('Toddlers');
     $audiences = array($a1, $a2, $a3);
     $list = $model->getList();
     foreach ($list as $event) {
         $event->setFamily($this->randomizeTestBoolean());
         $event->setAudience($this->randomizeTestArray($audiences, 1, 1));
     }
     $model->setEvents($list);
     // Page Announcement
     $msg = "<strong>This is some introductory text about this section of " . "the web site if needed.</strong>  Otherwise this would not be " . "here and everything below would move up so that there isn't a " . "big blank space.";
     $model->setAnnouncement($msg);
     return $model;
 }
示例#2
0
<?php

$city = city::select()->where("`name` = '?'", $parts[1])->one();
if ($city === false) {
    return 404;
}
$smarty->contentType('text', 'json');
$venues = venue::select()->where(isset($parts[2]) ? array($city, 'type' => $parts[2]) : $city)->order_by('title')->many();
echo '{"license": "Copyright, All Rights Reserved, Usage of this data without explicit permission is strictly forbidden!", "name": "' . $city->name . '", "title": "' . $city->title . '", "data": [';
foreach ($venues as $key => $venue) {
    if ($key > 0) {
        echo ",";
    }
    $data = $venue->get_row();
    $hours = hours::select()->where($venue)->many();
    unset($data['id']);
    unset($data['city_id']);
    $data['hours'] = array(null, null, null, null, null, null, null);
    foreach ($hours as $hour) {
        foreach (explode(',', $hour->weekday) as $day) {
            switch ($day) {
                case 'mon':
                    $data['hours'][0] = array($hour->open, $hour->close);
                    break;
                case 'tue':
                    $data['hours'][1] = array($hour->open, $hour->close);
                    break;
                case 'wed':
                    $data['hours'][2] = array($hour->open, $hour->close);
                    break;
                case 'thu':
示例#3
0
 /**
  * Response when updating role succeed.
  *
  * @param  \Orchestra\Model\Role  $role
  *
  * @return mixed
  */
 public function destroySucceed(venue $venue)
 {
     $message = trans('orchestra/control::response.roles.delete', ['name' => $venue->getAttribute('name')]);
     return $this->redirectWithMessage(handles('orchestra::venue'), $message);
 }
示例#4
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $venue = venue::find($id);
     $friendly_url = $venue->friendly_url;
     $venue->fill($request->all());
     // if has file
     if ($request->hasFile('image')) {
         $image_name = $this->uploadImage($request->file('image'), 'venues', $friendly_url);
         $venue->image = $image_name;
     }
     $venue->save();
     Session::flash('message', 'Lugar de encuentro actualizada Correctamente');
     return Redirect::to('venues');
 }
示例#5
0
<?php

$venue = venue::select()->where(array('type' => $parts[0], 'name' => $parts[1]))->one();
if ($venue === false) {
    return 404;
}
$smarty->assign('venue', $venue);
$smarty->assign('hours', $venue->hours());
$smarty->display('pages/venue.tpl');