Exemple #1
0
function update_category()
{
    $conn = connDB();
    $category_name = $_POST['category_name'];
    $category_description = $_POST['category_description'];
    $visibility_status = $_POST['visibility_status'];
    $category_parent = $_POST['category_parent'];
    $category_id = $_POST['hidden_category_id'];
    // CUSTOM
    $rgb_code = $_POST['rgb_code'];
    $code = $_POST['code'];
    $existing_image = $_POST['hidden_image'];
    if (!empty($_FILES['upload_tag_1']['name'])) {
        // ADD FOR ANTICIPATED CROWDED IMAGE NAME @ 4 November 2013
        $file_name = substr($_FILES['upload_tag_1']['name'], 0, -4);
        $file_type = substr($_FILES['upload_tag_1']['name'], -4);
        $uploads_dir = '../files/uploads/tagging_image/';
        //$userfile_name = str_replace(array('(',')',' '),'_',$_FILES['upload_tag_1']['name']);
        $userfile_name = cleanurl($file_name) . $file_type;
        $userfile_tmp = $_FILES['upload_tag_1']['tmp_name'];
        $prefix = 'tag_image-';
        $prod_img = $uploads_dir . $prefix . $userfile_name;
        move_uploaded_file($userfile_tmp, $prod_img);
        $slider_image = $prefix . $userfile_name;
        $filename = "files/uploads/tagging_image/" . $slider_image;
    } else {
        if ($_POST['hidden_image_flag'] == 'deleted') {
            unlink('../' . $existing_image);
            $filename = '';
        } else {
            $filename = $existing_image;
        }
    }
    //if(empty($category_id)){
    //category level
    if ($category_parent == 'top') {
        $category_level = '0';
    } else {
        $get_level = mysql_query("SELECT * from tbl_tags WHERE category_id = '{$category_parent}'", $conn);
        if (mysql_num_rows($get_level) != null) {
            $get_level_array = mysql_fetch_array($get_level);
            $category_level = $get_level_array["category_level"] * 1 + 1;
        }
    }
    $get_order = mysql_query("SELECT * from tbl_tags ORDER BY category_order DESC", $conn);
    if (mysql_num_rows($get_order) != null) {
        $get_order_array = mysql_fetch_array($get_order);
        $category_order = $get_order_array["category_order"] * 1 + 1;
    }
    mysql_query(" UPDATE tbl_tags SET category_name = '{$category_name}',\n                                     category_level = '{$category_level}',\n\t\t\t\t\t\t\t\t\t category_visibility_status = '{$visibility_status}',\n\t\t\t\t\t\t\t\t\t category_description='{$category_description}', \n\t\t\t\t\t\t\t\t\t rgb_code = '{$rgb_code}', \n\t\t\t\t\t\t\t\t\t image = '{$filename}', \n\t\t\t\t\t\t\t\t\t code = '{$code}'\n                 WHERE category_id = '{$category_id}'\n\t\t\t   ", $conn) or die(mysql_error());
    update_category_relation($category_id, $category_parent);
}
Exemple #2
0
 function getAdminToken($type, $token, $tokentime)
 {
     $sql = "SELECT COUNT(*) AS rows FROM `tbl_token` WHERE `type` = '{$type}'";
     $result = $this->fetchData('single', $sql);
     if ($result->rows > 0) {
         $sql = "SELECT `token`, `description`, `created_date`, `parameter` FROM `tbl_token` WHERE `token` = '{$token}'";
         $result = $this->fetchData('single', $sql);
         $temp_token = $this->verify($result->description . cleanurl($result->created_date . $result->parameter), $token);
         if ($temp_token) {
             $result = $result;
         } else {
             $result = 0;
         }
     } else {
         $result = 0;
     }
     return $result;
 }
Exemple #3
0
 function update_category($name, $description, $visibility, $parent, $category_id)
 {
     if ($parent == 'top') {
         $category_level = '0';
     } else {
         $sql = "SELECT * from tbl_category WHERE category_id = '{$parent}'";
         $query = $this->conn->query($sql);
         if ($query->num_rows != null) {
             $get_level_array = $query->fetch_object();
             $category_level = $get_level_array->category_level * 1 + 1;
         }
     }
     $sql = "SELECT * FROM tbl_category ORDER BY category_order DESC";
     $query = $this->conn->query($sql);
     if ($query->num_rows != null) {
         $get_order_array = $query->fetch_object();
         $category_order = $get_order_array->category_order * 1 + 1;
     }
     $get_alias = $this->get_alias($parent);
     if ($parent == 'top') {
         $alias = cleanurl($name);
     } else {
         $alias = $get_alias->category_alias . '-' . cleanurl($name);
     }
     $count_alias = $this->count_alias($alias, $category_id);
     if ($count_alias->rows > 0) {
         $type = 'danger';
         $msg = $name . ' has already existed';
         safe_redirect('detail-category/' . $category_id . '/' . $name);
     } else {
         $alias = $alias;
     }
     $sql = "UPDATE tbl_category  SET category_name = ?,\n\t  \t\t\t\t\t\t\t\t\t  category_alias = ?,\n                                          category_level = ?,\n\t\t\t\t\t\t\t\t\t\t  category_visibility_status = ?,\n\t\t\t\t\t\t\t\t\t\t  category_description = ? \n                 WHERE category_id = ?\n\t\t\t   ";
     $stmt = $this->conn->prepare($sql);
     if ($stmt === false) {
         trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR);
     } else {
         $stmt->bind_param("ssssss", $name, $alias, $category_level, $visibility, $description, $category_id);
         $stmt->execute();
     }
     $stmt->close();
     $this->update_category_relation($category_id, $parent);
 }
