- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
function section($sct,$grp = 'all') {
global $g,$a,$d,$lists,$master_list,$currency;
$access = ac_section($sct,$this->adminmode);
if ($access['r'] == 'no' ) {header("Location: /errors/all/403");}
$master = q1("SELECT * FROM `_s` WHERE `_id`='".$sct."' AND `_l`='".GetLanguage()."'");
if (isset($_POST['pcounts'])) {
$_SESSION['_pcount']=(int)$_POST['pcounts'];
} elseif (isset($_GET['pcounts'])) {
$_SESSION['_pcount']=(int)$_GET['pcounts'];
}
if (isset($_SESSION['_pcount'])) $master['_pcount']=$_SESSION['_pcount'];
$master_struct = $this->Struct_fields(qa("SHOW COLUMNS FROM `_s`"));
$grps = qa("SELECT * FROM `_g` WHERE `_s`='".$sct."' AND `_g`='".$grp."' AND `_l`='".GetLanguage()."'".((!empty($a[0]['con']))?(" AND `header` LIKE '%".$a[0]['con']."%'"):('')).((!empty($a[0]['gby']))?(" ORDER BY `".$a[0]['gby']."`".((!empty($a[0]['gdir']))?(' DESC'):(' ASC'))):(" ORDER BY ".$master['_sorting'])).((!empty($a[0]['gfrom']))?(' LIMIT '.$a[0]['gfrom'].','.((!empty($a[0]['gper']))?($a[0]['gper']):((!empty($master['_gcount']))?($master['_gcount']):('10')))):(' LIMIT 0,'.((!empty($a[0]['gper']))?($a[0]['gper']):((!empty($master['_gcount']))?($master['_gcount']):('10'))))));
$this->cq++;
$grps_nav_count = qa("SELECT count(*) `c` FROM `_g` WHERE `_s`='".$sct."' AND `_g`='".$grp."' AND `_l`='".GetLanguage()."'".((!empty($a[0]['con']))?(" AND `header` LIKE '%".$a[0]['con']."%'"):('')));
$grps_len = sizeof($grps);
$grps_struct = $this->Struct_fields(qa("SHOW COLUMNS FROM `_g`"));
$pgs = qa("SELECT * FROM `_p` WHERE `_s`='".$sct."' AND `_g`='".$grp."' AND `_l`='".GetLanguage()."'".((!empty($a[0]['con']))?(" AND `header` LIKE '%".$a[0]['con']."%'"):('')).((!empty($a[0]['by']))?(" ORDER BY `".$a[0]['by']."`".((!empty($a[0]['dir']))?(' DESC'):(' ASC'))):(" ORDER BY ".$master['_sorting'])).((!empty($a[0]['from']))?(' LIMIT '.$a[0]['from'].','.((!empty($a[0]['per']))?($a[0]['per']):((!empty($master['_pcount']))?($master['_pcount']):('10')))):(' LIMIT 0,'.((!empty($a[0]['per']))?($a[0]['per']):((!empty($master['_pcount']))?($master['_pcount']):('10'))))));
$this->cq++;
$pgs_nav_count = qa("SELECT count(*) `c` FROM `_p` WHERE `_s`='".$sct."' AND `_g`='".$grp."' AND `_l`='".GetLanguage()."'".((!empty($a[0]['con']))?(" AND `header` LIKE '%".$a[0]['con']."%'"):('')));
$this->cq++;
$pgs_len = sizeof($pgs);
$pgs_struct = $this->Struct_fields(qa("SHOW COLUMNS FROM `_p`"));
$list_g = '';
$list_p = '';
// Дальше еще строк 200 подобного кода