Exemplo n.º 1
0
function getBarcode($barcode)
{
    $data = mysql_fetch_assoc(query("select * from panelie_barcode where value='{$barcode}'"));
    $res['barcode_qty'] = $data['product_qty'];
    $res['measure'] = $data['product_measure'];
    $res['product_name'] = $data['attribute_1'];
    $res['company_name'] = $data['company_name'];
    $brands = array('BrandOwner_ID' => array('table' => 'panelie_brand_owners', 'field' => 'brand_owner'), 'Brand_ID' => array('table' => 'panelie_brands', 'field' => 'brand'), 'SubBrand_ID' => array('table' => 'panelie_brand_subunits', 'field' => 'subbrand'), 'ProductGeneralType_ID' => array('table' => 'panelie_brand_generaltype', 'field' => 'generaltype'));
    foreach ($brands as $k => $v) {
        if (!$data[$k]) {
            continue;
        }
        $tmp = mysql_fetch_assoc(query('select * from ' . $v['table'] . ' where id=' . $data[$k]));
        $res[$v['field'] . '_name'] = $tmp['name'];
        $res[$v['field'] . '_id'] = $data[$k];
    }
    $res = array_merge($res, getGPC($data['GPC_SegmentID'], 'segments', 'segment'));
    $res = array_merge($res, getGPC($data['GPC_Family_ID'], 'families', 'family'));
    $res = array_merge($res, getGPC($data['GPC_Class_ID'], 'classes', 'class'));
    $res = array_merge($res, getGPC($data['GPC_Brick_ID'], 'bricks', 'brick'));
    for ($i = 1; $i <= 7; $i++) {
        $res = array_merge($res, getGpcAttrib($data, $i));
    }
    $res = array_merge($res, getCover($data['CoverCode']));
    return $res;
}
Exemplo n.º 2
0
 /**
  * getHotList
  * 推荐列表
  * @param mixed $map
  * @param mixed $act
  */
 public function getHotList()
 {
     $opts_ids = self::factoryModel('opts')->field('id')->where('isHot=1')->limit(5)->findAll();
     foreach ($opts_ids as &$v) {
         $v = $v['id'];
     }
     $event_map['optsId'] = array('in', $opts_ids);
     $event_ids = $this->where($event_map)->findAll();
     $typeDao = self::factoryModel('type');
     foreach ($event_ids as &$v) {
         $v['type'] = $typeDao->getTypeName($v['type']);
         $v['address'] = getShort($v['address'], 6);
         $v['coverId'] = getCover($v['coverId'], 100, 100);
     }
     return $event_ids;
 }
Exemplo n.º 3
0
 /**
  * eventDetail
  * 活动详细页
  * @access public
  * @return void
  */
 public function eventDetail()
 {
     $id = intval($_GET['id']);
     $uid = intval($_GET['uid']);
     $test = array($id, $uid);
     //检测id和uid是否为0
     /*
     if( false == $this->checkUrl( $test ) ) {
         $this->assign('jumpUrl',U('event/Index/index'));
         $this->error( "错误的访问页面,请检查链接" );
     }
     */
     $this->event->setMid($this->mid);
     if ($result = $this->event->getEventContent($id, $uid)) {
         // 图片大小控制
         $result['cover'] = getCover($result['coverId'], 161, 161);
         $result['explain'] = preg_replace('/class="[0-9a-zA-Z_\\-]+"/', '', $result['explain']);
         //dump($result);
         //计算待审核人数
         if ($this->mid == $result['uid']) {
             $result['verifyCount'] = D('EventUser')->where("status = 0 AND action='joinIn' AND eventId ={$result['id']}")->count();
         }
         $result['attention'] = $result['attention'] ? $result['attention'] : array();
         $result['member'] = $result['member'] ? $result['member'] : array();
         $result['members'] = array_merge($result['attention'], $result['member']);
         $this->assign($result);
         $this->assign('event', $result);
         $memberUids = getSubByKey($result['members'], 'uid');
         $uids = array_merge($memberUids, array(0 => $result['uid']));
         $this->assign('user_info', model('User')->getUserInfoByUids($uids));
         $this->setTitle($result['title'] . ' - ' . $result['time'] . ' - ' . $result['city'] . ' - ' . $result['address'] . ' - ' . $result['type']);
         $utype = array('1' => '学生', '2' => '家长', '3' => '老师', '4' => '过来人');
         $evob = $result['evob'] ? $utype[$result[evob]] : '不限';
         $this->assign('evob', $evob);
         $this->display();
     } else {
         $this->assign('jumpUrl', U('event/Index/index'));
         $this->error('错误的访问页面,请检查链接');
     }
 }
