function sorting_info($columnName) { //just testing $sort_by = isset($_GET['sort_by']) ? $_GET['sort_by'] : ''; $order = isset($_GET['order']) ? $_GET['order'] : ''; if ($sort_by == $columnName && $order == 'asc') { $order = 'desc'; } else { $order = 'asc'; } $query_string = merge_query($_SERVER['QUERY_STRING'], array('sort_by' => $columnName, 'order' => $order, 'page' => 0)); $link = url_path() . "?" . $query_string; return $link; ////////////////////////////////// }
</td> <td><?php echo round($shortage->rate, 2); ?> </td> <td><?php echo rupee_format(round($shortage->shortage_amount, 2)); ?> </td> <td> <a href="<?php echo base_url() . "shortages/edit/" . $shortage->shortage_id; ?> " class="edit_shortage btn btn-xs btn-warning">Edit</a> <a class="btn btn-xs btn-danger" onclick="return confirm_deleting()" href="<?php echo url_path() . "?" . merge_query($_SERVER['QUERY_STRING'], array('del' => $shortage->shortage_id)); ?> ">Del</a> <?php if ($shortage->committed == false) { ?> <a href="#commit-shortages-popup" onclick="set_shortage_id_for_commit(<?php echo $shortage->shortage_id; ?> )" class="open-commit-shortages-popup btn btn-xs btn-primary"> Commit</a> <?php } ?> </td> </tr>