function render_table($schema, $data, $classname = false) { global $acl; if (!in_array('edit', $acl)) { unset($schema['edit']); } if (!in_array('delete', $acl)) { unset($schema['delete']); } $found = false; ?> <table width="100%" class="table table-striped<?php echo $classname != false ? ' ' . $classname : ''; ?> "><thead><tr> <?php $cmd_opened = false; foreach ($schema as $col => $meta) { if (!isset($meta['table']) || $meta['table']) { if (isset($meta['cmd']) || isset($meta['onclick'])) { if (!$cmd_opened) { echo '<th width="120" class="action_btns">Actions'; $cmd_opened = true; } } else { ?> <th><?php echo $meta[0]; ?> </th><?php } } } if ($cmd_opened) { echo '</th>'; } ?> </tr></thead><tbody><?php $key = false; if (is_array($data)) { foreach ($data as $row) { render_row($row, $schema, $found); } } else { while ($row = row_assoc($data)) { render_row($row, $schema, $found); } } if (!$found) { ?> <tr class="no-records"><td colspan="99"><i>No records to display</i></td></tr><?php } ?> </tbody></table><?php }
render_rev_slider($singlebox['rev_slider']); break; case "standard_slider": render_standard_slider($singlebox['standard_slider']); break; case "soundcloud": render_soundcloud($singlebox); break; case "simple_video": post_format_video($singlebox, $counter); break; case "google_map": render_googlemap($singlebox); break; case "row": render_row($singlebox); break; case "service_column": render_service_column($singlebox); break; case "service_box": render_service_box($singlebox); break; case "testimonial": render_testimonial($singlebox); break; case "pricing_table": render_pricing_table($singlebox['pricing_table']); break; case "portfolio_excerpt": lambda_portfolio_columns($singlebox, $counter, true);