Exemplo n.º 1
0
<?php

/**
 * Created by PhpStorm.
 * User: administrator
 * Date: 2015/8/19
 * Time: 13:44
 */
require_once '../include.php';
echo cate(15);
Exemplo n.º 2
0
                                        } else {
                                            if (preg_match("/film/i", $i2)) {
                                                return "Film";
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
$cate = cate($table[$select]);
var_dump($cate);
$s = "select video_count from {$table[$select]} limit 1";
$r = mysql_query($s);
$i = 0;
while ($line = mysql_fetch_array($r, MYSQL_ASSOC)) {
    $viewoftop = $line['video_count'];
    $i++;
}
//echo( $viewoftop.":".$i."\n");
//var_dump($week100);
$s = "select * from {$week100} where category = '{$cate}'";
//echo($s."\n");
$r = mysql_query($s);
$i = 0;
while ($line = mysql_fetch_array($r, MYSQL_ASSOC)) {
Exemplo n.º 3
0
function souwu_goods_list()
{
    $GLOBALS['db']->query('set names utf8');
    $filter['productcatename'] = empty($_REQUEST['productcatename']) ? '' : trim($_REQUEST['productcatename']);
    $filter['keyword'] = empty($_REQUEST['keyword']) ? '' : trim($_REQUEST['keyword']);
    $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'id' : trim($_REQUEST['sort_by']);
    $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
    /* 关键字 */
    if (!empty($filter['keyword'])) {
        $where .= " AND (producttitle LIKE '%" . mysql_like_quote($filter['keyword']) . "%' OR productcatenamestr LIKE '%" . mysql_like_quote($filter['keyword']) . "%')";
    }
    if (!empty($filter['productcatename'])) {
        $where .= " AND productcatename = {$filter['productcatename']}";
    }
    $sql = "SELECT  COUNT(*) FROM  " . $GLOBALS['ecs']->table('souwu_goods') . "WHERE showtype = 1 and productnum > 0 {$where} order by {$filter['sort_by']} {$filter['sort_order']}";
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    $goods_res_sql = "SELECT productcatename,and_add,id,producttitle, markprice,costprice,productnum,productcatenamestr,classPath FROM  " . $GLOBALS['ecs']->table('souwu_goods') . " WHERE showtype = 1 and productnum > 0 {$where} order by {$filter['sort_by']} {$filter['sort_order']}  LIMIT " . $filter['start'] . ", " . $filter['page_size'] . "";
    $filter['keywords'] = stripslashes($filter['keywords']);
    set_filter($filter, $goods_res_sql);
    $goods_res = $GLOBALS['db']->getAll($goods_res_sql);
    cate($filter['productcatename']);
    $arr = array('goods_res' => $goods_res, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
    return $arr;
}