/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // SET UP NEW CARBON DATES
     $_old = '2016/san-antonio';
     $_new = (object) ['slug' => '2017/san-antonio', 'published' => Carbon::create(2016, 01, 18, 16, 30, 00), 'start' => Carbon::create(2017, 01, 18, 07, 00, 00), 'end' => Carbon::create(2017, 01, 18, 16, 30, 00)];
     // DELETE DUPLICATES
     $conference = Conference::where('slug', '=', $_new->slug)->delete();
     $forceDel = Conference::onlyTrashed()->forceDelete();
     $agenda = Agenda::where('conference_slug', '=', $_new->slug)->delete();
     $forceDel = Agenda::onlyTrashed()->forceDelete();
     $option = Option::where('slug', '=', $_new->slug)->delete();
     $forceDel = Option::onlyTrashed()->forceDelete();
     unset($conference, $agenda, $option, $forceDel);
     // RESCHEDULE CONFERENCE
     $conference = Conference::where('slug', '=', $_old)->update(['slug' => $_new->slug, 'start_date' => $_new->start, 'end_date' => $_new->end, 'published' => $_new->published]);
     // UPDATE OPTIONS
     $option = Option::where('slug', '=', $_old)->update(['slug' => $_new->slug]);
     // UPDATE AGENDA
     $agendas = Agenda::where('conference_slug', '=', $_old)->get();
     foreach ($agendas as $agenda) {
         $agenda->conference_slug = $_new->slug;
         $agenda->timeslot = $_new->start->format('Y-m-d') . ' ' . $agenda->timeslot->format('H:i:s');
         $agenda->save();
     }
     // UPDATE SPEAKERS
     $speakers = Speaker::where('conference_slug', '=', $_old)->update(['conference_slug' => $_new->slug]);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     //
     Schema::create('conferences', function (Blueprint $table) {
         $table->increments('id');
         $table->string('slug');
         $table->string('conference');
         $table->string('city');
         $table->string('state');
         $table->datetime('start_date');
         $table->timestamp('end_date');
         $table->string('timezone', 3)->nullable();
         $table->tinyInteger('coming')->default(0);
         $table->text('about')->nullable();
         $table->text('partners')->nullable();
         $table->string('venue_slug')->nullable();
         $table->text('sponsors')->nullable();
         $table->text('tags')->nullable();
         $table->text('options')->nullable();
         $table->string('hero')->nullable();
         $table->string('photo')->nullable();
         $table->timestamps();
         $table->timestamp('published')->nullable();
         $table->softDeletes();
     });
     Conference::create(['slug' => 'austin', 'conference' => 'Austin IT Strategies Conference', 'city' => 'Austin', 'state' => 'TX', 'start_date' => Carbon::create(2015, 9, 15, 7, 30, 0), 'end_date' => Carbon::create(2015, 9, 15, 16, 30, 0), 'timezone' => 'CDT', 'coming' => 'September 2015', 'about' => '<p>Our Austin IT Strategies Conference will bring together CIOs, CTOs SVPs &#038; VPs of IT, IT Directors and Sr. Level IT Leaders of fortune 100-5000 companies and equivalent healthcare, government and educational entities in the greater Austin Region.  Our attendee’s will have the opportunity to hear from Industry experts, network with their peers and discuss critical challenges and issues that they face within their organizations.  We encourage our attendee’s to share and discuss their lessons learned, knowledge and insight as we dive into some of today’s biggest IT challenges.</p><p>We strive to produce content-rich presentations that will provide answers to many of today’s business challenges and hope that you will be able to gain practical knowledge and insights that you can then use within your own organization.</p>', 'partners' => Helpers::serialize(['partners' => ['tagitm'], 'text' => '<p><strong>We are proud to be able to partner with TAGITM for the 2015 Austin IT Strategies Conference.</strong></p>']), 'venue_slug' => 'texas-austin-crown-plaza-austin', 'sponsors' => Helpers::serialize(['emerald' => ['cylance', 'dynatrace', 'forsythe', 'hitachi', 'workday', 'mcci', 'good', '2fa', 'nimble-storage', 'secure-nation', 'windstream', 'arbor-networks']]), 'tags' => 'austin-it-strategies-2015,austin,texas,it-strategies,information-technology,it-solutions', 'options' => Helpers::serialize(['link' => '0', 'hero' => true, 'title' => 'event:conference', 'jumbotron' => 'event:hero', 'countdown' => true, 'about' => true, 'partners' => true, 'agenda' => true, 'speakers' => true, 'sponsors' => true, 'sponsorlevels' => false, 'venue' => true]), 'hero' => '/images/conferences/austin.jpg', 'photo' => '/images/conferences/austin-portfolio.jpg', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]);
     Conference::create(['slug' => 'san-antonio', 'conference' => 'San Antonio IT Strategies Conference', 'city' => 'San Antonio', 'state' => 'TX', 'start_date' => Carbon::create(2016, 5, 31, 0, 0, 0), 'end_date' => Carbon::create(2016, 5, 31, 23, 59, 59), 'timezone' => 'CDT', 'coming' => 1, 'about' => '<p>Our San Antonio IT Strategies Conference will bring together CIOs, CTOs SVPs &#038; VPs of IT, IT Directors and Sr. Level IT Leaders of fortune 100-5000 companies and equivalent healthcare, government and educational entities in the greater San Antonio Region.  Our attendee’s will have the opportunity to hear from Industry experts, network with their peers and discuss critical challenges and issues that they face within their organizations.  We encourage our attendee’s to share and discuss their lessons learned, knowledge and insight as we dive into some of today’s biggest IT challenges.</p><p>We strive to produce content-rich presentations that will provide answers to many of today’s business challenges and hope that you will be able to gain practical knowledge and insights that you can then use within your own organization.</p>', 'sponsors' => Helpers::serialize(['acclaim-events']), 'tags' => 'san-antonio,texas,it-strategies,information-technology,it-solutions', 'options' => Helpers::serialize(['link' => '0', 'title' => 'event:conference', 'jumbotron' => 'event:hero', 'countdown' => true, 'about' => true, 'partners' => false, 'agenda' => true, 'speakers' => false, 'sponsors' => false, 'sponsorlevels' => false, 'venue' => true]), 'hero' => '/images/conferences/san-antonio.jpg', 'photo' => '/images/conferences/san-antonio-portfolio.jpg', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]);
     Conference::create(['slug' => 'tampa', 'conference' => 'Tampa IT Strategies Conference', 'city' => 'Tampa', 'state' => 'FL', 'start_date' => Carbon::create(2017, 2, 28, 0, 0, 0), 'end_date' => Carbon::create(2017, 2, 28, 12, 59, 59), 'timezone' => 'EST', 'coming' => 1, 'about' => '<p>Our Tampa IT Strategies Conference will bring together CIOs, CTOs SVPs &#038; VPs of IT, IT Directors and Sr. Level IT Leaders of fortune 100-5000 companies and equivalent healthcare, government and educational entities in the greater Tampa Region.  Our attendee’s will have the opportunity to hear from Industry experts, network with their peers and discuss critical challenges and issues that they face within their organizations.  We encourage our attendee’s to share and discuss their lessons learned, knowledge and insight as we dive into some of today’s biggest IT challenges.</p><p>We strive to produce content-rich presentations that will provide answers to many of today’s business challenges and hope that you will be able to gain practical knowledge and insights that you can then use within your own organization.</p>', 'sponsors' => Helpers::serialize(['acclaim-events']), 'tags' => 'tampa,florida,it-strategies,information-technology,it-solutions', 'options' => Helpers::serialize(['link' => '0', 'title' => 'event:conference', 'jumbotron' => 'event:hero', 'countdown' => true, 'about' => true, 'partners' => false, 'agenda' => true, 'speakers' => false, 'sponsors' => false, 'sponsorlevels' => false, 'venue' => true]), 'hero' => '/images/conferences/tampa.jpg', 'photo' => '/images/conferences/tampa-portfolio.jpg', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]);
 }
 protected function create()
 {
     $route = Helpers::routeinfo();
     /*
     		$event 			= Conference::where('slug', '=', $route->params['conference'])
     									->published()
     									->latest();
     */
     $events = Lookup::lookup('conferences', [$route->params['conference']], ['latest' => true, 'published' => true]);
     $event = $events[0];
     $options = Helpers::unserialize($event->options);
     $options['speakers'] = false;
     $options['sponsors'] = false;
     $options['partners'] = false;
     $options = Helpers::options($route, $route->params['conference']);
     $newEvent = Conference::create(['slug' => $route->params['conference'], 'conference' => $event->conference, 'city' => $event->city, 'state' => $event->state, 'start_date' => Carbon::createFromFormat('Y-m-d H:i:s', $event->start_date)->addYear(), 'end_date' => Carbon::createFromFormat('Y-m-d H:i:s', $event->end_date)->addYear(), 'timezone' => $event->timezone, 'coming' => 1, 'about' => $event->about, 'tags' => $event->tags, 'options' => Helpers::serialize($options), 'hero' => $event->hero, 'photo' => $event->photo, 'published' => Carbon::now()]);
     $newEvent = (object) $newEvent->toArray();
     $newAgendas = [];
     $agendas = Lookup::lookup('agendas', ['conference' => $event->id], ['published' => true]);
     if (is_array($agendas)) {
         foreach ($agendas as $agenda) {
             $agenda->conference_id = $newEvent->id;
             $agenda->timeslot = Carbon::createFromFormat('Y-m-d H:i:s', $agenda->timeslot)->addYear();
             $agenda->title = $agenda->type === 'breakout' || $agenda->type === 'session' ? 'Breakout Session' : ($agenda->type === 'break' ? $agenda->title : 'Keynote');
             $agenda->title_short = $agenda->type === 'breakout' || $agenda->type === 'session' ? 'Breakout Session' : ($agenda->type === 'break' ? $agenda->title : 'Keynote');
             $agenda->subtitle = null;
             $agenda->desc = null;
             $agenda->speakers = null;
             $agenda->published = Carbon::now();
             $newAgendas[] = Agenda::create((array) $agenda);
         }
     }
     $container = (object) ['event' => (object) $newEvent, 'agendas' => (object) $newAgendas];
     dd($newEvent);
 }