Exemple #4
0
                }
            } else {
                $image_delete = filter_var($_POST['delete_news_' . $i], FILTER_SANITIZE_NUMBER_INT);
                if ($image_delete == 1) {
                    $image = '';
                    $_update->delete_news_img($news_id, $i);
                    if (is_file('../' . $news_detail->news_image)) {
                        unlink('../' . $news_detail->news_image);
                    }
                } else {
                    $oldImg = $_get->get_news_image($news_id, $i);
                    /*$image = $oldImg->image;*/
                }
            }
        }
        $image_null = '';
        if ($_req_lang === 'ID') {
            $_update->updateNewsLangField($news_detail->news_category, $image_null, $date, $visibility, $news_id);
            $_update->updateNews($category, $title, $alias, $date, $image_null, $excerpt, $content, $description, $keywords, $visibility, $news_id);
        } else {
            if ($_req_lang === 'EN') {
                $_update->updateNewsLang($title, $alias, $excerpt, $content, $description, $keywords, $news_id);
            }
        }
        $page = 'news-detail/' . $_req_lang . '/' . $news_detail->news_id . '/' . cleanurl(preg_replace("/[^A-Za-z0-9]/", ' ', $alias));
        $type = 'success';
        $msg = 'Changes successfully saved';
        set_alert($type, $msg);
        safe_redirect($page);
    }
}
Exemple #5
0
                  <div class="form-group col-xs-6 hidden" id="id-label-type">
                    <label><?php 
echo $var_bag_lbl_variant;
?>
</label>
                    <select class="form-control" id="id_option_type">
                      
                       <?php 
foreach ($types as $types) {
    echo '<option ';
    if ($types->type_alias == $_REQUEST['prod_type']) {
        echo 'selected = "selected"';
    } else {
        echo '';
    }
    echo ' value="' . BASE_URL . 'item/' . cleanurl($types->category_name) . '/' . $types->product_alias . '/' . $types->type_alias . '">' . $types->type_name . '</option> \\n';
}
?>
                      
                    </select>
                  </div>
                  <div class="form-group col-xs-4 hidden">
                    <label>Size</label>
                    <select class="form-control" id="id_option_stock">
                    
                      <?php 
$total_stock = count($stock);
foreach ($stock as $stock) {
    /* --- DEFAULT STOCK NON SOLD OUT --- */
    $default_stock = $_shop_detail_get->get_default_size($product->type_id, 0, 1);
    echo '<option value="' . $stock->stock_id . '" md_name="' . $stock->stock_name . '" ';
Exemple #6
0
*/
$_get = new LOCATION_GET();
$_update = new LOCATION_UPDATE();
//$full_order  = $_get->count_listing_news_category($search_query, $sort_by, $query_per_page);
//$total_query = $full_order['total_query'];
//$total_page  = $full_order['total_page'];
//$all_news    = $_get->get_listing_news_category($search_query, $sort_by, $first_record, $query_per_page);
/* --- BUTTON HANDLER --- */
if (isset($_POST['btn-insert-new-category']) && $_POST['btn-insert-new-category'] == 'Save Changes') {
    $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
    $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
    $active = filter_var($_POST['active'], FILTER_SANITIZE_STRING);
    $visibility = filter_var($_POST['visibility']);
    $meta_description = filter_var($_POST['meta_description'], FILTER_SANITIZE_STRING);
    $meta_keyword = filter_var($_POST['meta_keyword'], FILTER_SANITIZE_STRING);
    $alias = cleanurl($name);
    $temp_order = $_get->get_max_category_order();
    $order = $temp_order->max_order + 1;
    $count_alias = $_get->count_category($_POST['name']);
    if ($count_alias->rows > 0) {
        $page = 'self';
        $type = 'danger';
        $msg = $name . ' has already existed';
        set_alert($type, $msg);
        safe_redirect($page);
    } else {
        $alias = $alias;
    }
    $_update->insert($name, $alias, $description, $active, $visibility, $meta_description, $meta_keyword, $order);
    $page = 'self';
    $type = 'success';
Exemple #7
0
')">
                       <td>
                         <input type="checkbox" name="color_id[]" value="<?php 
    echo $all_color->gender_id;
    ?>
" id="<?php 
    echo "check_" . $row;
    ?>
" onmouseover="downCheck()" onmouseout="upCheck()" onclick="selectRowCheck('<?php 
    echo $row;
    ?>
')">
                       </td>
                       <td>
                         <a href="<?php 
    echo BASE_URL . 'detail-gender/' . $all_color->gender_id . '/' . cleanurl($all_color->gender_name);
    ?>
">
						   <?php 
    echo $all_color->gender_name;
    ?>
                         </a>
                       </td>
                       <td class="tr">
                         <!--<a href="<?php 
    echo BASE_URL . "product-view/1/top/25/product_name/collection_id-" . $all_color->gender_id;
    ?>
" target="_new">-->
						   <?php 
    echo $total_product->total_products;
    ?>
Exemple #8
0
                    $type = 'error';
                    $msg = 'Error: ' . $error;
                    set_alert($type, $msg);
                    safe_redirect('self');
                }
            } else {
                //$color_id  = $this->color_id[$i];
                $category_image = $_POST["color_image_" . $i];
            }
            $_update->update_category($name, $category_image, $visibility, $parent, $category_id);
            //HILLPAK
            //ACTIVATE NOT HILLPAK $_update->update_category($name, $description, $visibility, $parent, $category_id);
            //if($detail_category->category_level > 0){
            $count_child = $_get->count_childs($category_id);
            if ($count_child->rows > 0) {
                $temp_child = $_get->get_childs($detail_category->category_id);
                foreach ($temp_child as $temp_child) {
                    $child_category_alias = cleanurl($name) . '-' . cleanurl($temp_child->category_name);
                    $child_category_id = $temp_child->category_id;
                    $_update->update_child($child_category_alias, $child_category_id);
                }
            }
            // }
            $page = 'self';
            $type = 'success';
            $msg = 'Changes successfully saved';
            set_alert($type, $msg);
            safe_redirect($page);
        }
    }
}
Exemple #9
0
             throw new Exception("Wrong secured token");
         }
         if (empty($_POST['subject'])) {
             throw new Exception("Missing subject name");
         }
         if (empty($_POST['content'])) {
             throw new Exception("Missing topic content");
         }
         $t = new DB("forum_topics");
         $t->setColPrefix("topic_");
         $t->userid = USER_ID;
         $t->subject = $_POST['subject'];
         $t->forum = $forum_id;
         $t->insert();
         $topic_id = $t->getId();
         $topic_name = cleanurl($_POST['subject']);
         $p = new DB("forum_posts");
         $p->setColPrefix("post_");
         $p->topic = $topic_id;
         $p->user = USER_ID;
         $p->content = $_POST['content'];
         $p->added = time();
         $p->insert();
         $post_id = $p->getId();
         header("location: " . page("forums", "view-topic", "{$topic_name}-" . $topic_id, "", "", "page=p{$post_id}#post{$post_id}"));
     } catch (Exception $e) {
         echo error(_t($e->getMessage()));
     }
 }
 echo "<h4>" . _t("Create topic in") . " " . $db->name . "</h4>";
 ?>
