CodeIgniter 3 app for dinbestehjelper.no. Excludes vendor/, local backup folders (new/, archive/, archived/) and DB dumps (*.sql) via .gitignore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P16ttGUge8zj91dm6WrmEb
85 lines
3.3 KiB
PHP
85 lines
3.3 KiB
PHP
<?php
|
|
|
|
?>
|
|
<div class="tableContainer">
|
|
<!--<input type="text" class="formInputBox" style="margin-bottom:40px;padding:5px;font-size:15px;color:gray;max-width:350px;" onfocus="this.value=''" onfocusout="this.value='felhasználó keresés...'" value="felhasználó keresés...">-->
|
|
<form method="post" action="">
|
|
<div class="formRow">
|
|
<a href="<?php echo base_url();?>add-new-user" class="submitBtn">Új felhasználó</a>
|
|
</div>
|
|
<table class="tableClass">
|
|
<tr>
|
|
<td>#</td>
|
|
<td style="text-align:center">Profilkép</td>
|
|
<td style="text-align:center">Név</td>
|
|
<td style="text-align:center">Felhasználói név</td>
|
|
<td style="text-align:center">Jogosultság</td>
|
|
<td style="text-align:center">Státusz</td>
|
|
<td style="text-align:center">Megjegyzés</td>
|
|
<td></td>
|
|
<?php
|
|
?>
|
|
</tr>
|
|
<?php
|
|
$userIndex = 1;
|
|
foreach($users as $userItem){
|
|
echo '<tr>';
|
|
echo '<td>'.$userIndex.'.</td>';
|
|
echo '<td style="text-align:center;">';
|
|
?>
|
|
<div class="userProfileImage" style="background-image:url('<?php echo $userItem->profile_img_url; ?>');margin:0 auto;"></div></td>
|
|
<?php
|
|
echo '<td style="text-align:center;max-width:auto;">'.$userItem->fullname.'</td>';
|
|
echo '<td style="text-align:center;max-width:auto;">'.$userItem->username.'</td>';
|
|
echo '<td style="text-align:center;max-width:auto;">'.$userItem->permission_name.'</td>';
|
|
echo '<td style="max-width:auto;">';
|
|
?>
|
|
<label class="switch" style="margin:0 auto;">
|
|
<input type="checkbox" <?php echo $userItem->is_enabled?'checked':'';?> id="user_slider_<?php echo $userItem->user_id?>" onclick="changeUserStatus('<?php echo $userItem->user_id;?>')">
|
|
<span class="slider round"></span>
|
|
</label>
|
|
<?php
|
|
echo '</td>';
|
|
echo '<td style="max-width:auto;">'.$userItem->user_notes.'</td>';
|
|
echo '<td><a href="'.site_url().'modify-user/'.$userItem->user_id.'"><i class="fas fa-user-edit" style="font-size: 20px;"></i></a> | <a href="'.site_url().'user-management?delete-user='.$userItem->user_id.'"><i class="fas fa-trash-alt" style="font-size: 20px;"></i></a></td>';
|
|
$userIndex++;
|
|
echo '</tr>';
|
|
|
|
}
|
|
?>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
function changeUserStatus(id){
|
|
var newvalue = 0;
|
|
if($('#user_slider_'+id).prop('checked')){
|
|
newvalue = 1;
|
|
}
|
|
else{
|
|
newvalue = 0;
|
|
}
|
|
|
|
$.ajax({
|
|
url: '<?php echo base_url();?>ajax',
|
|
type: 'POST',
|
|
data: {
|
|
action:'changeUserStatus',
|
|
operator: '<?php echo $_SESSION['username'];?>',
|
|
user_id: id,
|
|
newValue: newvalue
|
|
},
|
|
error: function() {
|
|
//$('#info').html('<p>An error has occurred</p>');
|
|
},
|
|
//dataType: 'json',
|
|
success: function(data) {
|
|
},
|
|
}).done(function(result){
|
|
//console.log(result);
|
|
});
|
|
|
|
}
|
|
</script>
|