<?php

use RedDevil\ViewHelpers\ActionLink;
use RedDevil\ViewHelpers\CSFRToken;
use RedDevil\ViewHelpers\Form;
use RedDevil\ViewHelpers\SubmitButton;
use RedDevil\ViewHelpers\TextField;
?>
<div class="col-md-9">
    <h2>Add hall</h2>

    <?php 
$form = new Form('add-hall-form', '/venues/createhall');
$form->setAttribute('method', 'post');
$form->setAttribute('action', '/venues/createhall');
$form->addTextField(TextField::create()->setAttribute('id', 'id')->setAttribute('name', 'venueId')->setAttribute('value', $model)->setAttribute('hidden', 'hidden'));
$form->addTextField(TextField::create()->setAttribute('class', 'form-control')->setAttribute('id', 'title')->addLabel('Name', true)->setAttribute('name', 'title'));
$form->addTextField(TextField::create()->setAttribute('class', 'form-control')->setAttribute('id', 'capacity')->addLabel('Capacity', true)->setAttribute('name', 'capacity'));
$form->addSubmitButton(SubmitButton::create()->setAttribute('class', 'btn btn-default')->setNewLineAfter(false)->setAttribute('value', 'Create'));
$form->addActionLink(ActionLink::create()->setNewLineBefore(false)->setAttribute('id', 'cancel')->setAttribute('href', '/venues/own')->setData('Cancel')->setAttribute('class', 'btn btn btn-primary'));
$form->addCSRFToken(CSFRToken::create()->setAttribute('name', 'ValidationToken'));
$form->render();
?>
</div>
/** @var \RedDevil\ViewModels\VenueRequestViewModel[] $model */
use RedDevil\ViewHelpers\CSFRToken;
use RedDevil\ViewHelpers\Form;
use RedDevil\ViewHelpers\SubmitButton;
use RedDevil\ViewHelpers\TextField;
?>

<div class="col-md-4">
    <h2>Send Venue Request</h2>
    <?php 
?>
    <div class="panel panel-default">
        <div class="panel-heading"><strong>Choose venue</strong></div>
        <ul class="list-group">
            <?php 
foreach ($model as $venue) {
    $form = new Form('add-venue-request-form', '/conferences/addvenuerequest');
    $form->setAttribute('method', 'post');
    $form->setNewLineAfter(false);
    $form->setAttribute('action', '/conferences/addvenuerequest');
    $form->addTextField(TextField::create()->setAttribute('id', 'conferenceId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('name', 'conferenceId')->setAttribute('value', $venue->getConferenceId()));
    $form->addTextField(TextField::create()->setAttribute('id', 'venueId')->setAttribute('name', 'venueId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $venue->getVenueId()));
    $form->addSubmitButton(SubmitButton::create()->setAttribute('class', 'btn btn-link')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $venue->getVenueTitle()));
    $form->addCSRFToken(CSFRToken::create()->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('name', 'ValidationToken'));
    $form->render();
}
?>
        </ul>
    </div>
</div>
    ?>
        <div class="panel panel-default">
            <div class="panel-body">
                <?php 
    echo '<strong>Hall: </strong>' . $hall->getHallTitle();
    echo "<br/>";
    echo '<strong>With capacity: </strong>' . $hall->getCapacity();
    ?>

                <?php 
    $form = new Form('select-hall-form', '/lectures/addhall');
    $form->setAttribute('method', 'post');
    $form->setAttribute('class', 'pull-right');
    $form->setNewLineAfter(false);
    $form->setNewLineBefore(false);
    $form->setAttribute('action', '/lectures/addhall');
    $form->addTextField(TextField::create()->setAttribute('id', 'hallId')->setAttribute('name', 'hallId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $hall->getHallId()));
    $form->addTextField(TextField::create()->setAttribute('id', 'lectureId')->setAttribute('name', 'lectureId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $hall->getLectureId()));
    $form->addTextField(TextField::create()->setAttribute('id', 'conferenceId')->setAttribute('name', 'conferenceId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $hall->getConferenceId()));
    $form->addSubmitButton(SubmitButton::create()->setAttribute('class', 'btn btn-success')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', 'Select'));
    $form->addCSRFToken(CSFRToken::create()->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('name', 'ValidationToken'));
    $form->render();
    ?>
            </div>
        </div>
    <?php 
}
?>
    </div>

Пример #4
0
/** @var \RedDevil\ViewModels\SpeakerInvitationViewModel[] $model */
use RedDevil\ViewHelpers\CSFRToken;
use RedDevil\ViewHelpers\Form;
use RedDevil\ViewHelpers\SubmitButton;
use RedDevil\ViewHelpers\TextField;
?>

<div class="col-md-4">
    <h2>Send Speaker Invitation</h2>
    <?php 
?>
    <div class="panel panel-default">
        <div class="panel-heading"><strong>Choose speaker</strong></div>
        <ul class="list-group">
            <?php 
foreach ($model as $invitation) {
    $form = new Form('add-venue-request-form', '/lectures/sendinvitation');
    $form->setAttribute('method', 'post');
    $form->setNewLineAfter(false);
    $form->setAttribute('action', '/lectures/sendinvitation');
    $form->addTextField(TextField::create()->setAttribute('id', 'speakerId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('name', 'speakerId')->setAttribute('value', $invitation->getSpeakerId()));
    $form->addTextField(TextField::create()->setAttribute('id', 'lectureId')->setAttribute('name', 'lectureId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $invitation->getLectureId()));
    $form->addTextField(TextField::create()->setAttribute('id', 'conferenceId')->setAttribute('name', 'conferenceId')->setAttribute('hidden', 'hidden')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $invitation->getConferenceId()));
    $form->addSubmitButton(SubmitButton::create()->setAttribute('class', 'btn btn-link')->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('value', $invitation->getSpeakerUserName()));
    $form->addCSRFToken(CSFRToken::create()->setNewLineAfter(false)->setNewLineBefore(false)->setAttribute('name', 'ValidationToken'));
    $form->render();
}
?>
        </ul>
    </div>
</div>
</th>
            </tr>
        <?php 
}
?>
        </thead>
        <tbody>
        <td>
            <?php 
foreach ($model as $scenario) {
    ?>
            <?php 
    $form = new Form('batch-book-form', '/conferences/batchBook');
    $form->setAttribute('method', 'POST');
    $form->setAttribute('action', '/conferences/batchBook');
    $form->addSubmitButton(SubmitButton::create()->setAttribute('value', 'Book All')->setAttribute('class', 'btn btn-info btn-sm'));
    foreach ($scenario as $lecture) {
        $form->addTextField(TextField::create()->setAttribute('hidden', 'hidden')->setAttribute('value', $lecture->getId())->setAttribute('name', 'lectureIds[]'));
        echo "<strong>" . $lecture->getTitle() . "</strong>";
        echo "<br/>";
        echo $lecture->getStartDate();
        echo "<br/>";
        echo $lecture->getEndDate();
        echo "<br/>";
        echo "<br/>";
    }
    $form->addCSRFToken(CSFRToken::create()->setAttribute('name', 'ValidationToken'));
    $form->render();
    ?>

        </td>