public function testGetHumanDateCarbon()
 {
     $model = new Model();
     $model->date = Carbon::create(2014, 1, 1, 0, 0, 0);
     //Asserts
     $this->assertEquals('January 1, 2014', $model->getHumanDate('date'));
 }
 /**
  * @test
  */
 public function material_update_material_cost_form_submit_correct()
 {
     $this->visit('/material/13/edit')->see('MTech MIS Login Screen');
     $user = User::find(46);
     $this->actingAs($user)->visit('/material/13/edit')->type("32", 'mat_cost_cost_kg')->type(\Carbon\Carbon::create(2016, 03, 01), 'mat_cost_date')->press("Update Price")->assertSessionHas('flash');
     $this->assertResponseOk();
 }
Example #3
0
 public function testIssetReturnTrueForProperties()
 {
     $properties = array('year', 'month', 'day', 'hour', 'minute', 'second', 'dayOfWeek', 'dayOfYear', 'daysInMonth', 'timestamp', 'age', 'quarter', 'dst', 'offset', 'offsetHours', 'timezone', 'timezoneName', 'tz', 'tzName');
     foreach ($properties as $property) {
         $this->assertTrue(isset(Carbon::create(1234, 5, 6, 7, 8, 9)->{$property}));
     }
 }
 public function __construct()
 {
     parent::setUp();
     $this->user = factory(\App\User::class)->create();
     $this->administratorFactory = new \Larapress\Admin\Database\Factories\AdministratorFactory(Faker\Factory::create(), \Carbon\Carbon::create());
     $this->administrator = $this->administratorFactory->administrator($this->user->id)->save();
 }
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('sponsors', function (Blueprint $table) {
            $table->increments('id');
            $table->string('slug');
            $table->string('company');
            $table->string('website');
            $table->string('slogan')->nullable();
            $table->text('bio')->nullable();
            $table->text('tags')->nullable();
            $table->text('options')->nullable();
            $table->text('contacts')->nullable();
            $table->string('photo')->nullable();
            $table->timestamps();
            $table->timestamp('published')->nullable();
            $table->softDeletes();
        });
        Sponsor::create(['company' => 'Cylance', 'slug' => 'cylance', 'website' => 'http://www.cylance.com', 'bio' => '<p>Cylance is the first company to apply artificial intelligence, algorithmic science and machine learning to cyber security and improve the way companies, governments and end users proactively solve the world’s most difficult security problems. Using a breakthrough mathematical process, Cylance quickly and accurately identifies what is safe and what is a threat, not just what is in a blacklist or whitelist. Cylance provides the technology and services to be truly predictive and preventive against advanced threats.</p>', 'photo' => '/images/sponsors/cylance.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Dynatrace', 'slug' => 'dynatrace', 'website' => 'http://www.dynatrace.com', 'bio' => '<p>Dynatrace is the innovator behind the industry’s premier Digital Performance Platform, making real-time information about digital performance visible and actionable for everyone across business and IT. We help customers of all sizes see their applications and digital channels through the lens of their end users. More than 7,500 organizations use these insights to master complexity, gain operational agility and grow revenue by delivering amazing customer experiences.</p>', 'photo' => '/images/sponsors/dynatrace.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Forsythe Technology', 'slug' => 'forsythe', 'website' => 'http://www.forsythe.com', 'bio' => '<p>Founded in 1971, Forsythe is one of the largest independent IT integrators in North America, serving approximately 1,000 U.S. and Canada-based companies. Forsythe provides independent consulting, hosting solutions and technology financing, as well as IT products and services from leading IT infrastructure manufacturers and vendors. Clients come to Forsythe for help optimizing cost, managing risk, improving performance and enabling innovation within their IT and data center operations to deliver greater value to their business.</p>', 'photo' => '/images/sponsors/forsythe.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Hitachi Data Systems', 'slug' => 'hitachi', 'website' => 'http://www.hitachi.com', 'bio' => '<p>Hitachi Data Systems builds information management and Social Innovation solutions for business and social prosperity. Our IT solutions and services drive strategic management and analysis of the world’s data. Only HDS integrates the best of Hitachi IT and operational technology to deliver the insight that businesses need to thrive. HDS.com</p>', 'photo' => '/images/sponsors/hitachi.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Workday', 'slug' => 'workday', 'website' => 'http://www.workday.com', 'bio' => '<p>Workday is a leading provider of enterprise cloud applications for financeand human resources. Founded in 2005, Workday delivers financial management, human capital management, and analytics applications designed for the world\'s largest companies, educational institutions, and government agencies. Hundreds of organizations, ranging from medium-sized businesses to Fortune 50 enterprises, have selected Workday.</p>', 'photo' => '/images/sponsors/workday.jpg', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'MCCI', 'slug' => 'mcci', 'website' => 'http://www.mccinnovations.com/', 'bio' => '<p>MCCi provides innovative solutions that transform paper-based processes into smart practices. MCCi works with organizations on records and document management, scanning and business workflow. As the #1 Laserfiche reseller, we are passionate about helping organizations run their office more efficiently – saving time, money and resources.</p>', 'photo' => '/images/sponsors/mcci.jpg', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Good Technologies', 'slug' => 'good', 'website' => 'http://www.good.com', 'bio' => '<p>Good Technology is the leader in secure mobility, providing the leading secure mobility solution for enterprises and governments worldwide, across all stages of the mobility lifecycle. Good’s comprehensive, end-to-end secure mobility solutions portfolio consists of a suite of collaboration applications, a secure mobility platform, mobile device management, unified monitoring, management and analytics and a third-party application and partner ecosystem. Good has more than 5,000 customers in 184 countries, including more than 50 of the FORTUNE 100™ companies. Learn more at www.good.com.</p>', 'photo' => '/images/sponsors/good.jpg', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Nimble Storage', 'slug' => 'nimble-storage', 'website' => 'http://www.nimblestorage.com', 'bio' => '<p>The Power of One: A Single Storage Consolidation Platform. Most storage architectures were engineered to deliver just a single functional benefit: high performance or high capacity.The Nimble Storage Adaptive Flash platform is transforming this land of storage silos. Enterprises can use a single architectural approach to cater dynamically to varying workloads’ needs for performance and capacity, as well as data protection. Only Nimble offers the Power of One: gain the benefits of consolidation, without compromising the ability to deliver the service levels required for specific workloads. IT organizations that use the Nimble Storage Adaptive Flash platform can predict, manage, and deliver the storage that is required to optimize applications and workloads across the enterprise.</p>', 'photo' => '/images/sponsors/nimble-storage.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Windstream', 'slug' => 'windstream', 'website' => 'http://www.windstream.com', 'bio' => '<p>Windstream, a FORTUNE 500 company, is a leading provider of advanced network communications and technology solutions, including cloud computing and managed services, to businesses nationwide.</p>
					<p>Windstream Hosted Solutions offers one of the most comprehensive enterprise-class cloud and managed services portfolios in the industry. From robust cloud computing solutions including public, private and hybrid cloud and cloud storage to complete managed services and colocation options, your network infrastructure, applications, systems and data are maintained in highly secure data centers strategically located nationwide.</p>', 'photo' => '/images/sponsors/windstream.jpg', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => '2FA', 'slug' => '2fa', 'website' => 'http://www.2fa.com', 'bio' => '<p>2FA Inc. is a cybersecurity company created on the single vision of simplifying authentication. 2FA serves customers in diverse industries including: public sector, healthcare, and enterprise. 2FA supports over 1,000 customers and millions of users around the world, including deployments in all 50 states and over 25 countries.</p>', 'photo' => '/images/sponsors/2fa.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'SecureNation', 'slug' => 'secure-nation', 'website' => 'http://www.securenation.com', 'bio' => '<p>SecureNation’s is a “Network Security Advocate and Technology Ally” for our clients addressing almost all of their IT Security needs.  We are partnered with most of the industry leading technologies and we have over 300 Gartner Magic Quadrant partners.  We have saved millions of dollars for organizations across the US from colleges, financial institutions, state and local government, health-care to Fortune 500.  Solving information security and overall technology issues normally at a fraction of the cost.  The backbone of SecureNation is total transparency, deep discount negotiation, honesty and long lasting relationships.</p>', 'photo' => '/images/sponsors/secure-nation.png', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
        Sponsor::create(['company' => 'Arbor Networks', 'slug' => 'arbor-networks', 'website' => 'http://www.arbornetworks.com', 'bio' => '<p>Arbor Networks helps secure the world\'s largest enterprise and service provider networks from DDoS attacks and advanced threats. Arbor strives to be the "force multipler," making network and security teams the experts. Our goal is to provide a richer picture into networks and more security context - so customers can solve problems faster and help reduce the risk to their business.</p>', 'photo' => '/images/sponsors/arbor-networks.jpg', 'published' => Carbon::create(2015, 00, 04, 19, 37, 05)]);
    }
 /**
  * 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]);
 }
 /**
  * Cost Vs Selling Price Report
  *
  * @return $this
  */
 public function costVsSelling($month, $year)
 {
     $this->authorize('view_gp_report');
     $date = Carbon::create($year, $month);
     $jobIds = DespatchLogEntry::thisMonth($date)->get()->pluck('despatch_log_book_job_cards_id_fk')->toArray();
     return view('reports.costVsSelling')->with(['jobs' => JobCard::find($jobIds)]);
 }
Example #8
0
 /** @test */
 public function should_be_invalid_when_expired()
 {
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 10, 23, 34));
     $reminder = new Reminder($this->id, $this->email, $this->code);
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 11, 25, 12));
     $this->assertFalse($reminder->isValid());
 }
