first commit

This commit is contained in:
2026-04-02 15:13:15 +05:30
commit 24b759888a
6 changed files with 251 additions and 0 deletions

80
app/data.csv Normal file
View File

@@ -0,0 +1,80 @@
869356070050873
869356070050808
869356070052093
869356070825860
867730084636673
867730084683360
867730084693344
867730084697196
867730084692676
867730084631641
867730084685308
867730084691439
867730084669195
867730084689896
867730084691330
863078081737829
867730084685852
867730084693047
867730084684491
867730084691926
867730084669286
867730084668361
867730084682354
867730084671340
867730084691322
867730084680317
867730084683329
867730084685381
867730084691843
867730084697188
867730084695893
867730084687429
867730084685373
867730084695703
867730084697204
867730084691025
867730084684608
867730084685977
867730084686298
867730084686116
867730084687403
867730084669146
867730084701444
869356078426695
867730084695869
867730084671142
867730084685860
867730084640949
867730084697139
867730084687478
867730084687304
867730084645948
867730084690951
867730084685910
867730084690969
867730084686256
867730084695885
867730084669187
867730084695729
867730084672926
867730084695778
867730084645344
867730084681687
869356078430374
867730084667009
867730084687379
867730084633092
867730084687338
867730084687452
867730084697287
867730084697212
869356078424435
867730084641707
867730084669161
867730084684483
867730084691454
867730084691272
867730084693146
867730084692981
867730084680871
1 869356070050873
2 869356070050808
3 869356070052093
4 869356070825860
5 867730084636673
6 867730084683360
7 867730084693344
8 867730084697196
9 867730084692676
10 867730084631641
11 867730084685308
12 867730084691439
13 867730084669195
14 867730084689896
15 867730084691330
16 863078081737829
17 867730084685852
18 867730084693047
19 867730084684491
20 867730084691926
21 867730084669286
22 867730084668361
23 867730084682354
24 867730084671340
25 867730084691322
26 867730084680317
27 867730084683329
28 867730084685381
29 867730084691843
30 867730084697188
31 867730084695893
32 867730084687429
33 867730084685373
34 867730084695703
35 867730084697204
36 867730084691025
37 867730084684608
38 867730084685977
39 867730084686298
40 867730084686116
41 867730084687403
42 867730084669146
43 867730084701444
44 869356078426695
45 867730084695869
46 867730084671142
47 867730084685860
48 867730084640949
49 867730084697139
50 867730084687478
51 867730084687304
52 867730084645948
53 867730084690951
54 867730084685910
55 867730084690969
56 867730084686256
57 867730084695885
58 867730084669187
59 867730084695729
60 867730084672926
61 867730084695778
62 867730084645344
63 867730084681687
64 869356078430374
65 867730084667009
66 867730084687379
67 867730084633092
68 867730084687338
69 867730084687452
70 867730084697287
71 867730084697212
72 869356078424435
73 867730084641707
74 867730084669161
75 867730084684483
76 867730084691454
77 867730084691272
78 867730084693146
79 867730084692981
80 867730084680871

90
app/index.html Normal file
View File

@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Number Logger</title>
<style>
body {
font-family: Arial;
text-align: center;
padding: 20px;
}
input, button {
width: 90%;
padding: 12px;
margin: 10px;
font-size: 18px;
}
button {
background: #28a745;
color: white;
border: none;
}
ul {
list-style: none;
padding: 0;
}
li {
background: #f1f1f1;
margin: 5px;
padding: 10px;
}
</style>
</head>
<body>
<h2>Enter Number</h2>
<input type="number" id="number" placeholder="Enter number">
<button onclick="submitData()">Submit</button>
<p id="status"></p>
<h3>Saved Numbers</h3>
<ul id="list"></ul>
<script>
function loadData() {
fetch("read.php")
.then(res => res.json())
.then(data => {
let list = document.getElementById("list");
list.innerHTML = "";
data.reverse().forEach(item => {
let li = document.createElement("li");
li.innerText = item.number;
list.appendChild(li);
});
});
}
function submitData() {
let number = document.getElementById("number").value;
if (!number) {
alert("Enter a number");
return;
}
fetch("save.php", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: `number=${number}`
})
.then(res => res.text())
.then(data => {
document.getElementById("status").innerText = data;
document.getElementById("number").value = "";
loadData(); // refresh list
});
}
// Load data on page open
loadData();
</script>
</body>
</html>

21
app/read.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
$file = 'data.csv';
$data = [];
if (file_exists($file)) {
$handle = fopen($file, 'r');
while (($row = fgetcsv($handle)) !== false) {
$data[] = [
"number" => $row[0]
];
}
fclose($handle);
}
header('Content-Type: application/json');
echo json_encode($data);
?>

23
app/save.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$number = $_POST['number'];
if (empty($number)) {
echo "Invalid input";
exit;
}
$file = 'data.csv';
$handle = fopen($file, 'a');
// Save ONLY number (no timestamp)
fputcsv($handle, [$number]);
fclose($handle);
echo "Saved!";
}
?>