diff options
| author | ccwn <tzur@ccwn.org> | 2012-04-21 09:52:18 +0200 |
|---|---|---|
| committer | ccwn <tzur@ccwn.org> | 2012-04-21 09:52:18 +0200 |
| commit | ed8e4f88f2877c7bed09662291711b7165e7455f (patch) | |
| tree | 549426a7302fbf80f92af33dbd2bb63276867735 /protected/views/standort/index.php | |
| parent | a8874be6fb5803231ecb3af2bb7c924d7ae42587 (diff) | |
common views hinzugefügt
standort views hinzugefügt
Diffstat (limited to 'protected/views/standort/index.php')
| -rw-r--r-- | protected/views/standort/index.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/protected/views/standort/index.php b/protected/views/standort/index.php new file mode 100644 index 0000000..5449010 --- /dev/null +++ b/protected/views/standort/index.php @@ -0,0 +1,77 @@ +<?php +$this->breadcrumbs=array( + 'Standorte' +); + +$this->menu=array( + array('label'=>'Standort erstellen', 'url'=>array('create')), +); +?> + +<h1>Standorte</h1> + +<?php $this->renderPartial('/common/_comparison_text'); ?> + +<?php $this->renderPartial('/common/_advanced_search',array( + 'model'=>$model, +)); ?> + +<?php +$map = new Map(); +foreach ($standorte as $standort) { + $infoWindow = new EGMapInfoWindow("<div class='gmaps-label' style='color: #000; font-weight:bold'>".$standort->name."<br/>".CHtml::link("Bearbeiten", array("standort/update", "id"=>$standort->id), array("update"=>"#edit"))."</div>"); + $dragendfunction = "function (event) { + var save = confirm('Neue Koordinaten wirklich speichern?'); + if (save) { + $.ajax({ + 'type':'POST', + 'url':'".$this->createUrl('standort/savecoords', array('id'=>$standort->id))."', + 'data':({'lat': event.latLng.lat(), 'lng': event.latLng.lng()}), + 'cache':false, + 'statusCode': { + 404: function() { + alert('Der Standort existiert nicht.'); + }, + 500: function() { + alert('Fehler beim Speichern.'); + }, + 400: function() { + alert('Fehlende Parameter'); + }, + 200: function() { + alert('Neue Koordinaten erfolgreich gespeichert'); + } + } + }); + } + console.info(event) + } + "; + // Saving coordinates after user dragged our marker. + $dragevent = new EGMapEvent('dragend', $dragendfunction, false, EGMapEvent::TYPE_EVENT_DEFAULT); + $marker = new EGMapMarker($standort->pos_lat, $standort->pos_long, array('title' => $model->name, 'draggable'=>true), 'marker', array('dragevent'=>$dragevent)); + $marker->addHtmlInfoWindow($infoWindow); + $map->addMarker($marker, $standort->published); +} +$map->render(); +?> + +<?php $this->widget('zii.widgets.grid.CGridView', array( + 'id'=>'standort-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + 'name', + 'pos_lat', + 'pos_long', + array('header'=>'Öffentlich', + 'value'=>'CHtml::image($data->published ? "images/ok.png" : "images/nok.png", $data->published ? "ok.png" : "nok.png")', 'type'=>'raw'), + array( + 'class'=>'CButtonColumn', + 'template'=>'{update} {delete}' + ), + ), +)); ?> + + |
