{form_open}
    <div class="alert alert-success" style="display:none" id="msg_ok">{msg_ok}</div>
    <div class="preview-part">
        <div class="portrait"><img src="{photo_path}/{photo}" id="photo_img" /></div>
        <input type="hidden" name="photo" id="photo" value="{photo}">
        <input type="file" name="file_upload" id="file_upload" />
        <p>{ln_photo}</p>
    </div>
    <div class="info-part">
        <table>
            <tbody>
                <tr>
                    <td><h5>{ln_name}</h5></td>
                    <td></td>
                </tr>
                {name}
                <tr>
                    <td>{lang}:</td>
                    <td>
                        <input type="text" id="name_{id_lan}" name="name[{id_lan}]" value="{value}">
                    </td>
                </tr>
                {/name}
                <tr>
                    <td><h5>{ln_soname}</h5></td>
                    <td></td>
                </tr>
                {surname}
                <tr>
                    <td>{lang}:</td>
                    <td>
                        <input type="text" id="name_{id_lan}" name="surname[{id_lan}]" value="{value}">
                    </td>
                </tr>
                {/surname}
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><h5>{ln_email}</h5></td>
                    <td><input type="email" id="email" name="email" value="{email}" placeholder="email@email.com"/></td>
                </tr>
                <tr>
                    <td><h5>{Default language}</h5></td>
                    <td><?php echo form_dropdown('lan', $this->userinfo_model->get_lan_items(), $def_lan); ?></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td><h5>{ln_birth_date}</h5></td>
                    <td><input type="text" id="datepicker" class="date" name="birth_date" value="{birth_date}" placeholder="{ln_birth_date}"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr class="no-indent">
                    <td>
                        <h5 class="about">{ln_about}</h5>
                    </td>
                    <td></td>
                </tr>
                {about}
                <tr>
                    <td>{lang}:</td>
                    <td>
                        <textarea type="text" id="about_{id_lan}" name="about[{id_lan}]" rows="3">{value}</textarea>
                    </td>
                </tr>
                {/about}
                <tr>
                    <td colspan="2">
                        <button type="submit" class="btn btn-primary" id="btn_save">{btn_save}</button>
                        <button type="submit" class="btn" id="btn_cancel">{btn_cancel}</button>
                    </td>
                </tr>
            </tbody>
        </table>

    </div>
{form_close}
<script type="text/javascript">
    $(function() {
        $('div.wrapper').addClass('account');
        
        $( "#datepicker" ).datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'dd.mm.yy'
        });
        
        $('#file_upload').uploadify({
            'removeTimeout' : 0,
            'formData'      : {'photohash' : '{photohash}'},
            'buttonText' : '{button_text}',
            'multi'    : false,
            'swf'      : '/assets/plugins/uploadify3.2/uploadify.swf',
            'uploader' : '/ajax/userinfo/userinfo_admin/uploadify',
            'onUploadSuccess' : function(file, data, response) {
                var obj = jQuery.parseJSON(data);
                $('#photo').val(obj.file_name);
                $('#photo_img').attr('src', '{photo_path}/' + obj.file_name);
                $('#btn_save').click();
            } 
        }); 
    });
</script>