<!-- job/run-job.phtml -->

<script type="text/javascript">
$(document).ready(function() {
	$('#ok1').click(function() {
    	$.blockUI({
        	message: '<h2><?php print $this->translate->_("Please wait"); ?>...</h2>',
        	css: { backgroundColor: '#f3fcf2' },
        	centerX: true,
        	centerY: true
        });
    });
});
</script>
<script type="text/javascript">
  //select
  $(function(){
      $('select').each(function() {
          var t = $(this).selectmenu({maxHeight: 300});
	          eval(t);
	  });
  });
</script>
<script type="text/javascript">
function whenNow(elm)
{
    // console.log('checkbox : ' + elm.checked); // for debug firebug
    if (elm.checked)
    {
        document.form1.date_when.disabled = true;
        document.form1.time_when.disabled = true;
    }
    else    {
        document.form1.date_when.disabled = false;
        document.form1.time_when.disabled = false;
    }
}
</script>

<script type="text/javascript" src="<?php echo $this->baseUrl , '/scripts/jquery-ui.datepicker-', $this->language, '.js';?>"></script>
<script type="text/javascript">
$(function() {
    $('#date_when').datepicker({
        dateFormat: 'yy-mm-dd',
        changeMonth: true,
        changeYear: true
    });
});
</script>

<div class="ui-state-hover ui-corner-all" style="width: 46em; text-align: left;">
<?php
    if ( $this->result_error )
    {
        switch ( $this->result_error )
        {
            case 'ERROR_BCONSOLE': // ошибка при запуске bconsole
                $msg = $this->translate->_('ERROR: There was a problem executing bconsole.');
                break;
            case 'NOFOUND_BCONSOLE': // bconsole не найден
                $msg = $this->translate->_('ERROR: bconsole not found.');
                break;
            default: $msg = '';
        }
        echo '<font color="red"><div align="center"><p>' . $msg . '</p></div></font>';
        echo '<font color="red">';
        if ( $this->command_output )
        {
            foreach ($this->command_output as $line) {
             echo $line . '<br>';
          }
        }
        echo '</font>';
    }
?>

<?php
    $this->form->setAction( $this->url());
    echo $this->form;
?>

</div>