Esempio n. 1
0
function getTagsFilter($catid)
{
    $items = getCats($catid);
    $catTags = array();
    $allTags = array();
    $tags = array();
    if (count($items)) {
        require_once JPATH_BASE . '/components/com_k2/models/item.php';
        $K2ModelItem = new K2ModelItem();
        foreach ($items as $item) {
            $catTags[] = $K2ModelItem->getItemTags($item->id);
        }
        if (!empty($catTags)) {
            foreach ($catTags as $catTag) {
                if (!empty($catTag)) {
                    foreach ($catTag as $tag) {
                        $allTags[] = $tag->name;
                    }
                }
            }
        }
        $tags = array_unique($allTags);
    }
    return $tags;
}
Esempio n. 2
0
<input type="submit" name"search" value="Search"/>
</form>

</div>

</div>
<!-- navigation end!-->

<!--content wrapper start!-->
<div class="content_wrapper">
<!--sidebar!-->
<div class="sidebar">
<div class="sidebar_title">Categories</div>
<ul id="cats">
<?php 
getCats();
?>

</ul>

<div class="sidebar_title">Brands</div>
<ul id="cats">
<?php 
getBrands();
?>
</ul>
</div>

<div id="content_area">
<div id="shopping_cart">
 <span style=" font-size:10px;padding:10;" ><h1><center>
Esempio n. 3
0
<label>Post Content<span class="small">Enter the content</span> </label>
<textarea name="txtPostContent" cols="1" rows="1"></textarea>
<label>Post Status<span class="small">Select appropriate</span> </label>
<div class="selectchk">
	<div class="chk">
		<input name="radStatus" type="radio" value="1" /> Enable
	</div>
	<div class="chk">
		<input name="radStatus" type="radio" value="0" /> Disable
	</div>
</div>
<div class="clear"></div>
<label>Post Categories<span class="small">Unselect the categories</span> </label>
<div class="selectchk">
<?php 
        $all_cats = getCats();
        while ($row = mysql_fetch_assoc($all_cats)) {
            ?>
	<div class="chk">
		<input name="chkPostCats[]" type="checkbox" value="<?php 
            echo $row['cat_id'];
            ?>
" /><?php 
            echo $row['cat_name'];
            ?>
	</div>
<?php 
        }
        ?>
