rendered paste body<?php$product_class = new ProductsAdmin($database);switch ($_REQUEST["action"]){ case "view_category": $product_categories = array(); $product_class->CategoryList(0, 0, $product_categories, false); $theme->assign('items', $product_categories); $fetch_tpl = "product/category_view.tpl"; break; case "edit_category": case "add_category": switch ($_REQUEST["action"]) { case "add_category": $category_value->title = ""; $category_value->posi = "1"; $category_value->action = $_REQUEST["action"]; $category_value->id = ""; $category_value->active = true; break; case "edit_category": $category_details = $product_class->ShowCategory($_REQUEST["id"],false); $category_value->title = $category_details->title; $category_value->posi = $category_details->posi; $category_value->action = $_REQUEST["action"]; $category_value->id = $category_details->id; $category_value->parent = $category_details->parent; if($category_details->active == "1") $category_value->active = true; break; } if(isset($_REQUEST["formsubmit"])) { $category_value->title = $_REQUEST["title"]; $category_value->posi = $_REQUEST["posi"]; $category_value->id = $_REQUEST["id"]; if($_REQUEST["active"] == "1") $category_value->active = true; if($_REQUEST["action"] == "add_category") { $product_class->AddCategory(); $progress->Location("admin.php?page=product&action=view_category"); } else { $product_class->EditCategory($_REQUEST["id"]); } } $product_categories = array(); $product_class->CategoryArray(0, "-", $product_categories, false); $cat_select = new FormClass("parent"); $cat_select->option = $product_categories; $cat_select->value = $category_value->parent; $cat_select->class = "inputfield"; $cat_select->style = "width:250px"; $items->category = $cat_select->AddSelectBox(); $title_input = new FormClass("title"); $title_input->class = "inputfield"; $title_input->style = "width:250px"; $title_input->value = $category_value->title; $items->title = $title_input->AddInput("text"); $posi_input = new FormClass("posi"); $posi_input->class = "inputfield"; $posi_input->style = "width:18px"; $posi_input->value = $category_value->posi; $items->posi = $posi_input->AddInput("text"); $active_input = new FormClass("active"); $active_input->value = 1; $active_input->checked = $category_value->active; $items->active = $active_input->AddInput("checkbox"); $submit_input = new FormClass("formsubmit"); $submit_input->class = "button"; $submit_input->value = "Gönder"; $items->submit = $submit_input->AddInput("submit"); $action_input = new FormClass("action"); $action_input->value = $category_value->action; $items->action = $action_input->AddInput("hidden"); $page_input = new FormClass("page"); $page_input->value = "product"; $items->page = $page_input->AddInput("hidden"); $id_input = new FormClass("id"); $id_input->value = $category_value->id; $items->id = $id_input->AddInput("hidden"); $theme->assign('items', $items); $fetch_tpl = "product/category_form.tpl"; break; case "delete_category": $product_class->DeleteCategory($_REQUEST["id"]); $progress->Location("admin.php?page=product&action=view_category"); break; case "add_product": case "edit_product": include("fck2/fckeditor.php"); $product_info = new FCKeditor('info'); $product_info->BasePath = "fck2/"; $product_info->Height = 120; $product_more = new FCKeditor('more'); $product_more->BasePath = "fck2/" ; $product_more->Height = 350; switch ($_REQUEST["action"]) { case "add_product": $product_value->category = ""; $product_value->title = ""; $product_value->picture = ""; $product_value->top = false; $product_value->active = true; $product_value->action = $_REQUEST["action"]; $product_value->id = ""; break; case "edit_product": $product_details = $product_class->ShowProduct($_REQUEST["id"], false); $product_value->category = $product_details->category; $product_value->title = $product_details->title; $product_value->picture = $product_details->picture; $product_value->action = $_REQUEST["action"]; $product_value->id = $product_details->id; if($product_details->top == "1") $product_value->top = true; if($product_details->active == "1") $product_value->active = true; $product_info->Value = $product_details->info; $product_more->Value = $product_details->more; break; } if(isset($_REQUEST["formsubmit"])) { $product_value->title = $_REQUEST["title"]; $product_value->picture = $_REQUEST["picture"]; $product_info->Value = $_REQUEST["info"]; $product_more->Value = $_REQUEST["more"]; $product_value->category = $_REQUEST["category"]; $product_value->id = $_REQUEST["id"]; if($_REQUEST["top"] == "1") $product_value->top = true; if($_REQUEST["active"] == "1") $product_value->active = true; if($_REQUEST["action"] == "add_product") { $product_class->AddProduct(); $progress->Location("admin.php?page=product"); } else { $product_class->EditProduct($_REQUEST["id"]); } } $ibutton_js = "MediaPool('bild','picture');"; $product_categories = array(); $product_class->CategoryArray(0, "-", $product_categories, false); $cat_select = new FormClass("category"); $cat_select->option = $product_categories; $cat_select->value = $product_value->category; $cat_select->class = "inputfield"; $cat_select->style = "width:250px"; $items->category = $cat_select->AddSelectBox(); $title_input = new FormClass("title"); $title_input->class = "inputfield"; $title_input->style = "width:250px"; $title_input->value = $product_value->title; $items->title = $title_input->AddInput("text"); $active_input = new FormClass("active"); $active_input->value = 1; $active_input->checked = $product_value->active; $items->active = $active_input->AddInput("checkbox"); $top_input = new FormClass("top"); $top_input->value = 1; $top_input->checked = $product_value->top; $items->top = $top_input->AddInput("checkbox"); $submit_input = new FormClass("formsubmit"); $submit_input->class = "button"; $submit_input->value = "Gönder"; $items->submit = $submit_input->AddInput("submit"); $page_input = new FormClass("page"); $page_input->value = "product"; $items->page = $page_input->AddInput("hidden"); $action_input = new FormClass("action"); $action_input->value = $product_value->action; $items->action = $action_input->AddInput("hidden"); $id_input = new FormClass("id"); $id_input->value = $product_value->id; $items->id = $id_input->AddInput("hidden"); $items->info = $product_info->Create(); $items->more = $product_more->Create(); $button_input = new FormClass(); $button_input->class = "button"; $button_input->value = "Yükle"; $button_input->onclick = $ibutton_js; $items->ibutton = $button_input->AddInput("button"); $picture_input = new FormClass("picture"); $picture_input->class = "inputfield"; $picture_input->style = "width:250px"; $picture_input->value = $product_value->picture; $items->title = $title_input->AddInput("text"); $theme->assign('items', $items); $fetch_tpl = "product/product_form.tpl"; break; case "delete_product": $product_class->DeleteProduct($_REQUEST["id"]); $progress->Location("admin.php?page=product"); break; default: $query = $database->Query("products",array("COUNT(id) as total"),"WHERE lang='".$database->lang."'"); $sql = $query->SingleRow(); if(empty($_REQUEST["p"]) or $_REQUEST["p"] == 0) $_REQUEST["p"] = 1; $product_page = $product_class->Int($_REQUEST["p"]); $product_total = $sql->total; $product_limit = 25; $start = ($product_page - 1) * $product_limit; $items = $product_class->ShowProducts($product_limit,$start,false); $pagination = $product_class->Pagination("admin.php","product","view_products","",$product_page,$product_total,$product_limit); $theme->assign('items', $items); $theme->assign('pagination', $pagination); $fetch_tpl = "product/product_view.tpl"; }$theme->assign('content', $theme->fetch($fetch_tpl));?>