Example #1
0
                        $celldata = $data->val($r + $pos['row'], $pos['col'], $sheet - 1);
                    }
                    if ($cell_id === 'title') {
                        $title = $celldata;
                    } elseif ($cell_id === 'price') {
                        $price = $celldata;
                    } else {
                        $fields[] = $celldata;
                    }
                }
                $fields = serialize($fields);
                if ($title && $fields) {
                    $sql = "INSERT INTO cms_uc_items (category_id, title, pubdate, published, imageurl, fieldsdata, is_comments, tags, rating, meta_desc, meta_keys, price, canmany)\r\n                                VALUES ({$cat_id}, '{$title}', NOW(), '{$published}', '{$imgfile}', '{$fields}', {$is_comments}, '{$tags}', 0, '{$meta_desc}', '{$meta_keys}', '{$price}', {$canmany})";
                    dbQuery($sql) or die('Ошибка импорта. Проверьте правильность настроек. <a href="javascript:window.history.go(-2)">Назад</a>');
                    if ($tags) {
                        $lastid = dbLastId('cms_uc_items');
                        cmsInsertTags($tags, 'catalog', $lastid);
                    }
                }
            }
            if ($file) {
                @unlink($file);
            }
        } else {
            $msg .= 'Ошибка загрузки файла Excel!';
        }
    } else {
        $file = '';
    }
    header('location:?view=components&do=config&opt=list_items&id=' . $_REQUEST['id']);
}
Example #2
0
     if ($inCore->moveUploadedFile($_FILES['picture']['tmp_name'], $uploadphoto, $_FILES['picture']['error'])) {
         if (!isset($cfg['watermark'])) {
             $cfg['watermark'] = 0;
         }
         @img_resize($uploadphoto, $uploadthumb, $cfg['thumb1'], $cfg['thumb1'], $cfg['thumbsqr']);
         @img_resize($uploadphoto, $uploadphoto, $cfg['thumb2'], $cfg['thumb2'], $cfg['thumbsqr']);
     } else {
         $msg = $inCore->uploadError();
     }
 } else {
     $filename = '';
 }
 //insert into db
 $sql = "INSERT INTO cms_clubs (admin_id, title, description, imageurl, pubdate, clubtype, published, maxsize, enabled_blogs, enabled_photos)\r\n                    VALUES ({$admin_id}, '{$title}', '{$description}', '{$filename}', '{$pubdate}', '{$clubtype}', '{$published}', '{$maxsize}', '{$enabled_blogs}', '{$enabled_photos}')";
 dbQuery($sql);
 $id = dbLastId('cms_clubs');
 //create blog
 $blog_seolink = cmsCore::strToURL($title);
 $sql = "INSERT INTO cms_blogs (user_id, title, pubdate, allow_who, view_type, showcats, ownertype, premod, forall, owner, seolink)\r\n                    VALUES ('{$id}', 'Блог', NOW(), 'all', 'list', 1, 'multi', 0, 0, 'club', '{$blog_seolink}')";
 dbQuery($sql);
 $moders = $_POST['moderslist'];
 $members = $_POST['memberslist'];
 if (array_search($admin_id, $moders)) {
     unset($moders[array_search($admin_id, $moders)]);
 }
 if (array_search($admin_id, $members)) {
     unset($members[array_search($admin_id, $members)]);
 }
 clubSaveUsers($id, $moders, 'moderator');
 clubSaveUsers($id, $members, 'member');
 header('location:?view=components&do=config&opt=list&id=' . $_REQUEST['id']);