Пример #1
0
 public function testIsolation()
 {
     $now = Carbon\Carbon::create(2013, 12, 1);
     $expected = \Carbon\Carbon::create(2013, 12, 14, 15, 0, 0);
     $instance = new \Lutzen\Models\YuleDate($now);
     $now->addYear();
     $this->assertEquals($expected, $instance->getYulePartyDate(), "The returned date did not match!");
 }
Пример #2
0
 public function testMatch()
 {
     $zodiac = $this->getMockForAbstractClass('\\Intervention\\Zodiac\\AbstractZodiac');
     $zodiac->start = ['month' => '6', 'day' => '1'];
     $zodiac->end = ['month' => '6', 'day' => '10'];
     $this->assertTrue($zodiac->match(Carbon\Carbon::create(null, 6, 1)));
     $this->assertTrue($zodiac->match(Carbon\Carbon::create(null, 6, 10)));
     $this->assertTrue($zodiac->match(Carbon\Carbon::create(null, 6, 5)));
     $this->assertFalse($zodiac->match(Carbon\Carbon::create(null, 6, 11)));
 }
Пример #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $sportHallId = \App\SportHall::where('name', '=', 'Hall 1')->pluck('id');
     $userId = \App\User::where('name', '=', 'Jill')->pluck('id');
     $bookingStatusId = \App\BookingStatus::where('status', '=', 'Reserved')->pluck('id');
     DB::table('bookings')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'booking_time' => Carbon\Carbon::create(2015, 12, 10, 8, 0, 0)->toDateTimeString(), 'hours' => 1, 'sport_hall_id' => $sportHallId, 'user_id' => $userId, 'booking_status_id' => $bookingStatusId]);
     $sportHallId = \App\SportHall::where('name', '=', 'Hall 1')->pluck('id');
     $userId = \App\User::where('name', '=', 'Jamal')->pluck('id');
     $bookingStatusId = \App\BookingStatus::where('status', '=', 'Reserved')->pluck('id');
     DB::table('bookings')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'booking_time' => Carbon\Carbon::create(2015, 12, 10, 10, 0, 0)->toDateTimeString(), 'hours' => 1, 'sport_hall_id' => $sportHallId, 'user_id' => $userId, 'booking_status_id' => $bookingStatusId]);
     $sportHallId = \App\SportHall::where('name', '=', 'Hall 3')->pluck('id');
     $userId = \App\User::where('name', '=', 'Jill')->pluck('id');
     $bookingStatusId = \App\BookingStatus::where('status', '=', 'Reserved')->pluck('id');
     DB::table('bookings')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'booking_time' => Carbon\Carbon::create(2015, 12, 11, 8, 0, 0)->toDateTimeString(), 'hours' => 1, 'sport_hall_id' => $sportHallId, 'user_id' => $userId, 'booking_status_id' => $bookingStatusId]);
     $sportHallId = \App\SportHall::where('name', '=', 'Hall 4')->pluck('id');
     $userId = \App\User::where('name', '=', 'Jamal')->pluck('id');
     $bookingStatusId = \App\BookingStatus::where('status', '=', 'Reserved')->pluck('id');
     DB::table('bookings')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'booking_time' => Carbon\Carbon::create(2015, 12, 11, 10, 0, 0)->toDateTimeString(), 'hours' => 1, 'sport_hall_id' => $sportHallId, 'user_id' => $userId, 'booking_status_id' => $bookingStatusId]);
 }
Пример #4
0
}
?>
                            </tr>
                          </thead>
                          <tbody>
                              <tr class="itemblank">
                                <td><div class="innerblank"></div></td>
                              </tr>
                            <?php 
