Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
w33knd committed Jan 6, 2023
0 parents commit 8ea4cea
Show file tree
Hide file tree
Showing 1,612 changed files with 352,812 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Data Entry
243 changes: 243 additions & 0 deletions change.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
<?php
session_start();

if(!isset($_SESSION['valid'])){
header("Location: index.html?s=1");
die();
exit;
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Data Entry Application">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<title>Changing Data</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="cover.css" rel="stylesheet">
</head>
<body class="text-center">
<div class="cover-container d-flex h-100 w-100 p-2 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<?php include 'navbar.php'; ?>
</div>
<hr style="height:35px">
</header>
<div id="success"></div>
<main role="main" class="inner cover">
<h1 class="cover-heading">Change Data Entry</h1>
<br>
<form id="formcontainer" action="changing.php" method="POST">

<?php
include 'databaseinfo.php';

$valid = false;

try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$id=$_GET['id'];
$stmt = $conn->prepare("select * from datatable where entryid = ?;");
$stmt->execute(array($id));
global $result;
$result=$stmt->fetchAll();
$conn=null;
$valid=true;

} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
<div class="form-group row">
<label for="inputName" class="col-sm-2 col-form-label">Name:</label>
<div class="col-sm-10">
<div class="form-row">
<div class="col-5">
<input type="name" class="form-control" name="name" id="name" placeholder="" required value="<?php echo $result[0]['name']; ?>">
</div>
<label for="inputID" class="col col-form-label">Age:</label>
<div>
<input type="text" class="form-control" name="age" id="age" placeholder="Age" required value="<?php echo $result[0]['age']; ?>">
</div>
<label for="inputID" class="col col-form-label">Education:</label>
<div>
<input type="text" class="form-control" name="education" id="education" placeholder="Education" required value="<?php echo $result[0]['education']; ?>">
</div>
</div>
</div>

</div>
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">Father/Husband Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="fhname" id="inputID" placeholder="" required value="<?php echo $result[0]['fhname']; ?>">
</div>

</div>
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">Email:</label>
<div class="col">
<input type="email" class="form-control" name="email" id="inputID" placeholder="abc@gmail.com" value="<?php echo $result[0]['email']; ?>">
</div>
<label for="inputID" class="col-sm-1 col-form-label">Phone:</label>
<div class="col">
<input type="text" class="form-control" name="phone" id="inputID" placeholder="(+91) xxxxxxxxxx" required value="<?php echo $result[0]['phone']; ?>" >
</div>
</div>
<!--<div class="form-group row">-->
<!--<label for="inputID" class="col-sm-2 col-form-label">Phone:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="phone" id="inputID" placeholder="(+91) xxxxxxxxxx" required>-->
<!-- </div>-->
<!--</div>-->
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">Address:</label>
<div class="col-sm-10">
<div class="form-row">
<div class="col-4">
<input type="text" class="form-control" name="address" id="inputID" placeholder="123 street, area" required value="<?php echo $result[0]['address']; ?>" >
</div>
<div class="col">
<input type="text" class="form-control" name="village" id="inputID" placeholder="Village">
</div>
<div class="col">
<input type="text" class="form-control" name="district" id="inputID" placeholder="District">
</div>
<div class="col">
<input type="text" class="form-control" name="tehsil" id="inputID" placeholder="Tehsil">
</div>
<div class="col">
<input type="text" class="form-control" name="state" id="inputID" placeholder="State">
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">Business:</label>
<div class="col">
<input type="text" class="form-control" name="business" id="inputID" placeholder="" required value="<?php echo $result[0]['business']; ?>">
</div>
<label for="inputID" class="col-sm-2 col-form-label">Gurumantra Place:</label>
<div class="col">
<input type="text" class="form-control" name="gurumantra" id="inputID" placeholder="" required value="<?php echo $result[0]['gurumantra']; ?>">
</div>
</div>
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">How many trees:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="hmt" id="hmt" placeholder="" required value="<?php echo $result[0]['hmt']; ?>">
</div>
</div>
<div class="form-group row">
<label for="inputID" class="col-sm-2 col-form-label">Addiction, If yes, please specify:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="addiction" id="inputID" placeholder="Yes/No" required value="<?php echo $result[0]['addiction']; ?>">
</div>
</div>
<div>
<input type="submit" class="btn btn-primary" value="Submit">
</div>
<!--<div class="form-group row">-->
<!-- <label for="inputName" class="col-sm-2 col-form-label">Name:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <div class="form-row">-->
<!-- <div class="col-6">-->
<!-- <input type="name" class="form-control" name="name" id="name" placeholder="" required value="<?php echo $result[0]['name']; ?>">-->
<!-- </div>-->
<!-- <div class="col-sm-3 my-1">-->
<!-- <label class="sr-only" for="inlineFormInputGroupUsername">age</label>-->
<!-- <div class="input-group">-->
<!-- <div class="input-group-prepend">-->
<!-- <div class="input-group-text">Age</div>-->
<!-- </div>-->
<!-- <input type="text" class="form-control" name="age" id="age" placeholder="Age" value="<?php echo $result[0]['age']; ?>" required>-->
<!-- </div> -->
<!-- </div>-->
<!-- <div class="col">-->
<!-- <input type="text" class="form-control" name="education" id="education" placeholder="Education" value="<?php echo $result[0]['education']; ?>" required>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Father/Husband Name:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="fhname" id="inputID" placeholder="" value="<?php echo $result[0]['fhname']; ?>" required>-->
<!-- </div>-->

