Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php session_start(); $phn = ""; $state = ""; $dist = ""; $block = ""; $userrole..
Decoded Output download
<script>window.location.href='login';</script>
Did this file decode correctly?
Original Code
<?php
session_start();
$phn = "";
$state = "";
$dist = "";
$block = "";
$userrole = "";
$adminname = "";
if(isset($_SESSION['phone'])) {
$phn = $_SESSION['phone'];
}
if(isset($_SESSION['state'])) {
$state = $_SESSION['state'];
}
if(isset($_SESSION['dist'])) {
$dist = $_SESSION['dist'];
}
if(isset($_SESSION['block'])) {
$block = $_SESSION['block'];
}
if(isset($_SESSION['userrole'])) {
$userrole = $_SESSION['userrole'];
}
if(isset($_SESSION['adminname'])) {
$adminname = $_SESSION['adminname'];
}
if(!isset($_SESSION["uid"])) {
echo "<script>window.location.href='login';</script>";
}
if($_SESSION["uid"] == "") {
echo "<script>window.location.href='login';</script>";
}
$uid = $_SESSION["uid"];
date_default_timezone_set("Asia/Calcutta");
$strDate1=date("Y-m-d H:i:s");
$strDate2=date("Y-m-d");
include("./db/dbconfig.php");
OpenDB();
$distVisible = "block";
$blockVisible = "block";
if(isset($_REQUEST['voi'])){
if($_REQUEST['voi'] == "Edit") {
$wname = $_REQUEST['register'];
$wmobile = $_REQUEST['mobile'];
$wemail = $_REQUEST['email'];
$wstate = $_REQUEST['state'];
$wdist = $_REQUEST['hdnChkDist'];
$wblock = $_REQUEST['hdnChkBlock'];
$wpassword = $_REQUEST['password'];
$wisrverified = $_REQUEST['isrverified'];
$wispaidreporter = $_REQUEST['ispaidreporter'];
$wnewsvalue = $_REQUEST['newsvalue'];
$wtarget = $_REQUEST['target'];
$wfollowed = $_REQUEST['followed'];
$wID = $_REQUEST['id'];
$sql = "update Register set reportername ='$wname', mobile='$wmobile', email='$wemail', state='$wstate', dist='$wdist', block='$wblock', password='$wpassword', isrverified='$wisrverified', ispaidreporter='$wispaidreporter', newsvalue='$newsvalue', target=$target, followed='$followed' where id='$wID' ";
execUpdate($sql);
}
if($_REQUEST['voi'] == "Delete") {
$wID = $_REQUEST['id'];
$sql = "delete from Register where id='$wID' ";
execDelete($sql);
}
if($_REQUEST['voi'] == "Status") {
$wStatus = $_REQUEST['status'];
$wID = $_REQUEST['id'];
$sql = "update Register set userstatus ='$wStatus' where id='$wID' ";
execUpdate($sql);
}
}
$rid = "";
$name = "";
$mobile = "";
$email = "";
$userrole = "";
$rstate = "";
$rdistrict = "";
$rblock = "";
$status = "";
include('includes/header.php');
include('includes/navbar.php');
?>
<!-- Page Heading -->
<h1 class="h3 mb-2 text-gray-800">Register</h1>
<!-- DataTales Example -->
<div class="card shadow mb-4">
<div class="card-header py-3">
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Reporter Name</th>
<th>Mobile</th>
<th>e-Mail</th>
<th>State</th>
<th>District</th>
<th>Block</th>
<th>Edit</th>
<th>Delete</th>
<th>Status</th>
</tr>
<?php
$sqladmin = "select * from Register";
$resultadmin = execSelect($sqladmin);
while($rowadmin = getRows($resultadmin)) {
$rid = $rowadmin['id'];
$name = $rowadmin['reportername'];
$mobile = $rowadmin['mobile'];
$email = $rowadmin['email'];
$rstate = $rowadmin['state'];
$password = $rowadmin['password'];
$isrverified = $rowadmin['isrverified'];
$ispaidreporter = $rowadmin['ispaidreporter'];
$newsvalue = $rowadmin['newsvalue'];
$followed = $rowadmin['followed'];
$target = $rowadmin['target'];
$strState = "";
$strDist = "";
$strBlock = "";
$sqladmin1 = "select * from state where id='$rstate' ";
$resultadmin1 = execSelect($sqladmin1);
if($rowadmin1 = getRows($resultadmin1)) {
$strState = $rowadmin1['state'];
}
$resultadmin1->close();
$rdistrict = $rowadmin['dist'];
$sqladmin1 = "select * from dist where id in ($rdistrict) ";
$resultadmin1 = execSelect($sqladmin1);
while($rowadmin1 = getRows($resultadmin1)) {
$strDist .= $rowadmin1['dist'];
}
$resultadmin1->close();
$rblock = $rowadmin['block'];
$sqladmin1 = "select * from block where id in ($rblock) ";
$resultadmin1 = execSelect($sqladmin1);
while($rowadmin1 = getRows($resultadmin1)) {
$strBlock .= $rowadmin1['block'];
}
$resultadmin1->close();
$status = $rowadmin['userstatus'];
?>
<tr>
<td><?=$name?></td>
<td><?=$mobile?></td>
<td><?=$email?></td>
<td><?=$strState?></td>
<td><?=$strDist?></td>
<td><?=$strBlock?></td>
<td>
<button ttype="button" class="btn btn-primary1" data-bs-toggle="modal" data-bs-target="#exampleEditModal<?=$rid?>">Edit</button>
</td>
<td><button ttype="button" class="btn btn-primary1" data-bs-toggle="modal" data-bs-target="#exampleDeleteModal<?=$rid?>">Delete</button></td>
<td><button ttype="button" class="btn btn-primary1" data-bs-toggle="modal" data-bs-target="#exampleActiveModal<?=$rid?>"><?=$status?></button></td>
</tr>
<!-- /.container-fluid -->
<!-- End of Main Content -->
<!-- End of Main Content -->
<!-- Edit Modal -->
<div class="modal fade" id="exampleEditModal<?=$rid?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Edit</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">x</button>
</div>
<form method="post">
<div class="modal-body">
<div class="mb-3 w-75">
<label for="register" class="form-label">Enter Reporter Name</label>
<input type="text" class="form-control" name="register" required id="register" placeholder="Enter Reporter Name" value="<?=$name?>">
</div>
<div class="mb-3 w-75">
<label for="mobile" class="form-label">Enter Mobile No</label>
<input type="text" class="form-control" name="mobile" required id="mobile" placeholder="Enter Mobile No" value="<?=$mobile?>">
</div>
<div class="mb-3 w-75">
<label for="email" class="form-label">Enter e-Mail</label>
<input type="text" class="form-control" name="email" required id="email" placeholder="Enter e-Mail" value="<?=$email?>">
</div>
<div class="mb-3 w-75">
<label for="estate" class="form-label">Enter State</label>
<select name="estate" id="estate" class="form-control" onblur="getDist(this.value,'checkDistboxes1<?=$rid?>','hdnDistIti1<?=$rid?>','<?=$rdistrict?>','hdnChkDist1<?=$rid?>','1<?=$rid?>');">
<option value="<?=$itiAdState?>"><?=$strState?></option>
<?php
$sstate = "SELECT * FROM state";
$state1 = execSelect ($sstate);
while($state2 = getRows($state1)) {
?>
<option value="<?=$state2['id']?>"><?=$state2['state']?></option>
<?php }$state1->close(); ?>
?>
</select>
</div>
<div class="mb-3 w-75">
<label class="form-label">Enter District</label>
<div class="multiselect" style="width:100%;">
<div class="selectBox" onclick="showDistCheckboxes('1<?=$rid?>')">
<select class="form-control">
<option>Select an option</option>
</select>
<div class="overSelect"></div>
</div>
<div id="checkDistboxes1<?=$rid?>">
</div>
</div>
<input type="hidden" name="hdnDistIti" id="hdnDistIti1<?=$rid?>">
<input type="hidden" name="hdnChkDist" id="hdnChkDist1<?=$rid?>" value="<?=$rdistrict?>">
<!--
<select class="form-control" name="dist1" id="dist1" onblur="getBlock(this.value,'block1');"></select>
-->
</div>
<div class="mb-3 w-75">
<label class="form-label">Enter Block</label>
<div class="multiselect" style="width:100%;">
<div class="selectBox" onclick="showBlockCheckboxes('1<?=$rid?>')">
<select class="form-control">
<option>Select an option</option>
</select>
<div class="overSelect"></div>
</div>
<div id="checkBlockboxes1<?=$rid?>">
</div>
</div>
<input type="hidden" name="hdnBlockIti" id="hdnBlockIti1<?=$rid?>">
<input type="hidden" name="hdnChkBlock" id="hdnChkBlock1<?=$rid?>" value="<?=$rblock?>">
<!--
<select class="form-control" name="block1" id="block1" > </select>
-->
</div>
<div class="mb-3 w-75">
<label for="password" class="form-label">Enter Password</label>
<input type="text" class="form-control" name="password" required id="password" placeholder="Enter Password" value="<?=$password?>">
</div>
<div class="mb-3 w-75">
<label for="isrverified" class="form-label">Is Verified? </label>
<select class="form-control" name="isrverified">
<option value="<?=$isrverified?>"><?=$isrverified?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
<div class="mb-3 w-75">
<label for="ispaidreporter" class="form-label">Is Paid Reporter? </label>
<select class="form-control" name="ispaidreporter">
<option value="<?=$ispaidreporter?>"><?=$ispaidreporter?></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
<div class="mb-3 w-75">
<label for="newsvalue" class="form-label">Enter News Value</label>
<input type="Number" class="form-control" name="newsvalue" required id="newsvalue" placeholder="Enter News Value" value="<?=$newsvalue?>">
</div>
<div class="mb-3 w-75">
<label for="target" class="form-label">Enter Target No</label>
<input type="Number" class="form-control" name="target" required id="target" placeholder="Enter Target No" value="<?=$target?>">
</div>
<?php
if($state == "") {
?>
<div class="mb-3 w-75">
<label for="followed" class="form-label">Enter Followed</label>
<input type="Number" class="form-control" name="followed" required id="followed" placeholder="Enter Followed" value="<?=$followed?>">
</div>
<?php
} else {
?>
<input type="hidden" value="<?=$followed?>" name="followed">
<?php
}
?>
</div>
<div class="modal-footer">
<input type="hidden" name="id" value="<?=$rid?>">
<input type="hidden" name="voi" id="voi" value="Edit">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Edit</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exampleDeleteModal<?=$rid?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Delete</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">x</button>
</div>
<form method="post">
<div class="modal-body">
<div class="mb-3 w-75">
Are you want to Delete this Data?
<input type="hidden" name="id" value="<?=$rid?>">
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="voi" id="voi" value="Delete">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Delete</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exampleActiveModal<?=$rid?>" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Status</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">x</button>
</div>
<form method="post">
<div class="modal-body">
<div class="mb-3 w-75">
<label for="exampleFormControlInput1" class="form-label">Enter Status</label>
<select class="form-control" name="status">
<option value="<?=$status?>"><?=$status?></option>
<option value="Active">Active</option>
<option value="InActive">InActive</option>
</select>
<input type="hidden" name="id" value="<?=$rid?>">
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="voi" id="voi" value="Status">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</form>
</div>
</div>
</div>
<?php
}
$resultadmin->close();
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
function getDist(stateval,ctrlnm,ctrlnm1,selval,ctrlnm2,nm) {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
//x = document.getElementById(ctrlnm).innerHTML;
//xval = x + this.responseText;
x = this.responseText;
myArray = x.split("|");
document.getElementById(ctrlnm).innerHTML = myArray[0];
document.getElementById(ctrlnm1).value = myArray[1];
document.getElementById(ctrlnm2).value = myArray[2];
}
xhttp.open("GET", "getdist1?state="+stateval+"&seldist="+selval+"&voi="+nm, true);
xhttp.send();
}
function getBlock(stateval,ctrlnm,ctrlnm1,selval,ctrlnm2,nm) {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
x = this.responseText;
myArray = x.split("|");
document.getElementById(ctrlnm).innerHTML = myArray[0];
document.getElementById(ctrlnm1).value = myArray[1];
document.getElementById(ctrlnm2).value = myArray[2];
}
xhttp.open("GET", "getblock1?dist="+stateval+"&selblock="+selval+"&voi="+nm, true);
xhttp.send();
}
</script>
<script>
var expanded = false;
function showDistCheckboxes(x) {
var checkboxes = document.getElementById("checkDistboxes"+x);
if (!expanded) {
checkboxes.style.display = "block";
expanded = true;
} else {
checkboxes.style.display = "none";
expanded = false;
}
}
function showBlockCheckboxes(x) {
var checkboxes = document.getElementById("checkBlockboxes"+x);
if (!expanded) {
checkboxes.style.display = "block";
expanded = true;
} else {
checkboxes.style.display = "none";
expanded = false;
}
}
</script>
<script>
function dist(val, id, ctrlnm) {
var checkBox = document.getElementById(id);
var text = document.getElementById("hdnChkDist"+ctrlnm).value;
let length = text.length;
var myArray = [];
if(length > 0) {
myArray = text.split(",");
if (checkBox.checked == true){
myArray.splice(0, 0, val);
} else {
index = myArray.indexOf(val);
if (index > -1) {
myArray.splice(index, 1);
}
}
} else {
if (checkBox.checked == true){
myArray.push(val);
}
}
document.getElementById("hdnChkDist"+ctrlnm).value = myArray;
var selblock = "";
var text2 = document.getElementById("hdnChkBlock"+ctrlnm).value;
if(text2 != "") {
selblock = text2;
}
getBlock(myArray,'checkBlockboxes'+ctrlnm,'hdnBlockIti'+ctrlnm,selblock,'hdnChkBlock'+ctrlnm,ctrlnm);
}
function block(val, id, ctrlnm) {
var checkBox = document.getElementById(id);
var text = document.getElementById("hdnChkBlock"+ctrlnm).value;
let length = text.length;
var myArray1 = [];
if(length > 0) {
myArray1 = text.split(",");
if (checkBox.checked == true){
myArray1.splice(0, 0, val);
} else {
index = myArray1.indexOf(val);
if (index > -1) {
myArray1.splice(index, 1);
}
}
} else {
if (checkBox.checked == true){
myArray1.push(val);
}
}
document.getElementById("hdnChkBlock"+ctrlnm).value = myArray1;
}
</script>
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<?php
include('includes/scripts.php');
include('includes/footer.php');
?>
<?php
CloseDB();
?>
Function Calls
session_start | 1 |
date_default_timezone_set | 1 |
Stats
MD5 | 38ff8c5df4a7fa49e683d954ac1f679d |
Eval Count | 0 |
Decode Time | 129 ms |