Пример #1
0
        echo 'OK';
    } else {
        echo 'ERROR';
    }
}
if (isset($_GET['loadPosForImgList'])) {
    $idList = explode(',', $_POST['idList']);
    echo drawModalPositions($idList);
}
if (isset($_GET['addTagNameForImgList'])) {
    $res = '';
    $success = array();
    $errors = array();
    $imgList = explode(',', $_POST['idList']);
    foreach ($imgList as $imgId) {
        if (addTagToImage($_POST['tagName'], $imgId)) {
            $success[] = $imgId;
        } else {
            $errors[] = $imgId;
        }
    }
    $res .= drawMultiImgTags($imgList);
    echo $res;
}
if (isset($_GET['removeTagForImgList'])) {
    $imgList = explode(',', $_POST['idList']);
    foreach ($imgList as $imgId) {
        if (removeTagFromBdd($imgId, $_POST['tagId'])) {
            $success[] = $imgId;
        } else {
            $errors[] = $imgId;
Пример #2
0
    $CUR_FILE = $_GET['file'];
}
if (isset($_GET['img_id'])) {
    $CUR_IMG_ID = round($_GET['img_id']);
    if (isset($_GET['delTag'])) {
        echo 'delTag ' . $_GET['delTag'] . '<br>';
        removeTagFromBdd($CUR_IMG_ID, $_GET['delTag']);
    }
}
if (isset($_POST['attachTag'])) {
    addTagToImage($_POST['tagName'], $_POST['imgId']);
}
if (isset($_GET['addTagToFile'])) {
    $tagName = getTagNameById($_GET['tagId']);
    if ($tagName !== false) {
        addTagToImage($tagName, $_GET['img_id']);
    }
    header('Location: image.php?img_id=' . $_GET['img_id']);
    exit;
}
if (isset($_GET['remTagToFile'])) {
    removeTagFromBdd(round($_GET['img_id']), round($_GET['tagId']));
    header('Location: image.php?img_id=' . $_GET['img_id']);
    exit;
}
if (isset($_GET['folder_id'])) {
    $CUR_FOLDER_ID = $_GET['folder_id'];
}
if (isset($_GET['tag_id'])) {
    $CUR_TAG_ID = round($_GET['tag_id']);
}