Ejemplo n.º 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     foreach (Conference::all() as $conference) {
         $conference->managers()->attach(1);
     }
     foreach (Event::all() as $event) {
         $event->managers()->attach(1);
     }
 }
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $conferences = Conference::all();
     $in = 'in:';
     foreach ($conferences as $i => $event) {
         $event = (object) $event->toArray();
         $in .= ($i === 0 ? '' : ',') . $event->slug;
     }
     return ['conference' => 'required|' . $in, 'attendance' => 'required|in:advisor,sponsor,attendee', 'email' => 'required|email', 'phone' => 'required|phone:US', 'first_name' => 'required|string|max:255', 'last_name' => 'required|string|max:255', 'title' => 'required|string|max:255', 'company' => 'required|string|max:255', 'affiliation' => 'in:tagitm', 'street' => 'required|string|max:255', 'city' => 'required|string|max:255', 'state' => 'required|in:AL,AK,AZ,AR,CA,CO,CT,DE,DC,FL,GA,HI,ID,IL,IN,IA,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY', 'postal' => 'required|string|max:255'];
 }
Ejemplo n.º 6
0
 public function testStore()
 {
     $this->login($this->ADMIN);
     $this->post('/api/conferences', $this->TEST_DATA, $this->header);
     $this->assertResponseOk();
     $this->seeInDatabase('conferences', $this->TEST_DATA);
     $cid = Conference::where('name', $this->TEST_DATA['name'])->first()->getKey();
     $this->get('/api/conferences/' . $cid);
     $this->seeJson($this->TEST_DATA);
     $this->get('/api/conferences/' . $cid . '/managers');
     $this->seeJson(['username' => 'admin']);
     $this->logout();
 }
