<?php
// Get the search query from the AJAX request
$search = isset($_POST['search']) ? $_POST['search'] : '';

// Fetch filtered data from the database based on the search query
$result = get_data_for_articles_rzk($offset, $records_per_page, $search);

// Generate the HTML for the table rows
$html = '';
foreach ($result as $row) {
  $html .= '<tr>';
  $html .= '<td class="text-center">' . $row['itemcode'] . '</td>';
  $html .= '<td class="text-center">' . $row['itemname'] . '</td>';
  $html .= '<td class="text-center">';
  $html .= '<a href="#" onclick="loadUnitQuantity(\'' . $row['itemcode'] . '\')">' . $row['total_quantity'] . '</a>';
  $html .= '</td>';
  $html .= '</tr>';
}

// Send the generated HTML as the response
echo $html;
?>