Exemple #10
0
    }
    function get_prod_alias($id)
    {
        $sql = "SELECT * FROM `tbl_product` WHERE `id` = '{$id}'";
        $query = $this->conn->query($sql);
        $result = $query->fetch_object();
        return $result;
    }
}
$_custom = new CUSTOM_PRODUCT();
echo '<input type="hidden" id="custom_product_alias" value="' . $data['product_id'] . '">';
/* --- COLLECTION --- */
include 'custom/products/details/_collection/index.php';
/* --- GENDER --- */
include 'custom/products/details/_gender/index.php';
/* --- REDIRECT --- */
if (isset($_POST['btn-product-detail'])) {
    $alias = cleanurl($_POST['product_name']);
    //$check_product_name = $_custom->check_product_name($alias, $data['product_id']);
    $check_product_name = $_custom->get_prod_alias($data['product_id']);
    /*
    if($check_product_name->rows > 0){
       $product_alias = $alias.'-'.$check_product_name->rows;
    }else{
       $product_alias = $alias;
    }
    */
    $product_alias = $check_product_name->product_alias;
    $page = 'product-details-' . $product_alias;
    safe_redirect($page);
}
Exemple #11
0
$count_promo_banner = $_get->count_promos();
$max_id_promo = $_get->promo_get_maxid();
$item = 12;
$promo_banner = $_get->get_promos($item);
$promo_row = 1;
/* --- BUTTON HANDLER --- */
if (isset($_POST['btn-pages-home']) && $_POST['btn-pages-home'] == "Save Changes") {
    $promo_banner_id = $_POST['promo_id'];
    $promo_order = $_POST['promo_order'];
    foreach ($promo_banner_id as $promo_key => $promo_banner_id) {
        if ($_FILES['upload_promo_' . $promo_banner_id]['name'] != '') {
            $promo_banner_id = filter_var($promo_banner_id, FILTER_SANITIZE_NUMBER_INT);
            $promo_banner_name = substr($_FILES['upload_promo_' . $promo_banner_id]['name'], 0, -4);
            $promo_banner_type = substr($_FILES['upload_promo_' . $promo_banner_id]['name'], -4);
            $promo_uploads_dir = '../files/uploads/promo/';
            $promo_userfile_name = cleanurl(str_replace(array('(', ')', ' '), '_', $promo_banner_name)) . $promo_banner_type;
            $promo_userfile_tmp = $_FILES['upload_promo_' . $promo_banner_id]['tmp_name'];
            $promo_prefix = 'promo-' . $promo_banner_id . "-";
            $promo_prod_img = $promo_uploads_dir . $promo_prefix . $promo_userfile_name;
            move_uploaded_file($promo_userfile_tmp, $promo_prod_img);
            $promo_image = $promo_prefix . $promo_userfile_name;
            $promo_filename = 'files/uploads/promo/' . $promo_prefix . $promo_userfile_name;
            $promo_dml = $_get->check_promos($promo_banner_id);
            $promo_link = addslashes($_POST['promo_link_' . $promo_banner_id]);
            if ($promo_dml->rows > 0) {
                $_update->update_promo($promo_filename, $promo_link, $promo_order, ' ', $promo_banner_id);
            } else {
                if ($count_promo_banner->rows > 0) {
                    $temp_order = $_get->promo_get_max_order(0);
                    $row_order = array();
                    foreach ($temp_order as $temp_order) {
Exemple #12
0
            $alias = $alias;
        }
        /* --- IMAGE --- */
        if ($_FILES['upload_news_1']['name'] != '') {
            $image = upload_file($_global_general->url, 'images', $_FILES['upload_news_1'], 'news', 'files/uploads/news-image/', $ini_max_upload);
        } else {
            $image_delete = filter_var($_POST['delete_news'], FILTER_SANITIZE_NUMBER_INT);
            if ($image_delete == 1) {
                $image = '';
                if (is_file('../' . $news_detail->news_image)) {
                    unlink('../' . $news_detail->news_image);
                }
            } else {
                $image = $news_detail->news_image;
            }
        }
        if ($_req_lang === 'ID') {
            //$_update->updateNewsLangField($news_detail->news_category, $image, $date, $visibility, $news_id);
            $_update->updateNews($category, $title, $title_second, $alias, $date, $image, $excerpt, $content, $description, $keywords, $visibility, $news_id);
        } else {
            if ($_req_lang === 'EN') {
                $_update->updateNewsLang($title, $alias, $excerpt, $content, $description, $keywords, $news_id);
            }
        }
        $page = 'service-detail/' . $_req_lang . '/' . $news_detail->news_id . '/' . cleanurl(preg_replace("/[^A-Za-z0-9]/", ' ', $title));
        $type = 'success';
        $msg = 'Changes successfully saved';
        set_alert($type, $msg);
        safe_redirect($page);
    }
}
Exemple #13
0
          <option <?php 
if (strpos(ACT, 'categories')) {
    echo 'selected="selected"';
}
?>
 value="category">Grouped by Categories</option>
        </select>
        <div class="btn-placeholder" style="margin-bottom:10px;">
          <?php 
if ($date_start != '0000-00-00 00:00:00') {
    echo '<a href="' . BASE_URL . 'reporting/sales-by-category">';
    echo '<input type="button" class="btn btn-danger btn-sm m_r_10" value="Reset">';
    echo '</a>';
}
if (is_file('custom/reports/exports/' . '[' . $_global_general->website_title . ']-' . cleanurl($date_title . ' Sales By Items (Orders)') . '.xlsx')) {
    echo '<a class="hidden" target="_blank" href="' . BASE_URL . 'custom/reports/exports/' . '[' . $_global_general->website_title . ']-' . cleanurl($date_title . ' Sales By Items (Orders)') . '.xlsx">';
    echo '<input type="button" class="btn btn-success btn-sm" value="Download Report">';
    echo '</a>';
} else {
    echo '<a class="hidden" href="http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '">';
    echo '<input type="button" class="btn btn-warning btn-sm" value="Refresh">';
    echo '</a>';
}
?>
        </div>
      </div>
    </div>
    
    <div class="container main">
      <div class="box row">
        <div class="desc col-xs-3">
Exemple #14
0
ini_set('session.gc_maxlifetime', 172800);
// 48 hours
// Session cookie life time
ini_set('session.cookie_lifetime', 172800);
// 48 hours
// Prevent document expiry when user hits Back in browser
session_cache_limiter('private, must-revalidate');
session_name(COOKIE_PREFIX . 'session');
session_start();
//ob_start("ob_gzhandler"); //Uncomment this line and comment the one below to enable output compression.
ob_start();
// Sanitise $_SERVER globals
$_SERVER['PHP_SELF'] = cleanurl($_SERVER['PHP_SELF']);
$_SERVER['QUERY_STRING'] = isset($_SERVER['QUERY_STRING']) ? cleanurl($_SERVER['QUERY_STRING']) : "";
$_SERVER['REQUEST_URI'] = isset($_SERVER['REQUEST_URI']) ? cleanurl($_SERVER['REQUEST_URI']) : "";
$PHP_SELF = cleanurl($_SERVER['PHP_SELF']);
// Redirects to the index if the URL is invalid (eg. file.php/folder/)
if ($_SERVER['SCRIPT_NAME'] != $_SERVER['PHP_SELF']) {
    redirect($settings['siteurl']);
}
define("FUSION_QUERY", isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "");
define("FUSION_SELF", basename($_SERVER['PHP_SELF']));
define("FUSION_REQUEST", isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] != "" ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);
// Variables initializing
$mysql_queries_count = 0;
$mysql_queries_time = array();
$locale = array();
// Calculate ROOT path for Permalinks
$current_path = $_SERVER['REQUEST_URI'];
if (isset($settings['site_path']) && strcmp($settings['site_path'], "/") != 0) {
    $current_path = str_replace($settings['site_path'], "", $current_path);
Exemple #15
0
/* --- CALL FUNCTION --- */
$category = $_get->add_news_category();
/* --- BUTTON HANDLER --- */
if (isset($_POST['btn-add-news']) && $_POST['btn-add-news'] == "Save Changes") {
    $day = date('d');
    $month = date('m');
    $year = date('Y');
    $hour = date('H');
    $minute = date('i');
    $second = date('s');
    $category = filter_var($_POST['category'], FILTER_SANITIZE_STRING);
    $title = filter_var($_POST['title'], FILTER_SANITIZE_STRING);
    $title_second = filter_var($_POST['title_second'], FILTER_SANITIZE_STRING);
    $content = $_POST['content'];
    $excerpt = filter_var($_POST['excerpt'], FILTER_SANITIZE_STRING);
    $alias = cleanurl($_POST['title']);
    $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
    $keywords = filter_var($_POST['keywords'], FILTER_SANITIZE_STRING);
    $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_NUMBER_INT);
    $created_date = $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second;
    $date = $created_date;
    $check_title = $_get->check_news_title($alias);
    if ($check_title->rows > 0) {
        $alias = $alias . '-' . $check_title->rows;
    } else {
        $alias = $alias;
    }
    /* --- IMAGE --- */
    if (isset($_FILES['upload_new_1'])) {
        $image = upload_file($_global_general->url, 'images', $_FILES['upload_news_1'], 'news', 'files/uploads/news-image/', $ini_max_upload);
    } else {
Exemple #16
0
/*
* ----------------------------------------------------------------------
* SEARCH: INDEX
* ----------------------------------------------------------------------
*/

$gender        = filter_var($_REQUEST['gender'], FILTER_SANITIZE_STRING);

if($gender != '' && $gender != 'all'&& $gender != 'all-gender'){
   $gender_query = "AND `gender_hash` = '$gender'";
}else{
   $gender_query = "AND 1";
}

$key           = filter_var($_REQUEST['key'], FILTER_SANITIZE_STRING);
$key           = cleanurl($key);
$sql_query     = "AND (`product_name` LIKE '%$key%' OR `product_alias` LIKE '%$key%') $gender_query";
$category_link = 'search-'.$key;
$js_link       = 'search-index.js';
$dynamic_breadcrumb = 'search: '.$key;
$menu_js       = '';
$keyword       = filter_var($_REQUEST['key'], FILTER_SANITIZE_STRING);



/* --- HIDDEN VALUE FOR KEYWORDS --- */
echo '<input type="hidden" id="id-shop-keyword" value="'.$key.'">';


/* --- START --- */
$_fil_gender_men   = '';
Exemple #17
0
" onclick="selectRow('<?php 
    echo $row;
    ?>
')">
                        <td><input type="checkbox" name="news_id[]" id="<?php 
    echo "check_" . $row;
    ?>
" value="<?php 
    echo $all_news->news_id;
    ?>
" onmouseover="downCheck()" onmouseout="upCheck()" onclick="selectRowCheck('<?php 
    echo $row;
    ?>
')"></td>
                        <td><a href="<?php 
    echo BASE_URL . 'service-detail/ID/' . $all_news->news_id . "/" . cleanurl($all_news->news_title);
    ?>
"><?php 
    echo $all_news->news_title;
    ?>
</a></td>
                        <td><?php 
    echo format_date($all_news->news_date);
    ?>
</td>
                        <td class="text-right">

						  <?php 
    if ($all_news->news_visibility == '1') {
        echo 'Yes';
    } else {
Exemple #18
0
    <div class="row row-20">
      <div class="col-sm-4 col-md-3">
        <div class="detail-fixed">
          <a href="<?php echo BASE_URL;?>#projects" class="bread sans"><i class="fa fa-angle-left"></i> &nbsp;Back</a>
          <p class="m_t_15 m_b_20">
            <span class="sans">Client:</span> <?php echo $dataNews->category_name;?><br>
            <span class="sans">Location:</span> <?php echo $dataNews->category_description;?><br>
          </p>
          <ul class="m_b_20 event-list">

            <?php
            $arrAllUnderNews = array();
            $arrAllImg = '';
            foreach($allNews as $allNews){
              $date   = date('M Y',strtotime($allNews->news_date));
              echo '<li class="active"><span class="sans">'.$date.'-</span> <a href="'.BASE_URL.'project-details/'.$allNews->news_id.'/'.cleanurl($allNews->news_alias).'">'.$allNews->news_title.'</a></li>';

              array_push($arrAllUnderNews, $allNews->news_id);

              foreach($arrAllUnderNews AS $allNews){
                $getAllImg = $_get->get_news_image($allNews);
                $arrAllImg = $getAllImg;
                $row++;
              }
            }
            ?>

          </ul>
          <!-- <div class="hidden-xs">
                <p class="subheader m_b_20">Other Venues &nbsp;<i class="fa fa-angle-down"></i></p>
                <?php include("project/other.php"); ?>
Exemple #19
0
    echo $row;
    ?>
')">
                          <td><input type="checkbox" name="cat_id[]" id="<?php 
    echo "check_" . $row;
    ?>
" value="<?php 
    echo $list_category->category_id;
    ?>
" onmouseover="downCheck()" onmouseout="upCheck()" onclick="selectRowCheck('<?php 
    echo $row;
    ?>
')"></td>
                          <td>
                            <a href="<?php 
    echo BASE_URL . 'article-category-detail/ID/' . $list_category->category_id . '/' . cleanurl($list_category->category_name);
    ?>
">
                              <?php 
    echo $list_category->category_name;
    ?>
                            </a>
                          </td>
                          <td class="tr">
                            <a href="<?php 
    echo BASE_URL . 'article-view/1/' . $list_category->category_id . '/25/news_created_date/-';
    ?>
">
							  <?php 
    echo $list_category->total_news;
    ?>
Exemple #20
0
 function insert_product()
 {
     //include("static/thumbnail.php");
     /* --- DEFINED VARIABLE --- */
     $date = date('Y-m-d H:i:s');
     $date_only = date('d-m-y-H-i-s');
     $product_category = filter_var($this->product_category, FILTER_SANITIZE_NUMBER_INT);
     $product_name = filter_var($this->product_name, FILTER_SANITIZE_STRING);
     $product_size_type_id = filter_var($this->size_type, FILTER_SANITIZE_NUMBER_INT);
     $product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
     $type_id = $this->type_id;
     //array
     $color_id = $this->color_id;
     //array
     $type_name = $this->type_name;
     //array
     $type_code = $this->type_code;
     //array
     $type_price = $this->type_price;
     //array
     $type_description = $this->type_description;
     //array
     $type_sizefit = $this->type_sizefit;
     //array
     $type_image = $this->color_image;
     //double_array
     $type_delete = $this->type_delete;
     //array
     $order = $this->order;
     //double_array
     $image_id = $this->image_id;
     $image_delete = $this->image_delete;
     $stock_quantity = $this->stock_quantity;
     //double_array
     $stock_name = $this->stock_name;
     //double_array
     $type_weight = $this->type_weight;
     $page_title = filter_var($this->page_title, FILTER_SANITIZE_STRING);
     $page_description = filter_var($this->page_description, FILTER_SANITIZE_STRING);
     $page_keywords = filter_var($this->page_keywords, FILTER_SANITIZE_STRING);
     $product_alias = cleanurl($this->product_name, FILTER_SANITIZE_STRING);
     /* --- EDIT PRODUCT --- */
     $this->update_product($product_category, $product_name, $product_size_type_id, $product_alias, $page_title, $page_description, $page_keywords, $product_id);
     /* --- TYPE PRODUCT --- */
     $i = 0;
     $max_order = $this->get_max_type_order();
     foreach ($type_name as $key => $type_name) {
         $i = $key;
         $i = $i + $max_order->maximum_order;
         $temp_type_order = $this->get_type_data($this->type_id[$key]);
         /* --- DELETE PRODUCTS --- */
         if ($this->type_delete[$key] == '1') {
             if ($this->type_id[$key] != '') {
                 $type_id_ = $this->type_id[$key];
                 $this->update_delete_product('1', $type_id_);
                 $this->delete_stocks($type_id);
             }
         } else {
             $type_code = filter_var($this->type_code[$key], FILTER_SANITIZE_STRING);
             $type_name = filter_var($type_name, FILTER_SANITIZE_STRING);
             $type_alias = cleanurl($type_name);
             $type_price = filter_var($this->type_price[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             $type_description = $this->type_description[$key];
             $type_sizefit = $this->type_sizefit[$key];
             $type_information = $this->type_information[$key];
             $color_id = filter_var($this->color_id[$key], FILTER_SANITIZE_NUMBER_INT);
             $type_weight = filter_var($this->type_weight[$key], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             $product_id = filter_var($this->product_id, FILTER_SANITIZE_NUMBER_INT);
             $type_id = filter_var($this->type_id[$key], FILTER_SANITIZE_NUMBER_INT);
             /* --- ADD --- */
             if ($type_id == '') {
                 $this->insert_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $product_id, $i, $page_title, $page_description, $type_alias);
             } else {
                 $this->update_type_id($type_code, $type_name, $type_price, $type_description, $type_sizefit, $type_information, $color_id, $type_weight, $temp_type_order->type_order, $type_alias, $page_title, $page_description, $type_id);
             }
             if ($type_id == '') {
                 $temp = $this->get_max_type_id();
                 $type_id = $temp->max_type_id;
             } else {
                 $type_id = $type_id;
             }
             /* --- END: ADD --- */
             /* --- TYPE COLOR IMAGE--- */
             $i = $key;
             if ($this->color_image["tmp_name"][$i] != null) {
                 $file_type = substr($this->color_image["name"][$i], -4);
                 $file_name = substr($this->color_image["name"][$i], 0, -4);
                 $tmp_name = $this->color_image["tmp_name"][$i];
                 $name = cleanurl($type_name) . "_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type;
                 $error = $this->color_image["error"][$i];
                 if ($error == 0) {
                     move_uploaded_file($tmp_name, "../files/uploads/type_color_image/{$name}");
                     $img_src = "files/uploads/type_color_image/{$name}";
                 } else {
                     $type = 'error';
                     $msg = 'Error: ' . $error;
                     set_alert($type, $msg);
                     safe_redirect('self');
                 }
                 $this->insert_type_color($img_src, $type_id);
             } else {
                 $color_id = $this->color_id[$i];
                 $img_src = $_POST["color_image_" . $i];
             }
             //$this->insert_type_color($img_src, $type_id);
             /* --- TYPE IMAGE --- */
             for ($j = 0; $j < 5; $j++) {
                 $k = $order[$i][$j];
                 //initial order
                 $image_id = $this->image_id[$i][$k];
                 if ($image_id == "") {
                     if ($this->type_image["tmp_name"][$i][$k] != null) {
                         $file_type = substr($this->type_image["name"][$i][$k], -4);
                         $file_name = substr($this->type_image["name"][$i][$k], 0, -4);
                         $tmp_name = $this->type_image["tmp_name"][$i][$k];
                         $name = cleanurl($product_name) . "_" . cleanurl($type_name) . "_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type;
                         $error = $this->type_image["error"][$i][$k];
                         if ($error == 0) {
                             move_uploaded_file($tmp_name, "../files/uploads/product_image/{$name}");
                             $img_src = "files/uploads/product_image/{$name}";
                         } else {
                             $type = 'error';
                             $msg = 'Error: ' . $error;
                             set_alert($type, $msg);
                             safe_redirect('self');
                         }
                         /* --- GENERATE TYPE IMAGE --- */
                         //$tg = new thumbnailGenerator;
                         //$tg->generate('../files/uploads/product_image/'.$name, 260, 195, '../files/uploads/product_image/thumb_260x195/'.$name);
                         $this->insert_type_image($type_id, $img_src, $j);
                     }
                 } else {
                     if ($this->type_image["tmp_name"][$i][$k] != null) {
                         $file_type = substr($this->type_image["name"][$i][$k], -4);
                         $file_name = substr($this->type_image["name"][$i][$k], 0, -4);
                         $tmp_name = $this->type_image["tmp_name"][$i][$k];
                         $name = cleanurl($product_name) . "_" . cleanurl($type_name[$i]) . "_" . $date_only . "_" . cleanurl($file_name) . $file_type;
                         $error = $this->type_image["error"][$i][$k];
                         if ($error == 0) {
                             move_uploaded_file($tmp_name, "../files/uploads/product_image/{$name}");
                             $img_src = "files/uploads/product_image/{$name}";
                         } else {
                             $type = 'error';
                             $msg = 'Error: ' . $error;
                             set_alert($type, $msg);
                             safe_redirect('self');
                         }
                         /* --- CREATE THUMBNAIL --- */
                         //$tg = new thumbnailGenerator;
                         //$tg->generate('../files/uploads/product_image/'.$name, 240, 360, '../files/uploads/product_image/thumb_240x360/'.$name);
                         $this->update_type_image($img_src, $image_id);
                     }
                     $image_delete = filter_var($this->image_delete[$i][$k], FILTER_SANITIZE_NUMBER_INT);
                     if ($image_delete == '1') {
                         $this->delete_type_image($image_id);
                     }
                     $this->update_type_image_order($j, $image_id);
                 }
             }
             /* --- TYPE STOCK --- */
             $this->delete_stock($type_id);
             $stock_name_ = current($stock_name[$i]);
             $product_size_type_id = filter_var($this->size_type, FILTER_SANITIZE_NUMBER_INT);
             foreach ($stock_quantity[$i] as $stock_quantity_) {
                 if ($stock_quantity_ != 0) {
                     $stock_sold_out = 0;
                 } else {
                     $stock_sold_out = 1;
                 }
                 //$this->insert_stock($type_id, $stock_name_, $stock_quantity_, $stock_sold_out);
                 $this->insert_stock($type_id, $product_size_type_id, $stock_name_, $stock_quantity_, $stock_sold_out);
                 $stock_name_ = next($stock_name[$i]);
             }
         }
     }
     $this->check_sold_out($product_id);
     $page = 'product-details-' . $product_alias;
     $type = 'success';
     $msg = 'Changes successfully saved.';
     set_alert($type, $msg);
     //safe_redirect($page);
 }
Exemple #21
0
$post_method = addslashes($_POST['recipe_method']);
$getRecords = getRecords($post_recipes_name);
if ($_POST['btn-add-recipes'] == "Save Changes" || $_POST['btn-add-recipes'] == "Save Changes & Exit") {
    $checkName = getName($post_recipes_name);
    if ($checkName['rows'] > 0) {
        for ($i = 0; $i <= $getRecords['rows']; $i++) {
            $recipe_name = cleanurl($post_recipes_name . randomchr());
        }
    } else {
        $recipe_name = cleanurl($post_recipes_name);
    }
    $uploads_dir = '../files/uploads/recipes_image/';
    $userfile_name = str_replace(array('(', ')', ' '), '_', $_FILES['upload_recipes_1']['name']);
    $userfile_tmp = $_FILES['upload_recipes_1']['tmp_name'];
    $prefix = 'recipes_image-';
    $prod_img = $uploads_dir . $prefix . $userfile_name;
    move_uploaded_file($userfile_tmp, $prod_img);
    $slider_image = $prefix . $userfile_name;
    $filename = "files/uploads/recipes_image/" . $slider_image;
    addNews($post_category_recipes, $post_recipes_name, $filename, $post_recipes_date, $post_ingredients, $post_sauce, $post_method, cleanurl($recipe_name), 'Visible', 'top');
    if ($_POST['btn-add-recipes'] == "Save Changes & Exit") {
        ?>
      <script>
      location.href = "http://<?php 
        echo $_SERVER['HTTP_HOST'] . get_dirname($_SERVER['PHP_SELF']) . "/recipe-detail/" . cleanurl($recipe_name);
        ?>
";
	  </script>
   <?php 
    }
}
Exemple #22
0
                      <p>CHECK BACK IN</p>
                      <p><?php echo 'Time Remaining: '.$time_remaining;?></p>
                    </div>
                  </div>
                  <div class="thumb-label sale hidden"><img src="<?php echo BASE_URL;?>files/common/icon_sale.png"></div>
                  <img class="img-responsive lazy" data-original="<?php echo IMG_URL.$products->img_src.'&h=300&w=400&q=90';?>" width="100%">
                </a>
                </div>
                  <div class="info">
                  	<div class="brand shop-ellipsis">
                      <a class="transition" href="<?php echo BASE_URL."item/".cleanurl($category_link)."/".$products->product_alias."/".$products->type_alias;?>">
					    <?php echo $products->collection_name;?>
                      </a>
                    </div>
                    <div class="title shop-ellipsis">
                      <a class="transition" href="<?php echo BASE_URL."item/".cleanurl($category_link)."/".$products->product_alias."/".$products->type_alias;?>">
					    <?php echo $products->product_name.' '.$products->type_name?>
                      </a>
                    </div>
                  <div>
				  
				  <?php
                  /* --- PRICE --- */
				  if(!empty($products->promo_id) || $products->promo_id = "" || $products->promo_start_datetime <= date('Y-m-d') and $products->promo_end_datetime >= date('Y-m-d')){
				     echo '<span class="price now-price">'.$currency.price(CURRENCY, $price['now_price']).' </span>';
				     echo '<span class="price was-price">'.$currency.price(CURRENCY, $price['was_price']).'</span>&nbsp;|&nbsp; Size '.$_ready_stock;
				  }else{
				     echo '<span class="price normal-price">'.$currency.price(CURRENCY, $price['now_price']).' <i>&nbsp;|&nbsp; Size</i> '.$_ready_stock.'</span>';
				  }
				  ?>
                  
Exemple #23
0
                  <option value="top">All Category</option>
				  <?php 
$_get->listCategory(0, 'top', $root);
?>
                </select>
                <div class="btn-placeholder">
				  <?php 
if ($date_start != '0000-00-00 00:00:00') {
    echo '<a href="' . BASE_URL . 'reporting/sales-by-category">';
    echo '<input type="button" class="btn btn-danger btn-sm m_r_10" value="Reset">';
    echo '</a>';
}
//BASE_URL.'reports/exports/'.date('dm').' Inventory Details ('.$root_name.').xlsx'
//(BASE_URL.'custom/reports/exports/'.'['.$_global_general->website_title.']-'.cleanurl('Inventory Details ('.$root_name.')').'.xlsx');
if (is_file('custom/reports/exports/' . '[' . $_global_general->website_title . ']-' . cleanurl('Inventory Details (' . $root_name . ')') . '.xlsx')) {
    echo '<a target="_blank" href="' . BASE_URL . 'custom/reports/exports/' . '[' . $_global_general->website_title . ']-' . cleanurl('Inventory Details (' . $root_name . ')') . '.xlsx">';
    echo '<input type="button" class="btn btn-success btn-sm" value="Download Report">';
    echo '</a>';
} else {
    echo '<a href="http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '">';
    echo '<input type="button" class="btn btn-warning btn-sm" value="Refresh">';
    echo '</a>';
}
?>
                </div>
              </div>
            </div>

            <div class="container main" id="main-content">
              <div class="box row hidden">
                <div class="desc col-xs-3">
Exemple #24
0
 $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_NUMBER_INT);
 $created_date = $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second;
 $order = $_get->max_order();
 $check_title = $_get->check_news_title($alias);
 if ($check_title->rows > 0) {
     $alias = $alias . '-' . $check_title->rows;
 } else {
     $alias = $alias;
 }
 /* --- IMAGE --- */
 if ($_FILES['upload_news_1']['name'] != '') {
     $file_name = substr($_FILES['upload_news_1']['name'], 0, -4);
     $file_type = substr($_FILES['upload_news_1']['name'], -4);
     $uploads_dir = '../files/uploads/news-image/';
     //$userfile_name = str_replace(array('(',')',' '),'_',$_FILES['upload_news_1']['name']);
     $userfile_name = cleanurl(str_replace(array('(', ')', ' '), '_', $alias)) . $file_type;
     $userfile_tmp = $_FILES['upload_news_1']['tmp_name'];
     $file_error = $_FILES['upload_news_1']['error'];
     $file_type = $_FILES['upload_news_1']['type'];
     $prefix = 'news-' . date('y-m-d-h-i-s') . '-';
     $prod_img = $uploads_dir . $prefix . $userfile_name;
     $allowed_type = array('image/jpeg', 'image/png', 'image/gif');
     /* --- TOTAL SIZE SLIDESHOW --- */
     $image_total = $_FILES['upload_news_1']['size'];
     if ($image_total > $ini_max_upload * 1024000) {
         $type = 'danger';
         $msg = 'Error: Total files upload more than server configuration allowed (Total your file(s) size: ' . $image_total / 1024 . 'kB).';
         set_alert($type, $msg);
         safe_redirect('add-news');
     } else {
         if (!in_array($file_type, $allowed_type)) {
Exemple #25
0
$objPHPExcel->getDefaultStyle()->getFont()->setName('Helvetica')->setSize(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(60);
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(5);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(15);
//title
$objPHPExcel->getActiveSheet()->getStyle('A1:G3')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A1:A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
//header row
$objPHPExcel->getActiveSheet()->getStyle('A5:G5')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('A5:G5')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A5:G5')->getFill()->applyFromArray(array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('rgb' => '000000')));
$objPHPExcel->getActiveSheet()->getStyle('A5:G5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
for ($x = 1; $x <= $rowxls; $x++) {
    $objPHPExcel->getActiveSheet()->getRowDimension($x)->setRowHeight(22);
}
$objPHPExcel->getActiveSheet()->getStyle('A1:G' . $rowxls)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A6:B' . $rowxls)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
$objPHPExcel->getActiveSheet()->getStyle('C6:G' . $rowxls)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
// Rename sheet
//echo date('H:i:s') . " Rename sheet\n";
$objPHPExcel->getActiveSheet()->setTitle('Categories');
// Save Excel 2007 file
//echo date('H:i:s') . " Write to Excel2007 format\n";
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save('custom/reports/exports/' . '[' . $_global_general->website_title . ']-' . cleanurl($date_title . ' Sales By Items (Categories)') . '.xlsx');
// Echo done
//echo date('H:i:s') . " Done writing file.\r\n";
Exemple #26
0
')">
                              <td><input type="checkbox" name="cat_id[]" id="<?php 
        echo "check_" . $row;
        ?>
"
                                         value="<?php 
        echo $list_category->category_id;
        ?>
" onmouseover="downCheck()"
                                         onmouseout="upCheck()" onclick="selectRowCheck('<?php 
        echo $row;
        ?>
')"></td>
                              <td>
                                <a href="<?php 
        echo BASE_URL . 'services-category-detail/ID/' . $list_category->category_id . '/' . cleanurl($list_category->category_name);
        ?>
">
                                  <?php 
        echo $list_category->category_name;
        ?>
                                </a>
                              </td>
                              <!--                           <td class="tr">
                            <a href="<?php 
        echo BASE_URL . 'services-view/1/' . $list_category->category_id . '/25/news_created_date/-';
        ?>
">
							  <?php 
        echo $list_category->total_news;
        ?>
Exemple #27
0
    if ($_SESSION['dual-language'] === 'ID') {
        $featured->product_name = $featured->product_name;
    } else {
        $countFeatured = $_get->countFeaturedLang($featured->featured_type_id);
        if ($countFeatured->rows > 0) {
            $getFeaturedLang = $_get->getFeaturedLang($featured->featured_type_id);
            $featured->product_name = $getFeaturedLang->product_name;
        } else {
            $featured->product_name = $featured->product_name;
        }
    }
    ?>
			
			<div class="thumb col-xs-6 col-sm-3 col-md-2 col-lg-2">
				<a href="<?php 
    echo BASE_URL . "item/" . cleanurl($featured->category_name) . "/" . $featured->product_alias . "/" . $featured->type_alias;
    ?>
">
				<div class="img">
					<div class="loading"></div>
							
					<?php 
    $_shop->discount_label($featured->promo_item_id, $featured->promo_start_datetime, $featured->promo_end_datetime, BASE_URL);
    $_shop->new_in_label($featured->new_id, $featured->new_start, $featured->new_end, BASE_URL);
    if ($product_stock->total_stock == 0) {
        echo '<div class="thumb-label sold-out">' . $var_lbl_soldout . '</div>';
    }
    ?>
							
					<img class="img-responsive opac" src="<?php 
    echo BASE_URL . 'admin/static/thimthumb.php?src=' . $featured->img_src . "&w=300&h=400&q=100";
Exemple #28
0
" alt="" />
  </div>
</section>

<section class="blogie plain">
  <div class="container">
    <div class="row row-10">
      <div class="col-md-10 col-md-offset-1">

        <?php 
foreach ($all_news as $blog) {
    /* --- SHARER --- */
    $title = urlencode($blog->news_title);
    $url = urlencode(BASE_URL . "read-blog/" . substr($blog->news_date, 0, 10) . '/' . $blog->category_alias . '/' . $blog->news_alias);
    $image = urlencode(BASE_URL . $blog->news_image);
    $twitter_link = 'http://twitter.com/share?text=' . $title . '&url=' . $url . '&hashtags=' . cleanurl($_global_general->website_title);
    ?>

          <div class="article clearfix">
            <div class="row row-15">
              <div class="col-sm-3 col-md-4">
                <div class="img">
                  <img src="<?php 
    echo IMG_URL . $blog->news_image . '&w=300&q=100';
    ?>
" class="img-responsive" alt="" width="100%"/>
                </div>
              </div>
              <div class="col-sm-8 col-md-7">
                <div class="article-box">
                  <div class="head-detail">
        echo '<li class="' . $toggleSubMenu . '"><span><a href="#">' . $Cat[$i] . '</a></span>' . "\n";
    } else {
        echo '<li><a href="' . $Url[$i] . '">' . $Cat[$i] . '</a>' . "\n";
    }
    echo '<ul class="' . $subMenu_class . '">' . "\n";
    if (file_exists('db/' . $CId[$i] . '.dat')) {
        @($sub_lines = file('db/' . $CId[$i] . '.dat'));
        $x = 0;
        natcasesort($sub_lines);
        foreach ($sub_lines as $sub_data) {
            if (!empty($sub_data)) {
                list($spare, $CatId, $SubTitle, $SubId) = explode("|", $sub_data);
                if ($rewriting == 0) {
                    echo '<li><a href="products.php?cat=' . $CId[$i] . '&prod=' . $SubId . '" class="subMenu">' . $SubTitle . '</a></li>' . "\n";
                } else {
                    echo '<li><a href="content-' . cleanurl($Cat[$i]) . '-' . cleanurl($SubTitle) . '-' . $CId[$i] . '-' . $SubId . '.html" class="subMenu">' . $SubTitle . '</a></li>' . "\n";
                }
                $x++;
            }
        }
    }
    echo '</ul>';
    echo '</li>';
}
?>
<!-- Preload button rollover -->
<img src="img/display_ho.png" width="1" height="1" border="0" style="display: none"> 
<img src="img/button_cart_ho.png" width="1" height="1" border="0" style="display: none"> 
<img src="img/submit_ho.png" width="1" height="1" border="0" style="display: none"> 
<img src="img/download_ho.png" width="1" height="1" border="0" style="display: none"> 
<img src="img/cart_ho.png" width="1" height="1" border="0" style="display: none"> 
Exemple #30
0
if (isset($_POST['btn-add-collection']) && $_POST['btn-add-collection'] == 'Save Changes') {
    $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
    $check = $_get->count_products($name);
    $record = $_get->count_gender();
    if ($record->rows > 0) {
        $max_order = $_get->get_order();
    } else {
        $max_order = 1;
    }
    if ($check->rows > 0) {
        $type = 'danger';
        $msg = $name . ' has already existed, please choose another gender name';
    } else {
        $active = '1';
        $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING);
        $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
        $hash = cleanurl($_POST['name']);
        if ($record->rows > 0) {
            $order = $max_order->max_order + 1;
        } else {
            $order = 1;
        }
        $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING);
        $_update->insert($name, $description, $order, $active, $visibility, $hash);
        $type = 'success';
        $msg = 'Item(s) has been successfully added.';
    }
    $page = 'self';
    set_alert($type, $msg);
    safe_redirect($page);
}