foreach ($employees as $key => $value) {
    $calendar = $value->calendar;
    ?>
                                <tr>
                                  <?php 
    for ($i = 1; $i <= 31; $i++) {
        $dt = Carbon\Carbon::create($year, $month, $i);
        if (checkDateValid($i, $month, $year)) {
            if ($dt->dayOfWeek == 6 || $dt->dayOfWeek == 0) {
                ?>
                                          <td style="background-color:#ffbff7"><div class="item" idem="{{ $value->id }}" idday="<?php 
                echo $i;
                ?>
" ><?php 
                echo $calendar->{'n' . $i};
                ?>
</div></td>
                                        <?php 
            } else {
                ?>
                                          <td><div class="item" idem="{{ $value->id }}" idday="<?php 
                echo $i;
Пример #5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $data = ['name' => 'Person Counter', 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()];
     DeviceType::create($data);
 }
<?php

//file : app/constants.php
return ['ANNIVERSARY' => Carbon\Carbon::create(2013, 12, 7, 0, 0, 0, 'Asia/Manila')];
Пример #7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     /**
      * Create 10 events
      */
     $featuredCount = 0;
     //no more than 4
     for ($i = 0; $i < 10; $i++) {
         if ($featuredCount < 4) {
             $featured = rand(0, 1);
             if ($featured == 1) {
                 $featuredCount += 1;
             }
         } else {
             $featured = 0;
         }
         $year = 2016;
         $month = rand(5, 12);
         $startDate = rand(8, 28);
         $endDate = $startDate + 2;
         $closingDate = $startDate - 7;
         $statuses = array('unpublished', 'published', 'published', 'published');
         $status = $statuses[array_rand($statuses, 1)];
         $late = array_rand(array(0, 1), 1);
         $lateFee = 0;
         if ($late == 1) {
             $lateFee = rand(0, 10);
         }
         $reg = array_rand(array(0, 1), 1);
         $regFee = 0;
         if ($reg == 1) {
             $regFee = rand(0, 10);
         }
         $event_id = DB::table('events')->insertGetId(['user_id' => 1, 'name' => 'Awesome event ' . $i, 'slug' => Str::slug('Awesome event ' . $i), 'description' => 'This is the event description.', 'postcode' => 'YO24 4QP', 'startDate' => Carbon\Carbon::createFromDate($year, $month, $startDate, 'Europe/London'), 'endDate' => Carbon\Carbon::createFromDate($year, $month, $endDate, 'Europe/London'), 'closingDate' => Carbon\Carbon::createFromDate($year, $month, $closingDate, 'Europe/London'), 'paypal' => '*****@*****.**', 'status' => $status, 'lateEntries' => $late, 'lateEntriesFee' => $lateFee, 'registration' => $reg, 'registrationFee' => $regFee, 'featured' => $featured, 'currency' => 'GBP', 'imageFilename' => $i . ".jpg"]);
         //Create between 5-15 competitions
         for ($j = 0; $j < rand(5, 15); $j++) {
             $comp_id = DB::table('competitions')->insertGetId(['event_id' => $event_id, 'name' => 'Competition ' . $j, 'description' => 'This is the competition description.', 'fee' => rand(5, 25)]);
             //Create 1-3 details
             $numDetails = rand(1, 3);
             for ($k = 0; $k < $numDetails; $k++) {
                 $hour = rand(0, 23);
                 $minutes = array('00', '15', '30', '45');
                 $minute = $minutes[array_rand($minutes, 1)];
                 $max = rand(5, 25);
                 $detail_id = DB::table('details')->insertGetId(['competition_id' => $comp_id, 'name' => 'Qualification ' . $k, 'max' => $max, 'dateTime' => Carbon\Carbon::create($year, $month, $startDate, $hour, $minute, '00', 'Europe/London')]);
             }
         }
         //we've created competitions and details for this event. now do some entries
         $event = Event::findOrFail($event_id);
         foreach ($event->competitions()->get() as $competition) {
             $users = User::all()->keyBy('id');
             $users->forget(1);
             $details = $competition->details()->get();
             $detail = $details->random();
             for ($e = 0; $e < rand(1, 20); $e++) {
                 $user = $users->random();
                 DB::table('entries')->insert(['user_id' => $user->id, 'event_id' => $event_id, 'competition_id' => $competition->id, 'detail_id' => $detail->id, 'transaction_id' => null, 'user_lastname' => $user->lastname, 'paymentStatus' => 'paid']);
                 $users->forget($user->id);
                 $detail = $details->random();
             }
         }
     }
 }
<?php

//file : app/constants.php
$API_URL = '';
if (App::environment() == 'local') {
    $API_URL = 'http://localhost:8001/api/v1/';
} else {
    $API_URL = 'http://chainofmemoriesapi.sytes.net/api/v1/';
}
return ['ANNIVERSARY' => Carbon\Carbon::create(2013, 12, 7, 0, 0, 0, 'Asia/Manila'), 'API_URL' => $API_URL, 'CLIENT_ID' => 'web_frontend', 'CLIENT_SECRET' => 'chainofmemories'];
Пример #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('contracts')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'property_id' => '3', 'renter_id' => '1', 'term_start' => Carbon\Carbon::create(2015, 1, 1, 0, 0, 0), 'term_end' => Carbon\Carbon::create(2016, 1, 1, 0, 0, 0), 'rent' => '800']);
     DB::table('contracts')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'property_id' => '3', 'renter_id' => '2', 'term_start' => Carbon\Carbon::create(2016, 1, 1, 0, 0, 0), 'term_end' => Carbon\Carbon::create(2017, 1, 1, 0, 0, 0), 'rent' => '600']);
     DB::table('contracts')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'property_id' => '2', 'renter_id' => '2', 'term_start' => Carbon\Carbon::create(2014, 1, 1, 0, 0, 0)->toDateString(), 'term_end' => Carbon\Carbon::create(2015, 1, 1, 0, 0, 0)->toDateString(), 'rent' => '600']);
 }
Пример #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $data = [['uuid' => 'DEVICE_1', 'device_type_id' => DeviceType::first()->id, 'store_id' => Store::first()->id, 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]];
     Device::insert($data);
 }
Пример #11
0
 public function run()
 {
     $data = [['name' => 'admin', 'display_name' => 'admin', 'description' => 'Administrators', 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]];
     Role::insert($data);
 }
Пример #12
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $data = [['name' => 'ASpace - Manila', 'client_id' => Client::first()->id, 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]];
     Store::insert($data);
 }
Пример #13
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $data = [['name' => 'ASpace CoWorking Solutions', 'created_at' => Carbon\Carbon::create(), 'updated_at' => Carbon\Carbon::create()]];
     Client::insert($data);
 }
Пример #14
0
 public function run()
 {
     Order::create(['customer_id' => 1, 'business_id' => 1, 'employee_id' => 1, 'price' => null, 'created_at' => Carbon\Carbon::create(2014, 07, 10, 0, 0, 0), 'date' => null, 'comment' => null]);
 }