</div>
<div class="clear"></div>
Esempio n. 4
0
function edit_feature($params)
{
    global $tpl, $template, $config, $mysql, $lang, $twig;
    $tpath = locatePluginTemplates(array('config/main', 'config/add_feature'), 'eshop', 1);
    $id = intval($_REQUEST['id']);
    $row = $mysql->record('SELECT * FROM ' . prefix . '_eshop_features WHERE id = ' . db_squote($id) . ' LIMIT 1');
    if (isset($_REQUEST['submit'])) {
        $name = input_filter_com(convert($_REQUEST['name']));
        if (empty($name)) {
            $error_text[] = 'Название свойства не задано';
        }
        $position = intval($_REQUEST['position']);
        if (empty($position)) {
            $position = 0;
        }
        $in_filter = "1";
        if (empty($error_text)) {
            $mysql->query('UPDATE ' . prefix . '_eshop_features SET  
                name = ' . db_squote($name) . ',
                position = ' . db_squote($position) . ', 
                in_filter = ' . intval($in_filter) . '
                WHERE id = ' . $id . '
            ');
            $mysql->query("delete from " . prefix . "_eshop_categories_features where feature_id in ({$id})");
            $ids = $_REQUEST['feature_categories'];
            foreach ($ids as $id_x) {
                $mysql->query('INSERT INTO ' . prefix . '_eshop_categories_features (category_id, feature_id) 
                VALUES 
                (' . db_squote($id_x) . ',
                 ' . db_squote($id) . '
                )
               ');
            }
            redirect_eshop('?mod=extra-config&plugin=eshop&action=list_feature');
        }
    }
    if (!empty($error_text)) {
        foreach ($error_text as $error) {
            $error_input .= msg(array("type" => "error", "text" => $error));
        }
    } else {
        $error_input = '';
    }
    $res = mysql_query("SELECT * FROM " . prefix . "_eshop_categories ORDER BY id");
    $cats = getCats($res);
    $cat_ids = array();
    foreach ($mysql->select("SELECT * FROM " . prefix . "_eshop_categories_features WHERE feature_id = " . db_squote($id) . "") as $frow) {
        $cat_ids[] = $frow['category_id'];
    }
    $tEntry = array('name' => $row['name'], 'position' => $row['position'], 'in_filter' => $row['in_filter'], 'error' => $error_input, 'catz' => getMultiTree($cats, $cat_ids, 0));
    $xt = $twig->loadTemplate($tpath['config/add_feature'] . 'config/' . 'add_feature.tpl');
    $tVars = array('entries' => isset($tEntry) ? $tEntry : '');
    $xg = $twig->loadTemplate($tpath['config/main'] . 'config/' . 'main.tpl');
    $tVars = array('entries' => $xt->render($tVars), 'php_self' => $PHP_SELF, 'plugin_url' => admin_url . '/admin.php?mod=extra-config&plugin=eshop', 'skins_url' => skins_url, 'admin_url' => admin_url, 'home' => home, 'current_title' => 'Категории: Редактирование свойства');
    print $xg->render($tVars);
}
Esempio n. 5
0
            </div>




            <div class="content_wrapper">

                <!-- Barra Lateral -->
                <div id="sidebar">

                    <div id="sidebar_title">Produtos</div>
                    <div id="cats">

                        <ul>
                            <?php 
getCats($con);
?>


                        </ul>
                    </div>


                    <div id="sidebar_title">Tipo</div>
                        <!-- Brand-->
                        <div id="cats">
                            <ul>

                                <?php 
getBrands($con);
?>
Esempio n. 6
0
    case "search":
        search($option);
        break;
    case "searchby":
        searchby($option);
        break;
    case "advsearch":
        advsearch($option);
        break;
    case "advsearch2":
        advsearch2($option);
        break;
        /* Ajax Category */
    /* Ajax Category */
    case "getcats":
        getCats($cat_id);
        break;
        /* Default Main Index */
    /* Default Main Index */
    case "listcats":
    default:
        showTree($cat_id, $limitstart, $option, $my);
        break;
}
// Append CSS file to Head
if ($mtconf->get('load_css') && $document->getType() == 'html') {
    if (file_exists($savantConf['template_path'] . 'template.css')) {
        $document->addCustomTag("<link href=\"" . str_replace(DS, '/', str_replace($mtconf->getjconf('absolute_path'), $mtconf->getjconf('live_site'), $savantConf['template_path'] . 'template.css')) . "\" rel=\"stylesheet\" type=\"text/css\"/>");
    } elseif (file_exists($mtconf->getjconf('absolute_path') . '/components/com_mtree/templates/' . $mtconf->get('template') . '/template.css')) {
        $document->addCustomTag("<link href=\"" . $mtconf->getjconf('live_site') . "/components/com_mtree/templates/" . $mtconf->get('template') . "/template.css\" rel=\"stylesheet\" type=\"text/css\"/>");
    } else {
Esempio n. 7
0
				</div>


				<!-- Navigation Bar ends here -->
			</div>


			<!-- Content wrapper starts here -->
			<div class="content_wrapper">
				
				<div id="sidebar">
            <div id="sidebar_title">Categories</div>

            <ul id="cats">

		<?php getCats($DBConn);
		
  		?>	

            </ul>


        <div id="sidebar_title">Manufacturers</div>

            <ul id="cats">

               <?php getManu($DBConn);
               ?>
               
            </ul>
Esempio n. 8
0
?>
	
<!--content-->
<!---->
		<div class="product">
			<div class="container">
				<div class="col-md-3 product-price">
					  
				<div class=" rsidebar span_1_of_left">
					<div class="of-left">
						<h3 class="cate">Categories</h3>
					</div>
					<ul class="menu">
						<!-- /added********************************* -->
					    <?php 
$cats = getCats();
foreach ($cats as $key => $value) {
    ?>
					 	<li><a class="color1" href="#"><?php 
    echo $value["name"];
    ?>
</a>
					 	<?php 
}
?>
					</ul>
				</div>
				<!--initiate accordion-->
		<script type="text/javascript">
			$(function() {
			    var menu_ul = $('.menu > li > ul'),
Esempio n. 9
0
function edit_feature($params)
{
    global $tpl, $template, $config, $mysql, $lang, $twig;
    $tpath = locatePluginTemplates(array('config/main', 'config/add_feature'), 'eshop', 1);
    $id = intval($_REQUEST['id']);
    $row = $mysql->record('SELECT * FROM ' . prefix . '_eshop_features WHERE id = ' . db_squote($id) . ' LIMIT 1');
    if (isset($_REQUEST['submit'])) {
        $SQL['name'] = input_filter_com(convert($_REQUEST['name']));
        if (empty($SQL['name'])) {
            $error_text[] = 'Название свойства не задано';
        }
        $SQL['position'] = intval($_REQUEST['position']);
        if (empty($SQL['position'])) {
            $SQL['position'] = 0;
        }
        $SQL['in_filter'] = intval($_REQUEST['in_filter']);
        if (empty($SQL['in_filter'])) {
            $SQL['in_filter'] = 0;
        }
        $ftype = input_filter_com(convert($_REQUEST['ftype']));
        switch ($ftype) {
            case 'text':
                $SQL['ftype'] = '0';
                $SQL['fdefault'] = input_filter_com(convert($_REQUEST['text_default']));
                break;
            case 'checkbox':
                $SQL['ftype'] = '1';
                $SQL['fdefault'] = intval($_REQUEST['checkbox_default']);
                break;
            case 'select':
                $SQL['ftype'] = '2';
                $SQL['fdefault'] = input_filter_com(convert($_REQUEST['select_default']));
                $optlist = array();
                if (isset($_REQUEST['so_data']) && is_array($_REQUEST['so_data'])) {
                    foreach ($_REQUEST['so_data'] as $k => $v) {
                        if (is_array($v) && isset($v[0]) && isset($v[1]) && ($v[0] != '' || $v[1] != '')) {
                            if ($v[0] != '') {
                                $optlist[$v[0]] = iconv("windows-1251", "utf-8", $v[1]);
                            } else {
                                $optlist[] = iconv("windows-1251", "utf-8", $v[1]);
                            }
                        }
                    }
                }
                $SQL['foptions'] = json_encode($optlist);
                break;
            case 'html':
                $SQL['ftype'] = '3';
                $SQL['fdefault'] = $_REQUEST['html_default'];
                break;
        }
        if (empty($error_text)) {
            $vnames = array();
            foreach ($SQL as $k => $v) {
                $vnames[] = $k . ' = ' . db_squote($v);
            }
            $mysql->query('UPDATE ' . prefix . '_eshop_features SET ' . implode(', ', $vnames) . ' WHERE id = \'' . intval($id) . '\' ');
            $mysql->query("delete from " . prefix . "_eshop_categories_features where feature_id in ({$id})");
            $ids = $_REQUEST['feature_categories'];
            foreach ($ids as $id_x) {
                $mysql->query('INSERT INTO ' . prefix . '_eshop_categories_features (category_id, feature_id) 
                VALUES 
                (' . db_squote($id_x) . ',
                 ' . db_squote($id) . '
                )
               ');
            }
            generate_features_cache(true);
            generate_categories_features_cache(true);
            redirect_eshop('?mod=extra-config&plugin=eshop&action=list_feature');
        }
    }
    if (!empty($error_text)) {
        foreach ($error_text as $error) {
            $error_input .= msg(array("type" => "error", "text" => $error));
        }
    } else {
        $error_input = '';
    }
    $res = mysql_query("SELECT * FROM " . prefix . "_eshop_categories ORDER BY id");
    $cats = getCats($res);
    $cat_ids = array();
    foreach ($mysql->select("SELECT * FROM " . prefix . "_eshop_categories_features WHERE feature_id = " . db_squote($id) . "") as $frow) {
        $cat_ids[] = $frow['category_id'];
    }
    foreach ($row as $k => $v) {
        $tEntry[$k] = $v;
    }
    $tEntry['error'] = $error_input;
    $tEntry['catz'] = getMultiTree($cats, $cat_ids, 0);
    $tEntry['foptions'] = json_decode($tEntry['foptions'], true);
    $sOpts = array();
    $fNum = 1;
    if ($tEntry['ftype'] == '2') {
        if (is_array($tEntry['foptions'])) {
            foreach ($tEntry['foptions'] as $k => $v) {
                array_push($sOpts, '<tr><td><input size="12" name="so_data[' . $fNum . '][0]" type="text" value="' . ($tEntry['foptions'] ? htmlspecialchars($k, ENT_COMPAT | ENT_HTML401, 'cp1251') : '') . '"/></td><td><input type="text" size="55" name="so_data[' . $fNum . '][1]" value="' . iconv("utf-8", "windows-1251", $v) . '"/></td><td><a href="#" onclick="return false;"><img src="' . skins_url . '/images/delete.gif" alt="DEL" width="12" height="12" /></a></td></tr>');
                $fNum++;
            }
        }
    }
    if (!count($sOpts)) {
        array_push($sOpts, '<tr><td><input size="12" name="so_data[1][0]" type="text" value=""/></td><td><input type="text" size="55" name="so_data[1][1]" value=""/></td><td><a href="#" onclick="return false;"><img src="' . skins_url . '/images/delete.gif" alt="DEL" width="12" height="12" /></a></td></tr>');
    }
    $tEntry['sOpts'] = implode("\n", $sOpts);
    $xt = $twig->loadTemplate($tpath['config/add_feature'] . 'config/' . 'add_feature.tpl');
    $tVars = array('entries' => isset($tEntry) ? $tEntry : '', 'mode' => "edit");
    $xg = $twig->loadTemplate($tpath['config/main'] . 'config/' . 'main.tpl');
    $tVars = array('entries' => $xt->render($tVars), 'php_self' => $PHP_SELF, 'plugin_url' => admin_url . '/admin.php?mod=extra-config&plugin=eshop', 'skins_url' => skins_url, 'admin_url' => admin_url, 'home' => home, 'current_title' => 'Свойства: Редактирование свойства');
    print $xg->render($tVars);
}
Esempio n. 10
0
<?php

//Configure DATABASE
require_once 'blip_4815162342_108.php';
$conn = db_connect();
//Start Script
$categories = getCats();
function getCats()
{
    $resultsArray;
    global $conn;
    $search = mysqli_query($conn, "CALL GetCategories()") or die("Query fail: " . mysqli_error($conn));
    while ($row = $search->fetch_array(MYSQL_ASSOC)) {
        $resultsArray[] = $row;
    }
    $results = json_encode($resultsArray, true);
    return $results;
}
//Return Query Result to Frontend
echo $categories;
mysqli_close($conn);
Esempio n. 11
0
include "../functions/crawler_functions.php";
$url = $_POST['url'];
$script = $_POST['script'];
echo $url . '   ' . $script;
$http = new HttpConnection();
//$http->setCookiePath("cookies/");
$http->init();
/*$registration = array('email'=>'*****@*****.**','passwd'=>"Ayudasmayores",'back'=>"my-account","SubmitLogin"=>"");
	$http->post("http://cosmomedica.com/shop/autenticacion",$registration,true,true);*/
$http->get($url, true);
echo "<p>registrandose en la aplicacion</p>";
$DOM = new DOMDocument();
get_dom($url, $DOM, $http);
$count_success = 0;
include "../mainscripts/cat/" . $script;
getCats($DOM);
//echo "<br />";
//opcciones finales
$http->close();
echo "<p>Se han procesado {$count_success} urls correctamente</p>";
echo "<a href='getProducts.php?parser=" . $script . "' class='btn-type'>Obtener Productos</a>";
/*	$configuracion['variables']['ref_count'] = $reference_count;
	$achivo_contenido = ";<?php die(); ?>".PHP_EOL.put_ini_file(null,$configuracion);
	file_put_contents('crawler.conf.php', $achivo_contenido);

	echo "<p>Se han procesado $count_success urls correctamente</p>";
	echo "<p>".$count_failed." urls han fallado.</p>";
	echo "<a class='btn-type' href='./actualproccesview.php'>Ver Resultados</a>";
	echo "<a class='btn-type' href='./pageCrawler.php'>Seguir procesando</a>";*/
?>