<commit_before><?php
// if(!_acl::isAllow('monitoring')){
// 	die("Access denied");
// }
unset($parsed_res);
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Мониторинг";
$tpl->Assign('h1', $GLOBALS['IERA_LINKS'][$ii]['title']);
$Products = new Products();
if(isset($GLOBALS['REQAR'][1])){
	switch ($GLOBALS['REQAR'][1]){
		case 'specifications':
			$ii = count($GLOBALS['IERA_LINKS']);
			$GLOBALS['IERA_LINKS'][$ii]['title'] = "Характеристики";
			$specification = new Specification();
			// получить список категорий
			$res = $specification->GetSpecsForCats();
			// die();
			foreach($res as $value){
				$cat_spec[$value['id_cat']]['name'] = $value['name'];
				$cat_spec[$value['id_cat']]['specs'][$value['id_spec']] = $value['caption'];
			}
			// список категории и характеристик для выпадающего списка фильтров
			$tpl->Assign('cat_spec', $cat_spec);
			if(isset($_GET['smb'])){
				if(isset($_GET['id_category']) && $_GET['id_category'] !== '0'){
					$arr['id_category'] = $_GET['id_category'];
				}
				if(isset($_GET['id_caption']) && $_GET['id_caption'] !== '0'){
					$arr['id_caption'] = $_GET['id_caption'];
				}
			}elseif(isset($_GET['clear_filters'])){
				unset($_GET);
				$url = explode('?',$_SERVER['REQUEST_URI']);
				header('Location: '.$url[0]);
				exit();
			}
			$specification->GetMonitoringList(false, $arr);
			if((isset($_GET['limit']) && $_GET['limit'] != 'all') || !isset($_GET['limit'])){
				if(isset($_POST['page_nbr']) && is_numeric($_POST['page_nbr'])){
					$_GET['page_id'] = $_POST['page_nbr'];
				}
				$cnt = count($specification->list);
				$GLOBALS['paginator_html'] = G::NeedfulPages($cnt);
				$limit = ' '.$GLOBALS['Start'].', '.$GLOBALS['Limit_db'];
			}else{
				$GLOBALS['Limit_db'] = 0;
				$limit = false;
			}
			foreach($specification->list as $value){
				$specifications[$value['id_caption']] = $value['caption'];
			}
			$specification->GetMonitoringList($limit, $arr);
			$tpl->Assign('specifications', $specifications);
			$tpl->Assign('list', $specification->list);
			break;
		case 'products':
			// $Products->
			break;
		case 'characteristics':
			// $Products-><commit_msg>monitoring where array<commit_after><?php
// if(!_acl::isAllow('monitoring')){
// 	die("Access denied");
// }
unset($parsed_res);
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Мониторинг";
$tpl->Assign('h1', $GLOBALS['IERA_LINKS'][$ii]['title']);
$Products = new Products();
if(isset($GLOBALS['REQAR'][1])){
	switch ($GLOBALS['REQAR'][1]){
		case 'specifications':
			$ii = count($GLOBALS['IERA_LINKS']);
			$GLOBALS['IERA_LINKS'][$ii]['title'] = "Характеристики";
			$specification = new Specification();
			// получить список категорий
			$res = $specification->GetSpecsForCats();
			// die();
			foreach($res as $value){
				$cat_spec[$value['id_cat']]['name'] = $value['name'];
				$cat_spec[$value['id_cat']]['specs'][$value['id_spec']] = $value['caption'];
			}
			// список категории и характеристик для выпадающего списка фильтров
			$tpl->Assign('cat_spec', $cat_spec);
			if(isset($_GET['smb'])){
				if(isset($_GET['id_category']) && $_GET['id_category'] !== '0'){
					$where['id_category'] = $_GET['id_category'];
				}
				if(isset($_GET['id_caption']) && $_GET['id_caption'] !== '0'){
					$where['id_caption'] = $_GET['id_caption'];
				}
			}elseif(isset($_GET['clear_filters'])){
				unset($_GET);
				$url = explode('?',$_SERVER['REQUEST_URI']);
				header('Location: '.$url[0]);
				exit();
			}
			$specification->GetMonitoringList($where);
			if((isset($_GET['limit']) && $_GET['limit'] != 'all') || !isset($_GET['limit'])){
				if(isset($_POST['page_nbr']) && is_numeric($_POST['page_nbr'])){
					$_GET['page_id'] = $_POST['page_nbr'];
				}
				$cnt = count($specification->list);
				$GLOBALS['paginator_html'] = G::NeedfulPages($cnt);
				$limit = ' '.$GLOBALS['Start'].', '.$GLOBALS['Limit_db'];
			}else{
				$GLOBALS['Limit_db'] = 0;
				$limit = false;
			}
			foreach($specification->list as $value){
				$specifications[$value['id_caption']] = $value['caption'];
			}
			$specification->GetMonitoringList($limit, $where);
			$tpl->Assign('specifications', $specifications);
			$tpl->Assign('list', $specification->list);
			break;
		case 'products':
			// $Products->
			break;
		case 'characteristics':
			// $Products->
{'fraction_non_alphanumeric': 0.24701834862385322, 'fraction_numerical': 0.003211009174311927, 'mean_word_length': 5.107843137254902, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '216837', 'n_tokens_mistral': 1835, 'n_tokens_neox': 1614, 'n_words': 216}