/
compare.php
44 lines (41 loc) · 1.07 KB
/
compare.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Created by PhpStorm.
* User: master
* Date: 2016/3/6
* Time: 16:17
*/
require('./includes/lib_products.php');
require('./includes/config.php');
require('./includes/init.php');
require('./lang/'.$_SESSION['lang'].'/compare.php');
require('./includes/lib_user.php');
/*权限检查*/
$permission = permissionCheck();
$project=trim($_GET['proj']);
$db->changeDB($project);
$items=$_SESSION[$project]['idList'];
$lang=$_SESSION['lang'];
$ids=array_keys($items);
$comProducts=array();
$directory=getDirectoryWithLink($project);
$count=0;
if(!empty($ids)){
foreach($ids as $k=>$v){
// echo $v;
$comProducts[]=getDetails($v,2,$lang);
$count=count($comProducts);
}
}
//print_r($comProducts);
$smarty->assign('lang',$_LANG);
$smarty->assign('count',$count);
$smarty->assign('directory',$directory);
$smarty->assign('products',$comProducts);
$smarty->assign('project',$project);
$smarty->assign('title',"Comparison");
$smarty->assign('permission',$permission);
if(isMobile())
$smarty->display('compare_m.tpl');
else
$smarty->display('compare.tpl');