<?php
	require(__DIR__.'/connect.php'); break; 
	$db = new connect('visionwe_mateckoriginal','visionwe_matecku','7Z}jf_6}{KZ]');
	$mateck = new connect('visionwe_mateckkdb','visionwe_matecku','7Z}jf_6}{KZ]');
	//$grupos = array(202, 3210126, 3210126, 204, 203, 3210128, 3210125, 3210131, 3210130, 236);
	//$grupos = array(200, 3210133, 3210132, 3210134, 3210135, 3210136, 3210137, 3210138, 3210139, 
	// 3210140, 3210189, 3210141, 3210142, 3210143,3210144,3210145,3210146,3210147,3210148);
	//$grupos = array(3210149, 3210150, 3210151, 3210152, 3210153, 3210154, 3210155, 3210156, 
	// 3210157, 3210158, 3210159, 3210160, 3210161, 3210162, 3210163, 3210164, 3210165, 3210166, 3210167, 3210168);
	//$grupos = array(3210169, 3210170, 3210171, 3210172, 3210173, 3210174);
	//$grupos = array(3210175, 3210176, 3210177);
	//$grupos = array(3210184, 3210185, 3210186, 3210187, 3210188, 3210190, 3210191, 3210192, 3210193, 3210194, 3210195, 3210196, 3210197, 3210198, 3210199, 3210200, 3210201, 3210202, 3210203, 3210204);
	$grupos = array(321);
	 
	$cont = 87;
	$position = 86;
	foreach($grupos as $idx):
	
		echo "Id: <strong>$idx</strong>. - <br/>";
		$sql = "insert into ax_cms (id_cms, id_cms_category, position, active, indexation) values ($cont, 1, $position, 1, 1)";
		$mateck->insertRow($sql);
		$sql = "insert into ax_cms_shop(id_cms, id_shop) values ($cont, 1)";
		$mateck->insertRow($sql);
		/*Get Ingles*/
		echo '- Ingles <br/>';
		$query = "SELECT * FROM content_manager WHERE content_group='$idx' and languages_id = '1'";
		$info = $db->getRow($query); 
		$contenido = str_replace('images/', 'https://visionwebproject.de/mateckk/img/images/', $info['content_text']);
		$contenido = str_replace('/media/', 'https://visionwebproject.de/mateckk/media/', $contenido);
		$sql = "insert into ax_cms_lang(id_cms, id_lang, id_shop, meta_title, meta_description, meta_keywords, content, link_rewrite)";
		$sql.="values('".$cont."','".$info['languages_id']."','1','".$info['content_title']."','".$info['contents_meta_description']."','".$info['contents_meta_keywords']."','".$contenido."','".$info['gm_url_keywords']."')";
		$mateck->insertRow($sql);
		echo '- Aleman <br/>';
		/*Get Aleman*/
		$query = "SELECT * FROM content_manager WHERE content_group='$idx' and languages_id = '2'";
		$info = $db->getRow($query); 
		$contenido = str_replace('images/', 'https://visionwebproject.de/mateckk/img/images/', $info['content_text']);
		$contenido = str_replace('/media/', 'https://visionwebproject.de/mateckk/media/', $contenido);
		$sql = "insert into ax_cms_lang(id_cms, id_lang, id_shop, meta_title, meta_description, meta_keywords, content, link_rewrite)";
		$sql.="values('".$cont."','".$info['languages_id']."','1','".$info['content_title']."','".$info['contents_meta_description']."','".$info['contents_meta_keywords']."','".$contenido."','".$info['gm_url_keywords']."')";
		$mateck->insertRow($sql);
		echo '- Aleman <br/>';
		
		echo '$idx - Registrado';
		$cont++;
		$position++;
		
	endforeach;
	echo "Fin de la consulta"; 
	
?>