Ejemplo n.º 7
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Conference::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['cnf_id' => $this->cnf_id, 'cnf_created' => $this->cnf_created]);
     $query->andFilterWhere(['like', 'cnf_title', $this->cnf_title])->andFilterWhere(['like', 'cnf_class', $this->cnf_class])->andFilterWhere(['like', 'cnf_controller', $this->cnf_controller])->andFilterWhere(['like', 'cnf_description', $this->cnf_description]);
     return $dataProvider;
 }
Ejemplo n.º 8
0
 /**
  * @param int $id
  */
 public function actionCreate($id = 0)
 {
     if ($id != 0) {
         $oConf = Conference::findOne($id);
         if ($oConf === null) {
             $id = 0;
         }
     }
     if ($id == 0) {
         return $this->render('//doclad/select_conference', ['link' => ['cabinet/create', 'id' => 0], 'partial' => false]);
     } else {
         $this->conferenceId = $oConf->cnf_id;
         return parent::addDoclad();
     }
 }
Ejemplo n.º 9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ---------------------------------------------------------------------
     // CONFERENCE 4
     // ---------------------------------------------------------------------
     $conference = Conference::find(4);
     $item = ['name' => 'Laptop', 'quantity' => 1];
     $item = new Item($item);
     $item->conference()->associate($conference);
     $item->save();
     $item = ['name' => 'Projector', 'quantity' => 1];
     $item = new Item($item);
     $item->conference()->associate($conference);
     $item->save();
 }
Ejemplo n.º 10
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params, $aDop = [])
 {
     $query = Doclad::find();
     $aWith = [];
     if (isset($aDop['with'])) {
         $aWith = $aDop['with'];
         unset($aDop['with']);
     }
     $query->with(Yii::$app->user->can(User::USER_GROUP_MODERATOR) ? array_merge(['section', 'section.conference', 'files'], $aWith) : array_merge(['section', 'section.conference', 'files'], $aWith));
     $query->joinWith(['section', 'section.conference']);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $sFormname = $this->formName();
     if (!isset($params[$sFormname])) {
         $params[$sFormname] = [];
     }
     $params[$sFormname] = array_merge($params[$sFormname], $aDop);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $aFilters = ['doc_id' => $this->doc_id, 'doc_sec_id' => $this->doc_sec_id, 'doc_created' => $this->doc_created, 'ekis_id' => $this->ekis_id, 'doc_state' => $this->doc_state, 'doc_format' => $this->doc_format];
     if (!Yii::$app->user->can(User::USER_GROUP_MODERATOR)) {
         $aFilters['doc_us_id'] = Yii::$app->user->getId();
     } else {
         /** @var User $obUser */
         if (empty($this->conferenceid)) {
             // этот if тут для того, чтобы модераторы секций могли выгрузить вообще все доклады из конференции
             // потому что из-за их изголяния с разделением на персональных участников и от организаций, и разделением секций
             // по этому признаку, ранее зарегистрированные доклады перехолдят в другие секции и их невоможно увидеть в нужной секции
             // в контроллере я сюда ($this->conferenceid) загружаю конференции, в которых юзер главный модератор
             $obUser = Yii::$app->user->identity;
             if (!empty($obUser->sectionids)) {
                 $aFilters = ['doc_sec_id' => $obUser->sectionids];
             }
         }
     }
     if ($this->conferenceid) {
         $query->andFilterWhere([Conference::tableName() . '.cnf_id' => $this->conferenceid]);
     }
     $query->andFilterWhere($aFilters);
     if (!empty($this->doc_lider_fam)) {
         $query->andFilterWhere(['like', 'doc_lider_fam', $this->doc_lider_fam])->andFilterWhere(['like', 'doc_lider_name', $this->doc_lider_name])->andFilterWhere(['like', 'doc_lider_otch', $this->doc_lider_otch])->andFilterWhere(['like', 'doc_lider_email', $this->doc_lider_email])->andFilterWhere(['like', 'doc_lider_phone', $this->doc_lider_phone]);
     }
     $query->andFilterWhere(['like', 'doc_type', $this->doc_type])->andFilterWhere(['like', 'doc_subject', $this->doc_subject])->andFilterWhere(['like', 'doc_description', $this->doc_description])->andFilterWhere(['like', 'doc_lider_org', $this->doc_lider_org])->andFilterWhere(['like', 'doc_lider_group', $this->doc_lider_group])->andFilterWhere(['like', 'doc_lider_position', $this->doc_lider_position])->andFilterWhere(['like', 'doc_lider_lesson', $this->doc_lider_lesson]);
     return $dataProvider;
 }
 protected function getEvents()
 {
     $events = ['' => 'Select one...'];
     $conferences = Conference::where('start_date', '>', Carbon::now())->get();
     $conferences = Helpers::keysByField($conferences, 'slug');
     foreach ($conferences as $slug => $event) {
         $events[$slug] = $event->city . ', ' . $event->state . ' | ';
         $time = $event->start_date . (!empty($event->timezone) ? $event->timezone : '');
         if (!empty($event->coming)) {
             $events[$slug] .= date('F Y', strtotime($time));
         } else {
             $events[$slug] .= date('F j, Y', strtotime($time));
         }
     }
     return $events;
 }
