本文整理汇总了PHP中Categorie::get_all_categories方法的典型用法代码示例。如果您正苦于以下问题:PHP Categorie::get_all_categories方法的具体用法?PHP Categorie::get_all_categories怎么用?PHP Categorie::get_all_categories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categorie
的用法示例。
在下文中一共展示了Categorie::get_all_categories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _categories
function _categories($fk_parent = 0, $keyword = '')
{
global $db, $conf;
$TFille = array();
if (!empty($keyword)) {
$resultset = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie WHERE label LIKE '%" . addslashes($keyword) . "%' ORDER BY label");
while ($obj = $db->fetch_object($resultset)) {
$cat = new Categorie($db);
$cat->fetch($obj->rowid);
$TFille[] = $cat;
}
} else {
$parent = new Categorie($db);
if (empty($fk_parent)) {
if (empty($conf->global->SPC_DO_NOT_LOAD_PARENT_CAT)) {
$TFille = $parent->get_all_categories(0, true);
}
} else {
$parent->fetch($fk_parent);
$TFille = $parent->get_filles();
}
}
return $TFille;
}
示例2: foreach
foreach ($cats as $cat) {
$ways = $cat->print_all_ways();
foreach ($ways as $way) {
$i = !$i;
print "<tr " . $bc[$i] . "><td>" . $way . "</td>";
print "<td><a href= '" . DOL_URL_ROOT . "/fourn/product/categorie.php?id=" . $product->id . "&cat=" . $cat->id . "'>" . $langs->trans("DeleteFromCat") . "</a></td></tr>\n";
}
}
print "</table><br/><br/>\n";
} else {
if ($cats < 0) {
print $langs->trans("ErrorUnknown");
} else {
print $langs->trans("NoCat") . "<br/><br/>";
}
}
}
print $langs->trans("AddProductToCat") . "<br/><br/>";
print '<table class="border" width="100%">';
print '<form method="POST" action="' . DOL_URL_ROOT . '/fourn/product/categorie.php?id=' . $product->id . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print "<tr><td><select name='add_cat'><option value='-1'>" . $langs->trans("Choose") . "</option>";
$cat = new Categorie($db);
foreach ($cat->get_all_categories() as $categorie) {
print "<option value='" . $categorie->id . "'>" . $categorie->label . "</option>\n";
}
print "</select></td><td><input type='submit' value='" . $langs->trans("Select") . "'></td></tr>";
print "</form></table><br/>";
}
$db->close();
llxFooter();
示例3: Categorie
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
if (!$user->rights->categorie->lire) accessforbidden();
llxHeader ("","",$langs->trans("Categories"));
print_fiche_titre ($langs->trans ("CatList"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
$c = new Categorie ($db);
$cats = $c->get_all_categories ();
if ($cats != -1)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="right">'.$langs->trans("Type").'</td>';
print '</tr>';
$var=true;
foreach ($cats as $cat)
{
$var = ! $var;