Hell everyone i have datatables set up right now and i want to convert it over to server-side processing
Link to Script
right now i am using this code which seems to be very inefficient now that the database is getting larger. Would anyone want to help me convert this over to a server sided script like the one in the link above
also i would need to convert it to PDO because its better.
<?php
//connect to database
include 'Model/DBAdapter.php';
//create sql statement
$sql = "SELECT RMA_Number, Person_Calling, Company_Name, Unit_Serial_Number,
CONCAT(Employee_First_Name,' ',Employee_Last_Name) AS Employee_Name,
Call_Date,Received_Date,RMA_Status, Reason_For_Return, Notes, New_Install,
New_Unit_Serial_Number, Terminal_ID, Account_Number, Account_Name FROM RMA
JOIN Companies ON RMA.Company_ID = Companies.Company_ID
JOIN Employees ON RMA.Employee_ID = Employees.Employee_ID";
//Retrieve data
$result = $connection->query($sql);
//process results
if ($result) {
//loop through data
while ($view = $result->fetch()) {
$views[] = $view;
}
//display
include 'View/View.html.php';
} else {
//error message
$output = "No RMA found in database.";
include 'View/Template.html.php';
}
<body>
<div id="wrapper">
<h1 id="tableTitle">RMA's Submitted</h1>
<table id="table">
<thead>
<tr>
<th>RMA Number</th>
<th>Person Calling</th>
<th>Company ID</th>
<th>ISN</th>
<th>Employee</th>
<th>Call Date</th>
<th>Received Date</th>
<th>RMA Status</th>
<th>Reason for Return</th>
<th>Notes</th>
<th>New Install</th>
<th>New Serial Number</th>
<th>Terminal ID</th>
<th>Account Number</th>
<th>Account Name</th>
</tr>
</thead>
<tbody>
<?php foreach ($views as $view): ?>
<tr>
<td><?php echo $view['RMA_Number']; ?></td>
<td><?php echo $view['Person_Calling']; ?></td>
<td><?php echo $view['Company_Name']; ?></td>
<td><?php echo $view['Unit_Serial_Number']; ?></td>
<td><?php echo $view['Employee_Name']; ?></td>
<td><?php echo $view['Call_Date']; ?></td>
<td><?php echo $view['Received_Date']; ?></td>
<td><?php echo $view['RMA_Status']; ?></td>
<td><?php echo $view['Reason_For_Return']; ?></td>
<td><?php echo $view['Notes']; ?></td>
<td><?php echo $view['New_Install']; ?></td>
<td><?php echo $view['New_Unit_Serial_Number']; ?></td>
<td><?php echo $view['Terminal_ID']; ?></td>
<td><?php echo $view['Account_Number']; ?></td>
<td><?php echo $view['Account_Name']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>