fork download
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\helpers\Url;
  5. use yii\grid\GridView;
  6. use yii\bootstrap\Modal;
  7. use yii\web\JsExpression;
  8.  
  9. /* @var $this yii\web\View */
  10. /* @var $searchModel backend\models\EventSearch */
  11. /* @var $dataProvider yii\data\ActiveDataProvider */
  12.  
  13. $this->title = 'Events';
  14.  
  15. ?>
  16.  
  17. <?php
  18.  
  19. $JSEventClick = <<<EOF
  20. function(calEvent) {
  21.   //alert('Event: ' + calEvent.start.format());
  22. $("#eventInfo").html(calEvent.description);
  23. $("#eventLink").attr('href', 'view?id='+calEvent.id);
  24. $("#modalButton").attr('value', calEvent.id);
  25. $("#modalContentEvent").dialog({ modal: true, title: calEvent.title, width:350 });
  26. $("#startTime").html(calEvent.start.format());
  27. $("#modalButtonDelete").attr("href", function() { return $(this).attr("href")+calEvent.id });
  28. }
  29. EOF;
  30.  
  31. ?>
  32.  
  33. <div class="event-index">
  34.  
  35. <?php
  36. Modal::begin([
  37. 'header' => 'Event',
  38. 'id' => 'modal',
  39. 'size' => 'modal-lg',
  40. ]);
  41.  
  42. echo "<div id='modalContent'>";
  43. echo "</div>";
  44. Modal::end();
  45. ?>
  46.  
  47. <?php
  48. Modal::begin([
  49. 'header' => 'Update event',
  50. 'id' => 'modalUpdate',
  51. 'size' => 'modal-lg',
  52. ]);
  53.  
  54. echo "<div id='modalContentUpdate'>";
  55. echo "</div>";
  56. Modal::end();
  57. ?>
  58.  
  59. <?php
  60. Modal::begin([
  61. 'header' => 'Event',
  62. 'id' => 'modal',
  63. 'size' => 'modal-lg',
  64. ]);
  65.  
  66. echo "<div id='modalContentEvent'>";
  67. echo "Start: <span id='startTime'></span><br>";
  68. echo "<p id='eventInfo'></p>";
  69. echo "<p><strong><a id='eventLink' href='javascript:void(0);' target='_blank'>Read more</a></strong></p>";
  70. echo "<div class='row'>";
  71. echo "<div class='col-md-3'>";
  72. echo Html::button('Update', ['value' => '','class' => 'btn btn-primary', 'id'=>'modalButton']);
  73. echo "</div>";
  74. echo "<div class='col-md-3'>";
  75. echo Html::a('Delete', Url::to(['delete', 'id' => '']), [
  76. 'class' => 'btn btn-danger',
  77. 'id' => 'modalButtonDelete',
  78. 'data' => [
  79. 'confirm' => 'Are you sure you want to delete this item?',
  80. 'method' => 'post',
  81. ],
  82. ]);
  83. echo "</div>";
  84. echo "</div>";
  85. echo "</div>";
  86. Modal::end();
  87. ?>
  88.  
  89. <?= \yii2fullcalendar\yii2fullcalendar::widget(array(
  90. 'events' => $events,
  91. 'clientOptions' => [
  92. 'droppable' => false,
  93. 'editable' => false,
  94. 'lang' => 'pl',
  95. 'eventClick' => new JsExpression($JSEventClick)
  96. ],
  97. ));
  98. ?>
  99. <div style='clear:both'></div>
  100. </div>
Runtime error #stdin #stdout #stderr 0.01s 52488KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Using $this when not in object context in /home/baYcoD/prog.php on line 13