File: /home/cafsindia/refimac_cafsjobs_com/sec_recovery.php
<script type="text/JavaScript">
<!--
function formget1()
{
var major_head = document.getElementById("menu").value;
if(major_head=="Other")
{
document.getElementById("menu1").disabled=false;
document.getElementById("menu1").value="";
}
else
{
document.getElementById("menu1").disabled=true;
document.getElementById("menu1").value="NIL";
}
}
function formget2()
{
var major_head = document.getElementById("submenu").value;
if(major_head=="Other")
{
document.getElementById("submenu1").disabled=false;
document.getElementById("submenu1").value="";
}
else
{
document.getElementById("submenu1").disabled=true;
document.getElementById("submenu1").value="NIL";
}
}
function formValidator(){
// Make quick references to our fields
var menu = document.getElementById('menu');
var submenu = document.getElementById('submenu');
var page_name = document.getElementById('page_name');
// Check each input in the order that it appears in the form!
if(madeSelection(menu, "Please Select Menu Name!")){
if(madeSelection(submenu, "Please Select Submenu Name!")){
if(notEmpty(page_name, "Please enter Page Name !")){
return true;
}
}
}
return false;
}
function notEmpty(elem, helperMsg){
if(elem.value.length == 0){
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}
function madeSelection(elem, helperMsg){
if(elem.value == "Select"){
alert(helperMsg);
elem.focus();
return false;
}else{
return true;
}
}
//-->
</script>
<div id="contentwrapper">
<div class="main_content">
<div class="page-head">
<div class="container">
<!-- BEGIN PAGE TITLE -->
<div class="page-title">
<h1>User Password Recovery
<small>Password Recovery.</small></h1>
</div>
</div>
</div>
<div class="page-content">
<div class="container">
<div class="row-fluid">
<div class="span12">
<?php
if($nav=="1"||$nav=="3")
echo "<div class='alert alert-success'>
<span>Given information successfully updated !</span>
</div>";
elseif($nav=="2"||$nav=="4"||$nav=="6")
echo "<div class='alert alert-warning'>
<span>sorry, given information not updated, please try again !</span>
</div>";
elseif($nav=="5")
echo "<div class='alert alert-danger'>
<span>Selected Record successfully deleted !</span>
</div>";
?>
</div>
</div>
<div class="page-content-inner">
<div class="row portlet light">
<div class="col-md-12">
<h3 class="heading">View / Search / Update Users </h3>
<?php
if($per=="Super Admin")
$sql1="select * from serviceapp_login where hidden='N' order by user_name";
else
$sql1="select * from serviceapp_login where per!='Super Admin' and hidden='N' order by user_name";
$qu1=mysql_query($sql1);
?>
<table class="table table-striped table-bordered table-hover dt-responsive" id="sample">
<thead>
<tr>
<th width="222"><div align="center">User Name</div></th>
<th width="226"><div align="center">Password </div></th>
<th width="157"><div align="center">Access Privillage </div></th>
<th width="72"><div align="center">Option</div></th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$st1="";
while($rd=mysql_fetch_array($qu1))
{
if($rd['status']=="Allowed") $st1="Block";
elseif($rd['status']=="Denied") $st1="Unblock";
?>
<tr>
<td nowrap="nowrap"><div align="center" class="table_text_12px1"><?php echo $rd['user_name'];?></div></td>
<td nowrap="nowrap"><div align="center" class="table_text_12px1">
<?php $count1=strlen($rd['password']);echo str_repeat('*',$count1);?>
</div></td>
<td nowrap="nowrap"><div align="center" class="table_text_12px1"><?php echo $rd['per'];?></div></td>
<td nowrap="nowrap"><div align="center" class="table_text_12px1"><a href="landing.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $rd['user_name'];?>&up=1">Recovery </a></div></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
$up=$_REQUEST['up'];
$id=$_REQUEST['id'];
if($up==1)
{
$sql2="select * from serviceapp_login where user_name='".$id."'";
$qu2=mysql_query($sql2);
while($r2=mysql_fetch_array($qu2))
{
$access_user=$r2['user_name'];
$access_per=$r2['per'];
$access_st1=$r2['status'];
if($r2['status']=="Allowed") $access_st="Block User ID"; else $access_st="Unblock User ID";
}
?>
<form name="form1" action="<?php if($up==1)echo "up"; else echo "ad";?>d_details.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>" method="post">
<h3 class="heading">Selected User Details: </h3>
</br>
<div class="portlet light">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label> User Name </label><span class="f_req"> </span>: <?php echo $access_user;?>
<input name="access_user" type="hidden" id="access_user" value="<?php echo $access_user;?>" />
<input name="access_st1" type="hidden" id="access_user" value="<?php echo $access_st1;?>" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label> Access Privillage </label> <span class="f_req"></span> : <?php echo $access_per;?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label> Access Status </label> <span class="f_req"></span> : <?php echo $access_st1;?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label> New Password<span class="f_req">*</span></label>
<input name="pass" type="text" class="form-control:required" id="pass" value="" />
<span class="help-block">Please enter new password </span>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label> Reenter Password<span class="f_req">*</span></label>
<input name="repass" type="text" class="span6 :pass" id="repass" value="" />
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<button type="submit" class="btn green">Submit</button>
<button type="button" class="btn grey-salsa btn-outline">Cancel</button>
</div>
</div>
</div>
</div>
</form>
<?php }?>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function()
{
if ( $.fn.dataTable.isDataTable( '#sample' ) ) {
table = $('#sample').DataTable();
}
else {
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
});
</script>