Php 显示表行
仅当我的条件满足时,我才希望显示带有按钮的表格行 (例如:Php 显示表行,php,codeigniter,html-table,Php,Codeigniter,Html Table,仅当我的条件满足时,我才希望显示带有按钮的表格行 (例如:if($row->Estado=='Aceptado')) 代码: <?php if ($cotizaciones!= FALSE) {?> <table id="verlistacli" class="display" cellspacing="0" width="100%"> <thead> <tr> <th>Id Cotizacion</t
if($row->Estado=='Aceptado')
)
代码:
<?php
if ($cotizaciones!= FALSE) {?>
<table id="verlistacli" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Id Cotizacion</th>
<th>Fecha Cotizacion</th>
<th>Tipo Trabajo</th>
<th>Origen del Material</th>
<th>Material</th>
<th>Dimensiones</th>
<th>Cantidad</th>
<th>Estado</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($cotizaciones->result() as $row) {
echo "<tr>";
echo"<td>".$row->IdCotizacion."</td>";
echo "<td>".$row->FechaCotizacion."</td>";
if ($row->TipoTrabajo==0) {
echo "<td>Fabricacion</td>";
}else{
echo "<td>Reparacion</td>";
};
if ($row->OrigenMaterial==0) {
echo "<td>Empresa</td>";
}else{
echo "<td>Cliente</td>";
};
echo "<td>".$row->Material."</td>";
echo "<td>".$row->Alto."x".$row->Ancho."x".$row->Largo."</td>";
echo "<td>".$row->Cantidad."</td>";
echo "<td>".$row->Estado."</td>";
if ($row->Estado=='Aceptado'){
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
}?>
<?php echo "</tr>";
}
?>
</tbody>
</table>
<input type="button" class="btn btn-default" value="Volver"
onclick="history.back(-1)" />
<?php }else{
echo "<h2> No hay cotizaciones <h2>";
}?>
if ($row->Estado=='Aceptado'){ ?> <!--here you need to close php tag -->
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
<?php } ?>
身份协同
费恰共治
蒂波特拉巴霍
原材料
材料
尺寸
康蒂达
埃斯塔多
如果($row->Estado=='Aceptado')满足条件,则返回语法错误。请在html之前关闭php。您无法打开php标记内的php标记,因为php标记显示语法错误 示例
<?php
if ($cotizaciones!= FALSE) {?>
<table id="verlistacli" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Id Cotizacion</th>
<th>Fecha Cotizacion</th>
<th>Tipo Trabajo</th>
<th>Origen del Material</th>
<th>Material</th>
<th>Dimensiones</th>
<th>Cantidad</th>
<th>Estado</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($cotizaciones->result() as $row) {
echo "<tr>";
echo"<td>".$row->IdCotizacion."</td>";
echo "<td>".$row->FechaCotizacion."</td>";
if ($row->TipoTrabajo==0) {
echo "<td>Fabricacion</td>";
}else{
echo "<td>Reparacion</td>";
};
if ($row->OrigenMaterial==0) {
echo "<td>Empresa</td>";
}else{
echo "<td>Cliente</td>";
};
echo "<td>".$row->Material."</td>";
echo "<td>".$row->Alto."x".$row->Ancho."x".$row->Largo."</td>";
echo "<td>".$row->Cantidad."</td>";
echo "<td>".$row->Estado."</td>";
if ($row->Estado=='Aceptado'){
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
}?>
<?php echo "</tr>";
}
?>
</tbody>
</table>
<input type="button" class="btn btn-default" value="Volver"
onclick="history.back(-1)" />
<?php }else{
echo "<h2> No hay cotizaciones <h2>";
}?>
if ($row->Estado=='Aceptado'){ ?> <!--here you need to close php tag -->
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
<?php } ?>
if($row->Estado=='Aceptado'){?>
请在html之前关闭php。您无法打开php标记内的php标记,因为php标记显示语法错误
示例
<?php
if ($cotizaciones!= FALSE) {?>
<table id="verlistacli" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Id Cotizacion</th>
<th>Fecha Cotizacion</th>
<th>Tipo Trabajo</th>
<th>Origen del Material</th>
<th>Material</th>
<th>Dimensiones</th>
<th>Cantidad</th>
<th>Estado</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($cotizaciones->result() as $row) {
echo "<tr>";
echo"<td>".$row->IdCotizacion."</td>";
echo "<td>".$row->FechaCotizacion."</td>";
if ($row->TipoTrabajo==0) {
echo "<td>Fabricacion</td>";
}else{
echo "<td>Reparacion</td>";
};
if ($row->OrigenMaterial==0) {
echo "<td>Empresa</td>";
}else{
echo "<td>Cliente</td>";
};
echo "<td>".$row->Material."</td>";
echo "<td>".$row->Alto."x".$row->Ancho."x".$row->Largo."</td>";
echo "<td>".$row->Cantidad."</td>";
echo "<td>".$row->Estado."</td>";
if ($row->Estado=='Aceptado'){
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
}?>
<?php echo "</tr>";
}
?>
</tbody>
</table>
<input type="button" class="btn btn-default" value="Volver"
onclick="history.back(-1)" />
<?php }else{
echo "<h2> No hay cotizaciones <h2>";
}?>
if ($row->Estado=='Aceptado'){ ?> <!--here you need to close php tag -->
<td><a class='btn-sm btn-info' href="<?php echo base_url('profile/detallecotizacioncli/'.$row->IdCotizacion); ?>">Detalles</a></td>
<?php } ?>
if($row->Estado=='Aceptado'){?>