<?php
/**
 * Copyright 2014 Bogdan Ghervan
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
?>
<?php
/* @var $form \forms\AddJob\AdvancedForm */
$form->prepare();
?>
<form class="job-add-form job-add-advanced-form" role="form" method="post">
    <div class="form-alerts"></div>
    <input type="hidden" name="mode" value="advanced">
    <input type="hidden" name="returnHtml" value="1">
    <?php if (isset($hash)): ?>
        <input type="hidden" name="hash" value="<?php echo $hash ?>">
    <?php endif; ?>
    <div class="row">
        <div class="col-md-2">
            <span class="legend"><?php echo $form->get('name')->getLabel() ?></span>
        </div>
        <div class="col-md-10" data-has-error="<?php echo $form->get('name')->getName() ?>">
            <?php echo $this->formText($form->get('name')) ?>
            <?php echo $this->partial('partials/job-form-element-error.phtml', array(
                'element' => $form->get('name')
            )) ?>
        </div>
    </div>
    <div class="row">
        <div class="col-md-2">
            <span class="legend"><?php echo $form->get('expression')->getLabel() ?></span>
        </div>
        <div class="col-md-10" data-has-error="<?php echo $form->get('expression')->getName() ?>">
            <?php echo $this->formText($form->get('expression')) ?>
            <?php echo $this->partial('partials/job-form-element-error.phtml', array(
                'element' => $form->get('expression')
            )) ?>
        </div>
        <div class="col-md-2"></div>
        <div class="col-md-10">
            <p class="help-block">
                You may peep at this
                <a href="https://linuxmoz.com/crontab-syntax-tutorial/" target="_blank"
                   title="Crontab Syntax Tutorial With Examples - LinuxMoz">
                    tutorial on crons</a> or read
                <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5" target="_blank"
                   title="UNIX man pages : crontab (5)">
                    the crontab man page</a> for a full walkthrough on time expressions.
            </p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-2">
            <span class="legend"><?php echo $form->get('command')->getLabel() ?></span>
        </div>
        <div class="col-md-10" data-has-error="<?php echo $form->get('command')->getName() ?>">
            <?php echo $this->formTextarea($form->get('command')) ?>
            <?php echo $this->partial('partials/job-form-element-error.phtml', array(
                'element' => $form->get('command')
            )) ?>
        </div>
    </div>
</form>