<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Email:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="email" class="form-control" name="email" id="inputID" placeholder="abc@gmail.com" required value="<?php echo $result[0]['email']; ?>" required>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Phone:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="phone" id="inputID" placeholder="(+91) xxxxxxxxxx" required value="<?php echo $result[0]['phone']; ?>" required>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Address:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <div class="form-row">-->
<!-- <div class="col-4">-->
<!-- <input type="text" class="form-control" name="address" id="inputID" placeholder="123 street, area" required>-->
<!-- </div>-->
<!-- <div class="col">-->
<!-- <input type="text" class="form-control" name="village" id="inputID" placeholder="Village" required>-->
<!-- </div>-->
<!-- <div class="col">-->
<!-- <input type="text" class="form-control" name="district" id="inputID" placeholder="District" required>-->
<!-- </div>-->
<!-- <div class="col">-->
<!-- <input type="text" class="form-control" name="tehsil" id="inputID" placeholder="Tehsil" required>-->
<!-- </div>-->
<!-- <div class="col">-->
<!-- <input type="text" class="form-control" name="state" id="inputID" placeholder="State" required>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Business:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="business" id="inputID" placeholder="" value="<?php echo $result[0]['business']; ?>" required>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">How many trees:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="hmt" id="hmt" placeholder="" value="<?php echo $result[0]['hmt']; ?>" required>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="form-group row">-->
<!-- <label for="inputID" class="col-sm-2 col-form-label">Addiction, If yes, please specify:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <input type="text" class="form-control" name="addiction" id="inputID" placeholder="Yes/No" required value="<?php echo $result[0]['addiction']; ?>" required>-->
<!-- </div>-->
<!--</div>-->
<!--<div>-->
<!-- <input type="submit" class="btn btn-primary" value="Submit">-->
<!--</div>-->
<input type="hidden" id="entryId" name="id" value="<?php echo $id; ?>">
</form>
</main>
<footer class="mastfoot mt-auto">
</footer>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
103 changes: 103 additions & 0 deletions changing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php
session_start();

if(!isset($_SESSION['valid'])){
header("Location: index.html?s=1");
die();
exit;
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Data Entry Application">

<link rel="icon" href="#">
<title>Data Entry Status</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="cover.css" rel="stylesheet">
</head>
<body class="text-center">
<div class="cover-container d-flex h-100 p-2 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<?php include 'navbar.php'; ?>
</div>
<hr style="height:35px">
</header>
<main role="main" class="inner cover">
<?php
include 'databaseinfo.php';
$valid = false;
$id=$_POST['id'];
// $name=$_POST['name'];
// $email=$_POST['email'];
// $phone=$_POST['phone'];
// $address=$_POST['address'];
// $city=$_POST['city'];
// $state=$_POST['state'];
// $business=$_POST['business'];
// $fhname=$_POST['fhname'];
// $age=$_POST['age'];
// $education=$_POST['education'];
// $hmt=$_POST['hmt'];
// $addiction=$_POST['addiction'];
// $finaladdress=$address.",".$city.",".$state;
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$village=$_POST['village'];
$district=$_POST['district'];
$tehsil=$_POST['tehsil'];
$state=$_POST['state'];
$business=$_POST['business'];
$gurumantra=$_POST['gurumantra'];
$fhname=$_POST['fhname'];
$age=$_POST['age'];
$education=$_POST['education'];
$hmt=$_POST['hmt'];
$addiction=$_POST['addiction'];
$finaladdress=$address.",".$village.",".$district.",".$tehsil.",".$state;

try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$createaccountquery = $conn->prepare("UPDATE datatable SET name=?, fhname=?, age=?, education=?, email=?, phone=?, address=?, business=?, hmt=?, addiction=?, entrydate=current_time(), gurumantra=? WHERE entryid=?");
$createaccountquery->execute(array($name,$fhname,$age,$education,$email,$phone,$finaladdress,$business,$hmt,$addiction,$gurumantra,$id));
$conn=null;
$valid=true;
header("Location: dataentry.php?success=1");
exit;
// try {
// $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// // set the PDO error mode to exception
// $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// $createaccountquery = $conn->prepare("UPDATE datatable SET name=?, email=?, phone=?, city=?, profession=?, comments=?, entrydate=current_time() WHERE entryid=?");
// $createaccountquery->execute(array($name,$email,$phone,$city,$profession,$comments,$id));
// $conn=null;
// $valid=true;
// header("Location: display.php?success=1");
// exit;

} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
header("Location: display.php?success=0");
exit;
}

?>
</main>
<footer class="mastfoot mt-auto">
</footer>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions checkadmin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
session_start();
include 'databaseinfo.php';
$valid = false;

try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT password FROM admindb;");
$stmt->execute();
while($row = $stmt->fetchAll()) {
if($row[0]['password']==$_POST['password']){
$valid=true;
}
}

} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}


if($valid){
$_SESSION["valid"] = "yes";
header("Location: dataentry.php");
exit;
}
else{
echo "authentication failed";
header("Location: index.html?s=0");
exit;
}

?>
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require": {
"spipu/html2pdf": "^5.2",
"phpoffice/phpspreadsheet": "^1.21"
}
}
Loading

0 comments on commit 8ea4cea

Please sign in to comment.