Example #1
1
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_budget_report();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$budget = new \Kendo\Dataviz\UI\ChartSeriesItem();
$budget->field('budget');
$spending = new \Kendo\Dataviz\UI\ChartSeriesItem();
$spending->field('spending');
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('unit');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('template' => '$#= value / 1000 #k'));
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Budget report'))->dataSource($dataSource)->addSeriesItem($budget, $spending)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'radarLine', 'style' => 'smooth'));
echo $chart->render();
require_once '../include/footer.php';
Example #2
0
$title->field('Title');
$grid->addColumn($firstName, $lastName, $country, $city, $title)->dataSource($dataSource)->height(430)->sortable(true)->pageable(true)->dataBound('dataBound')->detailTemplateId('details');
echo $grid->render();
?>

<script id="details" type="text/x-kendo-template">
   <?php 
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('hierarchy.php?details=details')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
                return kendo.stringify(data);
              }');
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->total('total');
$dataSource = new \Kendo\Data\DataSource();
$filter = new \Kendo\Data\DataSourceFilterItem();
$filter->field('EmployeeID')->operator('eq')->value('#=EmployeeID#');
$dataSource->transport($transport)->pageSize(5)->schema($schema)->addFilterItem($filter)->serverSorting(true)->serverFiltering(true)->serverPaging(true);
$detailGrid = new \Kendo\UI\Grid('detailGrid#=EmployeeID#');
$orderID = new \Kendo\UI\GridColumn();
$orderID->field('OrderID')->width(70)->title('Order ID');
$shipCountry = new \Kendo\UI\GridColumn();
$shipCountry->field('ShipCountry')->width(110)->title('Ship Country');
$shipAddress = new \Kendo\UI\GridColumn();
$shipAddress->field('ShipAddress')->title('Ship Address');
$shipName = new \Kendo\UI\GridColumn();
$shipName->field('ShipName')->title('Ship Name')->width(200);
$detailGrid->dataSource($dataSource)->addColumn($orderID, $shipCountry, $shipAddress, $shipName)->pageable(true)->sortable(true)->scrollable(false);
echo $detailGrid->renderInTemplate();
?>
Example #3
0
              }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$productIDField = new \Kendo\Data\DataSourceSchemaModelField('ProductID');
