function chkLogin() { $u = $_POST['username']; if (!data_exists("user/{$u}/pwd")) { return LANG('No such user'); } $p = password($_POST['password']); if ($p != data_read("user/{$u}/pwd")) { return LANG('Password wrong'); } $_SESSION[USER_SESSION] = $u; return false; }
function checkPwd() { if (!isset($_POST['password'][2])) { return LANG('Password must be at least 3 charaters long'); } if ($_POST['password'] !== $_POST['retype']) { return LANG('Password retype doesn\'t match'); } $p = password($_POST['password']); $u = user('id'); data_save("user/{$u}/pwd", $p); return false; }
function chkRegister() { if (!preg_match('/^[0-9a-zA-Z_]+$/', $_POST['username'])) { return LANG('Username must only contain English alphabets, underscore and numbers'); } $u = $_POST['username']; if (data_exists("user/{$u}/pwd")) { return LANG('User exists'); } if (!isset($_POST['password'][2])) { return LANG('Password must be at least 3 charaters long'); } if ($_POST['password'] != $_POST['retype']) { return LANG('Password retype doesn\'t match'); } $p = password($_POST['password']); data_save("user/{$u}/pwd", $p); $_SESSION[USER_SESSION] = $u; }
public function GetHtml() { $out = '<div class="page-navigation">'; $total = $this->TotalPages(); if ($total > 1) { if ($this->HasPrevPage()) { $out .= ' <a href="#URL#' . $this->PrevPage() . '">← ' . LANG('PAGINATOR_PREV') . '</a> '; } for ($n = 1; $n <= $total; $n++) { if ($n == $this->currentPage) { $out .= ' <a href="#URL#' . $n . '" class="active">' . $n . '</a> '; } else { $out .= ' <a href="#URL#' . $n . '">' . $n . '</a> '; } } if ($this->HasNextPage()) { $out .= ' <a href="#URL#' . $this->NextPage() . '">' . LANG('PAGINATOR_NEXT') . ' →</a> '; } } $out .= '</div>'; return $out; }
if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) { die; } if (!empty($arResult) and !empty($arParams["SHOW_FIELDS"])) { $arDecorate = array("LOGIN" => '<a href="/scriptacid/admin/users/user.php?ID=#ID#">#LOGIN#</a>'); ?> <table> <thead> <tr> <?php foreach ($arParams["SHOW_FIELDS"] as $field) { ?> <th> <?php echo LANG('SYTEM_USER_' . $field); ?> </th> <?php } ?> </tr> </thead> <?php foreach ($arResult['USERS'] as $n => $arItem) { ?> <tr <?php echo $n % 2 ? 'class="altrow"' : ''; ?> > <?php
} else { $o = array(); } $c = iescape($_POST['content']); $lines = explode("\n", $c); $t = $lines[0]; unset($lines[0]); $c = implode('</br>', $lines); $o[] = array('title' => $t, 'content' => $c, 'user' => user('id')); data_save($dataitem, json_encode($o)); post_status(LANG('modify the calendar at %%', $_POST['date'])); } } elseif ($_GET['action'] == 'delete') { if (user() && user('verified') && posted('date', 'key')) { $dataitem = 'calendar/' . $_POST['date']; if (data_exists($dataitem)) { $o = json_decode(data_read($dataitem), true); } else { $o = array(); } if (isset($o[$_POST['key']])) { unset($o[$_POST['key']]); } if (count($o) <= 0) { data_remove($dataitem); } else { data_save($dataitem, json_encode($o)); } post_status(LANG('modify the calendar at %%', $_POST['date'])); } }
// checkbox radio select file } ?> </td> </tr> <?php } ?> </table> </div> <div id="personal"> <table width="100%"> <tr> <td> <b><?php echo LANG('SYTEM_USER_LOGIN'); ?> :</b> </td> <td> <input type="text" name="LOGIN" value="<?php echo $arUser["LOGIN"]; ?> " /> </td> </tr> </table> </div> <div id="groups"> <table class="form-table"> <?php
<?php break; ?> <?php default: ?> <h3><?php echo LANG("MODULE_CATALOG_TYPES_TITLE"); ?> </h3> <?php ShowMsg(); ?> <p> <a href="?ACTION=ADD"><?php echo LANG("MODULE_CATALOG_TYPES_ADD_TEXT"); ?> </a> </p> <?php App::callComponent("system:catalog.type.list", "_admin", array("SHOW_FIELDS" => array("ID", "NAME", "SORT", "SID", "SECTION_NAME", "ELEMENT_NAME"))); ?> <?php break; ?> <?php } } ?> <?php
?> </div> <div class="form-table-buttons"> <?php if ($arResult["MODE"] == "ADD") { ?> <input type="submit" class="button" name="add_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_ADD_TEXT'); ?> "/> <?php } else { ?> <input type="submit" class="button" name="edit_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_EDIT_TEXT'); ?> "/> <input type="submit" class="button" name="apply_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_APPLY_TEXT'); ?> "/> <?php } ?> <button class="button" onClick="return RedirectTo('/admin/catalog/')"><?php echo LANG('MODULE_CATALOG_ELEMENTS_CANCEL_TEXT'); ?> </button> </div> </div> </form><?php
<p></p> <b>Loose Stock</b><br /> If you are using only one location and a loose stock without palettes, you can simply select the category where you want to add/remove items to/from. Be awaware, that you can only add/remove items from categories, that didn't contain subcategories. <p></p> Select if the item is for male, female, baby persons (or none of them) and if you estimated the amount of items. You can select/deselect any of these options by clicking the corressponding button. Enter the number of items you want to add into <i><?php print LANG('income'); ?> </i> input field and the number of items you want to remove into <i><?php print LANG('outgo'); ?> </i> input field. Press the enter key or click <i><?php print LANG('add_to_loose_stock'); ?> </i>. <p></p> You selection for category, male, female, baby, estimated and income or outgo is saved and you can directly enter a new number for your last selected input field, if you want to.<br /> Select the category name above the form to go up inside the category tree. <p></p> <b>Stock at location and/or palette</b><br /> You can also select a location and/or palette by clicking on the location and/or palette at the locations/palettes overview. Than you're adding your items only at this particular location/palette. </div> <div> <h1>Terms of use</h1> Charity organisations that are working without profit can use this service for free.<br />
} if (isset($qpath)) { if (isset($qpath[1])) { unset($qpath[count($qpath) - 1]); $parent = implode('/', $qpath); } else { $parent = ''; } $index = data_list("wiki/{$parent}", 'wiki_'); foreach ($index as $k => &$v) { $v = array('path' => substr(str_replace('/wiki_', '/', $k), 5), 'name' => $v, 'child' => array(), 'active' => false); if ($v['path'] == $pquery) { $v['child'] = $childs; $v['active'] = true; } } if (isset($parent[0])) { $name = substr($qpath[count($qpath) - 1], 5); $index = array(array('path' => substr(str_replace('/wiki_', '/', $parent), 5), 'name' => $name, 'child' => $index, 'active' => false)); } } else { $index = $childs; } $content = data_read("wiki/{$query}/content"); if (!user('verified')) { $content = preg_replace('/\\{\\{\\{.*?\\}\\}\\}/s', '<span class="verified-only">' . LANG('Visible to verified user only') . '</span>', $content); } elseif (!isset($_GET['edit'])) { $content = preg_replace('/\\{\\{\\{(.*?)\\}\\}\\}/s', '$1', $content); } $data = array('query' => $pquery, 'title' => $title, 'path' => $path, 'index' => $index, 'content' => $content, 'isedit' => isset($_GET['edit']), 'attachments' => json_decode(data_read("wiki/{$query}/attachments"), true)); die(tpl('wiki', $data));
?> &CATALOG_ID=<?php echo sXss($_GET['CATALOG_ID']); ?> "><?php echo LANG("MODULE_CATALOG_ELEMENTS_ADD_TEXT"); ?> </a> <a href="?ACTION=ADD_SECTION&TYPE=<?php echo sXss($_GET['TYPE']); ?> &CATALOG_ID=<?php echo sXss($_GET['CATALOG_ID']); ?> "><?php echo LANG("MODULE_CATALOG_SECTION_ADD_TEXT"); ?> </a> </p> <?php Component::callComponent(":catalog.section.list", "_admin", array("SECTION_ID" => $_GET["SECTION_ID"], "CATALOG_ID" => $_GET["CATALOG_ID"], "=CATALOG_TYPE" => $_GET["TYPE"], "FIELDS" => array("ID", "ACTIVE", "NAME", "CATALOG_SECTION_ID", "CATALOG_ID", "SORT", "CODE", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "TAGS"))); ?> <?php Component::callComponent(":catalog.section", "_admin", array("CATALOG_TYPE" => $_GET["TYPE"], "CATALOG_ID" => intVal($_GET["CATALOG_ID"]), "=SECTION_ID" => $_GET["SECTION_ID"])); ?> <?php break; } ?> <p>
echo $parentID; ?> ">Вверх</a> </span> <?php } ?> <table> <thead> <tr> <?php foreach ($arParams["FIELDS"] as $field) { ?> <th> <?php echo LANG('MODULE_CATALOG_ELEMENTS_' . $field); ?> </th> <?php } ?> <th> </th> </tr> </thead> <?php if (!empty($arResult["ITEMS"]) and !empty($arParams["SHOW_FIELDS"])) { ?> <?php foreach ($arResult["ITEMS"] as $n => $arItem) { ?> <tr <?php
</table> </div> <div class="form-table-buttons"> <?php if ($arResult["MODE"] == "ADD") { ?> <input type="submit" class="button" name="add_btn" value="<?php echo LANG('MODULE_CATALOG_ADD_TEXT'); ?> "/> <?php } else { ?> <input type="submit" class="button" name="edit_btn" value="<?php echo LANG('MODULE_CATALOG_EDIT_TEXT'); ?> "/> <input type="submit" class="button" name="apply_btn" value="<?php echo LANG('MODULE_CATALOG_APPLY_TEXT'); ?> "/> <?php } ?> <button class="button" onClick="return RedirectTo('/scriptacid/admin/catalog/')"><?php echo LANG('MODULE_CATALOG_CANCEL_TEXT'); ?> </button> </div> </div> </form><?php
function getUser($u) { if (data_exists("user/{$u}/pwd")) { $id = $u; if (!data_exists("user/{$u}/info")) { $u = array('name' => $u, 'title' => LANG('Unidentified'), 'verified' => false); } else { $u = json_decode(data_read("user/{$u}/info"), true); } $u['id'] = $id; if (file_exists("data/user/{$id}/avatar.jpg")) { $u['avatar'] = BASE . "data/user/{$id}/avatar.jpg"; } else { $u['avatar'] = BASE . 'res/images/default-avatar.jpg'; } return $u; } return NULL; }
namespace ScriptAcid; if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) { die; } if (!Modules::includeModule('catalog')) { ShowError("Модуль каталогов не установлен."); return; } $arParams['BTN_NAME'] = strlen($arParams['BTN_NAME']) > 0 ? $arParams['BTN_NAME'] : 'add_btn'; $arParams['ADD_BTN_NAME'] = strlen($arParams['ADD_BTN_NAME']) > 0 ? $arParams['ADD_BTN_NAME'] : LANG('ADD_BTN'); $arParams['EDIT_BTN_NAME'] = strlen($arParams['EDIT_BTN_NAME']) > 0 ? $arParams['EDIT_BTN_NAME'] : LANG('EDIT_BTN'); $arParams['CATALOG_ID'] = intVal($arParams['CATALOG_ID']) > 0 ? intVal($arParams['CATALOG_ID']) : false; $arParams['USE_CAPTCHA'] = $arParams['USE_CAPTCHA'] == "Y" ? "Y" : "N"; $arParams['MSG_ADD'] = strLen($arParams['MSG_ADD']) > 0 ? $arParams['MSG_ADD'] : LANG('MSG_ADD'); $arParams['MSG_EDIT'] = strLen($arParams['MSG_EDIT']) > 0 ? $arParams['MSG_EDIT'] : LANG('MSG_EDIT'); $arParams['PREVIEW_TEXT_LENGTH'] = intVal($arParams['PREVIEW_TEXT_LENGTH']) > 0 ? intVal($arParams['PREVIEW_TEXT_LENGTH']) : 80; $arParams["ID"] = intVal($arParams["ID"]) > 0 ? intVal($arParams["ID"]) : 0; $arCatalog['PROPERTIES'] = Catalog::GetCatalogProperties($arParams['CATALOG_ID']); $arFields = CatalogUtils::GetMainFieldsArray(); if (!empty($arCatalog['PROPERTIES'])) { foreach ($arCatalog['PROPERTIES'] as $arProp) { $arFields[$arProp['ID']] = array("NAME" => $arProp['NAME'], "CODE" => $arProp['CODE'], "TYPE" => $arProp['PROPERTY_TYPE'], "MULTIPLE" => $arProp['MULTIPLE'], "DEFAULT" => $arProp['DEFAULT_VALUE']); } } $arResult['FIELDS'] = $arFields; // SECTION TREE $arSectionTree = array('' => array('NAME' => 'Корневой каталог')); $rsec = CatalogSection::GetList(array("NAME" => "ASC"), array("CATALOG_ID" => $arParams['CATALOG_ID'])); while ($obSec = $rsec->GetNextElement()) { $arSec = $obSec->GetFields();
} ?> <div class="form-table-buttons"> <?php if ($arResult["MODE"] == "ADD") { ?> <input type="submit" class="button" name="add_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_ADD_TEXT'); ?> "/> <?php } else { ?> <input type="submit" class="button" name="edit_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_EDIT_TEXT'); ?> "/> <input type="submit" class="button" name="apply_btn" value="<?php echo LANG('MODULE_CATALOG_ELEMENTS_APPLY_TEXT'); ?> "/> <?php } ?> <?php /*/?><button class="button" onClick="return RedirectTo('/scriptacid/admin/catalog/')"><?php echo LANG('MODULE_CATALOG_ELEMENTS_CANCEL_TEXT')?></button><?php //*/ ?> </div> </div> </form><?php
<td class="td-right"> <?php if ($arResult["MODE"] == "ADD") { ?> <input type="submit" class="button" name="add_btn" value="<?php echo LANG('CATALOG_TYPE_ADD_TEXT'); ?> "/> <?php } else { ?> <input type="submit" class="button" name="edit_btn" value="<?php echo LANG('CATALOG_TYPE_EDIT_TEXT'); ?> "/> <?php } ?> <button class="button" onClick="return RedirectTo(<?php echo SYS_ROOT; ?> '/admin/catalog/')"><?php echo LANG('CATALOG_TYPE_CANCEL_TEXT'); ?> </button> </td> </tr> </table> </form> <?php }
<?php namespace ScriptAcid; if (!defined("KERNEL_INCLUDED") || KERNEL_INCLUDED !== true) { die; } ?> <br /> <?php //d($arResult) ?> <b><?php echo LANG("NAVIGATION"); ?> </b>: <?php foreach ($arResult["ITEMS"] as $arItem) { ?> <a href="<?php echo $arItem["URL"]; ?> " title="<?php echo $arItem["NAME"]; ?> " style="color:red"><?php echo $arItem["NAME"]; ?> </a> <?php }
<div><span class="group_left"><img src="img/logo-48.png" /> Social Warehouse</span> <!-- <a href="lang/<?php print HELP_FILE(); ?> " target="_blanc" class="button table_cell smalltext lightgray"> <?php print LANG('help'); ?> </a>--></div> <div id="menu"></div> </div> <div class="mainframe"> <div id="loading" class="centertext tinytext"><img src="img/loading.gif" /> <?php print LANG('loading'); ?> </div> <div id="content"></div> <div class="footer"> Social Warehouse, published under <a href="http://www.gnu.org/licenses/gpl-3.0.txt" target="_blanc">GPLv3</a> by <a href="http://www.hanneseilers.de">Hannes Eilers</a> </div> </div> <div id="overlay" class="overlay"> <div class="overlay_main"> <div id="overlay_content"></div> <div class="hspacer"></div> <div id="overlay_buttons"></div> </div>
function list_status($start = NULL, $limit = 50) { $last = last_post_id(); if ($limit > 0) { if (!$start) { $start = $last + 1; } $step = -1; } else { $limit = -$limit; if (!$start) { $start = $last - $limit; } if ($start < 0) { $start = 0; } $n = $last - $start; if ($limit > $n) { $limit = $n; } $step = 1; } $start += $step; $ret = array(); $id = $start; while ($limit > 0 && $id > 0 && $id <= $last) { if (data_exists("status/post_{$id}")) { $item = json_decode(data_read("status/post_{$id}"), true); $item['id'] = $id; $item['type_lang'] = LANG($item['type']); $item['human_time'] = human_time($item['date']); $ret[] = $item; $limit--; } $id += $step; } if ($step > 0) { $ret = array_reverse($ret); } return $ret; }
?> <tr> <td valign="top"> <?php $LABEL = isset($arParams['CUSTOM_LABEL_' . $FID]) ? $arParams['CUSTOM_LABEL_' . $FID] : ''; ?> <?php if (!empty($LABEL)) { echo $LABEL; echo in_array($FID, $arParams['REQUIRED']) ? '<span class="required">*</span>' : ''; ?> :<?php } else { ?> <?php echo is_numeric($FID) ? $arField['NAME'] : LANG('CATALOG_ELEMENT_ADD_LABEL_' . $FID); echo in_array($FID, $arParams['REQUIRED']) ? '<span class="required">*</span>' : ''; ?> : <?php } ?> </td> <?php if (!is_numeric($FID)) { ?> <td><?php switch ($FID) { case 'CATALOG_SECTION_ID': $value = $_POST[$FID]; ?>
echo User::GetSign($arItem["CREATED_BY"]); ?> , <strong><?php echo LANG('ADD_DATE'); ?> </strong> <?php echo $arItem["DATE_CREATE"]; ?> </p> </td> </tr> <?php } ?> </table> <p> <?php echo str_replace('#URL#', GetCurPage() . '?PAGE=', $arResult['PAGINATION']); ?> </p> </div> <?php } else { ?> <p><?php echo LANG('NO_RESULT_TEXT'); ?> </p> <?php }
<!DOCTYPE html> <?php // include multilanguage support include "lang/lang.php"; // load classloader include_once 'api/classloader.php'; ?> <html> <head> <meta charset="UTF-8"> <title><?php print LANG('warehouse_stock'); ?> </title> <link rel="icon" type="image/png" href="favicon.png"> <link type="text/css" rel="stylesheet" href="style.css"> <script type="text/javascript"> var dom; function init(){ document.getElementById( 'stock' ).appendChild( dom ); } </script> </head> <body class="stock" id="stock"> </body> </html>