示例#1
0
<?if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
	// header('Content-Type: text/javascript; charset=utf-8');
	$Products = new Products();
	if(isset($_POST['action'])){
		switch($_POST['action']){
			case "decline":
				$Products->SetModerationStatus($_POST['id'], $_POST['status'], nl2br($_POST['comment']));
				break;
			case "accept":
				$_POST['art'] = $Products->CheckArticle($Products->GetLastArticle());
				$id = $Products->AcceptProductModeration($_POST);
				$Products->UpdateProductCategories($id, $_POST['category'], 1);
				$Products->RecalcSitePrices(array($id));
				$Products->SetModerationStatus($_POST['id'], $_POST['status']);
				break;
			default:
				break;
		}
	}
	exit();
}?>
示例#2
0
G::AddCSS('highslide.css');
G::AddJS('jquery-2.1.1.min.js');
G::AddJS('jquery.lazyload.min.js');
G::AddJS('jquery-ui.js');
G::AddJS('../plugins/js/jquery.cookie.js');
G::AddJS('bootstrap.min.js');
G::AddJS('../plugins/ckeditor/ckeditor.js');
G::AddJS('main.js');
G::AddJS('func.js');
$GLOBALS['__page_h1'] = '&nbsp;';
if ($GLOBALS['CurrentController'] != 'productedit') {
    // G::AddCSS('adm.css');
}
if (isset($_GET['check_art'])) {
    $Products = new Products();
    echo "<!-- " . $Products->CheckArticle($_GET['check_art']) . "-->";
}
if (isset($_GET['img'])) {
    $img = new Images();
    $img->resize(false, false, strtotime($_GET['img']));
}
if (isset($_GET['clear_thumbs'])) {
    $img = new Images();
    $img->clearThumbs();
}
// if($_SESSION['member']['id_user'] == 8569){
// 	// $sql = "SELECT * FROM "._DB_PREFIX_."image";
// 	// $result = $db->GetArray($sql);
// 	// $xc = 0;
// 	// foreach($result as $image){
// 	// 	print_r('<pre>');
示例#3
0
$dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db);
$Products = new Products();
$Unit = new Unit();
$Images = new Images();
$segmentation = new Segmentation();
if (isset($_GET['upload']) == true) {
    $res = $Images->upload($_FILES, $GLOBALS['PATH_product_img'] . 'original/' . date('Y') . '/' . date('m') . '/' . date('d') . '/');
    echo str_replace($GLOBALS['PATH_global_root'], '/', $res);
    exit(0);
}
$tpl->Assign('h1', 'Добавление товара');
if (isset($_POST['smb'])) {
    if (isset($_POST['images_visible'])) {
        $_POST['images_visible'][0] = 1;
    }
    $_POST['art'] = $Products->CheckArticle((int) $_POST['art']);
    require_once $GLOBALS['PATH_block'] . 't_fnc.php';
    // для ф-ции проверки формы
    if (isset($_POST['price']) && $_POST['price'] == '') {
        $_POST['price'] = 0;
    }
    list($err, $errm) = Product_form_validate();
    if (!$err) {
        if ($id = $Products->AddProduct($_POST)) {
            //Добавление видео
            if (!empty($_POST['video'])) {
                $Products->UpdateVideo($id, $_POST['video']);
            }
            $to_resize = array();
            //Добавление фото
            $article = $Products->GetArtByID($id);