Ejemplo n.º 12
0
 public function index()
 {
     $route = Helpers::routeinfo();
     $route->url = '/contact';
     $options = Helpers::options($route);
     $navs = Helpers::navigation($route, $options);
     $sub = Helpers::navigation($route, $options, true);
     $contact = (object) ['venue' => 'Acclaim Events', 'phone' => '(503) 206-5700', 'phone_short' => '5032065700', 'address' => '9860 SW Hall Blvd, Suite D<br>Tigard, OR 97223', 'address_short' => '9860 SW Hall Blvd, Suite D, Tigard, OR 97223', 'facebook' => 'http://www.facebook.com/acclaimeventsllc', 'linkedin' => 'company/acclaim-events-llc', 'place' => 'ChIJE5F6JvIMlVQR05xT-zTHqwk'];
     $event = (object) [];
     if (count($route->params) === 1 || $route->uri === 'contact/sponsorship/{year?}/{conference?}') {
         if (!empty($route->params['contact'])) {
             $team = DB::table('team_members')->where('first_name', '=', ucwords($route->params['contact']))->take(1)->get();
             if (is_array($team) && count($team) === 1) {
                 $team = $team[0];
                 $options->title = 'Contact ' . $team->first_name;
                 $contact->first_name = $team->first_name;
                 $contact->last_name = $team->last_name;
                 $contact->photo = $team->photo;
                 $contact->linkedin = $team->linkedin;
                 $contact->facebook = null;
                 $contact->phone = null;
                 $contact->address = null;
                 $route->url = '/contact/' . $route->params['contact'];
             } else {
                 redirect('/contact');
             }
         } elseif ($route->uri === 'contact/sponsorship/{year?}/{conference?}') {
             $options->title = 'Request Sponsorship Information';
             if (!empty($route->params['conference'])) {
                 $conference = $route->params['year'] . '/' . $route->params['conference'];
             } else {
                 $conference = $route->params['year'];
             }
             if (!empty($conference)) {
                 $events = Conference::lookup($conference)->current()->first();
                 //					dd($events);
                 if (is_object($events)) {
                     $event = (object) $events->toArray();
                 }
             }
         } else {
             redirect('/contact');
         }
     }
     //		dd($route);
     return view('pages/contact', compact('contact', 'event', 'route', 'options', 'navs', 'sub'));
 }
