سلام وقت همگی بخیر
من همچین جدولی دارم میخوام وقتی روی آیکون زرد کلیک میکنم بتونم اون input رو تو دیتابیس آپدیت کنم حالا با هر تکتولوژی که بشه که فک کنم ajax بهتر باشه
<?php require_once 'section/Header.php' ?>
<div class="container">
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<h5>Search Persons</h5>
</div>
<div class="card-body">
<div class="row justify-content-between">
<div class="col-md-4 offset-md-8">
<form action="" method="GET">
<input name="PersonnelCode" type="number" class="form-control" placeholder="PersonnelCode">
</div>
</div>
</div>
</form>
<div class="card-footer">
<small class="text-muted">You can search by PersonnelCode</small>
</div>
</div>
<ul class="nav nav-tabs" id="myTab1" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="user-tab" data-toggle="tab" href="#PInfo" role="tab" aria-controls="home" aria-selected="true">Personal Information</a>
</li>
<li class="nav-item">
<a class="nav-link" id="designer-tab" data-toggle="tab" href="#Performance" role="tab" aria-controls="profile" aria-selected="false">Performance</a>
</li>
</ul>
<div class="tab-content User-Lists" id="myTabContent1">
<div class="tab-pane fade show active" id="PInfo" role="tabpanel" aria-labelledby="home-tab">
<div class="widget-timeline m-b-25">
<table class="tbl-qa">
<thead>
<tr>
<th class="table-header" width="10%">Q.No.</th>
<th class="table-header">Question</th>
<th class="table-header">Answer</th>
</tr>
</thead>
<?php while ($row = $statment->fetch()): ?>
<div class="text-center project-main">
<img class="img-fluid rounded-circle" src="assets/images/user/avatar-2.jpg" alt="dashboard-user">
<?php echo "<h5 class='mt-4 calibri'>" . $row['firstname'] . " " . $row['lastname'] . "</h5>";?>
<?php echo "<span>" . $row['job'] . "</span>";?>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th><i class="fa fa-code text-danger"></i> Personnel Code</th>
<th><i class="fas fa-barcode text-danger"></i> National Code</th>
<!-- <th><i class="feather icon-user text-danger"></i> First Name</th>
<th><i class="feather icon-user text-danger"></i> Last name</th>
-->
<th><i class="fa fa-envelope text-danger"></i> Email</th>
<th><i class="fa fa-birthday-cake text-danger"></i> Birthday</th>
</tr>
</thead>
<tbody>
<tr>
<?php echo "<td>" . $row['PersonnelCode'] . "</td>";?>
<?php echo "<td>" . $row['NationalCode'] . "</td>";?>
<?php echo "<td>" . $row['email'] . "</td>";?>
<?php echo "<td>" . $row['birthday'] . "</td>";?>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th><i class="fa fa-mobile text-danger"></i> Mobile No.</th>
<th><i class="fa fa-phone text-danger"></i> Home No.</th>
<th><i class="fas fa-heart text-danger"></i> Marital Status</th>
<th><i class="fas fa-city text-danger"></i> City</th>
</tr>
</thead>
<tbody>
<tr>
<?php echo "<td>" . $row['mobilenumber'] . "</td>";?>
<?php echo "<td>" . $row['homenumber'] . "</td>";?>
<?php echo "<td>" . $row['maritalst'] . "</td>";?>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th><i class="fa fa-map-marker text-danger"></i> Address</th>
</tr>
</thead>
<tbody>
<tr>
<?php echo "<td>" . $row['address'] . "</td>";?>
</tr>
</table>
</tbody>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th><i class="fas fa-university text-danger"></i> Last educational certificate</th>
<th><i class="fas fa-wrench text-danger"></i> Expertise</th>
</tr>
</thead>
<tbody>
<tr>
<?php echo "<td>" . $row['lastedce'] . "</td>";?>
<?php echo "<td>" . $row['expertise'] . "</td>";?>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th><i class="fa fa-venus-mars text-danger"></i> Sex</th>
<th><i class="fas fa-user-md text-danger"></i> Job</th>
<th><i class="fas fa-user-clock text-danger"></i> shift</th>
<th><i class="fas fa-list-ul text-danger"></i> Line</th>
<th><i class="feather icon-headphones text-danger"></i> headsetcode</th>
</tr>
</thead>
<tbody>
<tr>
<?php echo "<td>" . $row['sex'] . "</td>";?>
<?php echo "<td>" . $row['job'] . "</td>";?>
<?php echo "<td>" . $row['shift'] . "</td>";?>
<?php echo "<td>" . $row['line'] . "</td>";?>
<?php echo "<td>" . $row['headsetcode'] . "</td>";?>
</tr>
</tbody>
</table>
</div>
<div class="col-md-2">
<div class="designer m-t-30">
<a href="#!" class="btn btn-primary shadow-2 text-uppercase btn-block">Edit This Profile</a>
<?php endwhile; ?>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="Performance" role="tabpanel" aria-labelledby="profile-tab">
<div class="widget-timeline m-b-25">
</div>
</div>
</div>
</div>
</div>
</div>
<?php require_once 'section/Footer.php' ?>
این هم کد مربوط به صفحه search
<?php
require_once "functions.php";
AuthLogin();
$email = $_SESSION['email'];
$PersonnelCode = isset($_GET['PersonnelCode']) ? $_GET[('PersonnelCode')] : 1;
$statment = $pdo->prepare("SELECT * FROM persons WHERE PersonnelCode = :PersonnelCode");
$statment->bindParam("PersonnelCode" , $PersonnelCode , pdo::PARAM_INT);
$statment->execute();
//$PersonnelCode = $statment->fetch(PDO::FETCH_OBJ);
if(! empty($PersonnelCode)) {
//print_r($PersonnelCode);
//die;
}
else {
die("not user");
}
require "views/search.view.php";