index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Apple Product</title>
<link rel="stylesheet" href="maxcdn.bootstrapcdn.com">
<style type="text/css">
body {
font-family: Arial, sans-serif;
padding: 20px;
}
form {
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
color: #000000;
font-family: Arial, sans-serif;
}
th, td {
border: 1px solid #dddddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
.btn-submit {
background-color: #28a745; /* Green */
border-color: #28a745;
}
.btn-submit:hover {
background-color: #218838; /* Darker green */
border-color: #1e7e34;
}
</style>
</head>
<body>
<div class="container">
<h2 class="mt-4 mb-4">Apple Product Hardware info </h2>
<form action="serialinfo.php" method="GET">
<div class="form-group">
<label for="serial">Enter Serial Number:</label>
<input type="text" id="serial" name="serial" class="form-control" placeholder="Serial Number" required>
</div>
<button type="submit" class="btn btn-submit">Submit</button>
</form>
<!-- Display results in a table -->
<div id="results">
<!-- Results will be displayed here -->
</div>
</div>
<!-- JavaScript libraries -->
<script src="ajax.googleapis.com"></script>
<script src="maxcdn.bootstrapcdn.com"></script>
<!-- Custom JavaScript for handling form submission and displaying results -->
<script>
$(document).ready(function(){
$('form').submit(function(event){
event.preventDefault(); // Prevent the form from submitting normally
var serialNumber = $('#serial').val(); // Get the serial number from the input field
// Perform AJAX request to fetch device info based on the serial number
$.get('serialinfo.php', {serial: serialNumber}, function(data){
$('#results').html(data); // Display the results in the 'results' div
});
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Apple Product</title>
<link rel="stylesheet" href="maxcdn.bootstrapcdn.com">
<style type="text/css">
body {
font-family: Arial, sans-serif;
padding: 20px;
}
form {
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
color: #000000;
font-family: Arial, sans-serif;
}
th, td {
border: 1px solid #dddddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
.btn-submit {
background-color: #28a745; /* Green */
border-color: #28a745;
}
.btn-submit:hover {
background-color: #218838; /* Darker green */
border-color: #1e7e34;
}
</style>
</head>
<body>
<div class="container">
<h2 class="mt-4 mb-4">Apple Product Hardware info </h2>
<form action="serialinfo.php" method="GET">
<div class="form-group">
<label for="serial">Enter Serial Number:</label>
<input type="text" id="serial" name="serial" class="form-control" placeholder="Serial Number" required>
</div>
<button type="submit" class="btn btn-submit">Submit</button>
</form>
<!-- Display results in a table -->
<div id="results">
<!-- Results will be displayed here -->
</div>
</div>
<!-- JavaScript libraries -->
<script src="ajax.googleapis.com"></script>
<script src="maxcdn.bootstrapcdn.com"></script>
<!-- Custom JavaScript for handling form submission and displaying results -->
<script>
$(document).ready(function(){
$('form').submit(function(event){
event.preventDefault(); // Prevent the form from submitting normally
var serialNumber = $('#serial').val(); // Get the serial number from the input field
// Perform AJAX request to fetch device info based on the serial number
$.get('serialinfo.php', {serial: serialNumber}, function(data){
$('#results').html(data); // Display the results in the 'results' div
});
});
});
</script>
</body>
</html>
serialinfo.php :
<?php
$SN = $_GET['serial'];
// The mapping array
$mapping = array(
"Manufacture" => array(0, 2),
"Assembly" => array(2, 1),
"Year" => array(3, 1),
"Week" => array(4, 1),
"UI" => array(5, 3),
"Model_Info" => array(8, 4)
);
// The output array
$output = array();
// Loop through the mapping and extract the substrings
foreach ($mapping as $key => $value) {
$output[$key] = substr($SN, $value[0], $value[1]);
}
//print_r($output);
include_once('output.inc');
?>
<?php
$SN = $_GET['serial'];
// The mapping array
$mapping = array(
"Manufacture" => array(0, 2),
"Assembly" => array(2, 1),
"Year" => array(3, 1),
"Week" => array(4, 1),
"UI" => array(5, 3),
"Model_Info" => array(8, 4)
);
// The output array
$output = array();
// Loop through the mapping and extract the substrings
foreach ($mapping as $key => $value) {
$output[$key] = substr($SN, $value[0], $value[1]);
}
//print_r($output);
include_once('output.inc');
?>
output.inc :
<title>Serial Decoder</title><style>
table {
border-collapse: collapse;
width: 100%;
color: #000000;
font-family: monospace;
font-size: 16px;
text-align: left;
}
th {
background-color: #1e7e34;
color: white;
}
tr:nth-child(even) {background-color: #f2f2f2}
</style>
<table>
<tbody><tr>
<th>Serial Information:</th>
<th></th>
</tr>
<tr>
<td>Serial #:</td>
<td><?php echo $SN; ?></td>
</tr>
<tr>
<td>Location of Manufacture:</td>
<td><?php echo $output['Manufacture']; ?></td>
</tr>
<tr>
<td>Year of Manufacture:</td>
<td><?php echo $output['Year']; ?></td>
</tr>
<tr>
<td>Week of Manufacture:</td>
<td><?php echo $output['Week']; ?></td>
</tr>
<tr>
<td>Unique Identifier:</td>
<td><?php echo $output['UI']; ?></td>
</tr>
<tr>
<td>Model Info:</td>
<td><?php echo $output['Model_Info']; ?></td>
</tr>
<tr>
<td>Model:</td>
<td>iPhone SE (1st generation)</td>
</tr>
<tr>
<td>Location of Manufacture:</td>
<td>Foxconn-Zhengzhou, China</td>
</tr>
<tr>
<td> Week of Manufacture:</td>
<td>8</td>
</tr>
<tr>
<td>Year:</td>
<td>2016</td>
</tr>
<tr>
<td>Manufacture Date:</td>
<td>Feb 22 2016</td>
</tr>
<tr>
<td>Production Line:</td>
<td>1163</td>
</tr>
<tr>
<td>System Specifications:</td>
<td><a href="support-sp.apple.com">View Hardware Specifications</a></td>
</tr>
<tr>
<td>Message:</td>
<td>Product Found in Database</td>
</tr>
</tbody></table>
</div>
<title>Serial Decoder</title><style>
table {
border-collapse: collapse;
width: 100%;
color: #000000;
font-family: monospace;
font-size: 16px;
text-align: left;
}
th {
background-color: #1e7e34;
color: white;
}
tr:nth-child(even) {background-color: #f2f2f2}
</style>
<table>
<tbody><tr>
<th>Serial Information:</th>
<th></th>
</tr>
<tr>
<td>Serial #:</td>
<td><?php echo $SN; ?></td>
</tr>
<tr>
<td>Location of Manufacture:</td>
<td><?php echo $output['Manufacture']; ?></td>
</tr>
<tr>
<td>Year of Manufacture:</td>
<td><?php echo $output['Year']; ?></td>
</tr>
<tr>
<td>Week of Manufacture:</td>
<td><?php echo $output['Week']; ?></td>
</tr>
<tr>
<td>Unique Identifier:</td>
<td><?php echo $output['UI']; ?></td>
</tr>
<tr>
<td>Model Info:</td>
<td><?php echo $output['Model_Info']; ?></td>
</tr>
<tr>
<td>Model:</td>
<td>iPhone SE (1st generation)</td>
</tr>
<tr>
<td>Location of Manufacture:</td>
<td>Foxconn-Zhengzhou, China</td>
</tr>
<tr>
<td> Week of Manufacture:</td>
<td>8</td>
</tr>
<tr>
<td>Year:</td>
<td>2016</td>
</tr>
<tr>
<td>Manufacture Date:</td>
<td>Feb 22 2016</td>
</tr>
<tr>
<td>Production Line:</td>
<td>1163</td>
</tr>
<tr>
<td>System Specifications:</td>
<td><a href="support-sp.apple.com">View Hardware Specifications</a></td>
</tr>
<tr>
<td>Message:</td>
<td>Product Found in Database</td>
</tr>
</tbody></table>
</div>
Loading suggestions...