Ejemplo n.º 13
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ---------------------------------------------------------------------
     // CONFERENCE 1
     // ---------------------------------------------------------------------
     $conference = ['name' => 'India Conference', 'description' => 'A conference in India.', 'start_date' => '2016-03-01', 'end_date' => '2016-03-31', 'address' => 'Sansad Marg, Connaught Place, New Delhi, Delhi 110001, India', 'city' => 'New Delhi', 'country' => 'India', 'capacity' => 1000, 'status' => 'approved'];
     $conference = Conference::create($conference);
     $event = ['name' => 'Opening Ceremony', 'description' => 'Welcome!', 'facilitator' => 'TBD', 'date' => '2016-05-01', 'start_time' => '09:00:00', 'end_time' => '10:00:00', 'address' => 'Sansad Marg, Connaught Place, New Delhi, Delhi 110001, India', 'city' => 'New Delhi', 'country' => 'India', 'capacity' => 1000, 'status' => 'approved'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
     // ---------------------------------------------------------------------
     // CONFERENCE 2
     // ---------------------------------------------------------------------
     $conference = ['name' => 'Canada Conference', 'description' => 'A conference in Canada.', 'start_date' => '2016-05-11', 'end_date' => '2016-05-20', 'address' => '1055 Canada Pl, Vancouver, BC V6C 0C3, Canada', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 1000, 'status' => 'approved'];
     $conference = Conference::create($conference);
     $event = ['name' => 'Opening Ceremony', 'description' => 'Welcome!', 'facilitator' => 'TBD', 'date' => '2016-05-11', 'start_time' => '09:00:00', 'end_time' => '10:00:00', 'address' => '1055 Canada Pl, Vancouver, BC V6C 0C3, Canada', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 1000, 'status' => 'approved'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
     // ---------------------------------------------------------------------
     // CONFERENCE 3
     // ---------------------------------------------------------------------
     $conference = ['name' => 'France Conference', 'description' => 'A conference in France.', 'start_date' => '2016-05-21', 'end_date' => '2016-05-30', 'address' => '17 Boulevard Saint-Jacques, Paris 75014, France', 'city' => 'Paris', 'country' => 'France', 'capacity' => 1000, 'status' => 'approved'];
     $conference = Conference::create($conference);
     $event = ['name' => 'Opening Ceremony', 'description' => 'Welcome!', 'facilitator' => 'TBD', 'date' => '2016-05-21', 'start_time' => '09:00:00', 'end_time' => '10:00:00', 'address' => '17 Boulevard Saint-Jacques, Paris 75014, France', 'city' => 'Paris', 'country' => 'France', 'capacity' => 1000, 'status' => 'approved'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
     // ---------------------------------------------------------------------
     // CONFERENCE 4
     // ---------------------------------------------------------------------
     $conference = ['name' => 'CPSC 319 Final Demos', 'description' => 'Teams present their projects.', 'start_date' => '2016-03-31', 'end_date' => '2016-04-07', 'address' => 'Hugh Dempster Pavilion, 6245 Agronomy Road, Vancouver, BC V6T 1Z4', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 100, 'status' => 'approved'];
     $conference = Conference::create($conference);
     $event = ['name' => 'Project 2 Final Demos', 'description' => 'Teams 5 to 8 present their projects.', 'facilitator' => 'Dr Ahmed Awad', 'date' => '2016-03-31', 'start_time' => '12:30:00', 'end_time' => '14:00:00', 'address' => 'Hugh Dempster Pavilion, 6245 Agronomy Road, Vancouver, BC V6T 1Z4', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 100, 'status' => 'approved'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
     $event = ['name' => 'Project 3 Final Demos', 'description' => 'Teams 9 to 12 present their projects.', 'facilitator' => 'Dr Ahmed Awad', 'date' => '2016-04-05', 'start_time' => '12:30:00', 'end_time' => '14:00:00', 'address' => 'Hugh Dempster Pavilion, 6245 Agronomy Road, Vancouver, BC V6T 1Z4', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 100, 'status' => 'pending'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
     $event = ['name' => 'Project 1 Final Demos', 'description' => 'Teams 1 to 4 present their projects.', 'facilitator' => 'Dr Ahmed Awad', 'date' => '2016-04-07', 'start_time' => '12:30:00', 'end_time' => '14:00:00', 'address' => 'Hugh Dempster Pavilion, 6245 Agronomy Road, Vancouver, BC V6T 1Z4', 'city' => 'Vancouver', 'country' => 'Canada', 'capacity' => 100, 'status' => 'pending'];
     $event = new Event($event);
     $event->conference()->associate($conference);
     $event->save();
 }
Ejemplo n.º 14
0
 /**
  * Delete a Manager of a Conference.
  *
  * @param  Request  $request
  * @param  int  $cid
  * @param  int  $uid
  * @return Response
  */
 public function destroy(Request $request, $cid, $uid)
 {
     try {
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         $user = User::find($uid);
         if (!$user) {
             return response()->error(404, 'User Not Found');
         }
         $conference->managers()->detach($user);
         return response()->success();
     } catch (Exception $e) {
         return response()->error();
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     $benefit = Benefit::where('text', 'like', '%Fortune 100-5000%')->get();
     if (is_array($benefit) && count($benefit) > 0 && isset($benefit[0]->text)) {
         $text = str_replace('fortune 100-5000', 'Fortune 100-3000', $benefit[0]->text);
         $text = str_replace('ΓÇÖ', "'", $text);
         $update = Benefit::where('text', 'like', '%Fortune 100-5000%')->update(['text' => $text]);
     }
     $events = Conference::where('about', 'like', '%Fortune 100-5000%')->get();
     foreach ($events as $event) {
         unset($text);
         $text = str_replace('fortune 100-5000', 'Fortune 100-3000', $event->about);
         $text = str_replace('ΓÇÖ', "'", $text);
         Conference::where('slug', '=', $event->slug)->where('about', 'like', '%Fortune 100-5000%')->update(['about' => $text]);
     }
 }
 protected function getEvents()
 {
     $events = ['' => 'Select one...'];
     $conferences = Conference::current()->get();
     $conferences = Helpers::keysByField($conferences, 'slug');
     $conferences = Lookup::addOptions($conferences);
     foreach ($conferences as $slug => $event) {
         $events[$slug] = $event->city . ', ' . $event->state . ' | ';
         $time = $event->start_date . (!empty($event->timezone) ? $event->timezone : '');
         if (!empty($event->options->show_upcoming)) {
             $events[$slug] .= date('F Y', strtotime($time));
         } else {
             $events[$slug] .= date('F j, Y', strtotime($time));
         }
     }
     return $events;
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // SET UP NEW CARBON DATES
     $_old = '2017/tampa';
     $_new = (object) ['slug' => '2017/tampa', 'published' => Carbon::create(2016, 03, 02, 16, 30, 00), 'start' => Carbon::create(2017, 03, 02, 07, 00, 00), 'end' => Carbon::create(2017, 03, 02, 16, 30, 00)];
     // RESCHEDULE CONFERENCE
     $conference = Conference::where('slug', '=', $_old)->update(['slug' => $_new->slug, 'start_date' => $_new->start, 'end_date' => $_new->end, 'published' => $_new->published]);
     // UPDATE OPTIONS
     $options = Option::insert(['slug' => '2017/tampa', 'option' => 'show_upcoming', 'value' => 0, 'published' => Carbon::now()]);
     // UPDATE AGENDA
     $agendas = Agenda::where('conference_slug', '=', $_old)->get();
     foreach ($agendas as $agenda) {
         $agenda->conference_slug = $_new->slug;
         $agenda->timeslot = $_new->start->format('Y-m-d') . ' ' . $agenda->timeslot->format('H:i:s');
         $agenda->save();
     }
     // UPDATE SPEAKERS
     $speakers = Speaker::where('conference_slug', '=', $_old)->update(['conference_slug' => $_new->slug]);
 }
Ejemplo n.º 18
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ---------------------------------------------------------------------
     // CONFERENCE 1
     // ---------------------------------------------------------------------
     $faker = Faker::create();
     $user = Sentinel::findById(6);
     $conference = Conference::find(1);
     $countries = ['Canada', 'France', 'India', 'United States'];
     $genders = ['female', 'male'];
     for ($i = 0; $i < 100; ++$i) {
         $profile = ['first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'city' => $faker->city, 'country' => $countries[rand(0, 3)], 'birthdate' => $faker->date($format = 'Y-m-d', $max = 'now'), 'gender' => $genders[rand(0, 1)]];
         $profile = new Profile($profile);
         $profile->user()->associate($user);
         $profile->save();
         $profile->conferences()->attach($conference->id, ['birthdate' => $profile->birthdate, 'country' => $profile->country, 'gender' => $profile->gender, 'status' => 'approved']);
         $conference->increment('attendee_count');
     }
     // ---------------------------------------------------------------------
     // CONFERENCE 2
     // ---------------------------------------------------------------------
     $conference = Conference::find(2);
     $event = $conference->events()->first();
     $room = $conference->accommodations()->first()->rooms()->first();
     $conferenceVehicle = $conference->vehicles()->first();
     $eventVehicle = $event->vehicles()->first();
     for ($i = 1; $i <= 7; ++$i) {
         $profile = Profile::find($i);
         $attendee = ['email' => $profile->email, 'phone' => $profile->phone, 'first_name' => $profile->first_name, 'middle_name' => $profile->middle_name, 'last_name' => $profile->last_name, 'city' => $profile->city, 'country' => $profile->country, 'birthdate' => $profile->birthdate, 'gender' => $profile->gender, 'accommodation_req' => true, 'accommodation_pref' => 1, 'arrv_ride_req' => true, 'arrv_date' => '2016-04-08', 'arrv_time' => '21:30', 'arrv_airport' => 'DEL', 'arrv_flight' => 'AC2273', 'dept_ride_req' => false, 'status' => 'approved'];
         $profile->conferences()->attach($conference, $attendee);
         $conference->increment('attendee_count');
         $profile->events()->attach($event);
         $profile->rooms()->attach($room);
         $room->increment('guest_count');
         $profile->conferenceVehicles()->attach($conferenceVehicle);
         $conferenceVehicle->increment('passenger_count');
         $profile->eventVehicles()->attach($eventVehicle);
         $eventVehicle->increment('passenger_count');
     }
 }
Ejemplo n.º 19
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ---------------------------------------------------------------------
     // CONFERENCE 2
     // ---------------------------------------------------------------------
     $conference = Conference::find(2);
     $accommodation = ['name' => 'Shangri-La Hotel Vancouver', 'address' => '1128 West Georgia Street', 'city' => 'Vancouver', 'country' => 'Canada'];
     $accommodation = new Accommodation($accommodation);
     $accommodation->conference()->associate($conference);
     $accommodation->save();
     $room = ['room_no' => '100', 'guest_count' => 0, 'capacity' => 2];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
     $room = ['room_no' => '101', 'guest_count' => 0, 'capacity' => 3];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
     $room = ['room_no' => '102', 'guest_count' => 0, 'capacity' => 4];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
     $accommodation = ['name' => 'The Fairmont Hotel Vancouver', 'address' => '900 West Georgia Street', 'city' => 'Vancouver', 'country' => 'Canada'];
     $accommodation = new Accommodation($accommodation);
     $accommodation->conference()->associate($conference);
     $accommodation->save();
     $room = ['room_no' => '200', 'guest_count' => 0, 'capacity' => 2];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
     $room = ['room_no' => '201', 'guest_count' => 0, 'capacity' => 3];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
     $room = ['room_no' => '202', 'guest_count' => 0, 'capacity' => 4];
     $room = new Room($room);
     $room->accommodation()->associate($accommodation);
     $room->save();
 }
Ejemplo n.º 20
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // ---------------------------------------------------------------------
     // CONFERENCE 2
     // ---------------------------------------------------------------------
     $conference = Conference::find(2);
     $vehicle = ['name' => 'Airport Taxi', 'passenger_count' => 0, 'capacity' => 7, 'type' => 'arrival'];
     $vehicle = new ConferenceVehicle($vehicle);
     $vehicle->conference()->associate($conference);
     $vehicle->save();
     $vehicle = ['name' => 'Airport Taxi', 'passenger_count' => 0, 'capacity' => 7, 'type' => 'departure'];
     $vehicle = new ConferenceVehicle($vehicle);
     $vehicle->conference()->associate($conference);
     $vehicle->save();
     $event = $conference->events()->first();
     $vehicle = ['name' => 'Hotel Shuttle', 'passenger_count' => 0, 'capacity' => 50, 'type' => 'arrival'];
     $vehicle = new EventVehicle($vehicle);
     $vehicle->event()->associate($event);
     $vehicle->save();
     $vehicle = ['name' => 'Hotel Shuttle', 'passenger_count' => 0, 'capacity' => 50, 'type' => 'departure'];
     $vehicle = new EventVehicle($vehicle);
     $vehicle->event()->associate($event);
     $vehicle->save();
 }
Ejemplo n.º 21
0
 /**
  * Delete an Accommodation of a Conference.
  *
  * @param  AccommodationRequest  $request
  * @param  int  $cid
  * @param  int  $aid
  * @return Response
  */
 public function destroy(AccommodationRequest $request, $cid, $aid)
 {
     try {
         $user = $this->isConferenceManager($request, $cid);
         if (!$user) {
             return response()->error(403, 'You are not a manager of this conference!');
         }
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         $accommodation = Accommodation::find($aid);
         if (!$accommodation) {
             return response()->error(404, 'Accommodation Not Found');
         }
         $accommodation->delete();
         return response()->success();
     } catch (Exception $e) {
         return response()->error();
     }
 }
Ejemplo n.º 22
0
 /**
  * Relation with conference
  * @return \yii\db\ActiveQuery
  */
 public function getConference()
 {
     return $this->hasOne(Conference::className(), ['cnf_id' => 'sec_cnf_id']);
 }
Ejemplo n.º 23
0
 /**
  * Delete an Attendee of a Conference.
  *
  * @param  ConferenceAttendeeRequest  $request
  * @param  int  $cid
  * @param  int  $pid
  * @return Response
  */
 public function destroy(ConferenceAttendeeRequest $request, $cid, $pid)
 {
     try {
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         $profile = Profile::find($pid);
         if (!$profile) {
             return response()->error(404, 'Profile Not Found');
         }
         $eventVehicles = $conference->eventVehicles()->get();
         foreach ($eventVehicles as $eventVehicle) {
             if ($eventVehicle->passengers()->where('profile_id', $pid)->exists()) {
                 $eventVehicle->passengers()->detach($profile);
                 $eventVehicle->decrement('passenger_count');
             }
         }
         $events = $conference->events()->get();
         foreach ($events as $event) {
             if ($event->attendees()->where('profile_id', $pid)->exists()) {
                 $status = $event->attendees()->where('profile_id', $pid)->first()->pivot->status;
                 $event->attendees()->detach($profile);
                 if ($status == 'approved') {
                     $event->decrement('attendee_count');
                 }
             }
         }
         $conferenceVehicles = $conference->vehicles()->get();
         foreach ($conferenceVehicles as $conferenceVehicle) {
             if ($conferenceVehicle->passengers()->where('profile_id', $pid)->exists()) {
                 $conferenceVehicle->passengers()->detach($profile);
                 $conferenceVehicle->decrement('passenger_count');
             }
         }
         $rooms = $conference->rooms()->get();
         foreach ($rooms as $room) {
             if ($room->guests()->where('profile_id', $pid)->exists()) {
                 $room->guests()->detach($profile);
                 $room->decrement('guest_count');
             }
         }
         $status = $conference->attendees()->where('profile_id', $pid)->first()->pivot->status;
         $conference->attendees()->detach($profile);
         if ($status == 'approved') {
             $conference->decrement('attendee_count');
         }
         $uid = $request->header('ID');
         $this->addActivity($uid, 'cancelled', $cid, 'conference attendance', $pid);
         return response()->success();
     } catch (Exception $e) {
         return response()->error();
     }
 }
Ejemplo n.º 24
0
 /**
  * Delete an Event of a Conference.
  *
  * @param  EventRequest  $request
  * @param  int  $cid
  * @param  int  $eid
  * @return Response
  */
 public function destroy(EventRequest $request, $cid, $eid)
 {
     try {
         $user = $this->isEventManager($request, $eid);
         if (!$user) {
             return response()->error(403, 'You are not a manager of this event!');
         }
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         $event = Event::find($eid);
         if (!$event) {
             return response()->error(404, 'Event Not Found');
         }
         $event->delete();
         $this->addActivity($user->getKey(), 'deleted', $eid, 'event');
         return response()->success();
     } catch (Exception $e) {
         return response()->error();
     }
 }
Ejemplo n.º 25
0
 /**
  * Email a Conference Attendee about an update to their application.
  *
  * @param  int  $cid
  * @param  int  $pid
  * @param  string  $status
  * @return void
  * @throws Exception
  */
 public function sendConferenceSignupEmail($cid, $pid, $status)
 {
     try {
         $conference = Conference::find($cid);
         $conferenceName = $conference->name;
         $profile = Profile::find($pid);
         $user = $profile->user()->first();
         $email = $user->email;
         $name = $profile->first_name;
         if ($email && $user->receive_email && $profile->is_owner) {
             $subject = '[Huddle] Update to Your Conference Attendance Request for ' . $conferenceName;
             $body = 'Hi, ' . $name . '!' . "\n\n" . 'Your request to attend the conference ' . $conferenceName . ' has been ' . $status . '.';
             Mail::queue([], [], function ($message) use($email, $subject, $body) {
                 $message->to($email)->subject($subject)->setBody($body);
             });
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
Ejemplo n.º 26
0
        <?php 
echo $form->field($model, 'cnf_shorttitle')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-3">
            <?php 
echo $form->field($model, 'cnf_class')->textInput(['maxlength' => true]);
?>
        </div>

        <div class="col-xs-3">
            <?php 
echo $form->field($model, 'cnf_flags')->dropDownList(Conference::getAllFlags());
?>
        </div>

        <div class="col-xs-3">
            <?php 
echo $form->field($model, 'cnf_controller')->textInput(['maxlength' => true]);
?>
        </div>

        <div class="col-xs-3">
            <?php 
echo $form->field($model, 'cnf_guestlimit')->textInput(['maxlength' => true]);
?>
        </div>
    </div>
Ejemplo n.º 27
0
 /**
  * Delete an Item of a Conference.
  *
  * @param  ItemRequest  $request
  * @param  int  $cid
  * @param  int  $iid
  * @return Response
  */
 public function destroy(ItemRequest $request, $cid, $iid)
 {
     try {
         $user = $this->isConferenceManager($request, $cid);
         if (!$user) {
             return response()->error(403, 'You are not a manager of this conference!');
         }
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         $item = Item::find($iid);
         if (!$item) {
             return response()->error(404, 'Item Not Found');
         }
         $item->delete();
         return response()->success();
     } catch (Exception $e) {
         return response()->error();
     }
 }
Ejemplo n.º 28
0
 public static function lookup_conferences($params, $flags)
 {
     $search = [];
     $year = null;
     foreach ($params as $k => $v) {
         if (empty($year) && preg_match("/^[0-9]{4}\$/", $v)) {
             $year = $v;
         } else {
             $search[] = $v;
         }
     }
     if (is_array($flags)) {
         $flags = (object) $flags;
     }
     // Start by getting all conferences
     $conferences = Conference::whereNotNull('start_date')->whereNotNull('end_date');
     // If a year is specified, limit search
     if (!empty($year)) {
         $conferences->year($year);
     }
     // If other search criteria were specified, limit search
     if (count($search) > 0) {
         $conferences->lookup($search);
     }
     // Flags will limit search
     if (is_object($flags)) {
         if (self::flags($flags, 'upcoming') && self::flags($flags, 'current')) {
             $conferences->upcomingOrCurrent();
         } elseif (self::flags($flags, 'past') && self::flags($flags, 'current')) {
             $conferences->pastOrCurrent();
         } elseif (self::flags($flags, 'upcoming')) {
             $conferences->upcoming();
         } elseif (self::flags($flags, 'current')) {
             $conferences->current();
         } elseif (self::flags($flags, 'past')) {
             $conferences->past();
         }
         if (self::flags($flags, 'published')) {
             $conferences->published();
         }
         if (self::flags($flags, 'home')) {
             $conferences->take(3);
         } elseif (!empty($flags->take) && is_int($flags->take)) {
             $conferences->take($flags->take);
         }
     }
     if (is_object($flags)) {
         if (self::flags($flags, 'latest')) {
             $conferences->orderBy('start_date', 'desc');
         } elseif (isset($flags->orderby)) {
             foreach ($flags->orderby as $order) {
                 list($by, $direction) = explode($order);
                 if (!empty($direction)) {
                     $conferences->orderBy($by, $direction);
                 } else {
                     $conferences->orderBy($by);
                 }
             }
         } else {
             $conferences->orderBy('start_date');
         }
         if (self::flags($flags, 'first')) {
             $conferences = $conferences->take(1)->get();
         } elseif (self::flags($flags, 'latest')) {
             $conferences = $conferences->take(1)->get();
         } elseif (self::flags($flags, 'take')) {
             $conferences = $conferences->take($flags->take)->get();
         } else {
             $conferences = $conferences->get();
         }
     } else {
         $conferences = $conferences->get();
     }
     $events = self::collectionToArray($conferences);
     return $events;
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     Conference::where('slug', '=', '2016/austin')->orWhere('slug', '=', '2017/austin')->update(['published' => null]);
 }
Ejemplo n.º 30
0
 /**
  * Retrieve all Events of a certain status from a Conference.
  *
  * @param  Request  $request
  * @param  int  $cid
  * @param  string  $status
  * @return Collection|Response
  */
 public function eventsWithStatus(Request $request, $cid, $status)
 {
     try {
         $conference = Conference::find($cid);
         if (!$conference) {
             return response()->error(404, 'Conference Not Found');
         }
         return $conference->events()->where('status', $status)->get();
     } catch (Exception $e) {
         return response()->error();
     }
 }