Тема: Ребята, не редактируется профиль!
Ребят, может что-то накосячил, может еще что, но не редактируется профиль, подскажите старику
Бэкэнд
<?php // Show template for exist user else show error if ($user !== null) { ?> <h2 class="margin-bottom-1"><?php echo __('Edit profile', 'users'); ?></h2> <div class="row"> <div class="col-md-6"> <?php echo ( Form::open(). Form::hidden('csrf', Security::token()). Form::hidden('user_id', Request::get('user_id')) ); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { ?> <div class="form-group"> <?php echo Form::label('login', __('Username', 'users')); echo Form::input('login', $user['login'], array('class' => 'form-control')); ?> </div> <?php } else { echo Form::hidden('login', $user['login']); } ?> <div class="form-group"> <?php echo ( Form::label('firstname', __('Firstname', 'users')). Form::input('firstname', $user_firstname, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('lastname', __('Lastname', 'users')). Form::input('lastname', $user_lastname, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('Thirdname', __('Thirdname', 'users')). Form::input('Thirdname', $user_Thirdname, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('mob', __('Mob', 'users')). Form::input('mob', $user_mob, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('strana', __('Strana', 'users')). Form::input('strana', $user_strana, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('email', __('Email', 'users')). Form::input('email', $user_email, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('pd', __('Pd', 'users')). Form::input('pd', $user_pd, array('class' => 'form-control')) ); ?> </div> <div class="form-group"> <?php echo ( Form::label('sum', __('Sum', 'users')). Form::input('sum', $user_sum, array('class' => 'form-control')) ); ?> </div> <?php if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { ?> <div class="form-group"> <?php echo Form::label('role', __('Role', 'users')); echo Form::select('role', array('admin' => __('Admin', 'users'), 'editor' => __('Editor', 'users'), 'user' => __('User', 'users')), $user['role'], array('class' => 'form-control')) ?> </div> <?php } else { echo Form::hidden('role', Session::get('user_role')); } echo ( Html::br(). Form::submit('edit_profile', __('Save', 'users'), array('class' => 'btn btn-phone btn-primary')).Html::nbsp(2). Html::anchor(__('Cancel', 'users'), 'index.php?id=users', array('title' => __('Cancel', 'users'), 'class' => 'btn btn-phone btn-cancel btn-default')). Form::close() ); ?> </div> <div class="col-md-6"> <?php echo ( Form::open(). Form::hidden('csrf', Security::token()). Form::hidden('user_id', Request::get('user_id')) ); ?> <div class="form-group"> <?php echo ( Form::label('new_password', __('New password', 'users')). Form::password('new_password', null, array('class' => 'form-control')) ); ?> </div> <?php echo ( Form::submit('edit_profile_password', __('Save', 'users'), array('class' => 'btn btn-phone btn-primary')). Form::close() ); ?> </div> </div> <?php } else { echo '<div class="error-message">'.__('This user does not exist', 'users').'</div>'; } ?>
Фронтэнд
<div class="row"> <div class="col-md-3"> <form method="post"> <?php echo ( Form::hidden('csrf', Security::token()). Form::hidden('user_id', $user['id']) ); ?> <?php if (isset($_SESSION['user_role']) && in_array($_SESSION['user_role'], array('admin'))) { ?> <div class="form-group"> <label><?php echo __('Username', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['login']; ?>" name="login"> </div> <?php } else { echo Form::hidden('login', $user['login']); } ?> <div class="form-group"> <label><?php echo __('Firstname', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['firstname']; ?>" name="firstname"> </div> <div class="form-group"> <label><?php echo __('Lastname', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['lastname']; ?>" name="lastname"> </div> <div class="form-group"> <label><?php echo __('Thirdname', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['Thirdname']; ?>" name="Thirdname"> </div> <div class="form-group"> <label><?php echo __('Mob', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['mob']; ?>" name="mob"> </div> <div class="form-group"> <label><?php echo __('Strana', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['strana']; ?>" name="strana"> </div> <div class="form-group"> <label><?php echo __('Email', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['email']; ?>" name="email"> </div> <div class="form-group"> <label><?php echo __('Pd', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['pd']; ?>" name="pd"> </div> <div class="form-group"> <label><?php echo __('Sum', 'users'); ?></label> <input class="form-control" type="text" value="<?php echo $user['sum']; ?>" name="sum"> </div> <div class="form-group"> <label><?php echo __('New Password', 'users'); ?></label> <input class="form-control" type="text" name="new_password"> </div> <div class="form-group"> <input type="submit" class="btn btn-primary" value="<?php echo __('Save', 'users'); ?>" name="edit_profile"> <?php echo Html::anchor(__('Cancel', 'users'), Site::url().'/users/'.Uri::segment(1), array('title' => __('Cancel', 'pages'), 'class' => 'btn btn-default')); ?> </div> </form> </div> </div>