Esempio n. 1
0
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>
    <body>
        <?php 
require_once '../../includes/session-start.req-inc.php';
include_once '../../includes/ico.html.php';
require_once '../../includes/access-required.html.php';
include_once '../../functions/dbconnect.php';
include_once '../../functions/category-functions.php';
include_once '../../functions/products-functions.php';
include_once '../../functions/utils-function.php';
$categories = getAllCategories();
if (isPostRequest()) {
    $category_id = filter_input(INPUT_POST, 'category_id');
    $product = filter_input(INPUT_POST, 'product');
    $price = filter_input(INPUT_POST, 'price');
    include_once '../../includes/products/uploadCheck.php';
    $errors = array();
    if (!isValidProduct($product)) {
        $errors[] = 'Product is not Valid';
    }
    if (!isValidPrice($price)) {
        $errors[] = 'Price is not Valid';
    }
    if (count($errors) == 0) {
        if (createProduct($category_id, $product, $price, $FN)) {
            $results = 'Product Added';
<?php

require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/core/system/ajax.php';
require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/common/php/class/class.website_category.php';
require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/common/php/class/class.category.php';
require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/common/php/class/class.website.php';
/* TEST DE LA VARIABLE ACTION PASSER EN AJAX 
	POUR DETERMINER QUELLE FONCTION EST APPELER */
if (isset($_POST['action']) && !empty($_POST['action'])) {
    $action = $_POST['action'];
    switch ($action) {
        case 'getAllWebsites':
            echo getAllWebsites();
            break;
        case 'getAllCategories':
            echo getAllCategories();
            break;
        case 'getAllWebsiteCategoriesDT':
            echo getAllWebsiteCategoriesDT();
            break;
        case 'deleteWebsiteCategory':
            $id = $_POST['id'];
            echo deleteWebsiteCategory($id);
            break;
        case 'editWebsiteCategory':
            $id = $_POST['id'];
            $category_id = $_POST['category_id'];
            $website_id = $_POST['website_id'];
            $category = $_POST['category'];
            $url = $_POST['url'];
            $use_url = $_POST['use_url'];
/**
 * Gets a category titlelink by id
 *
 * @param int $id id of the category
 * @return array
 */
function getCategory($id)
{
    deprecated_function_notify(gettext('Use the Zenpage class method instead.'));
    foreach (getAllCategories() as $cat) {
        if ($cat['id'] == $id) {
            return $cat;
        }
    }
    return '';
}
Esempio n. 4
0
<!--      Top Navigation End     -->
	<div class="container">
		<div class="row">
			<div class="span9">
      			<div id="ad_details">
      			<!-- Product Category Start -->
 					<div class="thumbnail-header">
						<span class="cat_header">Select Category & Subcategory: <span id="select_cat" class="label"></span>&nbsp;<button class="btn btn-small" type="button" id="change_cat_selection" >Change Selection</button></span>
					</div>
					<div id="category_table">
					<table class="category_table" cellpadding="10" cellspacing="0">     
					  <tr>  
			          	<!--   Colum One Start   -->
			            <td width="33%" valign="top">
						<?php 
$category_list = getAllCategories();
$rowcount = mysqli_num_rows($category_list);
$idcount = 1;
$counter = 3;
while ($row = mysqli_fetch_array($category_list)) {
    ?>
			            	<!--    Category Box Start   -->
			            	<div class="category_thumbnail">
			            		<legend><?php 
    echo $row['category_name'];
    ?>
</legend>
			            		<ul>
									<?php 
    $subcategory_list = getAllSubcategories($row['category_id']);
    while ($row_sub = mysqli_fetch_array($subcategory_list)) {
Esempio n. 5
0
 // require all needed models
 require_once APP_PATH . 'model/getJs.php';
 require_once APP_PATH . 'model/getAllCategories.php';
 require_once APP_PATH . 'model/getAllSubcategories.php';
 require_once APP_PATH . 'model/getAllSubcategoriesFromCategory.php';
 require_once APP_PATH . 'model/transformCategoryToUrl.php';
 require_once APP_PATH . 'model/transformProductNameToUrl.php';
 require_once APP_PATH . 'model/getAllProductsByCategory.php';
 require_once APP_PATH . 'model/getJs.php';
 require_once APP_PATH . 'model/getMenu.php';
 require_once APP_PATH . 'model/getOption.php';
 // call models
 $scripts = getJs($allScripts, ['liveChange' => 1, 'maps' => 1, 'search' => 1], true);
 $menu = getMenu($db);
 $slogan = getOption($db, 'slogan');
 $categories = getAllCategories($db);
 foreach ($categories as $key => $category) {
     if ($category['subcategory_id'] != NULL && $category['subcategory_name'] != NULL) {
         $cat['id'] = explode(',', $category['subcategory_id']);
         $cat['name'] = explode(',', $category['subcategory_name']);
         $max = count($cat['id']);
         for ($i = 0; $i <= $max - 1; $i++) {
             $categories[$key]['subcategories'][$i]['id'] = $cat['id'][$i];
             $categories[$key]['subcategories'][$i]['name'] = $cat['name'][$i];
         }
     }
 }
 $actionUrl = transformCategoryToUrl($categories, $action);
 $sidebar = APP_PATH . 'view/template/searchSidebar.php';
 // Is action parameter a category ? Else: Error
 if ($actionUrl['exists']) {
Esempio n. 6
0
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th style="text-align:center;">#sl</th>
                                            <th style="text-align:center;">Category Name</th>
                                            <th style="text-align:center;">Created By</th>
                                            <th style="text-align:center;">Created on</th>
                                             <th style="text-align:center;">Entry Date</th>
                                            <th style="text-align:center;">Delete</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php 
$qry = getAllCategories();
$i = 1;
while ($data = mysql_fetch_object($qry)) {
    ?>

                                        <tr class="odd gradeX">
                                            <td> <?php 
    echo $i;
    ?>
 </td>
                                            <td> <a href="edit-category.php?cId=<?php 
    echo $data->cId;
    ?>
 "><?php 
    echo $data->cName;
    ?>
Esempio n. 7
0
 public function getCategoriesList()
 {
     $list = new CategoriesModel($app);
     $list = getAllCategories();
     return $list;
 }
Esempio n. 8
0
<?php
	require_once '../util.php';
	require_once '../db_helper.php';
	
	$db = getDBInstance();
	$result = getAllCategories($db);
	$smarty = getSmartyInstance();
	$smarty->assign('categories',$result);
	$smarty->display('admin/category.html');
?>
Esempio n. 9
0
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>   
        <link href="../../css/bootstrap.css" rel="stylesheet">
        <script src="../../cd.js" language="JavaScript" type="text/javascript"></script>
    </head>
    <body>
        <?php 
require_once '../../includes/session-start.req-inc.php';
require_once '../../includes/access-required.html.php';
include_once '../../functions/dbConn.php';
include_once '../../functions/category-functions.php';
include_once '../../functions/products-functions.php';
include_once '../../functions/until.php';
$results = getAllCategories();
?>
        <div class="container">
            <table class="table table-striped table-hover">
                <thead>
                    <tr> <!-- Table Headers -->
                        <th>Name</th>
                        
                        <th>Options</th>
                    </tr>
                <h1>Company Name</h1> <a href="create.php" class="btn btn-primary btn-index">Create New Category</a>
                </thead>
            <tbody>
            <?php 
foreach ($results as $row) {
    ?>
Esempio n. 10
0
require "includes/dashboard_widget.php";
?>
            </div>
            
            <!-- Chart -->
            <div class="container row col-xs-12">
                <script type="text/javascript">
                    google.charts.load('current', {'packages':['bar']});
                    google.charts.setOnLoadCallback(drawChart);

                    function drawChart() {
                        var data = new google.visualization.arrayToDataTable([
                            ['Metric', 'Count'],
                            <?php 
$metrics = ['Published posts', 'Draft posts', 'Approved comments', 'Unapproved comments', 'Admin users', 'Other users', 'Categories'];
$counts = [count(getPublishedPosts()), count(getDraftPosts()), count(getApprovedComments()), count(getUnapprovedComments()), count(getAdminUsers()), count(getNoAdminUsers()), count(getAllCategories())];
for ($i = 0; $i < 7; $i++) {
    echo "['{$metrics[$i]}', {$counts[$i]}],";
}
?>
                        ]);

                        var options = {
                            title: '',
                            width: '100%',
                            height: '100%',
                            legend: { position: 'none' },
                            chart: { subtitle: '' },
                            axes: {
                                x: {
                                    0: { side: 'top', label: '' } // Top x-axis.
Esempio n. 11
0
        $filmData = getFilmData(trim($_GET['id']), $pdo);
    } else {
        if (isset($_GET['fromimdb'])) {
            require_once 'vendor/autoload.php';
            $imdbData = \Jleagle\Imdb\Imdb::retrieve(trim($_GET['fromimdb']));
            $filmData['fil_titre'] = $imdbData->title;
            $filmData['fil_annee'] = $imdbData->year;
            $filmData['fil_affiche'] = $imdbData->poster;
            $filmData['cat_id'] = getCategoryId(mb_substr($imdbData->genre, 0, mb_strpos($imdbData->genre, ',')), $pdo);
            $filmData['fil_description'] = $imdbData->plot;
            $filmData['fil_acteurs'] = $imdbData->actors;
        }
    }
}
$year = date('Y');
$categories = getAllCategories($pdo);
$title = 'GCFL - Add a film';
require_once 'inc/header.php';
?>
<main>
			<fieldset>
				<output><?php 
echo $message;
?>
</output>
				<form action="./form_film.php" method="post">
					<?php 
echo outputArrayValueIfExists($filmData, 'fil_id', '<input type="hidden" name="id" value="', '"/>');
?>
					<label>Title: <input name="title"<?php 
echo outputArrayValueIfExists($filmData, 'fil_titre', ' value="', '"');