Başka bir sayfada ayrı ayrı dizi ekranın her satırı nasıl yapılır?

0 Cevap php

Ben başka bir sayfada benim tabloda ekran bir satır nasıl anlamaya olamaz. Ben tek tek her satır yazdırılabilir yapmak ne yapmak istiyorum. İşte screen shot olduğunu.

İşte tablo (coupon_index.php) görüntülemek için kullanılan php:

<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
<div class="dashboard" id="dashboard">
<ul><?php echo current_account('/coupon/index.php'); ?></ul>
</div>
<div id="content" class="coupons-box clear">
<div class="box clear">
<div class="box-top"></div>
<div class="box-content">
<div class="head">
<h2>My <?php echo $INI['system']['couponname']; ?></h2>
<ul class="filter">
<li class="label">Category: </li>
<?php echo current_coupon_sub('index'); ?>

</ul>
</div>
<div class="sect">
<?php if($selector=='index'&&!$coupons){?>
<div class="notice">There is no usable <?php echo $INI['system']['couponname']; ?></div>
<?php }?>
<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
<tr><th width="300">Deal Item</th><th width="100" nowrap>Voucher's Number</th><th width="60" nowrap>Voucher's Password</th><th width="100" nowrap>Valid Till</th><th width="40">Email Voucher</th></tr>
<?php if(is_array($coupons)){foreach($coupons AS $index=>$one) { ?>
<tr <?php echo $index%2?'':'class="alt"'; ?>>
<td><a class="deal-title" href="/team.php?id=<?php echo $one['team_id']; ?>" target="_blank"><?php echo $teams[$one['team_id']]['title']; ?></a></td>
<td><?php echo $two['id']; ?></td>
<td><?php echo $two['secret']; ?></td>
<td><?php echo date('Y-m-d', $two['expire_time']); ?></td>
<td><a href="/coupon/print.php">Send</a></td>
</tr>
<?php }}?>
<tr><td colspan="5"><?php echo $pagestring; ?></td></tr>
</table>
</div>
</div>
<div class="box-bottom"></div>
</div>
</div>
<div id="sidebar">

</div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>

(index.php) ve daha fazla:

<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');

need_login();
$daytime = strtotime(date('Y-m-d'));
$condition = array(
'user_id' => $login_user_id,
'consume' => 'N',
"expire_time >= {$daytime}",
);

$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 10);
$coupons = DB::LimitQuery('coupon', array(
'condition' => $condition,
'coupon' => 'ORDER BY create_time DESC',
'size' => $pagesize,
'offset' => $offset,
));

$team_ids = Utility::GetColumn($coupons, 'team_id');
$teams = Table::Fetch('team', $team_ids);

include template('coupon_index');

Burada html (coupon_index.html) olduğunu:

<!--{include header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
    <div class="dashboard" id="dashboard">
        <ul>${current_account('/coupon/index.php')}</ul>
    </div>
    <div id="content" class="coupons-box clear">
        <div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>My {$INI['system']['couponname']}</h2>
                    <ul class="filter">
                        <li class="label">Category:  </li>
                        ${current_coupon_sub('index')}

                    </ul>
                </div>
                <div class="sect">
                    <!--{if $selector=='index'&&!$coupons}-->
                    <div class="notice">There is no usable {$INI['system']['couponname']}</div>
                    <!--{/if}-->
                    <table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
                    <tr><th width="300">Deal Item</th><th width="100" nowrap>Voucher's Number</th><th width="60" nowrap>Voucher's Password</th><th width="100" nowrap>Valid Till</th><th width="40">Print Voucher</th></tr>
                    <!--{loop $coupons $index $one}-->
                        <tr ${$index%2?'':'class="alt"'}>
                            <td><a class="deal-title" href="/team.php?id={$one['team_id']}" target="_blank">{$teams[$one['team_id']]['title']}</a></td>
                            <td>{$one['id']}</td>
                            <td>{$one['secret']}</td>
                            <td>${date('Y-m-d', $one['expire_time'])}</td>
                            <td></td>
                        </tr>   
                    <!--{/loop}-->
                        <tr><td colspan="5">{$pagestring}</td></tr>
                    </table>
                </div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
    <div id="sidebar">

    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<!--{include footer}-->

0 Cevap