Exemplo n.º 4
0
?>
<hr>

<h3><?= $count_results ?> résultat(s) pour la recherche <?= !empty($search) ? '"'.$search.'"' : '' ?></h3>

<br>

<div class="search-results list-group">

	<?php
	include 'pagination.php';

	foreach($search_results as $movie) {
	?>
	<a href="movie.php?id=<?= $movie['id'] ?>" class="list-group-item">
		<img height="80" width="60" class="movie-cover" src="<?= getCover($movie['id']) ?>" align="left">
		<h4 class="list-group-item-heading"><?= $movie['title'] ?> (<?= $movie['year'] ?>)</h4>
		<p class="list-group-item-text">
			<?= $movie['genres'] ?>
			<br>
			<?= $movie['actors'] ?>
		</p>
	</a>
	<?php
	}

	include 'pagination.php';
	?>

</div>
<?php
Exemplo n.º 5
0
					</div>
					<!-- END BLOCK VISITED MOVIE -->
					<?php } ?>

				</div><!-- #visited-movies -->
				<?php } ?>

				<hr>

				<div id="top-movies" class="row">

					<?php foreach ($top_movies as $key => $movie) { ?>
					<!-- BLOCK TOP MOVIE -->
					<div class="top-movie col-xs-12 col-sm-6 col-md-4 col-lg-3">
						<div class="thumbnail">
							<img src="<?= getCover($movie['id']) ?>" />
							<div class="caption">
								<h2><?= $movie['title'] ?></h2>
								<p><?= cutString($movie['synopsis'], 100, '[...]') ?></p>
								<p><a class="btn btn-default" href="movie.php?id=<?= $movie['id'] ?>" role="button">Voir la fiche du film &raquo;</a></p>
							</div>
						</div>
					</div>
					<!-- END BLOCK TOP MOVIE -->
					<?php } ?>

				</div><!-- #top-movies -->

			</div><!-- .col-xs-12.col-sm-9 -->

			<?php include 'sidebar.php'; ?>
Exemplo n.º 6
0
 /**
  * eventDetail
  * 活动详细页
  * @access public
  * @return void
  */
 public function eventDetail()
 {
     $id = intval($_GET['id']);
     $uid = intval($_GET['uid']);
     $test = array($id, $uid);
     //检测id和uid是否为0
     if (false == $this->checkUrl($test)) {
         $this->assign('jumpUrl', U('event/Index/index'));
         $this->error("错误的访问页面,请检查链接");
     }
     $this->event->setMid($this->mid);
     if ($result = $this->event->getEventContent($id, $uid)) {
         // 图片大小控制
         $result['cover'] = getCover($result['coverId'], 200, 200);
         //计算待审核人数
         if ($this->mid == $result['uid']) {
             $result['verifyCount'] = D('EventUser')->where("status = 0 AND action='joinIn' AND eventId ={$result['id']}")->count();
         }
         $this->assign($result);
         $this->assign('event', $result);
         $attentionUids = getSubByKey($result['attention'], 'uid');
         $memberUids = getSubByKey($result['member'], 'uid');
         // $uids = array_unique(array_merge(array($result['uid']),$attentionUids,$memberUids));
         // if($result['uid'] == $this->mid){
         //     $uids = $this->mid;
         // }
         $this->assign('user_info', model('User')->getUserInfoByUids($uids));
         $this->assign('user_info', model('User')->getUserInfoByUids($result['uid']));
         $this->setTitle($result['title'] . ' - ' . $result['time'] . ' - ' . $result['city'] . ' - ' . $result['address'] . ' - ' . $result['type']);
         $this->display();
     } else {
         $this->assign('jumpUrl', U('event/Index/index'));
         $this->error('错误的访问页面,请检查链接');
     }
 }
Exemplo n.º 7
0
    $back_link = $_SERVER['HTTP_REFERER'];
}
?>
<a href="<?php 
echo $back_link;
?>
" class="btn btn-default" role="button">&laquo; Retour</a>

<hr>

<div class="row movie-container">
	<div class="col-xs-12 col-sm-9">
		<div class="media">
			<div class="media-left">
				<img src="<?php 
echo getCover($movie['id']);
?>
">
			</div>
			<div class="media-body">
				<h2><?php 
echo $movie['title'];
?>
</h2>
				<hr>
				<p><strong>Date de sortie :</strong> <a href="search.php?year=<?php 
echo $movie['year'];
?>
"><?php 
echo $movie['year'];
?>