function showCategory($level, $parent, $current_category, $one, $two, $three, $four, $tot_query, $row) { $conn = connDB(); $get_data = mysql_query("SELECT \n cat.category_id, cat.category_name, cat.category_level, cat.category_order, cat.category_active_status, cat.category_visibility_status,\n\t\t\t\t\t\t\trel.relation_id, rel.category_child, rel.category_parent, rel.relation_level,\n\t\t\t\t\t\t\tCOUNT( prod.id ) AS total_product, prod.product_name\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tFROM tbl_tag AS cat LEFT JOIN tbl_product AS prod ON cat.category_id = prod.product_category\n\t\t\t\t\t\t\t INNER JOIN tbl_tag_relation AS rel ON cat.category_id = rel.category_child\n\t\t\t\t\t\t\tWHERE {$one} AND cat.category_level = '{$level}' AND rel.category_parent = '{$parent}'\n\t\t\t\t\t\t\tGROUP BY category_id\n\t\t\t\t\t\t\tORDER BY {$two} \n\t\t\t\t\t\t\tLIMIT {$three}, {$four}\n\t\t\t\t\t\t ", $conn); if (mysql_num_rows($get_data) != null && mysql_num_rows($get_data) != 0) { for ($counter = 1; $counter <= mysql_num_rows($get_data); $counter++) { $get_data_array = mysql_fetch_array($get_data); $new_level = $level * 1 + 1; $new_parent = $get_data_array["category_id"]; $cat_name = $get_data_array['category_name']; $cat_active = $get_data_array['category_active_status']; $cat_visibility = $get_data_array['category_visibility_status']; echo "<tr class=\"odd\" id=\"row_" . $row . "\" onclick=\"selectRow('" . $row . "')\">"; echo "<td><input type=\"checkbox\" name=\"category_id[]\" value=\"" . $new_parent . "\" id=\"check_" . $row . "\" onmouseover=\"downCheck()\" onmouseout=\"upCheck()\" onclick=\"selectRowCheck('" . $row . "')\"></td>"; echo "<td><a href=\"#\""; echo "category_name=\"ucwords(strtolower(" . $cat_name . "))\""; echo "active=\"" . $cat_active . "\""; echo "cat_id=\"" . $new_parent . "\""; echo "visible=\"" . $cat_visibility . "\""; echo "id=\"link-category-" . $new_parent . "\">"; for ($i = 0; $i < $level; $i++) { echo '-- '; } echo ucwords(strtolower($cat_name)) . "</a></td>"; echo "<td class=\"tr\"><a href=\"\">" . $get_data_array['total_product'] . "</a></td>"; echo "<td>" . $cat_active . "</td>"; echo "<td>" . $cat_visibility . "</td>"; echo "</tr>"; $new_row = $row * 1 + 1; showCategory($new_level, $new_parent, $current_category, $one, $two, $three, $four, $tot_query, $new_row); } } }
break; case "oneclick": $msg = oneClick(); showMaintenance($option); if ($msg) { echo "<script language=\"JavaScript\">window.onload=displayResult('{$msg}')</script>"; } break; case "editmailformat": showMailFormat($option); break; case "editsmsdetails": showSMSDetails($option); break; case "editsubscribers": showCategory($option); break; case "showsubscribers": showSubscribers($option); break; case "showmaintenance": showMaintenance($option); break; case "showbackup": showBackup($option); break; case "savecategory": saveCategory($option); break; case "savemailformat": saveMailFormat($option);
$level0 = $level == 0 ? $categoryStd->name : ""; $level1 = $level == 1 ? $categoryStd->name : ""; $level2 = $level == 2 ? $categoryStd->name : ""; $return = "<tr class=\"gradeX\">"; $return .= "<td class=\"con0\">" . $level0 . "</td>"; $return .= "<td class=\"con1\">" . $level1 . "</td>"; $return .= "<td class=\"con0\">" . $level2 . "</td>"; $return .= "<td class=\"center con1\">\n \t<a href=\"" . Config::getRootPath("backend/category/edit/level.{$level}/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/edit.png') . "\" alt=\"\"></a>\n \t<a href=\"" . Config::getRootPath("backend/category/delete/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a> \t\n \t</td>\n \t"; return $return; } foreach ($HttpContentResult->array_category as $categoryLevel0) { echo showCategory($categoryLevel0, 0); foreach ($categoryLevel0->__array_category as $categoryLevel1) { echo showCategory($categoryLevel1, 1); foreach ($categoryLevel1->__array_category as $categoryLevel2) { echo showCategory($categoryLevel2, 2); } } } //end foreach ?> </tbody> <tfoot> <tr> <th class="head0">Segmento</th> <th class="head1">Categoria</th> <th class="head0">SubCategoria</th> <th class="head1">Ações</th> </tr> </tfoot>
$checked = " checked = \"checked\""; } else { //$checked = " checked = \"__$level2id nao ".implode("|", $vo->categories_dad)."\""; } $return .= "<td class=\"con0\"><input type=\"checkbox\" {$checked} value=\"" . $level2id . "\" name=\"category[]\"> " . $level2 . "</td>"; } else { $return .= "<td class=\"con0\">" . $level2 . "</td>"; } return $return; } foreach ($HttpContentResult->array_category as $categoryLevel0) { echo showCategory($categoryLevel0, 0); foreach ($categoryLevel0->__array_category as $categoryLevel1) { echo showCategory($categoryLevel1, 1); foreach ($categoryLevel1->__array_category as $categoryLevel2) { echo showCategory($categoryLevel2, 2, $HttpContentResult->vo); } } } //end foreach ?> </tbody> <tfoot> <tr> <th class="head0">Segmento</th> <th class="head1">Categoria</th> <th class="head0">SubCategoria</th> </tr> </tfoot> </table>
function Categories_Spider_Catalog() { ////////including functions for categories require_once "Categories.php"; require_once "Categories.html.php"; if (!function_exists('print_html_nav')) { require_once "nav_function/nav_html_func.php"; } if (isset($_GET["task"])) { $task = $_GET["task"]; } else { $task = ''; } if (isset($_GET["id"])) { $id = $_GET["id"]; } else { $id = 0; } global $wpdb; switch ($task) { case 'add_cat': add_category(); break; case 'publish_cat': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } change_cat($id); showCategory(); break; case 'publish': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); publish_all(TRUE); showCategory(); break; case 'unpublish_cat': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } change_cat($id); showCategory(); break; case 'unpublish': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); publish_all(FALSE); showCategory(); break; case 'edit_cat': if ($id) { editCategory($id); } else { $id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "spidercatalog_product_categories"); editCategory($id); } break; case 'save': if ($id) { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); apply_cat($id); } else { save_cat(); check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); } showCategory(); break; case 'apply': if ($id) { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); apply_cat($id); editCategory($id); } else { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); $true = save_cat(); if ($true) { $id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "spidercatalog_product_categories"); editCategory($id); } else { ?> <h1>Database Error Please install plugin again</h1><?php showCategory(); } } break; case 'remove_cat': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } removeCategory($id); showCategory(); break; case 'delete': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); delete_all(); showCategory(); break; default: showCategory(); break; } }
<div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle collapsed" title="<?php echo $category->title; ?> " data-toggle="collapse" data-parent="#dropdownCat" href="#collapse_<?php echo $category->id; ?> "><?php echo $category->title; ?> <b class="caret pull-right"></b></a> </div> <div id="collapse_<?php echo $category->id; ?> " class="accordion-body collapse"> <div class="accordion-inner"> <?php if ($category->children) { ?> <?php showCategory($category->children); ?> <?php } ?> </ul> </div> </div> </div>
<?php require '../../../../../wp-load.php'; if (isset($_POST['myAction'])) { $action = $_POST['myAction']; switch ($action) { case 'category': showCategory($_POST['category']); break; case 'size': showSizes($_POST['category']); break; } } function show($p) { $args = array('post_type' => 'page', 'name' => $p); $query = new WP_Query($args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); ?> <h1><?php the_title(); ?> </h1> <?php the_content(); ?> <?php }