commitall

This commit is contained in:
Sampanna Rimal
2024-07-10 18:28:19 +05:45
parent 140abda4e6
commit 9cd05ef3cb
15723 changed files with 4818733 additions and 0 deletions

View File

@ -0,0 +1,109 @@
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<div class="container-fluid">
<div class="panel panel-default crd-dsgn-prt">
<div class="panel-heading">Add Users</div>
<div class="panel-body">
<form method="post">
<fieldset class="fld-sec-prt">
<legend style="width:auto; padding-left: 20px;padding-right:20px;">Users Details</legend>
<div class="row">
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="text" class="input2" id="user_name" name="user_name">
<span class="focus-input2" data-placeholder="User Name"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="email" class="input2" id="user_email" name="user_email">
<span class="focus-input2" data-placeholder="User Email"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="password" class="input2" id="user_password" name="user_password">
<span class="focus-input2" data-placeholder="User Password"></span>
</div>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="checkbox" id="setPrivilege">
<label><input type="checkbox" required> Set Privilege</label>
</div>
<table id="notificationsTableId" style="width:100%;">
<thead>
<tr role="row">
<th rowspan="1" colspan="1" aria-label="" align="center">
<label><input type="checkbox" id="selectall">Select all</label>
</th>
</tr>
</thead>
<?php
$controllers=$this->config->item('checkControllers');
foreach ($controllers as $controller):
setPrivilege($controller);
endforeach;
?>
<tbody role="alert">
<?php
function setPrivilege($name)
{
?>
<tr class="results-table-row">
<td style="text-transform: capitalize"><?php echo $name; ?></td>
<td><label><input type="checkbox" class="selectedId" value="1" name="<?php echo $name; ?>"> view</label></td>
<td><label><input type="checkbox" class="selectedId" value="2" name="<?php echo $name; ?>"> add/update</label></td>
<td><label><input type="checkbox" class="selectedId" value="3" name="<?php echo $name; ?>"> delete</label></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</fieldset >
<div class="txt-cntr"><button type="submit" class="btn-prt-sec btn--1"><span class="btn__text">Add</span></button></div>
</form>
</div>
</div>
</div>
<script>
$("#setPrivilege").on('click', function () {
});
$('#setPrivilege').click(function () {
if (this.checked) {
alert('checked');
}
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#selectall').click(function () {
$('.selectedId').prop('checked', this.checked);
});
$('.selectedId').change(function () {
var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
$('#selectall').prop("checked", check);
});
});
</script>

View File

@ -0,0 +1,109 @@
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<div class="container-fluid">
<div class="panel panel-default crd-dsgn-prt">
<div class="panel-heading">Delete Users</div>
<div class="panel-body">
<form method="post">
<fieldset class="fld-sec-prt">
<legend style="width:auto; padding-left: 20px;padding-right:20px;">Users Details</legend>
<div class="row">
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="text" class="input2" id="user_name" name="user_name">
<span class="focus-input2" data-placeholder="User Name"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="email" class="input2" id="user_email" name="user_email">
<span class="focus-input2" data-placeholder="User Email"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="password" class="input2" id="user_password" name="user_password">
<span class="focus-input2" data-placeholder="User Password"></span>
</div>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="checkbox" id="setPrivilege">
<label><input type="checkbox" required> Set Privilege</label>
</div>
<table id="notificationsTableId" style="width:100%;">
<thead>
<tr role="row">
<th rowspan="1" colspan="1" aria-label="" align="center">
<label><input type="checkbox" id="selectall">Select all</label>
</th>
</tr>
</thead>
<?php
$controllers=$this->config->item('checkControllers');
foreach ($controllers as $controller):
setPrivilege($controller);
endforeach;
?>
<tbody role="alert">
<?php
function setPrivilege($name)
{
?>
<tr class="results-table-row">
<td style="text-transform: capitalize"><?php echo $name; ?></td>
<td><label><input type="checkbox" class="selectedId" value="1" name="<?php echo $name; ?>"> view</label></td>
<td><label><input type="checkbox" class="selectedId" value="2" name="<?php echo $name; ?>"> add/update</label></td>
<td><label><input type="checkbox" class="selectedId" value="3" name="<?php echo $name; ?>"> delete</label></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</fieldset >
<div class="txt-cntr"><button type="submit" class="btn-prt-sec btn--1"><span class="btn__text">Delete</span></button></div>
</form>
</div>
</div>
</div>
<script>
$("#setPrivilege").on('click', function () {
});
$('#setPrivilege').click(function () {
if (this.checked) {
alert('checked');
}
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#selectall').click(function () {
$('.selectedId').prop('checked', this.checked);
});
$('.selectedId').change(function () {
var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
$('#selectall').prop("checked", check);
});
});
</script>

View File

