<?php

/* DorcasTabithaBundle:Assistance:assistanceformedit.html.twig */
class __TwigTemplate_fe2f00a9164ea5fe240ac3bbd6479be5 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("::base.html.twig");

        $this->blocks = array(
            'image' => array($this, 'block_image'),
            'body' => array($this, 'block_body'),
            'logout' => array($this, 'block_logout'),
            'javascripts' => array($this, 'block_javascripts'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "::base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 2
    public function block_image($context, array $blocks = array())
    {
    }

    // line 3
    public function block_body($context, array $blocks = array())
    {
        // line 4
        echo "
<div id=\"assistance_edit\">

<div id=\"override_javascript_alert\"></div>

<form id=\"clientform\" action=\"";
        // line 9
        if (isset($context["assistance"])) { $_assistance_ = $context["assistance"]; } else { $_assistance_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("DorcasTabithaBundle_assistance_update", array("assistance_id" => $this->getAttribute($_assistance_, "assistanceid"))), "html", null, true);
        echo "\" method=\"post\" ";
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderEnctype($_form_);
        echo " class=\"dorcas\">

    <h4>Edit a Check - Admin Only</h4>

 

    <div style=\"width:30%; float:left;\">
                Purpose*
                ";
        // line 17
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "checkpurpose"), array("attr" => array("style" => "width: 160px;")));
        echo "
    </div>
    <div style=\"width:20%; float:left;\">
                ";
        // line 20
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "checks_issued_date"));
        echo "
                ";
        // line 21
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "checks_issued_date"));
        echo "
                ";
        // line 22
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "checks_issued_date"), array("attr" => array("size" => "11", "class" => "datepicker")));
        echo "
    </div>
    <div style=\"width:40%; float:left;\">
                ";
        // line 25
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "checks_issued_payee"));
        echo "
                ";
        // line 26
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "checks_issued_payee"));
        echo "
                ";
        // line 27
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "checks_issued_payee"), array("attr" => array("size" => "30")));
        echo "
    </div>
<br>&nbsp;<br>

    <div style=\"width:23%; float:left;\">
                ";
        // line 32
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "check_dorcas"));
        echo "
                ";
        // line 33
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "check_dorcas"));
        echo "
                ";
        // line 34
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "check_dorcas"), array("attr" => array("size" => "10", "onchange" => "isNumber(this)")));
        echo " 
    </div>
    <div style=\"width:23%; float:left;\">
                ";
        // line 37
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "check_oasis"));
        echo "
                ";
        // line 38
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "check_oasis"));
        echo "
                ";
        // line 39
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "check_oasis"), array("attr" => array("size" => "10", "onchange" => "isNumber(this)")));
        echo "
    </div>
    <div style=\"width:23%; float:left;\">
                ";
        // line 42
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "check_sfumc"));
        echo "
                ";
        // line 43
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "check_sfumc"));
        echo "
                ";
        // line 44
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "check_sfumc"), array("attr" => array("size" => "10", "onchange" => "isNumber(this)")));
        echo "
    </div>
    <div style=\"width:23%; float:left;\">
                ";
        // line 47
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($_form_, "check_other"));
        echo "
                ";
        // line 48
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($_form_, "check_other"));
        echo "
                ";
        // line 49
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($_form_, "check_other"), array("attr" => array("size" => "10", "onchange" => "isNumber(this)")));
        echo "
    </div>

<br>&nbsp;<br>
        <div style=\" padding-top: 18px;\">
    <input type=\"button\" value=\"Save and Close Window\" onclick=\"closeandreload()\" >
    </div>      

                ";
        // line 57
        if (isset($context["form"])) { $_form_ = $context["form"]; } else { $_form_ = null; }
        echo $this->env->getExtension('form')->renderRest($_form_);
        echo "

            ";
        // line 59
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "session"), "hasFlash", array(0 => "notice"), "method")) {
            // line 60
            echo "                <div class=\"flash-notice\" >
                    ";
            // line 61
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_app_, "session"), "flash", array(0 => "notice"), "method"), "html", null, true);
            echo "
                </div>
            ";
        }
        // line 64
        echo "
    <br />
</form>
</div>

