<div class="col-md-3"></div>
<form class="form-horizontal user-setting-panel pt_forms col-md-6 pt_shadow" id="profile-settings" method="POST">
    <div class="setting-profile-alert"></div>
	<!-- Text input-->
	<div class="form-group">
		<label class="col-md-12" for="first_name">{{LANG first_name}}</label>
		<div class="col-md-12">
			<input id="first_name" name="first_name" type="text" placeholder="" class="form-control input-md" value="{{USER first_name}}">
		</div>
	</div>
	<!-- Text input-->
	<div class="form-group">
		<label class="col-md-12" for="last_name">{{LANG last_name}}</label>
		<div class="col-md-12">
			<input id="last_name" name="last_name" type="text" placeholder="" class="form-control input-md" value="{{USER last_name}}">
		</div>
	</div>
	<!-- Textarea-->
	<div class="form-group">
		<label class="col-md-12" for="about">{{LANG about_profile}}</label>
		<div class="col-md-12">
			<textarea name="about" id="about" cols="20" class="form-control" rows="5">{{USER about_decoded}}</textarea>
		</div>
	</div>
	<hr>
	<!-- Text input-->
	<div class="form-group">
		<label class="col-md-12" for="facebook">{{LANG facebook}}</label>
		<div class="col-md-12">
			<input id="facebook" name="facebook" type="text" placeholder="Username" class="form-control input-md" value="{{USER facebook}}">
		</div>
	</div>
	<!-- Text input-->
	<div class="form-group">
		<label class="col-md-12" for="google">{{LANG google_plus}}</label>
		<div class="col-md-12">
			<input id="google" name="google" type="text" placeholder="Username" class="form-control input-md" value="{{USER google}}">
		</div>
	</div>
	<!-- Text input-->
	<div class="form-group">
		<label class="col-md-12" for="twitter">{{LANG twitter}}</label>
		<div class="col-md-12">
			<input id="twitter" name="twitter" type="text" placeholder="Username" class="form-control input-md" value="{{USER twitter}}">
		</div>
	</div>
	<hr>
	{{CUSTOM_FIELDS}}
	<input type="hidden" name="hash_id" value="<?php echo PT_CreateSession()?>">
	<input type="hidden" name="user_id" value="{{USER id}}">
	<input type="hidden" name="cf" value="{{CUSTOM_DATA}}">
	<!-- Button (Double) -->
	<div class="last-sett-btn modal-footer" style="margin: 0px -30px -10px -30px;">
		<button id="submit" name="submit" class="btn btn-main setting-panel-mdbtn"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg> {{LANG save}}</button>
	</div>
</form>
<div class="col-md-3"></div>
<script>
    $(function() {
        var form = $('form#profile-settings');
        form.ajaxForm({
            url: '{{LINK aj/user/profile}}?hash=' + $('.main_session').val(),
            beforeSend: function() {
                form.find('button').text("{{LANG please_wait}}");
                // FL_progressIconLoader(form.find('button'));
            },
            success: function(data) {
                scrollToTop();
                if (data.status == 200) {
                    $('.setting-profile-alert').html('<div class="alert alert-success">' + data.message + '</div>');
                    $('.alert-success').fadeIn('fast', function() {
                        $(this).delay(2500).slideUp(500, function() {
                            $(this).remove();
                        });
                    });
                } else if (data.errors) {
                    var errors = data.errors.join("<br>");
                    $('.setting-profile-alert').html('<div class="alert alert-danger">' + errors + '</div>');
                    $('.alert-danger').fadeIn(300);
                }
                form.find('button').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg> {{LANG save}}');
                // FL_progressIconLoader(form.find('button'));
            }
        });
    });
</script>