Example #9
0
 public function testDateGetsSet()
 {
     $apod = new APOD();
     $date = \Carbon\Carbon::create();
     $apod->date($date);
     $this->assertTrue($apod->parameters['date'] == $date->format('Y-m-d'));
 }
Example #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     foreach (range(2015, 2030) as $year) {
         DB::table('terms')->insert(['start_date' => Carbon::create($year, 8, 20)->toIso8601String(), 'end_date' => Carbon::create($year, 12, 31)->toIso8601String()]);
         DB::table('terms')->insert(['start_date' => Carbon::create($year + 1, 1, 1)->toIso8601String(), 'end_date' => Carbon::create($year + 1, 5, 31)->toIso8601String()]);
     }
 }
 /**
  * Run the database seed for account "Compte joint".
  *
  * @return void
  */
 public function runAccount1()
 {
     Revenue::create(['account_id' => 1, 'name' => 'Salaire Simon', 'amount' => 1551.24, 'date' => Carbon::create(2015, 8, 3, 0)]);
     Revenue::create(['account_id' => 1, 'name' => 'Indemnité Delphine', 'amount' => 1146.38, 'date' => Carbon::create(2015, 8, 4, 0)]);
     Revenue::create(['account_id' => 1, 'name' => 'Prestations CAF', 'amount' => 446.1, 'date' => Carbon::create(2015, 8, 5, 0)]);
     Revenue::create(['account_id' => 1, 'name' => 'Remboursement Bébé au naturel', 'amount' => 13.94, 'date' => Carbon::create(2015, 8, 6, 0)]);
 }
 /**
  * @test
  */
 public function material_store_cost_log_route_works()
 {
     $this->visit('/material')->see('MTech MIS Login Screen');
     $user = \App\User::find(46);
     $this->actingAs($user)->post('/material/13/costlog', ['_token' => csrf_token(), 'mat_cost_cost_kg' => 32, 'mat_cost_date' => \Carbon\Carbon::create(2016, 03, 01)]);
     $this->assertRedirectedTo('/material');
 }
 public function testMarc005()
 {
     $rec = $this->parseRecordData('
        <marc:controlfield tag="005">20090407000000.0</marc:controlfield>
     ');
     $this->assertEquals(Carbon::create(2009, 4, 7, 0, 0, 0), $rec->modified);
 }
 public function store(MensalidadeRequest $request, Mensalidade $m)
 {
     //$m = new Mensalidade();
     $dataPrimeiroVenc = $request->dt_venc;
     //  dd/mm/yyyy
     $dta = explode("/", $dataPrimeiroVenc);
     $dia = $dta[0];
     $mes = $dta[1];
     $ano = $dta[2];
     $data_venc = Carbon::create($ano, $mes, $dia);
     $valor = $this->getfloat($request->valor);
     for ($i = 1; $i <= $request->num_parcelas; $i++) {
         if ($i == 1) {
             //primeiro vencimento
             $mes_data_venc = $data_venc;
         } else {
             $mes_data_venc = $data_venc->addMonth();
         }
         $m->mes_status = $request->status;
         $m->insert(['mes_alu_id' => $request->aluno, 'mes_num' => $i, 'mes_valor' => $valor, 'mes_data_venc' => $mes_data_venc, 'mes_status' => $request->status, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
     }
     $mensalidades = $m->join('aluno', function ($join) {
         $join->on('mensalidade.mes_alu_id', '=', 'aluno.id');
     })->where('mes_alu_id', '=', $request->aluno)->get();
     $aluno = new Aluno();
     //$nomeAluno = $aluno->all()->where('alu_id',$request->aluno);
     $objAluno = DB::table('aluno')->where('id', '=', $request->aluno)->get();
     //return $nomeAluno;
     //return redirect()->route('mensalidades.lista', ['mensalidades'=>$mensalidades, 'aluno'=>$objAluno, 'test'=>1]);
     return view('mensalidade.index', ['mensalidades' => $mensalidades, 'aluno' => $objAluno, 'test' => 1]);
     //return var_dump($mensalidades);
 }
 private function carbonFromIso($dateFromApi)
 {
     if ($dateFromApi == null) {
         return Carbon::create(null);
     }
     return Carbon::createFromFormat(\DateTime::ISO8601, $dateFromApi);
 }
 /**
  * @return array
  */
 public function rules()
 {
     $sessionFirst = clone session('first');
     $first = $sessionFirst->subDay()->format('Y-m-d');
     $today = Carbon::create()->addDay()->format('Y-m-d');
     return ['start_date' => 'required|date|after:' . $first, 'end_date' => 'required|date|before:' . $today, 'accounts' => 'required', 'accounts.*' => 'required|exists:accounts,id|belongsToUser:accounts'];
 }
 public function run()
 {
     // INITAL PUBLISH DATE
     $published = Carbon::create(2015, 00, 28, 15, 05, 29);
     // DELETING TABLE ENTRIES
     DB::table($this->_table)->delete();
     // GENERAL OPTIONS
     DB::table($this->_table)->insert([['slug' => 'general', 'option' => 'maintenance', 'value' => '0', 'published' => $published], ['slug' => 'general', 'option' => 'show_hero_image', 'value' => '0', 'published' => $published], ['slug' => 'general', 'option' => 'active_menu', 'value' => 'home', 'published' => $published], ['slug' => 'general', 'option' => 'title', 'value' => 'Acclaim Events', 'published' => $published], ['slug' => 'general', 'option' => 'jumbotron', 'value' => '/images/networking.jpg', 'published' => $published]]);
     // HOME PAGE OPTIONS
     DB::table($this->_table)->insert([['slug' => 'home', 'option' => 'active_menu', 'value' => 'home', 'published' => $published], ['slug' => 'home', 'option' => 'show_hero_image', 'value' => '1', 'published' => $published], ['slug' => 'home', 'option' => 'jumbotron', 'value' => '/images/networking.jpg', 'published' => $published], ['slug' => 'home', 'option' => 'show_upcoming', 'value' => '1', 'published' => $published], ['slug' => 'home', 'option' => 'show_benefits', 'value' => '1', 'published' => $published], ['slug' => 'home', 'option' => 'show_testimonials', 'value' => '1', 'published' => $published]]);
     // ABOUT PAGE OPTIONS
     DB::table($this->_table)->insert([['slug' => 'about', 'option' => 'active_menu', 'value' => 'about', 'published' => $published], ['slug' => 'about', 'option' => 'show_hero_image', 'value' => '0', 'published' => $published], ['slug' => 'about', 'option' => 'title', 'value' => 'About Acclaim Events', 'published' => $published], ['slug' => 'about', 'option' => 'show_about', 'value' => '1', 'published' => $published], ['slug' => 'about', 'option' => 'about_text', 'value' => '<p>Established in 2012, Acclaim Events was created to help Business Technology Executives find solutions to many of today’s critical business challenges. We were built on the premise that networking and the sharing of ideas among technology leaders will help broaden and expand IT knowledge within the local community. With over 20 years of combined experience, our Acclaim Events team knows what it takes to facilitate high quality, interactive and educational technology networking conferences.</p><p>IT Professionals are tasked with keeping corporate and private information secure, while embracing new ways of supporting and doing business. With technology advancing at an alarming rate, it can be challenging to keep up with many of the technological advances, trends and best practices that help to keep our organizations competitive and secure.</p><p>Our IT Strategies Conferences foster an exclusive environment for CIOs &amp; Sr. level IT Executives that is conducive to learning, networking and sharing ideas with their peers; giving them valuable insight and knowledge that they can use within their organizations.</p>', 'published' => $published], ['slug' => 'about', 'option' => 'show_team', 'value' => '1', 'published' => $published], ['slug' => 'about', 'option' => 'show_advisors', 'value' => '1', 'published' => $published]]);
     // CONFERENCES PAGE OPTIONS
     DB::table($this->_table)->insert([['slug' => 'conferences', 'option' => 'active_menu', 'value' => 'conferences', 'published' => $published], ['slug' => 'conferences', 'option' => 'show_hero_image', 'value' => '0', 'published' => $published], ['slug' => 'conferences', 'option' => 'title', 'value' => 'Conferences', 'published' => $published], ['slug' => 'conferences', 'option' => 'show_conferences', 'value' => '1', 'published' => $published]]);
     // INDIVIDUAL CONFERENCE PAGE DEFAULT OPTIONS
     DB::table($this->_table)->insert([['slug' => 'conference', 'option' => 'active_menu', 'value' => 'conferences', 'published' => $published], ['slug' => 'conference', 'option' => 'show_hero_image', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'jumbotron', 'value' => 'event:hero', 'published' => $published], ['slug' => 'conference', 'option' => 'title', 'value' => 'event:conference', 'published' => $published], ['slug' => 'conference', 'option' => 'show_countdown', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'show_upcoming', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'show_about', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'show_partners', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_topics', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'topics_by_alpha', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_agenda', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'show_speakers', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_speakers_agenda', 'value' => '1', 'published' => $published], ['slug' => 'conference', 'option' => 'show_sponsors', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'sponsor_levels', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_map', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_address', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_coordinates', 'value' => '0', 'published' => $published], ['slug' => 'conference', 'option' => 'show_venue', 'value' => '0', 'published' => $published]]);
     // CONTACT PAGE OPTIONS
     DB::table($this->_table)->insert([['slug' => 'contact', 'option' => 'active_menu', 'value' => 'contact', 'published' => $published], ['slug' => 'contact', 'option' => 'show_hero_image', 'value' => '0', 'published' => $published], ['slug' => 'contact', 'option' => 'jumbotron', 'value' => '/images/contact.jpg', 'published' => $published], ['slug' => 'contact', 'option' => 'title', 'value' => 'Contact Us', 'published' => $published], ['slug' => 'contact', 'option' => 'show_contact', 'value' => '1', 'published' => $published]]);
     // CONFERENCE REGISTRATION PAGE OPTIONS
     DB::table($this->_table)->insert([['slug' => 'register', 'option' => 'active_menu', 'value' => 'register', 'published' => $published], ['slug' => 'register', 'option' => 'show_hero_image', 'value' => '0', 'published' => $published], ['slug' => 'register', 'option' => 'jumbotron', 'value' => '/images/registration.jpg', 'published' => $published], ['slug' => 'register', 'option' => 'title', 'value' => 'Conference Registration', 'published' => $published], ['slug' => 'register', 'option' => 'show_register', 'value' => '1', 'published' => $published]]);
     // CONFERENCE-SPECIFIC OPTIONS
     // AUSTIN 2015
     DB::table($this->_table)->insert([['slug' => '2015/austin', 'option' => 'show_upcoming', 'value' => '0', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_topics', 'value' => '0', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_speakers', 'value' => '1', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_sponsors', 'value' => '1', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_map', 'value' => '1', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_address', 'value' => '1', 'published' => $published], ['slug' => '2015/austin', 'option' => 'show_venue', 'value' => '1', 'published' => $published]]);
     $published = Carbon::create(2015, 12, 28, 15, 05, 17);
     // SAN ANTONIO 2016
     DB::table($this->_table)->insert([['slug' => '2016/san-antonio', 'option' => 'show_upcoming', 'value' => '0', 'published' => $published], ['slug' => '2016/san-antonio', 'option' => 'show_topics', 'value' => '0', 'published' => Carbon::create(2016, 02, 27, 16, 06, 32)], ['slug' => '2016/san-antonio', 'option' => 'show_map', 'value' => '1', 'published' => $published], ['slug' => '2016/san-antonio', 'option' => 'show_address', 'value' => '1', 'published' => $published], ['slug' => '2016/san-antonio', 'option' => 'show_venue', 'value' => '1', 'published' => $published]]);
     // AUSTIN 2016
     DB::table($this->_table)->insert([['slug' => '2016/austin', 'option' => 'show_upcoming', 'value' => '0', 'published' => $published], ['slug' => '2016/austin', 'option' => 'show_map', 'value' => '1', 'published' => $published], ['slug' => '2016/austin', 'option' => 'show_address', 'value' => '1', 'published' => $published], ['slug' => '2016/austin', 'option' => 'show_venue', 'value' => '1', 'published' => $published]]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $datetime = \Carbon\Carbon::create();
     $items = [['id' => 1, 'code' => 'en', 'name' => 'English', 'active' => 1, 'created_at' => $datetime, 'updated_at' => $datetime], ['id' => 2, 'code' => 'lt', 'name' => 'Lietuvių kalba', 'active' => 1, 'created_at' => $datetime, 'updated_at' => $datetime], ['id' => 3, 'code' => 'ru', 'name' => 'Русский', 'active' => 1, 'created_at' => $datetime, 'updated_at' => $datetime]];
     DB::table('_translator_languages')->truncate();
     DB::table('_translator_languages')->insert($items);
 }
Example #19
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $page = cache('pages')->filter(function ($page) {
         return $page->url == "events";
     })->first();
     // Delete all record first
     DB::table('layout_events')->truncate();
     $photoType = ['abstract', "animal", "business", "cats", "city", "food", "nightlife", "fashion", "people", "nature", "sports", "technics", "transport"];
     $months = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
     $catList = ['Dance', "Drama", "Sport", "Party"];
     foreach ($months as $month) {
         for ($day = 1; $day <= (int) date('t', strtotime("2015-{$month}")); $day++) {
             $number = rand(0, 5);
             if ($day < 10) {
                 $date = "0{$day}";
             } else {
                 $date = $day;
             }
             if ($number > 0) {
                 for ($i = 0; $i < $number; $i++) {
                     $type = $photoType[rand(0, 12)];
                     $cat = $catList[rand(0, 3)];
                     $startDate = Carbon::create(2015, $month, $date);
                     $endDate = Carbon::create(2015, $month, $date)->addDays(rand(1, 5));
                     $data = ['lang_id' => 1, 'meta_title' => "Event {$i} on day {$day}", 'meta_description' => "Lorem ipsum dolor sit amet, ea elit dolore urbanitas quo. Est assum cetero ei. Eam semper docendi id. Mucius doming.", 'page_id' => $page->id, 'content_identifier' => "event_seeder_{$month}-{$day}-{$i}", 'active' => 1, 'eventStartDate' => $startDate->format("Y-m-d h:i:s"), 'eventEndDate' => $endDate->format("Y-m-d h:i:s"), 'address' => "hong Kong", 'image1' => "http://lorempixel.com/380/300/{$type}", 'image2' => "http://lorempixel.com/380/300/{$type}", 'image3' => "http://lorempixel.com/380/300/{$type}", 'image4' => "http://lorempixel.com/380/300/{$type}", 'summary' => "this is the summary for a {$cat} event {$i} on {$date} {$month}", 'detail' => "Lorem ipsum dolor sit amet, consectetur adipisicing elit. A ad aliquam aperiam, consectetur debitis delectus dicta distinctio dolorum ea enim non odio placeat, quam quibusdam unde vero, voluptas voluptatibus? Accusantium alias amet, autem consectetur delectus dicta dignissimos esse id incidunt inventore ipsam maxime, provident quaerat quisquam quod sunt suscipit veritatis voluptas? A animi aperiam architecto dignissimos ducimus exercitationem, explicabo facilis id iste itaque labore maxime modi provident, quos, ratione recusandae repellendus sunt tenetur ut vero? Adipisci alias aliquam aliquid aperiam cumque delectus dignissimos dolorem doloribus et facere harum itaque mollitia nobis provident quia, repudiandae sint sit soluta temporibus vitae voluptatibus.", 'cat' => $cat];
                     DB::table('layout_events')->insert($data);
                 }
             }
         }
     }
 }
Example #20
0
 public function record(Request $request)
 {
     $this->validate($request, ['uuid' => 'required|exists:devices']);
     $date = Carbon::create();
     DB::table((new Visitor())->getTable())->lockForUpdate()->insert(['device_id' => Device::where('uuid', $request->get('uuid'))->first()->id, 'type' => $request->get('type') ? 'in' : 'out', 'created_at' => $date, 'updated_at' => $date]);
     return $this->response()->created();
 }
 private function parseValue($value)
 {
     $value = trim($value);
     // strip <ref> tag if exists:
     $value = preg_replace('/<ref([ \\w=]+)>?(.*)?<\\/ref>/i', '', $value);
     if (substr($value, 0, 2) == '{{' && substr($value, -2) == '}}') {
         // https://en.wikipedia.org/wiki/Template:Death_date_and_age
         // {{birth date and age|mf=yes|1972|10|17}}
         // {{Birth date|df=yes|1707|5|23}}
         // {{Death date and age|df=yes|1778|1|10|1707|5|23}}
         // {{birth date|1889|4|20|df=yes}}
         $value = substr($value, 2, -2);
         $parts = explode('|', $value);
         $parts[0] = strtolower($parts[0]);
         if (in_array($parts[0], ['birth date and age', 'birth date', 'death date and age'])) {
             $date = [];
             for ($i = 1; $i < count($parts); $i++) {
                 // df/mf  = date first, month first (controls date display on wp, we can ignore)
                 if (in_array($parts[$i], ['mf=yes', 'df=yes', 'df=y', 'mf=y'])) {
                     continue;
                 }
                 $date[] = $parts[$i];
             }
             return Carbon::create($date[0], $date[1], $date[2]);
         }
     }
     //dbg('unrecognized value format: '.$value);
     return $value;
 }
 public function index()
 {
     $sortBy = \Request::get('sortBy', 'created_at');
     $direction = \Request::get('direction', 'desc');
     $dateFilter = \Request::get('date_filter', '');
     $memberFilter = \Request::get('member_filter', '');
     $reasonFilter = \Request::get('reason_filter', '');
     $this->paymentRepository->setPerPage(50);
     if ($dateFilter) {
         $startDate = \Carbon\Carbon::createFromFormat('Y-m-d', $dateFilter)->setTime(0, 0, 0);
         $this->paymentRepository->dateFilter($startDate, $startDate->copy()->addMonth());
     }
     if ($memberFilter) {
         $this->paymentRepository->memberFilter($memberFilter);
     }
     if ($reasonFilter) {
         $this->paymentRepository->reasonFilter($reasonFilter);
     }
     $payments = $this->paymentRepository->getPaginated(compact('sortBy', 'direction'));
     $paymentTotal = $this->paymentRepository->getTotalAmount();
     $dateRangeEarliest = \Carbon\Carbon::create(2009, 07, 01);
     $dateRangeStart = \Carbon\Carbon::now();
     $dateRange = [];
     while ($dateRangeStart->gt($dateRangeEarliest)) {
         $dateRange[$dateRangeStart->toDateString()] = $dateRangeStart->format('F Y');
         $dateRangeStart->subMonth();
     }
     $memberList = $this->userRepository->getAllAsDropdown();
     $reasonList = ['subscription' => 'Subscription', 'induction' => 'Equipment Access Fee', 'balance' => 'Balance', 'door-key' => 'Key Deposit', 'storage-box' => 'Storage Box Deposit', 'equipment-fee' => 'Equipment Costs'];
     return \View::make('payments.index')->with('payments', $payments)->with('dateRange', $dateRange)->with('memberList', $memberList)->with('reasonList', $reasonList)->with('paymentTotal', $paymentTotal);
 }
Example #23
0
 public function specificDatesOfWeek($year, $month, $day)
 {
     $weekSpecified = Carbon::create($year, $month, $day, 0);
     //setting the date passed as the current date for subtraction and addition using carbon functions
     Carbon::setTestNow($weekSpecified);
     $targetDay = $this->dateObjectToArray($weekSpecified);
     //retrieving data for the next 3 days prior and after the currentDate
     $dateDayAfter = $weekSpecified->tomorrow();
     $dateDayBefore = $weekSpecified->yesterday();
     $dateDayAfter2 = $weekSpecified->tomorrow()->addDay();
     $dateDayAfter3 = $weekSpecified->tomorrow()->addDays(2);
     $dateDayBefore2 = $weekSpecified->yesterday()->subDay();
     $dateDayBefore3 = $weekSpecified->yesterday()->subDays(2);
     $weekBeforeObject = $weekSpecified->yesterday()->subDays(6);
     $weekAfterObject = $weekSpecified->tomorrow()->addDays(6);
     //unsetting the date
     Carbon::setTestNow();
     //putting the data in the array using the function using the ObjectToArray Trait
     $dayAfter = $this->dateObjectToArray($dateDayAfter);
     $dayBefore = $this->dateObjectToArray($dateDayBefore);
     $dayAfter2 = $this->dateObjectToArray($dateDayAfter2);
     $dayAfter3 = $this->dateObjectToArray($dateDayAfter3);
     $dayBefore2 = $this->dateObjectToArray($dateDayBefore2);
     $dayBefore3 = $this->dateObjectToArray($dateDayBefore3);
     $weekBefore = $this->dateObjectToArray($weekBeforeObject);
     $weekAfter = $this->dateObjectToArray($weekAfterObject);
     $data = ['thisDay' => '', 'thisWeek' => "class = active ", 'thisMonth' => '', 'id' => 'thisWeek'];
     // $listdata = $this->listRepository->getLists();
     return view('main-tabs.thisWeek', $data)->with('targetDay', $targetDay)->with('dayBefore', $dayBefore)->with('dayAfter', $dayAfter)->with('dayAfter2', $dayAfter2)->with('dayAfter3', $dayAfter3)->with('dayBefore2', $dayBefore2)->with('dayBefore3', $dayBefore3)->with('weekYearBefore', $weekBefore['currentYear'])->with('weekYearAfter', $weekAfter['currentYear'])->with('weekMonthBefore', $weekBefore['currentMonth'])->with('weekMonthAfter', $weekAfter['currentMonth'])->with('weekDayBefore', $weekBefore['currentDay'])->with('weekDayAfter', $weekAfter['currentDay']);
 }
 public function run()
 {
     // DELETING TABLE ENTRIES
     DB::table($this->_table)->delete();
     // CONFERENCE VENUES
     DB::table($this->_table)->insert([['venue' => 'Crown Plaza Austin', 'slug' => 'texas-austin-crown-plaza-austin', 'city' => 'Austin', 'state' => 'Texas', 'place' => 'ChIJVzSZghjKRIYREyXBujdzq6w', 'directions' => 'http://www.ihg.com/crowneplaza/hotels/us/en/austin/ausgz/hoteldetail?cm_mmc=GoogleMaps-_-cp-_-USEN-_-ausgz#map-directions', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)], ['venue' => 'Norris Conference Center - San Antonio', 'slug' => 'norris-conference-center-san-antonio', 'city' => 'San Anotnio', 'state' => 'Texas', 'place' => 'ChIJXUnvShVeXIYRw3zHzaw3Rhw', 'directions' => 'https://www.google.com/maps/dir//Norris+Conference+Centers+-+San+Antonio,+Park+North+Shopping+Center,+618+NW+Loop+410+%23207,+San+Antonio,+TX+78216/@29.5183577,-98.5047857,17z/data=!4m13!1m4!3m3!1s0x865c5e154aef495d:0x1c4637accdc77cc3!2sNorris+Conference+Centers+-+San+Antonio!3b1!4m7!1m0!1m5!1m1!1s0x865c5e154aef495d:0x1c4637accdc77cc3!2m2!1d-98.502597!2d29.518353', 'published' => Carbon::create(2015, 12, 28, 15, 05, 17)], ['venue' => 'Norris Conference Center - Austin', 'slug' => 'norris-conference-center-austin', 'city' => 'Austin', 'state' => 'Texas', 'place' => 'ChIJx5kWoq_LRIYRsUK4L-zQQls', 'directions' => 'https://www.google.com/maps/dir//Norris+Conference+Centers+-+Austin,+Northcross+Mall,+2525+W+Anderson+Ln+%23365,+Austin,+TX+78757/@30.3550942,-97.7360862,17z/data=!3m1!5s0x8644cbaf5b32b761:0x881f1844b29bbce0!4m13!1m4!3m3!1s0x8644cbafa21699c7:0x5b42d0ec2fb842b1!2sNorris+Conference+Centers+-+Austin!3b1!4m7!1m0!1m5!1m1!1s0x8644cbafa21699c7:0x5b42d0ec2fb842b1!2m2!1d-97.7338975!2d30.3550896', 'published' => Carbon::create(2015, 12, 28, 15, 05, 17)]]);
 }
Example #25
0
 public function testDepartures()
 {
     $time = \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin');
     $departures = BVGApi\Station::getDepartures(9100003, $time);
     $expected = [['time' => \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin'), 'line' => 'Tra M6', 'direction' => 'S Hackescher Markt (Berlin)'], ['time' => \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin'), 'line' => 'Tra M6', 'direction' => 'Riesaer Str. (Berlin)'], ['time' => \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin'), 'line' => 'Tra M2', 'direction' => 'Am Steinberg']];
     $this->assertEquals($expected, $departures);
 }
 /**
  * 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)]);
 }
Example #27
0
 public function testGetIndexedDocumentDataReturnsStringDates()
 {
     $model = new TestEntity();
     $model->date = \Carbon\Carbon::create();
     $indexData = $model->getIndexDocumentData();
     $this->assertInternalType('string', $indexData['date']);
 }
Example #28
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('songs')->insert(['title' => 'Rock Me Amadeus', 'length' => 224, 'bpm' => 90, 'user_id' => 1, 'created_at' => Carbon::create(2016, 1, 1, 0), 'updated_at' => Carbon::create(2016, 1, 1, 0)]);
     DB::table('songs')->insert(['title' => 'Gloria', 'length' => 268, 'bpm' => 130, 'user_id' => 1, 'created_at' => Carbon::create(2016, 1, 1, 0), 'updated_at' => Carbon::create(2016, 1, 1, 0)]);
     DB::table('songs')->insert(['title' => 'Earth Angel', 'user_id' => 1, 'created_at' => Carbon::create(2016, 1, 1, 0), 'updated_at' => Carbon::create(2016, 1, 1, 0)]);
     DB::table('songs')->insert(['title' => 'Golden Girls Theme', 'user_id' => 1, 'created_at' => Carbon::create(2016, 1, 1, 0), 'updated_at' => Carbon::create(2016, 1, 1, 0)]);
 }
 public function run()
 {
     // DELETING TABLE ENTRIES
     DB::table($this->_table)->delete();
     // CONFERENCE PARTNERS
     DB::table($this->_table)->insert([['company' => 'TAGITM', 'slug' => 'tagitm', 'website' => 'http://www.tagitm.org', 'slogan' => '', 'tags' => '2015/austin', 'photo' => '/images/partners/tagitm.png', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]]);
 }
 public function index()
 {
     $now = Carbon::create();
     $last7 = $this->error->where('updated_at', '>', $now->subDays(7))->get();
     $all = $this->error->get();
     return view('laramanager::errors.index', compact('last7', 'all'));
 }