Witam,
mam taki kod widoku
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Imię i Nazwisko</th>
<th>Login</th>
<th>Rola</th>
<th>Status</th>
<th>Akcje</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
foreach($users as $user)
{
echo '<td>' . $i . '</td>'; echo '<td>' . $user->user_name . ' ' . $user->user_surname . '</td>'; echo '<td>' . $user->user_login . '</td>'; echo '<td>' . $user->user_type . '</td>'; echo '<td>' . $user->user_status . '</td>';
<td>
<div class="btn-group">
<a class="btn btn-mini btn-primary" href="#"><i class="icon-edit icon-white"></i> Rozwiń</a>
<a class="btn btn-mini btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a data-toggle="modal" href="#example" ><i class="icon-pencil"></i> Zmień hasło</a></li>';
if($user->user_status == 'active')
{
echo '<li><a href="' . base_url
() . 'users/switch_user_status/deactivate/' . $user->user_id . '"><i class="icon-trash"></i> Wyłącz to konto</a></li>'; }
else
{
echo '<li><a href="' . base_url
() . 'users/switch_user_status/activate/' . $user->user_id . '"><i class="icon-trash"></i> Włącz to konto</a></li>'; }
</div>
</td>
';
$i++;
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="5">
<button onclick="window.location.href='
<?php echo base_url
(); ?>users/add'" class="btn btn-primary">Dodaj użytkownika</button>
</td>
</tr>
</tfoot>
</table>
<!-- modal window from twitter bootstram -->
<div id="example" class="modal hide fade in" style="display: none; ">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Zmiana hasła</h3>
</div>
<div class="modal-body">
<h4>Podaj nowe hasło</h4>
<p>
<form method="POST" action="
<?php echo base_url
(); ?>user/change_passwd">
<input type="text" name="user_password" />
</p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Zapisz</button>
<a href="#" class="btn" data-dismiss="modal">Rezygnuj</a>
</form>
</div>
</div>
i teraz gdy kliknę w wierszu na zmień hasło pojawia mi się bootstrapowe okienko gdzie mam formularz z polem do wpisania nowego hasła. Tutaj mam mały problem bo musiałbym ten formularz wysłać i wykonać akcję change_passwd z parametrem id danego usera. I narazie nie mam pomysłu jak to osiągnąć. Wstawiać js`em do form action =""id usera jakoś?
Ten post edytował john_doe 2.02.2013, 14:31:09