$productIDField->type('number')->editable(false)->nullable(true);
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$discontinuedField = new \Kendo\Data\DataSourceSchemaModelField('Discontinued');
$discontinuedField->type('boolean');
$model->id('ProductID')->addField($productIDField)->addField($productNameField)->addField($unitPriceField)->addField($discontinuedField)->addField($unitsInStockField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->errors('errors')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->batch(true)->schema($schema)->pageSize(4);
$listview = new \Kendo\UI\ListView('listView');
$listview->dataSource($dataSource)->templateId('template')->editTemplateId('editTemplate')->selectable(true)->navigatable(true)->pageable(true);
echo $listview->render();
?>
</div>

<script>
    $(function() {
        $(".k-add-button").click(function(e) {
            var listView = $("#listView").data("kendoListView");

            listView.add();
            e.preventDefault();
        });
Example #4
0
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('selection.php')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
                return kendo.stringify(data); }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$model->addField($productNameField)->addField($unitPriceField)->addField($unitsInStockField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->pageSize(12);
$listview = new \Kendo\UI\ListView('listView');
$listview->dataSource($dataSource)->templateId('template')->selectable('multiple')->pageable(true)->dataBound("onDataBound")->change("onChange");
echo $listview->render();
?>
</div>

<div class="demo-section">
	<h2>Console Log</h2>
	<div class="console"></div>
</div>


<script>
    function onDataBound() {
Example #5
0
$productIDField = new \Kendo\Data\DataSourceSchemaModelField('ProductID');
$productIDField->type('number')->editable(false)->nullable(true);
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string')->validation(array('required' => true));
$unitPriceValidation = new \Kendo\Data\DataSourceSchemaModelFieldValidation();
$unitPriceValidation->required(true)->min(1);
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number')->validation($unitPriceValidation);
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$discontinuedField = new \Kendo\Data\DataSourceSchemaModelField('Discontinued');
$discontinuedField->type('boolean');
$model->id('ProductID')->addField($productIDField)->addField($productNameField)->addField($unitPriceField)->addField($unitsInStockField)->addField($discontinuedField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->errors('errors')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->batch(true)->pageSize(20)->schema($schema);
$grid = new \Kendo\UI\Grid('grid');
$productName = new \Kendo\UI\GridColumn();
$productName->field('ProductName')->title('Product Name');
$unitPrice = new \Kendo\UI\GridColumn();
$unitPrice->field('UnitPrice')->format('{0:c}')->width(100)->title('Unit Price');
$unitsInStock = new \Kendo\UI\GridColumn();
$unitsInStock->field('UnitsInStock')->width(100)->title('Units In Stock');
$discontinued = new \Kendo\UI\GridColumn();
$discontinued->field('Discontinued')->width(100);
$command = new \Kendo\UI\GridColumn();
$command->addCommandItem('edit')->addCommandItem('destroy')->title('&nbsp;')->width(160);
$grid->addColumn($productName, $unitPrice, $unitsInStock, $discontinued, $command)->dataSource($dataSource)->addToolbarItem(new \Kendo\UI\GridToolbarItem('create'))->height(430)->editable('popup')->pageable(true);
echo $grid->render();
?>
function create_makerfaire_scheduler($faire_id)
{
    $transport = new \Kendo\Data\DataSourceTransport();
    $create = new \Kendo\Data\DataSourceTransportCreate();
    $create->url('makerfaire-scheduling-tasks.php?type=create')->contentType('application/json')->type('POST')->dataType('json');
    $read = new \Kendo\Data\DataSourceTransportRead();
    $read->url('makerfaire-scheduling-tasks.php?type=read')->contentType('application/json')->type('GET')->dataType('json');
    $update = new \Kendo\Data\DataSourceTransportUpdate();
    $update->url('makerfaire-scheduling-tasks.php?type=update')->contentType('application/json')->type('POST')->dataType('json');
    $destroy = new \Kendo\Data\DataSourceTransportDestroy();
    $destroy->url('makerfaire-scheduling-tasks.php?type=destroy')->contentType('application/json')->type('POST')->dataType('json');
    $transport->create($create)->read($read)->update($update)->destroy($destroy)->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
    $model = new \Kendo\Data\DataSourceSchemaModel();
    $locationIdField = new \Kendo\Data\DataSourceSchemaModelField('locationID');
    $locationIdField->type('number')->from('locationID')->nullable(true);
    $titleField = new \Kendo\Data\DataSourceSchemaModelField('title');
    $titleField->from('Title')->defaultValue('No title')->validation(array('required' => false));
    $startField = new \Kendo\Data\DataSourceSchemaModelField('start');
    $startField->type('date')->from('Start');
    $endField = new \Kendo\Data\DataSourceSchemaModelField('end');
    $endField->type('date')->from('End');
    $isAllDayField = new \Kendo\Data\DataSourceSchemaModelField('isAllDay');
    $isAllDayField->type('boolean')->from('IsAllDay');
    $subareaIdField = new \Kendo\Data\DataSourceSchemaModelField('subareaId');
    $subareaIdField->from('SubareaID')->nullable(true);
    $entriesField = new \Kendo\Data\DataSourceSchemaModelField('entries');
    $entriesField->from('Entries')->nullable(true);
    $model->id('locationID')->addField($locationIdField)->addField($titleField)->addField($startField)->addField($endField)->addField($isAllDayField)->addField($subareaIdField)->addField($entriesField);
    $schema = new \Kendo\Data\DataSourceSchema();
    $schema->model($model);
    $dataSource = new \Kendo\Data\DataSource();
    $dataSource->transport($transport)->schema($schema)->batch(false);
    $subareasResource = new \Kendo\UI\SchedulerResource();
    $locations_array = get_entry_locations($faire_id);
    $subareasResource->field('subareaId')->title('Stage')->name('Stages')->dataSource($locations_array);
    $entries = get_entries($faire_id);
    $entriesResource = new \Kendo\UI\SchedulerResource();
    $entriesResource->field('entries')->title('Presenter')->multiple(true)->name('Presenters')->dataSource($entries);
    $pdf = new \Kendo\UI\SchedulerPdf();
    $pdf->fileName('Kendo UI Scheduler Export.pdf')->proxyURL('makerfaire-scheduling.php?type=save');
    $scheduler = new \Kendo\UI\Scheduler('scheduler');
    $scheduler->eventTemplateId('presentation-template')->timezone('UTC')->currentTimeMarker(false)->date(new DateTime('2015/9/26 00:00', new DateTimeZone('UTC')))->height(900)->pdf($pdf)->addToolbarItem(new \Kendo\UI\SchedulerToolbarItem('pdf'))->addResource($subareasResource, $entriesResource)->group(array('resources' => array('Stages')))->addView(array('type' => 'day', 'majorTick' => 30, 'showWorkHours' => true, 'workWeekEnd' => 7, 'workDayStart' => new DateTime('2015/1/1 15:00', new DateTimeZone('UTC')), 'workDayEnd' => new DateTime('2015/1/1 24:00', new DateTimeZone('UTC'))), array('type' => 'workWeek', 'majorTick' => 30, 'selected' => true, 'workWeekStart' => 5, 'workWeekEnd' => 7, 'showWorkHours' => true, 'workDayStart' => new DateTime('2015/1/1 15:00', new DateTimeZone('UTC')), 'workDayEnd' => new DateTime('2015/1/1 24:00', new DateTimeZone('UTC'))), 'agenda')->dataSource($dataSource);
    return $scheduler;
}
Example #7
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
?>

<div class="demo-section">
    <div class="k-rtl">
        <h2>USA STATES:</h2>
<?php 
$states = array('Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Northern Marianas Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Puerto Rico', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Virgin Islands', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data($states);
$autoComplete = new \Kendo\UI\AutoComplete('states');
$autoComplete->dataSource($dataSource);
echo $autoComplete->render();
?>
    </div>
</div>
<style scoped>
    .demo-section {
        width: 250px;
        margin: 35px auto 50px;
        padding: 30px;
    }
    .demo-section h2 {
        text-transform: uppercase;
        font-size: 1.2em;
        margin-bottom: 10px;
    }
</style>
Example #8
0
require_once '../lib/Kendo/Autoload.php';
require_once '../lib/DataSourceResult.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = new DataSourceResult('sqlite:..//sample.db');
    echo json_encode($result->read('Customers', array('ContactName', 'CustomerID', 'CompanyName')));
    exit;
}
require_once '../include/header.php';
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('template.php')->type('POST');
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read($read);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema);
$autoComplete = new \Kendo\UI\AutoComplete('customers');
$autoComplete->minLength(1)->dataTextField('ContactName')->dataSource($dataSource)->height(370)->attr('style', 'width:400px')->headerTemplate(<<<TEMPLATE
<div class="dropdown-header"><span class="k-widget k-header">Photo</span><span class="k-widget k-header">Contact info</span></div>
TEMPLATE
)->template(<<<TEMPLATE
<span class="k-state-default"><img src="../content/web/Customers/#= CustomerID #.jpg" alt="#= CustomerID #" /></span><span class="k-state-default"><h3>#: data.ContactName #</h3><p>#: data.CompanyName #</p></span>
TEMPLATE
);
?>

<div class="demo-section">
<h2>Customers</h2>
<?php 
echo $autoComplete->render();
Example #9
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$dataSource = new \Kendo\Data\DataSource();
$dataSource->type("geojson")->transport(array('read' => '../content/dataviz/map/countries-users.geo.json'));
$layer = new \Kendo\Dataviz\UI\MapLayer();
$layer->type("shape")->dataSource($dataSource)->style(array('fill' => array('opacity' => 0.7)));
$map = new \Kendo\Dataviz\UI\Map('map');
$map->center(array(30.2681, -97.7448))->zoom(3)->addLayer($layer)->shapeCreated('onShapeCreated')->shapeMouseEnter('onShapeMouseEnter')->shapeMouseLeave('onShapeMouseLeave');
echo $map->render();
?>
<script src="../content/dataviz/map/js/chroma.min.js"></script>
<script>

var scale = chroma
    .scale(["white", "green"])
    .domain([1, 1000]);

function onShapeCreated(e) {
    var shape = e.shape;
    var users = shape.dataItem.properties.users;
    if (users) {
        var color = scale(users).hex();
        shape.fill(color);
    }
}

function onShapeMouseEnter(e) {
    e.shape.options.set("fill.opacity", 1);
}
Example #10
0
$data = array(array('meetingID' => 1, 'title' => 'Call Charlie about the project', 'start' => new DateTime('2013/6/13 10:30'), 'end' => new DateTime('2013/6/13 11:30'), 'roomId' => 1, 'attendee' => 1), array('meetingID' => 2, 'title' => 'Performance review', 'start' => new DateTime('2013/6/13 9:00'), 'end' => new DateTime('2013/6/13 12:30'), 'roomId' => 2, 'attendee' => 2), array('meetingID' => 3, 'title' => 'HR Lecture', 'start' => new DateTime('2013/6/13 13:00'), 'end' => new DateTime('2013/6/13 14:30'), 'roomId' => 1, 'attendee' => 2));
$model = new \Kendo\Data\DataSourceSchemaModel();
$startField = new \Kendo\Data\DataSourceSchemaModelField('start');
$startField->type('date');
$endField = new \Kendo\Data\DataSourceSchemaModelField('end');
$endField->type('date');
$titleField = new \Kendo\Data\DataSourceSchemaModelField('title');
$titleField->defaultValue('No title')->validation(array('required' => true));
$roomIdField = new \Kendo\Data\DataSourceSchemaModelField('roomId');
$roomIdField->nullable(true);
$attendeeField = new \Kendo\Data\DataSourceSchemaModelField('attendee');
$attendeeField->defaultValue(1);
$model->id('meetingID')->addField($roomIdField)->addField($startField)->addField($endField)->addField($attendeeField)->addField($titleField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->model($model);
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data($data)->schema($schema);
$roomResource = new \Kendo\UI\SchedulerResource();
$roomResource->field('roomId')->title('Room')->name('Rooms')->dataSource(array(array('text' => 'Meeting Room 101', 'value' => 1, 'color' => '#6eb3fa'), array('text' => 'Meeting Room 201', 'value' => 2, 'color' => '#f58a8a')));
$attendeesResource = new \Kendo\UI\SchedulerResource();
$attendeesResource->field('attendee')->title('Attendee')->name('Attendee')->dataSource(array(array('text' => 'Alex', 'value' => 1, 'color' => '#f8a398'), array('text' => 'Bob', 'value' => 2, 'color' => '#51a0ed')));
$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->date(new DateTime('2013/6/13'))->height(600)->addResource($attendeesResource, $roomResource)->group(array('resources' => array('Rooms')))->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 7:00')))->resize('scheduler_resize')->resizeEnd('scheduler_resizeEnd')->move('scheduler_move')->moveEnd('scheduler_moveEnd')->addEvent('scheduler_add')->save('scheduler_save')->dataSource($dataSource);
echo $scheduler->render();
?>

<script>
    function scheduler_resize(e) {
        if (roomIsOccupied(e.start, e.end, e.event, e.resources) || attendeeIsOccupied(e.start, e.end, e.event, e.resources)) {
            this.wrapper.find(".k-marquee-color").addClass("invalid-slot");
            e.preventDefault();
Example #11
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_screen_resolution();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('share')->categoryField('resolution')->visibleInLegendField('visibleInLegend')->padding(10);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->addSortItem(array('field' => 'order', 'dir' => 'asc'))->addGroupItem(array('field' => 'year'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => '1024x768 screen resolution trends'))->dataSource($dataSource)->addSeriesItem($series)->legend(array('position' => 'top'))->tooltip(array('visible' => true, 'template' => '#= dataItem.resolution #: #= value #% (#= dataItem.year #)'))->seriesDefaults(array('type' => 'donut', 'startAngle' => 270));
echo $chart->render();
require_once '../include/footer.php';
Example #12
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('value')->name('United States');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '{0}%'))->line(array('visible' => false));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('year')->majorGridLines(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= category # - #= value #%');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_united_states_internet_usage());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Internet Users in United States'))->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'area', 'labels' => array('visible' => true, 'format' => '{0}%', 'background' => 'transparent')))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Example #13
0
$transport->read($read)->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$orderIDField = new \Kendo\Data\DataSourceSchemaModelField('OrderID');
$orderIDField->type('number');
$shipNameField = new \Kendo\Data\DataSourceSchemaModelField('ShipName');
$shipNameField->type('string');
$shipAddressField = new \Kendo\Data\DataSourceSchemaModelField('ShipAddress');
$shipAddressField->type('string');
$shipCountryField = new \Kendo\Data\DataSourceSchemaModelField('ShipCountry');
$shipCountryField->type('string');
$model->addField($orderIDField)->addField($shipNameField)->addField($shipAddressField)->addField($shipCountryField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->pageSize(15)->serverPaging(true)->serverSorting(true)->schema($schema);
$grid = new \Kendo\UI\Grid('rowSelection');
$orderID = new \Kendo\UI\GridColumn();
$orderID->field('OrderID')->width(130)->title('Order ID');
$shipCountry = new \Kendo\UI\GridColumn();
$shipCountry->field('ShipCountry')->width(160)->title('Ship Country');
$shipName = new \Kendo\UI\GridColumn();
$shipName->field('ShipName')->title('Ship Name')->width(220);
$shipAddress = new \Kendo\UI\GridColumn();
$shipAddress->field('ShipAddress')->filterable(false)->title('Ship Address');
$grid->dataSource($dataSource)->addColumn($orderID, $shipCountry, $shipName, $shipAddress)->height(430)->resizable(true)->pageable(true);
echo $grid->render();
?>

<?php 
Example #14
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_spain_electricity_production();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$nuclear = new \Kendo\Dataviz\UI\ChartSeriesItem();
$nuclear->field('nuclear')->name('Nuclear');
$hydro = new \Kendo\Dataviz\UI\ChartSeriesItem();
$hydro->field('hydro')->name('Hydro');
$wind = new \Kendo\Dataviz\UI\ChartSeriesItem();
$wind->field('wind')->name('Wind');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => 'N0'))->line(array('visible' => false))->majorUnit(10000);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('year')->labels(array('rotation' => -90))->crosshair(array('visible' => true));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('N0')->shared(true);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->addSortItem(array('field' => 'year', 'dir' => 'asc'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Spain electricity production (GWh)'))->dataSource($dataSource)->legend(array('position' => 'top'))->addSeriesItem($nuclear, $hydro, $wind)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'line'))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Example #15
0
require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_april_sales();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('verticalBullet')->currentField('current')->targetField('target')->gap(4)->target(array('color' => '#aaaaaa'));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->shared(true)->template('Target: #= value.target # items<br /> Actual: #= value.current # items');
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->min(2000)->max(11000)->majorGridLines(array('visible' => false))->minorTicks(array('' => true))->addPlotBand(array('from' => 1000, 'to' => 3000, 'color' => '#aaaaaa', 'opacity' => 0.55), array('from' => 3000, 'to' => 5000, 'color' => '#aaaaaa', 'opacity' => 0.4), array('from' => 5000, 'to' => 8000, 'color' => '#aaaaaa', 'opacity' => 0.25), array('from' => 8000, 'to' => 11000, 'color' => '#aaaaaa', 'opacity' => 0.1));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->majorGridLines(array('visible' => false))->field('category');
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addCategoryAxisItem($categoryAxis)->addValueAxisItem($valueAxis)->tooltip($tooltip);
echo $chart->render();
?>
<style>
    .chart-wrapper {
        padding-top: 20px;
    }
    .chart-wrapper .k-tooltip {
        text-align: left;
Example #16
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_antenna_gain();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$gain = new \Kendo\Dataviz\UI\ChartSeriesItem();
$gain->type('polarLine')->xField('azimuth')->yField('gain');
$xAxis = new \Kendo\Dataviz\UI\ChartXAxisItem();
$xAxis->majorUnit(30);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'remote-data-binding.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport);
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Antenna Gain (dB)'))->dataSource($dataSource)->addSeriesItem($gain)->addXAxisItem($xAxis);
echo $chart->render();
require_once '../include/footer.php';
Example #17
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$data = array(array('title' => 'Fast and furious 6', 'image' => '../content/web/scheduler/fast-and-furious.jpg', 'imdb' => 'http://www.imdb.com/title/tt1905041/', 'start' => new DateTime('2013/6/13 17:00'), 'end' => new DateTime('2013/6/13 18:30')), array('title' => 'The Internship', 'image' => '../content/web/scheduler/the-internship.jpg', 'imdb' => 'http://www.imdb.com/title/tt2234155/', 'start' => new DateTime('2013/6/13 14:00'), 'end' => new DateTime('2013/6/13 15:30')), array('title' => 'The Perks of Being a Wallflower', 'image' => '../content/web/scheduler/wallflower.jpg', 'imdb' => 'http://www.imdb.com/title/tt1659337/', 'start' => new DateTime('2013/6/13 16:00'), 'end' => new DateTime('2013/6/13 17:30')), array('title' => 'The Help', 'image' => '../content/web/scheduler/the-help.jpg', 'imdb' => 'http://www.imdb.com/title/tt1454029/', 'start' => new DateTime('2013/6/13 12:00'), 'end' => new DateTime('2013/6/13 13:30')), array('title' => 'Now You See Me', 'image' => '../content/web/scheduler/now-you-see-me.jpg', 'imdb' => 'http://www.imdb.com/title/tt1670345/', 'start' => new DateTime('2013/6/13 10:00'), 'end' => new DateTime('2013/6/13 11:30')), array('title' => 'Fast and furious 6', 'image' => '../content/web/scheduler/fast-and-furious.jpg', 'imdb' => 'http://www.imdb.com/title/tt1905041/', 'start' => new DateTime('2013/6/13 19:00'), 'end' => new DateTime('2013/6/13 20:30')), array('title' => 'The Internship', 'image' => '../content/web/scheduler/the-internship.jpg', 'imdb' => 'http://www.imdb.com/title/tt2234155/', 'start' => new DateTime('2013/6/13 17:30'), 'end' => new DateTime('2013/6/13 19:00')), array('title' => 'The Perks of Being a Wallflower', 'image' => '../content/web/scheduler/wallflower.jpg', 'imdb' => 'http://www.imdb.com/title/tt1659337/', 'start' => new DateTime('2013/6/13 17:30'), 'end' => new DateTime('2013/6/13 19:00')), array('title' => 'The Help', 'image' => '../content/web/scheduler/the-help.jpg', 'imdb' => 'http://www.imdb.com/title/tt1454029/', 'start' => new DateTime('2013/6/13 13:30'), 'end' => new DateTime('2013/6/13 15:00')), array('title' => 'Now You See Me', 'image' => '../content/web/scheduler/now-you-see-me.jpg', 'imdb' => 'http://www.imdb.com/title/tt1670345/', 'start' => new DateTime('2013/6/13 12:30'), 'end' => new DateTime('2013/6/13 14:00')));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data($data);
$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->date(new DateTime('2013/6/13'))->height(600)->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 10:00'), 'endTime' => new DateTime('2013/6/13 23:00')), array('type' => 'agenda', 'startTime' => new DateTime('2013/6/13 10:00'), 'endTime' => new DateTime('2013/6/13 23:00')))->editable(false)->eventTemplateId('event-template')->dataSource($dataSource);
echo $scheduler->render();
?>

<script id="event-template" type="text/x-kendo-template">
    <div class='movie-template'>
        <img src="#= image #">
        <p>
            #: kendo.toString(start, "hh:mm") # - #: kendo.toString(end, "hh:mm") #
        </p>
        <h3>#: title #</h3>
        <a href="#= imdb #">Movie in IMDB</a>
    </div>
</script>

<style scoped>
    .movie-template img {
        float: left;
        margin: 0 8px;
    }
    .movie-template p {
        margin: 5px 0 0;
    }
Example #18
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->field('value')->colorField('userColor');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->max(28)->majorGridLines(array('visible' => false))->visible(false);
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('day')->majorGridLines(array('visible' => false))->line(array('visible' => false));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= category # - #= value #%');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_blog_comments());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('align' => 'left', 'text' => 'Comments per day'))->dataSource($dataSource)->legend(array('visible' => false))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'column', 'labels' => array('visible' => true, 'background' => 'transparent')))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Example #19
0
<script id="toolbar" type="text/x-kendo-template">

<div class="toolbar">
    <label class="category-label" for="category">Show products by category:</label>

    <?php 
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('toolbar-template.php?type=categories')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
                return kendo.stringify(data);
              }');
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema);
$dropDownList = new \Kendo\UI\DropDownList('category');
$dropDownList->dataSource($dataSource)->dataTextField('CategoryName')->dataValueField('CategoryID')->autoBind(false)->change('categoryChange')->optionLabel('All');
echo $dropDownList->renderInTemplate();
?>

</div>

</script>

<script>
    function categoryChange() {
        var value = this.value(),
            grid = $("#grid").data("kendoGrid");
Example #20
0
$startTimezoneField = new \Kendo\Data\DataSourceSchemaModelField('startTimezone');
$startTimezoneField->from('StartTimezone');
$endField = new \Kendo\Data\DataSourceSchemaModelField('end');
$endField->type('date')->from('End');
$endTimezoneField = new \Kendo\Data\DataSourceSchemaModelField('endTimezone');
$endTimezoneField->from('EndTimezone');
$isAllDayField = new \Kendo\Data\DataSourceSchemaModelField('isAllDay');
$isAllDayField->type('boolean')->from('IsAllDay');
$descriptionField = new \Kendo\Data\DataSourceSchemaModelField('description');
$descriptionField->type('string')->from('Description');
$recurrenceIdField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceId');
$recurrenceIdField->from('RecurrenceID');
$recurrenceRuleField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceRule');
$recurrenceRuleField->from('RecurrenceRule');
$recurrenceExceptionField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceException');
$recurrenceExceptionField->from('RecurrenceException');
$model->id('taskID')->addField($taskIDField)->addField($titleField)->addField($startField)->addField($endField)->addField($startTimezoneField)->addField($endTimezoneField)->addField($descriptionField)->addField($recurrenceIdField)->addField($recurrenceRuleField)->addField($recurrenceExceptionField)->addField($isAllDayField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->errors('errors')->model($model);
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->batch(true);
$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->timezone("Etc/UTC")->date(new DateTime('2013/6/13', new DateTimeZone('UTC')))->height(400)->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 7:00', new DateTimeZone('UTC'))), array('type' => 'week', 'selected' => true, 'startTime' => new DateTime('2013/6/13 7:00', new DateTimeZone('UTC'))), 'month', 'agenda')->dataSource($dataSource);
?>
<div class="k-rtl">
<?php 
echo $scheduler->render();
?>
</div>
<?php 
require_once '../include/footer.php';
Example #21
0
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('events.php')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$model->addField($productNameField)->addField($unitPriceField)->addField($unitsInStockField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->pageSize(5)->schema($schema)->serverSorting(true)->serverPaging(true);
$grid = new \Kendo\UI\Grid('grid');
$productName = new \Kendo\UI\GridColumn();
$productName->field('ProductName')->title('Product Name');
$unitPrice = new \Kendo\UI\GridColumn();
$unitPrice->field('UnitPrice')->format('{0:c}')->width(150)->title('Unit Price');
$unitsInStock = new \Kendo\UI\GridColumn();
$unitsInStock->field('UnitsInStock')->width(150)->title('Units In Stock');
$grid->addColumn($productName, $unitPrice, $unitsInStock)->selectable('cell multiple')->pageable(true)->sortable(true)->dataSource($dataSource)->change('onChange')->dataBound('onDataBound')->dataBinding('onDataBinding');
echo $grid->render();
?>

<script>
    function onChange(arg) {
        var selected = $.map(this.select(), function(item) {
Example #22
0
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('index.php')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
                return kendo.stringify(data); }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$productNameField = new \Kendo\Data\DataSourceSchemaModelField('ProductName');
$productNameField->type('string');
$unitPriceField = new \Kendo\Data\DataSourceSchemaModelField('UnitPrice');
$unitPriceField->type('number');
$unitsInStockField = new \Kendo\Data\DataSourceSchemaModelField('UnitsInStock');
$unitsInStockField->type('number');
$model->addField($productNameField)->addField($unitPriceField)->addField($unitsInStockField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->pageSize(15);
$listview = new \Kendo\UI\ListView('listView');
$listview->dataSource($dataSource)->templateId('template')->pageable(true);
echo $listview->render();
?>
</div>

<style scoped>
    .demo-section {
        padding: 30px;
        width: 577px;
    }
    #listView {
        padding: 10px;
	    margin-bottom: -1px;
Example #23
0
$isAllDayField = new \Kendo\Data\DataSourceSchemaModelField('isAllDay');
$isAllDayField->type('boolean')->from('IsAllDay');
$descriptionField = new \Kendo\Data\DataSourceSchemaModelField('description');
$descriptionField->type('string')->from('Description');
$recurrenceIdField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceId');
$recurrenceIdField->from('RecurrenceID');
$recurrenceRuleField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceRule');
$recurrenceRuleField->from('RecurrenceRule');
$recurrenceExceptionField = new \Kendo\Data\DataSourceSchemaModelField('recurrenceException');
$recurrenceExceptionField->from('RecurrenceException');
$ownerIdField = new \Kendo\Data\DataSourceSchemaModelField('ownerId');
$ownerIdField->from('OwnerID')->defaultValue(1);
$model->id('taskID')->addField($taskIDField)->addField($titleField)->addField($startField)->addField($endField)->addField($startTimezoneField)->addField($endTimezoneField)->addField($descriptionField)->addField($recurrenceIdField)->addField($recurrenceRuleField)->addField($recurrenceExceptionField)->addField($ownerIdField)->addField($isAllDayField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->errors('errors')->model($model);
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->batch(true);
$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->timezone("Etc/UTC")->date(new DateTime('2013/6/13'))->startTime(new DateTime('2013/6/13 6:00'))->height(600)->addView('day', array('type' => 'week', 'selected' => true))->dataSource($dataSource);
?>
<div class="configuration-horizontal">
    <div class="config-section">
        <label><input type="checkbox" checked />Snap events to slot boundaries</label>
    </div>
</div>

<?php 
echo $scheduler->render();
?>

<script>
Example #24
0
<?php

require_once '../include/header.php';
require_once '../lib/Kendo/Autoload.php';
?>

<div id="tshirt-view" class="k-header">
    <h2>Customize your Kendo T-shirt</h2>
    <img id="tshirt" src="../content/web/combobox/tShirt.png" />
    <div id="options">
        <h3>T-shirt Fabric</h3>
<?php 
$fabrics = new \Kendo\Data\DataSource();
$fabrics->data(array(array('text' => 'Cotton', 'value' => 1), array('text' => 'Polyester', 'value' => 2), array('text' => 'Cotton/Polyester', 'value' => 3), array('text' => 'Rib Knit', 'value' => 4)));
$input = new \Kendo\UI\ComboBox('fabric');
$input->dataSource($fabrics)->dataTextField('text')->dataValueField('value')->filter('contains')->placeholder('Select fabric ...')->suggest(true)->index(3);
echo $input->render();
?>
        <h3>T-shirt Size</h3>
<?php 
$select = new \Kendo\UI\ComboBox('size');
$select->dataSource(array('X-Small', 'Small', 'Medium', 'Large', 'X-Large', '2X-Large'))->placeholder('Select size ...')->index(0);
echo $select->render();
?>
        <button class="k-button" id="get">Customize</button>
    </div>
</div>
<style scoped>
#example h2 {
    font-weight: normal;
}
Example #25
0
    header('Content-Type: application/json');
    $request = json_decode(file_get_contents('php://input'));
    $result = new DataSourceResult('sqlite:..//sample.db');
    echo json_encode($result->read('Products', array('ProductID', 'ProductName'), $request));
    exit;
}
require_once '../include/header.php';
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('remotedatasource.php')->contentType('application/json')->type('POST');
$transport->read($read)->parameterMap('function(data) {
              return kendo.stringify(data);
           }');
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema);
$dropDownList = new \Kendo\UI\DropDownList('products');
$dropDownList->dataSource($dataSource)->dataTextField('ProductName')->dataValueField('ProductID')->attr('style', 'width: 250px');
?>
<div class="demo-section">
    <h2>Products</h2>
<?php 
echo $dropDownList->render();
?>
</div>
<style scoped>
    .demo-section {
        width: 250px;
        margin: 35px auto 50px;
        padding: 30px;
Example #26
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
    $result = chart_stock_prices();
    echo json_encode($result);
    exit;
}
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->type('line')->field('close')->name('#= group.value # (close)');
$valueAxis = new \Kendo\Dataviz\UI\ChartValueAxisItem();
$valueAxis->labels(array('format' => '${0}', 'skip' => 2, 'step' => 2));
$categoryAxis = new \Kendo\Dataviz\UI\ChartCategoryAxisItem();
$categoryAxis->field('date')->labels(array('format' => 'MMM'));
$tooltip = new \Kendo\Dataviz\UI\ChartTooltip();
$tooltip->visible(true)->format('{0}%')->template('#= series.name # - #= value #%');
$model = new \Kendo\Data\DataSourceSchemaModel();
$model->addField(array('field' => 'date', 'type' => 'date'));
$schema = new \Kendo\Data\DataSourceSchema();
$schema->model($model);
$transport = new \Kendo\Data\DataSourceTransport();
$transport->read(array('url' => 'grouped-data.php', 'type' => 'POST', 'dataType' => 'json'));
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->schema($schema)->addGroupItem(array('field' => 'symbol'))->addSortItem(array('field' => 'date', 'dir' => 'asc'));
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Stock Prices'))->dataSource($dataSource)->legend(array('position' => 'bottom'))->addSeriesItem($series)->addValueAxisItem($valueAxis)->addCategoryAxisItem($categoryAxis)->seriesDefaults(array('type' => 'area'))->tooltip($tooltip);
echo $chart->render();
require_once '../include/footer.php';
Example #27
0
<?php

require_once '../lib/Kendo/Autoload.php';
require_once '../include/chart_data.php';
require_once '../include/header.php';
$series = new \Kendo\Dataviz\UI\ChartSeriesItem();
$series->xField('price')->yField('performance');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data(chart_price_performance());
$chart = new \Kendo\Dataviz\UI\Chart('chart');
$chart->title(array('text' => 'Price-Performance Ratio'))->dataSource($dataSource)->addSeriesItem($series)->tooltip(array('visible' => true, 'template' => "#= '<b>\$' + value.x + ' / ' + dataItem.family + ' ' + dataItem.model + ': ' + value.y + '%</b>' #"))->addXAxisItem(array('max' => 1000, 'labels' => array('format' => '${0}'), 'title' => array('text' => 'Price')))->addYAxisItem(array('min' => 80, 'labels' => array('format' => '{0}%'), 'title' => array('text' => 'Performance Ratio')))->legend(array('visible' => false))->seriesDefaults(array('type' => 'scatter'));
echo $chart->render();
require_once '../include/footer.php';
Example #28
0
$transport->read($read)->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$orderIDField = new \Kendo\Data\DataSourceSchemaModelField('OrderID');
$orderIDField->type('number');
$shipNameField = new \Kendo\Data\DataSourceSchemaModelField('ShipName');
$shipNameField->type('string');
$shipAddressField = new \Kendo\Data\DataSourceSchemaModelField('ShipAddress');
$shipAddressField->type('string');
$shipCountryField = new \Kendo\Data\DataSourceSchemaModelField('ShipCountry');
$shipCountryField->type('string');
$model->addField($orderIDField)->addField($shipNameField)->addField($shipAddressField)->addField($shipCountryField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->pageSize(30)->schema($schema)->serverSorting(true)->serverFiltering(true)->serverPaging(true);
$grid = new \Kendo\UI\Grid('grid');
$orderID = new \Kendo\UI\GridColumn();
$orderID->field('OrderID')->width(130)->title('Order ID');
$shipCountry = new \Kendo\UI\GridColumn();
$shipCountry->field('ShipCountry')->width(160)->title('Ship Country');
$shipName = new \Kendo\UI\GridColumn();
$shipName->field('ShipName')->title('Ship Name')->width(220);
$shipAddress = new \Kendo\UI\GridColumn();
$shipAddress->field('ShipAddress')->filterable(false)->title('Ship Address');
$grid->dataSource($dataSource)->addColumn($orderID, $shipCountry, $shipName, $shipAddress)->height(430)->columnMenu(true)->pageable(true)->sortable(true)->filterable(true);
echo $grid->render();
?>

<?php 
Example #29
0
        <thead>
            <tr>
                <th class="month">MONTH</th>
                <th>MAX TEMP &deg;C</th>
                <th>WIND SPEED KM/H</th>
                <th>RAINFALL MM</th>
            </tr>
        </thead>
        <tbody>
<?php 
$months = array("January", "February", "March", "April", "May", "June");
for ($i = 0; $i < count($months); $i++) {
    $monthNumber = $i + 1;
    $transport = new \Kendo\Data\DataSourceTransport();
    $transport->read(array('url' => "_weather.php?station=SOFIA&year=2012&month={$monthNumber}", 'type' => 'POST', 'dataType' => 'json'));
    $dataSource = new \Kendo\Data\DataSource();
    $dataSource->transport($transport);
    ?>
        <tr>
            <td class="month"><?php 
    echo $months[$i];
    ?>
</td>
            <td>
<?php 
    $tmaxSeries = new \Kendo\Dataviz\UI\SparklineSeriesItem();
    $tmaxSeries->type('column')->field('TMax')->color('#ff0000')->negativeColor('#0099ff');
    $tmax = new \Kendo\Dataviz\UI\Sparkline("sparkline-tmax-{$i}");
    $tmax->dataSource($dataSource)->addSeriesItem($tmaxSeries);
    echo $tmax->render();
    ?>
Example #30
0
          }');
$model = new \Kendo\Data\DataSourceSchemaModel();
$shipNameField = new \Kendo\Data\DataSourceSchemaModelField('ShipName');
$shipNameField->type('string');
$shipCityField = new \Kendo\Data\DataSourceSchemaModelField('ShipCity');
$shipCityField->type('string');
$orderIDField = new \Kendo\Data\DataSourceSchemaModelField('OrderID');
$orderIDField->type('number');
$freightField = new \Kendo\Data\DataSourceSchemaModelField('Freight');
$freightField->type('number');
$orderDateField = new \Kendo\Data\DataSourceSchemaModelField('OrderDate');
$orderDateField->type('date');
$model->addField($shipNameField)->addField($freightField)->addField($orderIDField)->addField($shipCityField)->addField($orderDateField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')->model($model)->total('total');
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)->pageSize(10)->schema($schema)->serverFiltering(true)->serverSorting(true)->serverPaging(true);
$grid = new \Kendo\UI\Grid('grid');
$orderID = new \Kendo\UI\GridColumn();
$orderID->field('OrderID')->filterable(false)->title('Order ID');
$freight = new \Kendo\UI\GridColumn();
$freight->field('Freight')->title('Freight');
$orderDate = new \Kendo\UI\GridColumn();
$orderDate->field('OrderDate')->width(120)->format('{0:MM/dd/yyyy}')->title('OrderDate');
$shipName = new \Kendo\UI\GridColumn();
$shipName->field('ShipName')->width(260)->title('Ship Name');
$shipCity = new \Kendo\UI\GridColumn();
$shipCity->field('ShipCity')->width(150)->title('Ship City');
$grid->addColumn($orderID, $freight, $orderDate, $shipName, $shipCity)->dataSource($dataSource)->sortable(true)->filterable(true)->pageable(true);
echo $grid->render();
?>