www.gusucode.com > CPF开源的PHP SNS问答社区 v0.7源码程序 > code/src/app/admin/templates/adminlte/settings/friendsLink.tpl.php

    <form action="" class="form" method="post">
    <div class="box">
        <div class="box-body table-responsive">
            <table class="table table-bordered">
                <tr>
                    <th>ID</th>
                    <th style="width:100px;min-width: 150px">名称</th>
                    <th style="width:100px;">状态</th>
                    <th style="min-width: 250px">网址</th>
                    <th style="min-width: 250px">图片链接</th>
                    <th style="width:80px;min-width: 80px">排序</th>
                    <th>操作</th>
                </tr>

                <?php
                if (!empty($data['list'])) {
                    foreach ($data['list'] as $link) {
                        $site_name = $this->input('text', array(
                            'name' => "update[{$link['id']}][site_name]",
                            'value' => $link['site_name'],
                            'class' => 'form-control'
                        ));

                        $url = $this->input('text', array(
                            'name' => "update[{$link['id']}][url]",
                            'value' => $link['url'],
                            'class' => 'form-control'
                        ));

                        $logo = $this->input('text', array(
                            'name' => "update[{$link['id']}][logo]",
                            'value' => $link['logo'],
                            'class' => 'form-control'
                        ));

                        $status_input_params = array(
                            'name' => "update[{$link['id']}][status]",
                            'data-toggle' => 'toggle',
                            'data-on' => '有效',
                            'data-off' => '无效',
                            'data-size' => 'small'
                        );

                        if ($link['status']) {
                            $status_input_params['checked'] = 1;
                        }

                        $status = $this->input('checkbox', $status_input_params);
                        $sort = $this->input('text', array(
                            'name' => "update[{$link['id']}][sort]",
                            'value' => $link['sort'],
                            'class' => 'form-control'
                        ));

                        $del_act_link = $this->url('settings:friendsLink', array('act' => 'del', 'id' => $link['id']));
                        ?>
                        <tr>
                            <td><?php echo $link['id'] ?></td>
                            <td><?php echo $site_name ?></td>
                            <td><?php echo $status ?></td>
                            <td><?php echo $url ?></td>
                            <td><?php echo $logo ?></td>
                            <td><?php echo $sort ?></td>
                            <td>
                                <a href="javascript:void(0)" class="confirm-href-flag"
                                   action="<?php echo $del_act_link ?>">删除</a>
                            </td>
                        </tr>
                        <?php
                    }
                }
                ?>
                <tr>
                    <td>+</td>
                    <td>
                        <input type="text" name="new[site_name]" class="form-control">
                    </td>
                    <td>
                        <input type="checkbox" name="new[status]" class="form-control"
                               data-on="有效" data-off="无效" data-size="small" checked data-toggle="toggle">
                    </td>
                    <td>
                        <input type="text" name="new[url]" class="form-control">
                    </td>
                    <td>
                        <input type="text" name="new[logo]" class="form-control">
                    </td>
                    <td>
                        <input type="text" name="new[sort]" class="form-control">
                    </td>
                    <td>

                    </td>
                </tr>
            </table>
        </div>
        <div class="box-footer">
            <input type="submit" value="保存" class="btn btn-primary">
            <div class="pull-right pagination-no-margin">
                <?php echo $this->page($data['page']) ?>
            </div>
        </div>
    </div>
</form>

<?php
/**
 * @author wonli <wonli@live.com>
 * list.tpl.php
 */