40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
require_once($_SERVER['DOCUMENT_ROOT']."/config.php");
|
||
|
|
|
||
|
|
if($_SESSION['id'] && $_GET['id']) {
|
||
|
|
if (strpos($_GET['id'], "|") !== false) {
|
||
|
|
$ids = explode("|", $_GET['id']);
|
||
|
|
if (count($ids) > 0) {
|
||
|
|
foreach ($ids as $id) {
|
||
|
|
if ($_GET['st'] == 0) {
|
||
|
|
$mas = array();
|
||
|
|
foreach ($_SESSION['checked'] as $ts) {
|
||
|
|
if ($ts !== $id) {
|
||
|
|
$mas[] = $ts;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
$_SESSION['checked'] = $mas;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($_GET['st'] == 1) {
|
||
|
|
$_SESSION['checked'][] = $id;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
if ($_GET['st'] == 0) {
|
||
|
|
$mas = array();
|
||
|
|
foreach ($_SESSION['checked'] as $ts) {
|
||
|
|
if ($ts != $_GET['id']) {
|
||
|
|
$mas[] = $ts;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
$_SESSION['checked'] = $mas;
|
||
|
|
}
|
||
|
|
|
||
|
|
if ($_GET['st'] == 1) {
|
||
|
|
$_SESSION['checked'][] = $_GET['id'];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|