ognjenm/reservations-calendar

此包的最新版本(1.0.0)没有可用的许可信息。

这是根据我的需求重写的 [https://github.com/bastianallgeier/gantti] Gantt 类,例如:显示每个资源的多个事件(预订)以及 Laravel 4 兼容性。

1.0.0 2015-07-20 16:56 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:29:29 UTC


README

#Laravel 5 预订日历 ##关于 这是根据我的需求重写的 [https://github.com/bastianallgeier/gantti] Gantt 类,例如:显示每个资源的多个事件(预订)以及 Laravel 5 兼容性

##截图

##安装

在 composer.json 中要求 ognjenm/reservations-calendar,并运行 composer update。

{
    "require": {
        "laravel/framework": "5.1.*",
        ...
        "ognjenm/reservations-calendar": "*"
    }
    ...
}

Composer 将下载此包。包下载完成后,打开 config/app.php 并添加以下服务提供者和别名


'providers' => array(
    ...
    'Ognjenm\ReservationsCalendar\ReservationsCalendarServiceProvider',
),



'aliases' => array(
    ...
    'ResCalendar'     => 'Ognjenm\ReservationsCalendar\Facades\ResCalendar',
),

最后,您需要运行以下 Artisan 命令来发布配置文件。

php artisan vendor:publish --tag=public --force

在视图中包含 CSS

<link href="/public/vendor/ognjenm/calendar.css" rel="stylesheet" type="text/css">

###示例

准备数据


$data[] = [
            'label' => 'Soba 1',
        	'info' => '2+1',
        	'class' => 'blue',
            'events' => [

                    [
                    'label' => 'Ognjen Miletic',
                    'tooltip' => '<h5>Potvrdjena rezervacija</h5><br><p>od: 19.06.2015</p><p>do: 23.06.2015</p><p>Ukupno: 578 EUR</p>',
                    'url' => 'http://google.com',
                    'start' => '2015-06-19',
                    'end'   => '2015-06-23',
                    'class' => '',
                    'icon' => 'fa-arrow-down'
                    ],
                    [
                            'label' => 'Madona i ekipa',
                            'tooltip' => '<h5>Potvrdjena rezervacija</h5><br>
<p>od: 19.06.2015</p><p>do: 23.06.2015</p><p>Ukupno: 1578 EUR</p>',
                            'start' => '2015-06-10',
                            'end'   => '2015-06-19',
                            'class' => 'checkout',
                            'icon' => 'fa-sign-out'
                    ],
                    [
                            'label' => 'Jovan Jovanovic Zmaj',
                            'start' => '2015-06-23',
                            'end'   => '2015-06-30',
                            'class' => 'uncomfirmed',
                            'icon' => 'fa-question'
                    ],
                    [
                            'label' => 'Nikola Nikolic',
                            'tooltip' => '<h5>This is some html</h5>',
                            'url' => 'http://google.com',
                            'start' => '2015-06-30',
                            'end'   => '2015-07-15',
                            'class' => 'stay'
                    ],
            ]

            ];

    }

渲染日历

{!! ResCalendar::render($data,['title'=>'Hotel'])!!}

##欢迎贡献