Hey guys. I’m just wondering behind the logic of approve function (e.g. if User request an item, admin will see in hes/her table the request item and then the admin will click “approve” button to confirm);
below are my script:
HTML:
`<?php
`define(‘DBHOST’,’localhost’);
`define(‘DBNAME’,’db_aacadmin’);
`define(‘DBUSER’,’root’);
`define(‘DBPASS’,”);
`try
`{
`$conn = new PDO(“mysql:host=”.DBHOST.”;charset=utf8mb4;dbname=”.DBNAME, DBUSER,DBPASS);
`$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
`$qry = “SELECT * FROM tbl_woplnrfrm”;
`$stmt = $conn->prepare($qry);
`$stmt->execute();
`$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
`}
`catch(PDOException $e)
`{
`die(“Error Connection”.$e->getMessage());
`}
`?>
`<div class=”box-body” style=”max-width: 5000px; overflow: auto;”>
<table id=”example2″ class=”table table-bordered table-striped”>
<thead>
<tr>
<th>Item #</th>
<th>Date</th>
<th>WO #</th>
<th>Item Description</th>
<th>P/N / Specs</th>
<th>Qty</th>
<th>U/M</th>
<th>Purpose</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach($result as $value)
{
echo ‘<tr id=”plnr_id_’ .$value[‘plnr_id’]. ‘”data-id=”‘ .$value[‘plnr_id’]. ‘”>
<td>’ .$value[‘plnr_id’]. ‘</td>
<td>’ .$value[‘plnr_dte’]. ‘</td>
<td>’ .$value[‘plnr_wocde’]. ‘</td>
<td>’ .$value[‘plnr_itmdesc’]. ‘</td>
<td>’ .$value[‘plnr_pnspecs’]. ‘</td>
<td>’ .$value[‘plnr_qty’]. ‘</td>
<td>’ .$value[‘plnr_um’]. ‘</td>
<td>’ .$value[‘plnr_prpse’]. ‘</td>’;
echo “<td><a href=’#’ name=’approve’><i class=’fa fa-thumbs-up’> Approve</i></a>”; echo “ ”; echo “ ”;
echo “<a href=’#’><i class=’fa fa-eye’> View Attached File”;
}
?>
</tfoot>
</table>
</div>
<!– /.box-body –>
</div>
<!– /.box –>
</div>
<!– /.col –>
</div>
<!– /.row –>
</section>
<!– /.Left col –>
</div>
</div>
————————————————————————————————————————–
can someone help me the logic if the admin will approve, it will return to the user that the item request has been approve. Thank you for the help guys!!