@ -0,0 +1,108 @@
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<div class="container-fluid">
<div class="panel panel-default crd-dsgn-prt">
<div class="panel-heading">Edit Users</div>
<div class="panel-body">
<form method="post">
<fieldset class="fld-sec-prt">
<legend style="width:auto; padding-left: 20px;padding-right:20px;">Users Details</legend>
<div class="row">
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="text" class="input2" id="user_name" name="user_name" value="<?php echo $Users->user_name;?>">
<span class="focus-input2" data-placeholder="User Name"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="email" class="input2" id="user_email" name="user_email" value="<?php echo $Users->user_email;?>">
<span class="focus-input2" data-placeholder="User Email"></span>
</div>
</div>
<div class="col-lg-6 col-sm-6 col-md-6">
<div class="wrap-input2 validate-input" data-validate="Name is required">
<input type="password" class="input2" id="user_password" name="user_password" value="<?php echo $Users->user_password;?>">
<span class="focus-input2" data-placeholder="User Password"></span>
</div>
</div>
<div class="col-md-12 col-sm-12 col-lg-12">
<div class="checkbox" id="setPrivilege">
<label><input type="checkbox" required> Set Privilege</label>
</div>
<table id="notificationsTableId" style="width:100%;">
<thead>
<tr role="row">
<th rowspan="1" colspan="1" aria-label="" align="center">
<label><input type="checkbox" id="selectall">Select all</label>
</th>
</tr>
</thead>
<?php
$controllers=$this->config->item('checkControllers');
foreach ($controllers as $controller):
setPrivilege($controller);
endforeach;
?>
<tbody role="alert">
<?php
function setPrivilege($name)
{
?>
<tr class="results-table-row">
<td style="text-transform: capitalize"><?php echo $name; ?></td>
<td><label><input type="checkbox" class="selectedId" value="1" name="<?php echo $name; ?>" > view</label></td>
<td><label><input type="checkbox" class="selectedId" value="2" name="<?php echo $name; ?>"> add/update</label></td>
<td><label><input type="checkbox" class="selectedId" value="3" name="<?php echo $name; ?>"> delete</label></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</fieldset >
<div class="txt-cntr"><button type="submit" class="btn-prt-sec btn--1"><span class="btn__text">Edit</span></button></div>
</form>
</div>
</div>
</div>
<script>
$("#setPrivilege").on('click', function () {
});
$('#setPrivilege').click(function () {
if (this.checked) {
alert('checked');
}
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#selectall').click(function () {
$('.selectedId').prop('checked', this.checked);
});
$('.selectedId').change(function () {
var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
$('#selectall').prop("checked", check);
});
});
</script>

View File

@ -0,0 +1,125 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse2">
View Users
</a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse in">
<div class="panel-body">
<?php $value=getPrivilege('users'); ?>
<table class="table table-hover">
<thead>
<tr>
<th>S.no</th>
<th>Name</th>
<th>Email</th>
<?php if (isSuperAdmin()):?><th>Password</th><?php endif;?>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i=0;foreach ($Users as $user): $i++;?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $user->user_name;?></td>
<td><?php echo $user->user_email;?></td>
<?php if (isSuperAdmin()):?><td><?php echo $user->user_password;?></td><?php endif;?>
<td>
<?php if (isViewable('edit')){?>
<button type="button" onclick="changePrivilege(<?php echo $user->user_id;?>)" class="btn btn-primary">Change Privilege</button>
<button type="button" class="btn btn-primary" data-toggle="modal" onclick="passwordModal(<?php echo $user->user_id;?>)" data-target="#changePassword">Change Password</button>
<?php }?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
<!-- The Modal -->
<div class="modal fade" id="changePrivilege" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div id="container_modal">
</div>
</div>
<div class="modal" id="changePassword">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Change Password</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<input type="password" id="password1">
<input type="password" id="password2">
</div>
<!-- Modal footer -->
<div class="modal-footer">
<a id="changeA">Close</a>
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php
function changePrivilege($name)
{
?>
<tr>
<td style="text-transform: capitalize"><?php echo $name; ?></td>
<td><label><input type="checkbox" value="1" name="<?php echo $name; ?>"> view</label></td>
<td><label><input type="checkbox" value="2" name="<?php echo $name; ?>"> add/update</label></td>
<td><label><input type="checkbox" value="3" name="<?php echo $name; ?>"> delete</label></td>
</tr>
<?php
}
?>
<script>
function passwordModal(id) {
$("#changeA").html("<button type='button' onclick='changePassword("+ id +")' class='btn btn-success' id='changeBtn'>Update</button>");
}
function changePassword(id) {
if ($('#password1').val() === $('#password2').val()) {
$.post("<?php echo base_url('ajax/changePassword/');?>"+id, {password: $('#password1').val()}, function(result){
alert('Password changed successfully');
window.location=window.location;
});
}
else {
alert('Passwords do not match');
}
}
function changePrivilege(id) {
$.ajax({
url:"<?php echo base_url('ajax/updatePrivilege/');?>"+ id,
success: function(data)
{
$("#container_modal").html(data);
$('#changePrivilege').modal();
}
});
}
</script>

View File

@ -0,0 +1,66 @@
<div class="panel panel-default">
<div class="panel-heading panel-heading-view-pg">Users
<?php if(isViewable('add')){?>
<a type="button" class="btn btn-primary pull-right" href="<?php echo base_url('users/add');?>">Add Users</a>
<?php }?>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table jstablesecprtsec">
<thead>
<tr>
<th>S.no.</th>
<th>User Name</th>
<th>User Email</th>
<th>User Password</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i=0;foreach ($Users as $user): $i++;?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $user->user_name;?></td>
<td><?php echo $user->user_email;?></td>
<td><?php echo $user->user_password;?></td>
<td class="flx-prt">
<?php if (isViewable('edit')){?>
<a href="<?php echo base_url('users/edit/'.$user->user_id);?>" class="btn btn-info" role="button" title="Edit <?php echo $user->user_name?>"><i class="fa fa-pencil" aria-hidden="true"></i>Edit</a>
<?php } ?>
<?php if (isViewable('delete')){?>
<a class="btn btn-danger" title="Delete" role="button" data-toggle="modal" data-target="#exampleModal<?php echo $i+1;?>"><i class="fa fa-trash" aria-hidden="true"></i>Delete</a>
<?php } ?>
</td>
</tr>
<!-- Modal -->
<div class="modal fade" id="exampleModal<?php echo $i+1;?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" style="top: 20%;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"><?php echo $user->user_name?> Delete</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are You Sure Want to Delete?
</div>
<div class="modal-footer">
<a href="<?php echo base_url('users/delete/'.$user->user_id);?>"><button type="button" class="btn btn-primary"> Yes</button></a>
<button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>