";
    }

    // line 71
    public function block_logout($context, array $blocks = array())
    {
    }

    // line 74
    public function block_javascripts($context, array $blocks = array())
    {
        // line 75
        echo "
";
        // line 76
        $this->displayParentBlock("javascripts", $context, $blocks);
        echo "
               
<script type=\"text/javascript\">          

\$(function() {
    \$( \".datepicker\" ).datepicker({ showAnim: \"slideDown\" });
});

</script>

<script type=\"text/javascript\">

window.alert = function(message) {
\t\$('#override_javascript_alert').html(message).dialog({
\t\tmodal:true,
\t\ttitle:'Tabitha Validation Message',
\t\tbuttons: {
\t\t\t'OK':function(){
\t\t\t\t\$(this).dialog('close');
\t\t\t}
\t\t}
\t});
};


/**--------------------------
//* Validate Date Field script- By JavaScriptKit.com
//* For this script and 100s more, visit http://www.javascriptkit.com
//* This notice must stay intact for usage
---------------------------**/

function checkdate(input){
    var validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}\$/ //Basic check for format validity
    var returnval=false
    if (!validformat.test(input))
    {
//        alert(\"Invalid Date Format. Please correct and submit again.\")
    }
    else{ //Detailed check for valid date ranges
        var monthfield=input.split(\"/\")[0]
        var dayfield=input.split(\"/\")[1]
        var yearfield=input.split(\"/\")[2]
        var dayobj = new Date(yearfield, monthfield-1, dayfield)
        if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))
        {
//            alert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\")
        }
        else
            returnval=true
    }
//    if (returnval==false) input.select()
    return returnval
}


function closeandreload(){ 

    // Do Validation
    var payee = document.getElementById('assistanceform_checks_issued_payee');
    var dorcas = document.getElementById('assistanceform_check_dorcas');
    var oasis = document.getElementById('assistanceform_check_oasis');
    var sfumc = document.getElementById('assistanceform_check_sfumc');
    var other = document.getElementById('assistanceform_check_other');
    var cidate = document.getElementById('assistanceform_checks_issued_date');
    var purpose = document.getElementById('assistanceform_checkpurpose');
    var message = '';

    if ( payee.value == '' )
    {
        var valid = false;
        var message = message + '&#8227 Please enter a Payee.<br/>';
    }

    if ( dorcas.value == '' && oasis.value == '' && sfumc.value == '' && other.value == '' )
    {
        var valid = false;
        var message = message + '&#8227 Please enter a dollar value in one of the fields.<br/>';
    }

    if ( cidate.value == '' )
    {
        var valid = false;
        var message = message + '&#8227 Please enter a Date.<br/>';
    }

    // Check Checks Issued Date for valid date
    if ( cidate.value && !checkdate(cidate.value))
    {
        var valid = false;
        var message = message + '&#8227 Please enter a valid Date. <br/>';
    }

    if ( purpose.value == '1' )
    {
        var valid = false;
        var message = message + '&#8227 Please select a Purpose.<br/>';
    }

    if ( valid == false )
    {
        alert( message );
        return(false);
    }
    
    var form = document.forms[\"clientform\"];
    form.submit();
    opener.location.reload(true); // or opener.location.href = opener.location.href;
    window.close(); // or self.close(); 
}


function isNumber(field)
{
     if( isNaN(field.value)){
        alert(\"&#8227 Please enter a dollar amount with no dollar sign.\");
        field.value = 0;
        field.focus();
         }
}


</script>

    
";
    }

    public function getTemplateName()
    {
        return "DorcasTabithaBundle:Assistance:assistanceformedit.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  203 => 71,  187 => 61,  141 => 43,  129 => 39,  119 => 37,  59 => 17,  370 => 141,  355 => 130,  350 => 129,  345 => 128,  338 => 125,  333 => 124,  328 => 123,  321 => 120,  316 => 119,  311 => 118,  304 => 115,  299 => 114,  294 => 113,  287 => 110,  274 => 101,  269 => 100,  264 => 99,  257 => 96,  247 => 94,  240 => 91,  223 => 86,  218 => 85,  213 => 84,  205 => 80,  195 => 78,  188 => 75,  183 => 74,  171 => 70,  149 => 56,  137 => 52,  72 => 26,  40 => 12,  21 => 3,  252 => 95,  248 => 74,  244 => 73,  236 => 71,  230 => 89,  225 => 63,  222 => 62,  212 => 50,  204 => 50,  200 => 79,  197 => 47,  177 => 40,  160 => 35,  157 => 34,  126 => 18,  106 => 13,  98 => 6,  184 => 60,  181 => 59,  173 => 38,  163 => 49,  155 => 63,  139 => 22,  135 => 58,  133 => 57,  114 => 15,  110 => 49,  105 => 47,  93 => 27,  76 => 22,  69 => 47,  209 => 78,  206 => 51,  201 => 76,  194 => 64,  191 => 70,  186 => 67,  180 => 41,  176 => 61,  166 => 66,  158 => 48,  153 => 47,  143 => 49,  134 => 20,  123 => 40,  118 => 16,  90 => 33,  87 => 27,  66 => 20,  60 => 39,  146 => 44,  136 => 42,  122 => 17,  107 => 33,  101 => 35,  95 => 29,  82 => 25,  73 => 20,  67 => 17,  52 => 30,  109 => 41,  104 => 34,  96 => 32,  84 => 62,  80 => 24,  26 => 4,  34 => 3,  112 => 34,  102 => 32,  89 => 16,  63 => 40,  56 => 12,  43 => 13,  92 => 28,  79 => 29,  57 => 21,  46 => 7,  37 => 4,  33 => 4,  29 => 2,  19 => 1,  44 => 9,  27 => 5,  55 => 19,  45 => 25,  36 => 8,  50 => 18,  47 => 15,  30 => 4,  25 => 3,  249 => 96,  239 => 72,  235 => 90,  228 => 84,  224 => 82,  219 => 80,  217 => 58,  214 => 76,  211 => 75,  208 => 74,  202 => 72,  199 => 71,  193 => 44,  182 => 63,  178 => 73,  175 => 57,  172 => 59,  165 => 55,  161 => 57,  156 => 51,  154 => 57,  150 => 31,  147 => 30,  132 => 51,  127 => 50,  117 => 51,  113 => 34,  86 => 32,  83 => 25,  78 => 15,  68 => 9,  64 => 22,  61 => 21,  48 => 10,  39 => 8,  32 => 5,  24 => 4,  22 => 4,  23 => 3,  20 => 2,  17 => 1,  144 => 55,  138 => 46,  130 => 19,  124 => 38,  121 => 41,  115 => 45,  111 => 36,  108 => 31,  99 => 43,  94 => 34,  91 => 71,  88 => 26,  85 => 26,  77 => 58,  74 => 20,  71 => 21,  65 => 45,  62 => 15,  58 => 34,  54 => 32,  51 => 10,  42 => 9,  38 => 8,  35 => 7,  31 => 4,  28 => 3,);
    }
}
