<?php

/* DorcasTabithaBundle:Users:userformedit.html.twig */
class __TwigTemplate_a4721761348f006c36bdf65f73529a11 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=\"user_edit\">


    <form id=\"clientform\" action=\"";
        // line 8
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("DorcasTabithaBundle_user_update", array("id" => $this->getAttribute($this->getContext($context, "user"), "id"))), "html", null, true);
        echo "\" method=\"post\" ";
        echo $this->env->getExtension('form')->renderEnctype($this->getContext($context, "form"));
        echo " class=\"dorcas\">

        <h4>Edit User Profile</h4>
        <h6> Note: If a password is not entered, it will not be changed.</h6>


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

        <div style=\"width:11%; float:left;\">
                ";
        // line 17
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "username"));
        echo "
                ";
        // line 18
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "username"));
        echo "
                ";
        // line 19
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "username"), array("attr" => array("size" => "12")));
        echo "
        </div>
\t<div style=\"width:14%; float:left;\">
                ";
        // line 22
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "first"));
        echo "
                ";
        // line 23
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "first"));
        echo "
                ";
        // line 24
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "first"), array("attr" => array("size" => "16")));
        echo "
\t</div>
\t<div style=\"width:14%; float:left;\">
                ";
        // line 27
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "second"), "Confirm Password:");
        echo "
                ";
        // line 28
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "second"));
        echo "
                ";
        // line 29
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getAttribute($this->getContext($context, "form"), "password"), "second"), array("attr" => array("size" => "16")));
        echo "
\t</div>
\t
\t<div style=\"width:23%; float:left;\">
            ";
        // line 33
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "first_name"));
        echo "
            ";
        // line 34
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "first_name"));
        echo "
            ";
        // line 35
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "first_name"), array("attr" => array("size" => "30")));
        echo "
        </div>
        <div style=\"width:22%; float:left; \">
            ";
        // line 38
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "last_name"));
        echo "
            ";
        // line 39
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "last_name"));
        echo "
            ";
        // line 40
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "last_name"), array("attr" => array("size" => "30")));
        echo "
        </div>
\t
\t<br>
\t<div style=\"width:37%; float:left;\">
                ";
        // line 45
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "address"));
        echo "
                ";
        // line 46
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "address"));
        echo "
                ";
        // line 47
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "address"), array("attr" => array("size" => "50")));
        echo " 
        </div>
            <div style=\"width:14%; float:left; padding-left:6px;\">
                    ";
        // line 50
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "phone"));
        echo "
                    ";
        // line 51
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "phone"));
        echo "
                    ";
        // line 52
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "phone"), array("attr" => array("size" => "14", "class" => "phonex")));
        echo "
        </div>
        <div style=\"width:20%; float:left;\">
                    ";
        // line 55
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "email"));
        echo "
                    ";
        // line 56
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "email"));
        echo "
                    ";
        // line 57
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "email"), array("attr" => array("size" => "25")));
        echo "
        </div>
        <br>
        <div style=\"width:5%; float:left;\">
                    ";
        // line 61
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "isAdmin"));
        echo "
                    ";
        // line 62
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "isAdmin"));
        echo "
                    ";
        // line 63
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "isAdmin"), array("attr" => array("size" => "2")));
        echo "
        </div>
        <div style=\"width:1%; float:left; padding-right: 18px;\">
                    ";
        // line 66
        echo $this->env->getExtension('form')->renderLabel($this->getAttribute($this->getContext($context, "form"), "isActive"));
        echo "
                    ";
        // line 67
        echo $this->env->getExtension('form')->renderErrors($this->getAttribute($this->getContext($context, "form"), "isActive"));
        echo "
                    ";
        // line 68
        echo $this->env->getExtension('form')->renderWidget($this->getAttribute($this->getContext($context, "form"), "isActive"), array("attr" => array("size" => "2")));
        echo "
        </div>

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

        ";
        // line 78
        echo $this->env->getExtension('form')->renderRest($this->getContext($context, "form"));
        echo "

    </form>
</div>

";
    }

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

    // line 87
    public function block_javascripts($context, array $blocks = array())
    {
        // line 88
        echo "
";
        // line 89
        $this->displayParentBlock("javascripts", $context, $blocks);
        echo "

<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});
};


function closeandreload(){ 

    // Do Validation
    var username = document.getElementById('userform_username');
    var firstname = document.getElementById('userform_first_name');
    var lastname = document.getElementById('userform_last_name');
    var passwordfirst = document.getElementById('userform_password_first');
    var passwordsecond = document.getElementById('userform_password_second');
    var phone = document.getElementById('userform_phone');
    var email = document.getElementById('userform_email');

    var message = '';

    if ( username.value.length < 5 )
    {
        var valid = false;
        var message = '&#8227 Username must have at least 5 characters.<br/>';
    }

    if ( passwordfirst.value != '' && passwordfirst.value.length < 8 )
    {
        var valid = false;
        var message = message + '&#8227 Password must have at least 8 characters.<br/>';
    }

    else if ( passwordsecond.value != '' && passwordsecond.value.length < 8 )
    {
        var valid = false;
        var message = message + '&#8227 Confirm Password must have at least 8 characters.<br/>';
    }

    if ( passwordfirst.value != passwordsecond.value )
    {
        var valid = false;
        var message = message + '&#8227 Passwords do not match.<br/>';
    }

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

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

    // Check Phone for < 14 characters
    if ( phone.value && phone.value.length < 14 )
    {
        var valid = false;
        var message = message + '&#8227 Please complete Phone number.<br/>';
    }

    // Check Email for valid (kinda) address
    if ( email.value )
    {
        var atpos = email.value.indexOf(\"@\");
        var dotpos = email.value.lastIndexOf(\".\");
        if ( atpos <1 || dotpos < atpos+2 || dotpos+2 >= email.value.length)
        //if ( email.value && email.value.indexOf(\"@\") == -1 ))
        {
            var valid = false;
            var message = message + '&#8227 Please enter a valid Email address.<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(); 
}

</script>
   
";
    }

    public function getTemplateName()
    {
        return "DorcasTabithaBundle:Users:userformedit.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  229 => 89,  226 => 88,  223 => 87,  218 => 85,  208 => 78,  195 => 68,  191 => 67,  187 => 66,  181 => 63,  177 => 62,  173 => 61,  166 => 57,  162 => 56,  158 => 55,  152 => 52,  148 => 51,  144 => 50,  138 => 47,  134 => 46,  130 => 45,  122 => 40,  118 => 39,  114 => 38,  108 => 35,  104 => 34,  100 => 33,  93 => 29,  89 => 28,  85 => 27,  79 => 24,  75 => 23,  71 => 22,  65 => 19,  61 => 18,  57 => 17,  43 => 8,  37 => 4,  34 => 3,  29 => 2,);
    }
}
