Esempio n. 1
0
 }
 /* 获取商品类型存在规格的类型 */
 $specifications = get_goods_type_specifications();
 $goods['specifications_id'] = $specifications[$goods['goods_type']];
 $_attribute = get_goods_specifications_list($goods['goods_id']);
 $goods['_attribute'] = empty($_attribute) ? '' : 1;
 /* 根据商品重量的单位重新计算 */
 if ($goods['goods_weight'] > 0) {
     $goods['goods_weight_by_unit'] = $goods['goods_weight'] >= 1 ? $goods['goods_weight'] : $goods['goods_weight'] / 0.001;
 }
 if (!empty($goods['goods_brief'])) {
     $goods['goods_brief'] = trim_right($goods['goods_brief']);
     $goods['goods_brief'] = $goods['goods_brief'];
 }
 if (!empty($goods['keywords'])) {
     $goods['keywords'] = trim_right($goods['keywords']);
     $goods['keywords'] = $goods['keywords'];
 }
 /* 如果不是促销,处理促销日期 */
 if (isset($goods['is_promote']) && $goods['is_promote'] == '0') {
     unset($goods['promote_start_date']);
     unset($goods['promote_end_date']);
 } else {
     $goods['promote_start_date'] = local_date('Y-m-d', $goods['promote_start_date']);
     $goods['promote_end_date'] = local_date('Y-m-d', $goods['promote_end_date']);
 }
 /* 如果是复制商品,处理 */
 if ($_REQUEST['act'] == 'copy') {
     // 商品信息
     $goods['goods_id'] = 0;
     $goods['goods_sn'] = '';
    $drop_button = $this->block->generate_drop_icon('myinfo/myaccount/drop_work_rewards_error', "{id: {$work_rewards_error->id}}", TRUE);
    $id = $work_rewards_error->id;
    $work_id_arr = $this->work_rewards_model->fetch_worker_by_id($id);
    $worker = array();
    foreach ($work_id_arr as $work_id) {
        $worker[] = fetch_user_name_by_id($work_id['worker_id']);
    }
    $worker_id = implode(',', $worker);
    $edit_button = $this->block->generate_edit_link(site_url('myinfo/myaccount/work_rewards_error_edit', array($work_rewards_error->id)), FALSE);
    $department = $this->document_catalog_model->fetch_name_by_dept_id($work_rewards_error->department);
    if ($CI->is_super_user() or $priority > 1) {
        $drop_button .= $edit_button;
    } else {
        $drop_button = $edit_button;
    }
    $data[] = array(trim_right(substr($work_rewards_error->content_item, 0, 100)), $department, $work_rewards_error->result, $worker_id, $work_rewards_error->order_no, $work_rewards_error->author, lang($work_rewards_error->type), lang($work_rewards_error->status), $work_rewards_error->created_time, $drop_button);
}
$filters = array(array('type' => 'input', 'field' => 'content_item'), array('type' => 'dropdown', 'field' => 'department', 'options' => $dept), array('type' => 'input', 'field' => 'result'), array('type' => 'input', 'field' => 'name'), array('type' => 'input', 'field' => 'order_no'), array('type' => 'input', 'field' => 'author'));
$type = array('' => lang('please_select'), 'reward' => lang('reward'), 'pulish' => lang('pulish'));
$filters[] = array('type' => 'dropdown', 'field' => 'type', 'options' => $type, 'method' => '=');
$status = array('' => lang('please_select'), 'wait_for_proccess' => lang('wait_for_proccess'), 'completed' => lang('completed'));
$filters[] = array('type' => 'dropdown', 'field' => 'status', 'options' => $status, 'method' => '=');
$filters[] = array('type' => 'date', 'field' => 'created_time', 'method' => 'from_to');
$filters[] = '';
$title = lang('work_rewards_error');
echo block_header($title);
echo $this->block->generate_pagination('work_rewards');
$config = array('filters' => $filters);
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'work_rewards');
Esempio n. 3
0
/**
 * 截取UTF-8编码下字符串的函数
 *
 * @params str  $str     被截取的字符串
 * @params int  $length  截取的长度
 * @params bol  $append  是否附加省略号
 *
 * @return str
 */
function sub_str($str, $length = 0, $append = true)
{
    $str = trim($str);
    $len = strlen($str);
    if ($length == 0 || $length >= $len) {
        return $str;
    } else {
        if ($length < 0) {
            $length = $len + $length;
            if ($length < 0) {
                $length = $len;
            }
        }
    }
    if (function_exists('mb_substr')) {
        $newstr = mb_substr($str, 0, $length, 'UTF-8');
    } else {
        if (function_exists('iconv_substr')) {
            $newstr = iconv_substr($str, 0, $length, 'UTF-8');
        } else {
            $newstr = trim_right(substr($str, 0, $length));
        }
    }
    if ($append && $str != $newstr) {
        $newstr .= '...';
    }
    return $newstr;
}
Esempio n. 4
0
            <th align="left">链接ID</th>
            <th align="left">链接名称</th>
            <th align="left">链接地址</th>
            <th align="left">錄入時間</th>
            <th align="left">操作</th>
        </tr>
        <?php 
foreach ($this->rows as $row) {
    ?>
        <tr>
            <td align="left"><?php 
    echo $row['link_id'];
    ?>
</td>
            <td align="left"><?php 
    echo trim_right(substr($row['link_name'], 0, 100));
    ?>
</td>
            <td align="left"><?php 
    echo $row['link_url'];
    ?>
</td>

            <td align="left"><?php 
    echo date('Y-m-d H:i:s', $row['save_time']);
    ?>
</td>

            <td align="left">
                <a href="<?php 
    echo $row['link_url'];
Esempio n. 5
0
            <td align="center" colspan="6" height="50"><span class="warning">未找到录入记录</span></td>
            </tr>
        <?php 
} else {
    ?>

        <?php 
    foreach ($this->paginator as $row) {
        ?>
        <tr>
            <td align="left"><?php 
        echo $row['art_id'];
        ?>
</td>
            <td align="left"><?php 
        echo trim_right(substr($row['title'], 0, 100));
        ?>
</td>

            <td align="left"><?php 
        echo date('Y-m-d H:i:s', $row['save_time']);
        ?>
</td>
            <td align="left"><?php 
        echo $row['clicks'];
        ?>
</td>
            <td align="left"><?php 
        echo $row['comments'];
        ?>
</td>