I have created a shortcode which renders this table on the frontend. At the moment the shortcode puts the content at the top of the page rather than respecting the location of where the shortcode is pasted in the editor.
How can i fix this?
<div id="cookie-container">
<div class="row justify-content-center mb-3">
<div class="col-12">
<h3>Essential Cookies</h3>
</div>
</div>
<table class="table table-bordered table-hover table-sm diva-cookie-table">
<thead class="diva-cookie-table__thead">
<tr>
<th style="width: 33%" class="diva-cookie-table__th">Name</th>
<th style="width: 33%" class="diva-cookie-table__th">Cookie</th>
<th style="width: 33%" class="diva-cookie-table__th">Purpose</th>
</tr>
</thead>
<tbody class="diva-cookie-table__tbody">
<tr>
<?php
$essential_cookies = carbon_get_theme_option( 'essential_cookies' );
foreach ( $essential_cookies as $cookie ) {
echo '<tr>';
if($cookie['name']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['name'];
echo '</td>';
}
if($cookie['cookies']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['cookies'];
echo '</td>';
}
if($cookie['usage']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['usage'];
echo '</td>';
}
}
echo '</tr>';
?>
</tr>
</tbody>
</table>
</div>
/**
* Construct Essential Cookies Shortcode
*/
function construct_essential_cookies_table()
{
ob_start();
include dirname( __FILE__ ) . '/partials/essential_cookie_table.php';
return ob_get_clean();
}
add_shortcode('diva_essential_cookies', 'construct_essential_cookies_table');
You need to include the full HTML code inside the php output buffer functions like that.
<?php ob_start(); ?>
<div id="cookie-container">
<div class="row justify-content-center mb-3">
<div class="col-12">
<h3>Essential Cookies</h3>
</div>
</div>
<table class="table table-bordered table-hover table-sm diva-cookie-table">
<thead class="diva-cookie-table__thead">
<tr>
<th style="width: 33%" class="diva-cookie-table__th">Name</th>
<th style="width: 33%" class="diva-cookie-table__th">Cookie</th>
<th style="width: 33%" class="diva-cookie-table__th">Purpose</th>
</tr>
</thead>
<tbody class="diva-cookie-table__tbody">
<tr>
<?php
$essential_cookies = carbon_get_theme_option( 'essential_cookies' );
foreach ( $essential_cookies as $cookie ) {
echo '<tr>';
if($cookie['name']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['name'];
echo '</td>';
}
if($cookie['cookies']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['cookies'];
echo '</td>';
}
if($cookie['usage']) {
echo '<td class="diva-cookie-table__title">';
echo $cookie['usage'];
echo '</td>';
}
}
echo '</tr>';
?>
</tr>
</tbody>
</table>
</div>
<?php return ob_get_clean();
Related
image link
Good day everyone i would like to ask if there is someone had a idea on how to make that specific column a link so that the user can download that pdf file.
This my Datatable
<table id="example" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th class="text-center align-middle">Control Number</th>
<th class="text-center align-middle">Attached Form</th>
<th class="text-center align-middle">P.R. Date.</th>
<th class="text-center align-middle">ABC/PR Amount.</th>
<th class="text-center align-middle">File</th>
</tr>
</thead>
<tbody>
<?php
if($logs){
foreach ($logs as $log){
?>
<tr>
<td class="<?php
if (empty($log->control_number)) {
echo "noactioncell";
}
else
{
echo "donecell";
}
?> text-center align-middle" >
<?php
if (!empty($log->control_number)) {
echo $log->control_number;
}
?>
</td>
<td class="<?php
if (empty($log->category)) {
echo "noactioncell";
}
else
{
echo "donecell";
}
?> text-center align-middle" >
<?php
if (!empty($log->category)) {
echo $log->category;
}
?>
</td>
<td class="<?php
if (empty($log->pr_date)) {
echo "noactioncell";
}
else
{
echo "donecell";
}
?> text-center align-middle" >
<?php
if (!empty($log->pr_date)) {
echo date("m/d/Y", strtotime($log->pr_date));
}
?>
</td>
<td class="<?php
if (empty($log->approve_budget )) {
echo "noactioncell";
}
else
{
echo "donecell";
}
?> text-center align-middle" >
<?php
if (!empty($log->approve_budget )) {
echo $log->approve_budget ;
}
?>
</td>
//Here is the column that i want to be a link to be downloaded
<td class="<?php
if (empty($log->file)) {
echo "noactioncell";
}
else
{
echo "donecell";
}
?> text-center align-middle" >
<?php
if (!empty($log->file )) {
echo $log->file ;
}
?>
</td>
////////////////////////////////////////////////////////////////////////
</tr>
<?php
}
}
?>
</tbody>
</table>
just create an anchor link
<?php
if (!empty($log->file )) {
echo '<a href="'.$log->file.'" target="_blank" >'.$log->file.'</a>';
}
i have that table and a div with a quicksearch and after i write 2 or 3 letters he show results, but then the div search dissapear after show the results and if i want to write something new, i have to refresh the page
thats the div
<table id="tabela" class="table admin">
<tr class="outro">
<th width="15%">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.quicksearch/2.3.1/jquery.quicksearch.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="form-group input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
<input name="consulta" id="txt_consulta" placeholder="Procurar..." type="text" class="form-control">
</div>
</th>
<th width="10%"></th>
<th width="30%"></th>
<th width="15%">
<img src="../assets/img/add.PNG" class="icone" />Adicionar utilizador
</a>
</th>
</tr>
<tr class="tabela">
<th width="10%">
<p>Nome</p>
</th>
<th width="5%"></th>
<th width="30%">
<p>Permissões</p>
</th>
<th width="10%"></th>
</tr>
<?php
foreach ($utilizadores as $key => $value) {
echo '<tr><td>' . '<p class="texto">' . $value->nome . '</p>' . '</td>';
echo '<td>' . '<button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal">' . '<p>Info</p>' . '</button></td>';
echo '<td>';
if ($value->tipo_user == "1") {
echo '<p class="texto">' . "Administrador" . '</p>';
} else if ($value->tipo_user == "2") {
echo '<p class="texto">' . "Gestor" . '</p>';
} else {
echo '<p class="texto">' . "Utilizador" . '</p>';
}
'</td>';
echo '<td>Eliminar</p></td></tr>';
}
?>
</table>
and thats the script
<script>
$('input#txt_consulta').quicksearch('table#tabela tbody tr');
</script>
what am i doing wrong?
It's because your quicksearch filters all rows of your table. You can solve that by giving your dynamically added rows a class and set quicksearch upon that class.
echo '<tr class="filter_row"><td>' . '<p class="texto">' . $value->nome . '</p>' . '</td>';
and then you have to add that to the configuration script:
<script>
$('input#txt_consulta').quicksearch('table#tabela tbody tr.filter_row');
</script>
Below I'll post my code and I am going to explain my problem: The fact is that this code should show the value of every record of the query that I established, the problem is that the query is right (cause I checked it on phpMyAdmin) but the page don't show me the <tbody>, it show me nothing, I tried to put a single echo output with the <td> tag but nothing, can someone solve my problem and see the error that I have done?
<div class="container-fluid col-lg-6">
<table class="table">
<thead class="thead-default">
<tr>
<th>ID Pratica</th>
<th>ID Utente</th>
<th>Data Inizio</th>
<th>Descrizione</th>
<th>Data Stimata</th>
<th>Stato</th>
</tr>
</thead>
<tbody>
<?php
$query_search_all="SELECT * FROM `pratiche`";
$result = mysql_query($query_search_all);
while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<td>".$row['id_pratica']."</td>";
echo "<td>".$row['id_utente']."</td>";
echo "<td>".$row['data_inizio']."</td>";
echo "<td>".$row['descrzione']."</td>";
echo "<td>".$row['data_stimata']."</td>";
echo "<td>".$row['stato']."</td>";
}
?>
</tbody>
</table>
</div>
You forgot the <tr> tag.
<div class="container-fluid col-lg-6">
<table class="table">
<thead class="thead-default">
<tr>
<th>ID Pratica</th>
<th>ID Utente</th>
<th>Data Inizio</th>
<th>Descrizione</th>
<th>Data Stimata</th>
<th>Stato</th>
</tr>
</thead>
<tbody>
<?php
$query_search_all="SELECT * FROM `pratiche`";
$result = mysql_query($query_search_all);
while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr>";
echo "<td>".$row['id_pratica']."</td>";
echo "<td>".$row['id_utente']."</td>";
echo "<td>".$row['data_inizio']."</td>";
echo "<td>".$row['descrzione']."</td>";
echo "<td>".$row['data_stimata']."</td>";
echo "<td>".$row['stato']."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
Can you please check the following code???
<?php
$query_search_all="SELECT * FROM pratiche ";
$result = mysql_query($query_search_all);
while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr>";
echo "<td>".$row['id_pratica']."</td>";
echo "<td>".$row['id_utente']."</td>";
echo "<td>".$row['data_inizio']."</td>";
echo "<td>".$row['descrzione']."</td>";
echo "<td>".$row['data_stimata']."</td>";
echo "<td>".$row['stato']."</td>";
echo "</tr>";
}
?>
I have a code :
<?php
getPriceListHeader();
function getPriceListDetail($PriceListCode)
{
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = "SELECT * FROM pricelisdetail where pricelist_code='".$PriceListCode."'";
$results = $readConnection->fetchAll($query);
echo "<table id='tbdata'>
<thead>
<tr>
<th>Price List Code</th>
<th>Price List Name</th>
<th>Effective From</th>
<th>Effective To</th>
</tr>
</thead>
<tbody> ";
foreach ($results as $row)
{
echo "<tr>";
echo "<td> ".$row[entity_id];
echo "<td> ".$row[sku];
echo "<td> ".$row[sku];
echo "<td> ".$row[sku];
};
echo " </tbody>
</table> ";
}
function getPriceListHeader()
{
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT * FROM pricelistheader';
$results = $readConnection->fetchAll($query);
echo "
<h2>Price List</h2>
<div>
<h3>Please select Price List</h3>
<div>
<select class='element select large' id='pricelist' name='element_2'>";
foreach ($results as $row)
{
echo '<option value="' . $row[entity_id]. '">' . $row[sku] . '</option>';
}
echo "</select>
</div>
<input type='button' class='button' name='insert' value='Get Data' onclick='getPriceListDetail(pricelist.value)'/>
";
getPriceListDetail('');
}
?>
I have a dropdown list, a button, a table
When I select a value from dropdown list, then I click button , table will be filled data again. There are 2 method, getPriceListHeader(): load data header when load the page, getPriceListDetail : load data detail when click a button. I try to put event getPriceListDetail(value) to button, but when I click, nothing happens
Please help me how to do this.
Yes, you can call php via ajax request to server like this (very simple):
Note that the following code uses jQuery
jQuery.ajax({
type: "POST",
url: 'my_php_function.php',
dataType: 'name_the_data_type',
success: function (data) {
// here you will get the response your function
}
});
and my_php_function.php like this:
<?php
// here is your php code or function
?>
from the source How can I call PHP functions by JavaScript?
You can't attach PHP function to HTML. PHP is server-side language, so after it's displayed in users browser you can't refer to PHP again, unless you reload page.
There are 3 options I think you can do:
Reload page after changing select page and using GET prepare new data.
Send all data to user browser and than show only part of it related to selected option.
Use AJAX and ask server for new data in background.
Finally, I found out the way.It works for me. Now, I do not understand the code , I am trying to read and get it clearly.
Thanks all for your comments.
$to="";
$from="";
$show_order_statuses = 0;
$orserstatus = "";
$result_order = 0;
//var_dump($results);
//return;
if(!empty($_REQUEST['filter_type']))
{
$orders_row = array();
$filter_type = $_REQUEST['filter_type'];
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = " SELECT * FROM pricelistitem where pricelist_code='".$filter_type."' ";
// $query = 'SELECT * FROM pricelistheader1';
$results = $readConnection->fetchAll($query);
foreach ($results as $rowid)
{
$result_order=10;
$orders_row[]=array($rowid['pricelist_code'],$rowid['product_code'],number_format( $rowid['unitprice'],2),$rowid['UOM']);
// $orders_row[]=array(1,1,1,1,1);
}
}
?>
<div id="anchor-content" class="middle">
<div id="page:main-container">
<div class="content-header">
<table cellspacing="0">
<tbody>
<tr>
<td style="width:50%;"><h3 class="icon-head head-report-sales-sales"><?php echo $this->__("Price List");?></h3></td>
<td class="form-buttons"><button style="" onclick="filterFormSubmit.submit()" class="scalable " type="button" id="id_<?php echo Mage::getSingleton('core/session')->getFormKey() ?>"><span>Show Report</span></button></td>
</tr>
</tbody>
</table>
</div>
<div>
<div class="entry-edit">
<form method="get" action="<?php echo Mage::helper('core/url')->getCurrentUrl();?>" id="filter_form">
<?php /*?><input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" /><?php */?>
<div class="entry-edit-head">
<h4 class="icon-head head-edit-form fieldset-legend">Filter</h4>
<div class="form-buttons"></div>
</div>
<div id="sales_report_base_fieldset" class="fieldset">
<div class="hor-scroll">
<table cellspacing="0" class="form-list">
<tbody>
<tr>
<td class="label"><label for="sales_report_filter_type">Filter By <span class="required">*</span></label></td>
<td class="value">
<select class="required-entry select" name="filter_type" id="sales_report_filter_type" onchange="myFunction();">
<?php
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = " SELECT * FROM pricelistheader ";
$results = $readConnection->fetchAll($query);
$so=1;
foreach ($results as $row)
{
$selected='';
if ($filter_type==$row[pricelist_code])
$selected= ' selected=selected';
else
$selected='';
echo '<option value="' . $row[pricelist_code]. '" '.$selected.' >' . $row[pricelist_name].' '. $row[pricelist_code] . '</option>';
}
?>
</select>
</tr>
<tr>
<td class="label"><label for="effect_from">Effect From </label></td>
<td class="value">
<?php
foreach ($results as $row)
{
if ($filter_type==$row[pricelist_code])
echo $row[pricelist_fromdate];
}
?>
</td>
</tr>
<tr>
<td class="label"><label for="effect_from">Effect To </label></td>
<td class="value">
<?php
foreach ($results as $row)
{
if ($filter_type==$row[pricelist_code])
echo $row[pricelist_todate];
}
?>
</td>
</tr>
</tbody>
<script>
function myFunction() {
// document.getElementById("tbdata").deleteRow(1);
var rowCount = tbdata.rows.length;
for (var i = rowCount - 1; i > 0; i--) {
tbdata.deleteRow(i);
}
srt.value=pricelist.options[pricelist.selectedIndex].value;
";
//$('#tbdata').empty();
}
</script>
</table>
</div>
</div>
</form>
</div>
<script type="text/javascript">
//<![CDATA[
var filterFormSubmit = new varienForm('filter_form');
//]]>
</script>
<script type="text/javascript"> new FormElementDependenceController({"sales_report_order_statuses":{"sales_report_show_order_statuses":"1"}}); </script>
<style type="text/css">
.no-display{display:none;}
</style>
</div>
<div>
<?php if($result_order>0){?>
<table cellspacing="0" class="actions">
<tbody>
<tr>
<td class="pager"> </td>
<td class="export a-right">
<form method="post" action="<?php echo $this->getUrl('*/*/exportCsv')?>" id="csv_form_customer">
<input name="form_key_customer" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
</form>
<script type="text/javascript">
//<![CDATA[
var csvFormSubmitcustomer = new varienForm('csv_form_customer');
//]]>
</script>
</td>
<td class="filter-actions a-right">
<img class="v-middle" alt="" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>skin/adminhtml/default/default/images/icon_export.gif"> Export to:
<select style="width:8em;" id="sales_order_grid_export_customer" name="sales_order_grid_export_customer">
<option value="<?php echo $this->getUrl('*/*/exportCsv')?>">CSV</option>
</select>
<button onclick="csvFormSubmitcustomer.submit()" class="scalable task" type="button"><span>Export</span></button>
</td>
</tr>
</tbody>
</table>
<?php } ?>
<div id="id_customer<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" class="print_customer<?php echo Mage::getSingleton('core/session')->getFormKey() ?>">
<div class="grid">
<div class="hor-scroll">
<table cellspacing="0" id="id_customer<?php echo Mage::getSingleton('core/session')->getFormKey() ?>_table" class="data">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr class="headings">
<th class=" no-link"><span class="nobr">Price List Code</span></th>
<th class=" no-link"><span class="nobr">Cust Code</span></th>
<th class=" no-link"><span class="nobr">Cust Name</span></th>
</tr>
</thead>
<tbody id="">
<?php
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = " SELECT * FROM " . $resource->getTableName('catalog/product');;
$customercount=0;
$customerresults = $readConnection->fetchAll($query);
$customerresults = Mage::getModel('customer/customer')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('erp_pricelistcode_1', $filter_type)
// ->addFieldToSelect (array('created_at','customer_id','increment_id','updated_at','status','entity_id','state'))
;
// ->addAttributeToFilter('erp_pricelistcode_1','00')->load();
$so=1;
foreach ($customerresults as $row) {
$customercount++;
}
// var_dump(#$customerresults);
if($customercount>0){
foreach($customerresults as $singlerows){
$cot=0;
{
echo "<tr>";
{
$cot++;
?>
<td>
<?php
echo $singlerows->getData('erp_pricelistcode_1');
?>
</td>
<td>
<?php
echo $singlerows->getFirstname();
?>
</td>
<td>
<?php
echo $singlerows->getName();
?>
</td>
<?php
}
echo "</tr>";
}
}
}else{
?>
<tr class="even">
<td colspan="13" class="empty-text a-center">No records found.</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div>
<?php if($result_order>0){?>
<table cellspacing="0" class="actions">
<tbody>
<tr>
<td class="pager"> </td>
<td class="export a-right">
<form method="post" action="<?php echo $this->getUrl('*/*/exportCsv')?>" id="csv_form">
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
</form>
<script type="text/javascript">
//<![CDATA[
var csvFormSubmit = new varienForm('csv_form');
//]]>
</script>
</td>
<td class="filter-actions a-right">
<img class="v-middle" alt="" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>skin/adminhtml/default/default/images/icon_export.gif"> Export to:
<select style="width:8em;" id="sales_order_grid_export" name="sales_order_grid_export">
<option value="<?php echo $this->getUrl('*/*/exportCsv')?>">CSV</option>
</select>
<button onclick="csvFormSubmit.submit()" class="scalable task" type="button"><span>Export</span></button>
</td>
</tr>
</tbody>
</table>
<?php } ?>
<div id="id_<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" class="print_<?php echo Mage::getSingleton('core/session')->getFormKey() ?>">
<div class="grid">
<div class="hor-scroll">
<table cellspacing="0" id="id_<?php echo Mage::getSingleton('core/session')->getFormKey() ?>_table" class="data">
<colgroup>
<col>
<col>
<col>
<col>
</colgroup>
<thead>
<tr class="headings">
<th class=" no-link"><span class="nobr">Price List Code</span></th>
<th class=" no-link"><span class="nobr">Product Code</span></th>
<th class=" no-link"><span class="nobr">Unit Price</span></th>
<th class=" no-link"><span class="nobr">UOM</span></th>
</tr>
</thead>
<tbody id="">
<?php
$cot=0;
if(count($orders_row)>0){
foreach($orders_row as $singlerows){
$cot=0;
if(!empty($singlerows)){
echo "<tr>";
foreach($singlerows as $value){
$cot++;
?>
<td>
<?php
if ($cot==3 )
echo "<div style='float:right;width:30%;'>";
echo $value;
echo "</div>";
?>
</td>
<?php
}
echo "</tr>";
}
}
}else{
?>
<tr class="even">
<td colspan="13" class="empty-text a-center">No records found.</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
This code works when I have data rows returned for the messages object but when there isn't I have it returning NULL in which case I am having a hard time getting this code to still show up correctly so that it works with the tabs plugin I have up. I'm using datatables for my tables.
Anybody have any ideas?
<!-- Start of the main content -->
<div id="main_content">
<h2 class="grid_12">Personal Messages</h2>
<div class="clean"></div>
<div class="grid_8">
<div id="tab-panel-1" class="box">
<div class="header">
<img src="<?php echo base_url() ?>assets/img/icons/packs/fugue/16x16/shadeless/mail.png" width="16" height="16" />
<h3>Messages</h3><span></span>
<ul>
<li>Inbox Messages</li>
<li>Sent Messages</li>
<li>Compose Message</li>
</ul>
</div>
<div class="content">
<div id="tab-1" class="tab-content">
<table id="inbox" class="table dataTable">
<thead>
<tr>
<th></th>
<th>Date</th>
<th>Subject</th>
<th>From</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
if ($messages[0] !== NULL)
{
foreach ($messages[0] AS $message)
{
echo '<tr>';
echo '<td style="text-align: center">';
if ($message->message_read == 1)
{
echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-open.png />';
}
else
{
echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail.png />';
}
echo '</td>';
echo '<td>'.date('F d, Y', strtotime($message->date_sent)).'</td>';
echo '<td>'.$message->subject.'</td>';
echo '<td>'.$message->first_name.' '.$message->last_name.'</td>';
echo '<td></td>';
echo '</tr>';
}
}
else
{
echo '<tr>';
echo 'No records';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<div id="tab-2" class="tab-content">
<table id="sent" class="table dataTable">
<thead>
<tr>
<th></th>
<th>Date</th>
<th>Subject</th>
<th>To</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
if ($messages[1] !== NULL)
{
foreach ($messages[1] AS $message)
{
echo '<tr>';
echo '<td style="text-align: center">';
if ($message->message_read == 1)
{
echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-open.png />';
}
else
{
echo '<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail.png />';
}
echo '</td>';
echo '<td>'.date('F d, Y', strtotime($message->date_sent)).'</td>';
echo '<td>'.$message->subject.'</td>';
echo '<td>'.$message->first_name.' '.$message->last_name.'</td>';
echo '<td></td>';
echo '</tr>';
}
}
else
{
echo '<tr>';
echo 'No records';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<div id="tab-3" class="tab-content">
<?php echo form_open('') ?>
<div class="_100">
<p>
<?php echo form_label('Recipient', 'recipient'); ?>
<select name="to" class="required">
<option></option>
<?php
foreach ($users AS $user)
{
echo '<option>'.$user->first_name.' '.$user->last_name.'</option>';
}
?>
</select>
</p>
</div>
<div class="_100">
<?php echo form_label('Subject', 'subject'); ?>
<?php echo form_input('subject', '', 'class=required'); ?>
</div>
<div class="_100">
<?php echo form_label('Message', 'message'); ?>
<?php echo form_textarea('message', '', 'class=required'); ?>
</div>
<?php echo form_hidden('sender', $this->session->userdata('user_id')); ?>
<div class="actions">
<div class="actions-left">
<?php echo form_reset('reset', 'Reset'); ?>
</div>
<div class="actions-right">
<?php echo form_submit(array('id' => 'submit', 'name' => 'submit'), 'Submit Message'); ?>
</div>
</div>
<?php echo form_close(); ?>
</div>
</div> <!-- End of .content -->
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
Heres what its doing:
http://jsfiddle.net/MGram/
echo '<tr>';
echo 'No records';
echo '</tr>';
needs td
echo '<tr><td colspan="5">';
echo 'No records';
echo '</td></tr>';
There seems to be an issue with javascript and the instantiation of the tabs plugin. I don't see the js for the tabs anywhere. But I did see that there is a CI error on the page in a select:
<select name="to" class="required">
<option></option>
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Invalid argument supplied for foreach()</p>
<p>Filename: views/pmsystem.php</p>
<p>Line Number: 121</p>
</div> </select>
which can sometimes mess up javascript stuff.
Are you getting anything in the error console?
Can we see the js?