<th width="30px">id</th> <th width="60px" filter-type='ddl'>type</th> <th filter-type='ddl'>brand_id</th> <th>marking</th> <th>image</th> <th>label</th> <th width="30%">title</th> <th width="60px">price</th> <th width="60px">amount</th> </tr> </thead> <tbody> <?php foreach ($products as $product) { //DEBUG /* if ($product["id"] == 3){ G::logMessage("IN DB 11 look like >> '" . $product["title"] ."'"); $res = mb_detect_encoding($product["title"], array("UTF-8", "WINDOWS-1251")); $resUTF = iconv("WINDOWS-1251", "UTF-8", $product["title"]); $resWIN = iconv("UTF-8", "WINDOWS-1251", $product["title"]); G::logMessage("mb_detect_encoding('" . $product["title"] . "') = " . $res . "; >> to UTF=" . $resUTF . "; to WIN=" . $resWIN . ";"); } */ // echo RenderUtils::renderNodeTableRow($product); } ?> </tbody> </table> </div>
<?php include PATH_INCLUDES . "forms/registration_form.php"; echo "<div id=\"reg_errors\">\n"; if (isset($_POST['submit'])) { if (count($user->getErrors()) > 0) { foreach ($user->getErrors() as $error) { echo RenderUtils::renderError($error); } } else { echo ">>> reg is successfull ! <br />"; } } echo "</div>\n";
if (G::$user->isOrHigher(U_MODERATOR)) { $type = $_POST["image_type"]; $img_filename = trim($_POST["img_filename"]); $img_filename = G::$db->quote(strip_tags($img_filename)); $img_filename = preg_replace("/^\\'|\\'\$/", "", $img_filename); // remove side qoutes $path = defineImageDir($type); $file = ROOT . $path . $img_filename . ".jpg"; if (!file_exists($file)) { $errors[] = RenderUtils::renderError("File " . $path . $img_filename . ".jpg does not exist!"); } else { @unlink($file); $result = true; } } else { $errors[] = RenderUtils::renderError("Access denied!"); } if (count($errors)) { $result = false; } $data = array("result" => $result, "errors" => $errors); break; } function defineImageDir($type) { $path = ""; switch ($type) { default: case "pages": $path = "/images/pages/"; break;
/** DELETE page node * @return bool */ public function delete($label) { $result = false; $errors = array(); $label = $this->data["label"]; if (!isset($label)) { $errors[] = RenderUtils::renderError("Label undefined!"); } else { if (!PageUtils::validatePageParam($label, "label")) { $errors[] = RenderUtils::renderError("Label is invalid!"); } else { if (!PageUtils::labelExists($label)) { $errors[] = RenderUtils::renderError("Label does not exist!"); } else { } } } /* !!!!!!!!!!!!!!!!!!!!! */ if (PageUtils::isTechnicalPage($label)) { $errors[] = RenderUtils::renderError("This is technical page!"); } // if (count($errors) == 0) { # TODO delete meta node // DELETE PAGE $result = PageUtils::deletePageNode($label); // check db errors if (intval(G::$db->errorCode()) != 0) { $error_info = G::$db->errorInfo(); $text_error = " DB >> " . $error_info[1] . " > " . $error_info[2]; $this->errors[] = RenderUtils::renderError($text_error); } } return $result; }
public function getErrors($rendered = false) { $errors = array(); if (!$rendered) { $errors = $this->errors; } else { foreach ($this->errors as $error) { $errors[] = RenderUtils::renderError($error); } } return $errors; }
</tr> </thead> <tbody> <?php for ($i = 0; $i < count($files); $i++) { $file = $files[$i]; $file_name = substr($file, 0, stripos($file, ".")); $labels = array(); foreach ($products as $pr) { if (preg_match("/[\\=?\\&?]/", $pr["image"])) { parse_str($pr["image"], $image_data); $image = $image_data[$image_type]; //DEBUG G::logMessage("image >>> " . $image . " " . print_r($image_data, true)); // } else { // DEBUG $image = $pr["image"]; // } if ($image == $file_name) { $labels[] = "(<a href='" . $view_path . $pr["label"] . "' target='_blank'>{$pr['label']}</a>) {$pr['title']}"; } } $text = implode("<br />", $labels); echo RenderUtils::renderImageDataTableRow($i, $path, $file, $text); } ?> </tbody> </table> </div>