本文整理汇总了PHP中category::getCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP category::getCategories方法的具体用法?PHP category::getCategories怎么用?PHP category::getCategories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::getCategories方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$(function() {
$("#select_city").change(function() {
var list = $("#select_city").children();
list.each(function() {
if(this.selected == true){
$("#location_find").val(this.text);
}
});
});
});
$(function() {
$( "#incident_title" ).focus();
$( "#incident_title" ).autocomplete({
source: <?php
echo category::getCategories($categories);
?>
,
minLength: 2,
select: function( event, ui ) {
// $( '#incident_category' ).val(ui.item.incident_category);
$('input[name=incident_category]').val(ui.item.incident_category);
// $('input[name=incident_category[]]').val('Array ( [0] => '+ui.item.incident_category+')');
$( '#incident_title' ).val(ui.item.label);
}
});
});
</script>
<!-- HTML -->
示例2: category
<?php
// Includng configuration file
include 'config/config.php';
//Check user is already login or not
checkAuthentication();
$id = $_SESSION['adminid'];
$category = new category();
$categories = $category->getCategories($id);
$smarty->assign('action', 'category');
$smarty->assign('toolbar', $smarty->fetch('toolbar.tpl'));
if (isset($_GET['action']) && $_GET['action'] == 'new') {
$smarty->assign('content', $smarty->fetch('addcategory.tpl'));
} elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
$id = $_GET['id'];
$categories = $category->getCategory($id);
$smarty->assign('category', $categories);
$smarty->assign('content', $smarty->fetch('editcategory.tpl'));
} elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
$data = $_POST;
if ($category->addCategory($data)) {
header('Location: ' . FRONTEND . 'category.php');
exit;
}
} elseif (isset($_POST['action']) && $_POST['action'] == 'update') {
$data = $_POST;
if ($category->updateCategory($data)) {
header('Location: ' . FRONTEND . 'category.php');
exit;
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'search') {
示例3: product
<?php
// Includng configuration file
include 'config/config.php';
//Check user is already login or not
checkAuthentication();
$product = new product();
$category = new category();
$smarty->assign('categories', $category->getCategories());
if (isset($_GET['action']) && $_GET['action'] == 'new') {
$smarty->assign('content', $smarty->fetch('additem.tpl'));
} elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
$id = $_GET['id'];
$producted = $product->getProduct($id);
$smarty->assign('product', $producted);
$smarty->assign('content', $smarty->fetch('edititem.tpl'));
} elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
$file = $_FILES;
$data = $_POST['data']['Item'];
$data['image'] = $file['name'];
if ($product->checkProduct($data)) {
$_SESSION['message'] = 'Product with catalog no already exist. Please search with product sku and update details.';
header('Location: ' . FRONTEND . 'inventory.php');
exit;
} else {
if ($product->addProduct($data)) {
header('Location: ' . FRONTEND . 'inventory.php');
exit;
}
}
} elseif (isset($_POST['action']) && $_POST['action'] == 'update') {
示例4: category
require_once 'api/Twig/Autoloader.php';
require_once 'api/class_question.php';
require_once 'api/class_category.php';
require_once 'api/class_mysql.php';
require_once 'api/class_user.php';
require_once 'conf/mysql.php';
require_once 'site/module/category/category.php';
# TWIG Config
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('site/templates');
$twig = new Twig_Environment($loader);
#Basic Layout laden
$template = $twig->loadTemplate('index.html');
# Kategorien
$c1 = new category();
$categories = $c1->getCategories();
$q1 = new class_question();
$questionCount = $q1->getQuestionCount();
$u1 = new class_user();
$regions = $u1->getRegionList();
# Frage
$favorite_indexCardCount = $q1->getIndexCardFavoriteCount();
$question = $q1->getRandomQuestion();
#Lernkartei
$indexCards = $q1->getIndexCardCounts();
#Fragenkatalog
$level = 1;
$questions = $q1->getQuestionsByLevel($level);
$logged_in = true;
echo $template->render(array('logged_in' => $logged_in, 'questionCount' => $questionCount, 'question' => $question, 'categories' => $categories, 'indexCards' => $indexCards, 'questions' => $questions, 'regions' => $regions));
示例5: header
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
exit;
}
if ($permission["editcateg"]) {
$id = $_GET['cat'];
$parent_id = $_GET['parent_id'];
$cat = new category();
$categories = $cat->getAllCategories();
unset($cat->categories);
$cat->getCategories($parent_id, false);
$cat->buildTree($parent_id);
print "<h2>" . $PMF_LANG["ad_categ_edit_1"] . " <em>" . $categories[$id]["name"] . "</em> " . $PMF_LANG["ad_categ_edit_2"] . "</h2>\n";
?>
<form action="<?php
print $_SERVER["PHP_SELF"] . $linkext;
?>
" method="post">
<fieldset>
<legend><?php
print $PMF_LANG["ad_categ_edit_1"];
?>
</legend>
<input type="hidden" name="aktion" value="changecategory" />
<input type="hidden" name="cat" value="<?php
print $id;