diff --git a/addtype.php b/addtype.php new file mode 100644 index 0000000..fcd240f --- /dev/null +++ b/addtype.php @@ -0,0 +1,123 @@ +GetPreviousElement($type,$change); + switch($type) + { + case 1: + $upd = "UPDATE `bt_message` SET `priority` = '".$id."' WHERE `priority` = '".$change."'"; + break; + case 2: + $upd = "UPDATE `bt_options` SET `type` = '".$id."' WHERE `type` = '".$change."'"; + break; + case 3: + $upd = "UPDATE `bt_options` SET `subtype` = '".$id."' WHERE `subtype` = '".$change."'"; + break; + case 4: + $upd = "UPDATE `bt_message` SET `status` = '".$id."' WHERE `status` = '".$change."'"; + break; + default: + $upd = false; + } + if($upd) + { + if(!$sql->exe($cfg->get("realmd"),$upd)) + echo 'Ошибка переноса! MySQL код некорректен!'; + } + else + echo 'Ошибка! Тип '.$type.' не опознан!'; + } + if($sql->exe($cfg->get("realmd"),$query)) + echo 1; + else + echo 'Ошибка! MySQL код некорректен!'; + } + else + echo 'Ошибка! Тип '.$type.' не опознан!'; +} +else + echo 'Параметры не переданы!'; +?> \ No newline at end of file diff --git a/config.php b/config.php index 7aca4d0..665ea76 100644 --- a/config.php +++ b/config.php @@ -50,7 +50,7 @@ function get($id) ## installquery: Count of query for install. Do not change! ##################################################################################################*/ "CheckVersion" => false, - "version" => 23, + "version" => 24, "checkdiff" => 2, "installquery" => 212 ); diff --git a/img/Thumbs.db b/img/Thumbs.db new file mode 100644 index 0000000..ba9fbb6 Binary files /dev/null and b/img/Thumbs.db differ diff --git a/img/cancel.png b/img/cancel.png new file mode 100644 index 0000000..03e3433 Binary files /dev/null and b/img/cancel.png differ diff --git a/img/check_mark.png b/img/check_mark.png new file mode 100644 index 0000000..f109a56 Binary files /dev/null and b/img/check_mark.png differ diff --git a/img/noadd.png b/img/noadd.png new file mode 100644 index 0000000..3a428c6 Binary files /dev/null and b/img/noadd.png differ diff --git a/img/nocancel.png b/img/nocancel.png new file mode 100644 index 0000000..d6edecb Binary files /dev/null and b/img/nocancel.png differ diff --git a/img/nocheck_mark.png b/img/nocheck_mark.png new file mode 100644 index 0000000..386caa0 Binary files /dev/null and b/img/nocheck_mark.png differ diff --git a/img/nolens.png b/img/nolens.png new file mode 100644 index 0000000..a5fd215 Binary files /dev/null and b/img/nolens.png differ diff --git a/img/noscissors.png b/img/noscissors.png new file mode 100644 index 0000000..513bf21 Binary files /dev/null and b/img/noscissors.png differ diff --git a/img/notrash.png b/img/notrash.png new file mode 100644 index 0000000..635f4c5 Binary files /dev/null and b/img/notrash.png differ diff --git a/img/onadd.png b/img/onadd.png new file mode 100644 index 0000000..17c79a7 Binary files /dev/null and b/img/onadd.png differ diff --git a/img/oncancel.png b/img/oncancel.png new file mode 100644 index 0000000..ec4e9a2 Binary files /dev/null and b/img/oncancel.png differ diff --git a/img/oncheck_mark.png b/img/oncheck_mark.png new file mode 100644 index 0000000..7f31cbe Binary files /dev/null and b/img/oncheck_mark.png differ diff --git a/img/onlens.png b/img/onlens.png new file mode 100644 index 0000000..8bd80fc Binary files /dev/null and b/img/onlens.png differ diff --git a/img/onscissors.png b/img/onscissors.png new file mode 100644 index 0000000..3b27a7e Binary files /dev/null and b/img/onscissors.png differ diff --git a/img/ontrash.png b/img/ontrash.png new file mode 100644 index 0000000..5592a00 Binary files /dev/null and b/img/ontrash.png differ diff --git a/img/scissors.png b/img/scissors.png new file mode 100644 index 0000000..c280cdb Binary files /dev/null and b/img/scissors.png differ diff --git a/lib/classes.php b/lib/classes.php index a8c5342..72c7758 100644 --- a/lib/classes.php +++ b/lib/classes.php @@ -9,34 +9,34 @@ function num_rows($query); interface create { - public function SelectMessage($id); - public function SelectOptions($id); - public function GetNewId(); - public function GetNameByGUID($guid); - public function GetAccountNameById($id); - public function GetSections(); - public function GetPercent($id,$one=false); - public function GetPriority($id,$one=false); - public function GetStatus($id,$one=false); - public function GetDate($format); + function SelectMessage($id); + function SelectOptions($id); + function GetNewId(); + function GetNameByGUID($guid); + function GetAccountNameById($id); + function GetSections(); + function GetPercent($id,$one=false); + function GetPriority($id,$one=false); + function GetStatus($id,$one=false); + function GetDate($format); + function GetPreviousElement($type,$change); + function SetStatus($statusid=-1,$id=-1); - public function SetStatus($statusid=-1,$id=-1); + function LoadZones(); + function LoadChar($acc); + function LoadStatus($id="0"); + function LoadSection(); + function LoadMap(); + function LoadList($status="all"); + function LoadPriority($id = "0"); + function LoadView($id); + function LoadSubType(); - public function LoadZones(); - public function LoadChar($acc); - public function LoadStatus($id="0"); - public function LoadSection(); - public function LoadMap(); - public function LoadList($status="all"); - public function LoadPriority($id = "0"); - public function LoadView($id); - public function LoadSubType(); - - public function login($login,$pass); - public function cookies($login,$pass); - public function AccountRepass($acc,$code); - public function isValidSection($id); - public function PercentList($id=0); + function login($login,$pass); + function cookies($login,$pass); + function AccountRepass($acc,$code); + function isValidSection($id); + function PercentList($id=0); } interface html @@ -57,6 +57,7 @@ function login(); function success(); function inc($content); function admin(); + function adminconfig(); function CheckVersion(); function adminpanel(); function authorization($login,$pass); diff --git a/lib/create.php b/lib/create.php index 358f10d..f5fde3e 100644 --- a/lib/create.php +++ b/lib/create.php @@ -95,7 +95,29 @@ public function GetDate($format) return date($format); } } - + + public function GetPreviousElement($type,$change) + { + $cfg = new config; + $sql = new sql; + switch($type) + { + case 1: $table='bt_priority';break; + case 2: $table='bt_section';break; + case 3: $table='bt_subtype';break; + case 4: $table='bt_status';break; + default: return; + } + $id = $sql->res($cfg->get("realmd"),"SELECT `id` FROM `".$table."` WHERE `id` < '".$change."' ORDER BY `id` DESC LIMIT 1"); + if($id != -1) + return $id; + else + $id = $sql->res($cfg->get("realmd"),"SELECT `id` FROM `".$table."` WHERE `id` > '".$change."' ORDER BY `id` ASC LIMIT 1"); + if($id != -1) + return $id; + return false; + } + public function SetStatus($statusid=-1,$id=-1) { $cfg = new config; @@ -155,11 +177,10 @@ public function LoadStatus($id="0",$all="0") $text = ""; while($row=$sql->fetch($query)) { - if($id > 0) + $attr = ""; + if($id > "0") if($row['id'] == $this->GetStatus($all,true)) $attr = "SELECTED"; - else - $attr = ""; $text.= ''; } return $text; @@ -170,10 +191,12 @@ public function LoadSection() $cfg = new config; $sql = new sql; $query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_section` ORDER BY `id` ASC"); + $text = ''; while($row=mysql_fetch_array($query)) { - echo ''; + $text.= ''; } + return $text; } public function LoadMap() @@ -239,30 +262,35 @@ public function LoadList($status="all",$sort='') return $sql->exe($cfg->get("realmd"),$query); } - public function LoadPriority($id="0",$all="0") + public function LoadPriority($id="0",$all="0",$color="0") { $cfg = new config; $sql = new sql; - $query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_priority` ORDER BY `id` ASC"); + $query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name`,`color` FROM `bt_priority` ORDER BY `id` ASC"); $txt=""; - while($row=mysql_fetch_array($query)) + + if($color == "color") + $clr = '
'; + echo $clr; + } + return $txt; } public function LoadSubType() @@ -275,7 +303,7 @@ public function LoadSubType() { $txt.= ''; } - echo $txt; + return $txt; } public function LoadView($opt) diff --git a/lib/html.php b/lib/html.php index 48ff8f5..772eaf4 100644 --- a/lib/html.php +++ b/lib/html.php @@ -7,6 +7,8 @@ public function send() $cfg = new config; $main = new main; $main->LoadZones(); + $sections = $main->LoadSection(); + $subtype = $main->LoadSubType(); if($user['id'] > "-1") { echo ' @@ -37,13 +39,13 @@ public function send()