Beispiel #1
0
        return $startVal;
    } else {
        return 1 + level($obj->s_parent, $mysqli, $startVal);
    }
}
function parent($id, $mysqli)
{
    $query = "SELECT s_parent FROM shop WHERE s_rowID='{$id}'";
    $result = $mysqli->query($query);
    $obj = $result->fetch_object();
    return $obj->s_parent;
}
if (isset($_GET['parent'])) {
    $parent = $_GET['parent'];
} else {
    $parent = parent($_GET['ID'], $mysqli);
}
if (isset($_GET['parent'])) {
    $level = level($_GET['parent'], $mysqli, 1);
} else {
    $level = level($_GET['ID'], $mysqli, 0);
}
if ($level == 0) {
    $parent = 0;
}
/*
echo "level: $level<br/>";
echo "parent: $parent<br/>";
*/
path($_GET['ID'], $parent, $mysqli);
/* *** DB handling *** */
 /**
  * Default Constructor. 
  * 
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent();
     $this->setName('DB Realm');
     $this->_db = DB::instance();
 }
Beispiel #3
0
 /**
  * Enqueues style for SASS comnpile or WP enqueue, depending on 'use_sass' arg.
  *
  * @since       3.3.9
  * @access      public
  *
  * @param       string $handle   Name of the stylesheet.
  * @param       string $css_src  Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
  * @param       string $scss_dir Directory path to SCSS file.
  * @param       array  $deps     An array of registered style handles this stylesheet depends on. Default empty array.
  * @param       string $ver      String specifying the stylesheet version number, if it has one. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the stylesheet.
  * @param       string $media    Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print', 'screen', 'tty', or 'tv'.
  *
  * @return      void
  */
 function redux_enqueue_style($parent, $handle, $css_src, $scss_dir, $deps = array(), $ver = '', $media = false)
 {
     if ($parent->args['sass']['enabled']) {
         self::$parent = $parent;
         //if ($parent->args['dev_mode'] || $parent->args['sass']['page_output']) {
         $path_parts = pathinfo($css_src);
         $filename = $path_parts['filename'];
         //echo $filename . '<br>';
         $scss_dir = Redux_Helpers::cleanFilePath($scss_dir);
         $scss_dir = untrailingslashit($scss_dir);
         $is_diff = reduxSassCompiler::is_scss_newer($scss_dir, $filename);
         if ($is_diff) {
             reduxSassCompiler::compile_single_field($parent, $scss_dir, $filename);
             reduxSassCompiler::$_do_compile = true;
         }
         reduxSassCompiler::add_path($scss_dir);
         reduxSassCompiler::add_import('@import "' . $filename . '.scss"');
         //}
     } else {
         wp_enqueue_style($handle, $css_src, $deps, $ver, $media);
     }
 }
Beispiel #4
0
?>
">
                        <a href="#"> <i class="fa fa-users"></i> <span>Users</span> <i class="fa fa-angle-left pull-right"></i></a>
                        <ul class="treeview-menu">
                            <li class="<?php 
echo child('list');
?>
"><a href="user_list"><i class="fa fa-circle-o"></i> List Users</a></li>
                            <li class="<?php 
echo child('add');
?>
"><a href="user_add"><i class="fa fa-circle-o"></i> Add User</a></li>
                        </ul>
                    </li>
                    <li class="treeview <?php 
echo parent('category');
?>
">
                        <a href="#"> <i class="fa fa-users"></i> <span>Categories</span> <i class="fa fa-angle-left pull-right"></i></a>
                        <ul class="treeview-menu">
                            <li class="<?php 
echo child('list');
?>
"><a href="category_list"><i class="fa fa-circle-o"></i> List Categories</a></li>
                            <li class="<?php 
echo child('add');
?>
"><a href="category_add"><i class="fa fa-circle-o"></i> Add Category</a></li>
                        </ul>
                    </li>
                    <!-- Optionally, you can add icons to the links -->
Beispiel #5
0
        if (parent()->engine->force < 1) {
            echo "Not enough force to roll, give it some gas.\n";
        } else {
            echo "Rolling...\n";
        }
    };
    return this();
}, 'car');
/**
 * This is a derived "plane" object of the "vehicle" type. It allows you to "fly" if
 * enough force is given to its "engine" object component.
 */
$plane = proto(function ($engine) use($vehicle) {
    proto($vehicle($engine));
    this()->fly = function () {
        if (parent()->engine->force < 2) {
            echo "Not enough force to fly, give it some gas.\n";
        } else {
            echo "Flying...\n";
        }
    };
    return this();
}, 'plane');
/**
 * This is a derived "amphibious" object of the "car" and "plane" type. It is also a derived
 * of the "vehicle" type because of "car" and "plane". This allows multiple inheritance. This
 * object can "roll" and "fly" without having to implement any logic.
 */
$amphibious = proto(function ($engine) use($car, $plane) {
    proto($car($engine));
    proto($plane($engine));
Beispiel #6
0
?>
">
                        <a href="#"> <i class="fa fa-list"></i> <span> Vendor Items</span> <i class="fa fa-angle-left pull-right"></i></a>
                        <ul class="treeview-menu">
                            <li class="<?php 
echo child('list');
?>
"><a href="item_list"><i class="fa fa-circle-o"></i> List Items</a></li>
                            <li class="<?php 
echo child('add');
?>
"><a href="item_add"><i class="fa fa-circle-o"></i> Add Item</a></li>
                        </ul>
                    </li>
                    <li class="treeview <?php 
echo parent('user');
?>
">
                        <a href="#"> <i class="fa fa-users"></i> <span>Users</span> <i class="fa fa-angle-left pull-right"></i></a>
                        <ul class="treeview-menu">
                            <li class="<?php 
echo child('list');
?>
"><a href="user_list"><i class="fa fa-circle-o"></i> List Users</a></li>
                            <li class="<?php 
echo child('add');
?>
"><a href="user_add"><i class="fa fa-circle-o"></i> Add User</a></li>
                        </ul>
                    </li>
                    <!-- Optionally, you can add icons to the links -->
function subcategories($cat_name)
{
    global $conn;
    $query = "SELECT * FROM Categories WHERE parent_cat = ?";
    $stm = $conn->prepare($query);
    $stm->execute(array(category()));
    $parent = $stm->fetchAll();
    $links = parent();
    $links .= "<ul>";
    foreach ($parent as $row) {
        $links .= "<li><a href='category.php?cat=" . $row['cat_id'] . "'>" . $row['cat_name'] . "</a></li>";
    }
    $links .= "</ul>";
    $links .= "<hr><li><a href='category.php?cat=0'>Back</a></li>";
    echo $links;
}