?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
PK 9H[2M_d7 7 edit/function.inc.phpnu W+A
###############################################################################
function ColumnInData ($Object_FieldID, $type, $LinkID)
{
global $SystemTableID, $LinkID;
# $type description:
# 1 - add
# 2 - modify
# 3 - drop
$TableName = GetSystemTableName ($SystemTableID);
$SelectObject_Field = "select Object_Field_Name,TypeOfData_ID,NotNull,DefaultState from Object_Field where Object_Field_ID=".$Object_FieldID;
$QueryResult = mysql_query ($SelectObject_Field, $LinkID);
list($Object_FieldName,$TypeOfDataID,$NotNull,$DefaultState) = mysql_fetch_row ($QueryResult);
switch ($type) {
case 1: $oper = "add"; break;
case 2: $oper = "modify"; break;
case 3: $oper = "drop"; break;
}
$alter = "alter table ".$TableName." ".$oper." ".$Object_FieldName;
if ($type==3) {
$AlterResult = mysql_query ($alter, $LinkID);
return;
}
$alter .= " ";
switch ($TypeOfDataID) {
case 1: $alter .= "char(255)"; break;
case 2: $alter .= "int"; break;
case 3: $alter .= "text"; break;
case 4: $alter .= "int"; break;
case 5: $alter .= "tinyint"; break;
case 6: $alter .= "char(255)"; break;
case 7: $alter .= "double"; break;
case 8: $alter .= "datetime"; break;
}
if ($DefaultState!="" && $TypeOfDataID!=3)
$alter.= " NOT NULL DEFAULT '$DefaultState'";
else
if ($NotNull) $alter.= " NOT NULL"; else $alter.= " NULL";
$AlterResult = mysql_query ($alter, $LinkID);
}
###############################################################################
function Object_FieldList ($SystemTableID, $msg = null)
{
global $LinkID;
$select = "select Object_Field_ID, Object_Field_Name, Description, Priority from Object_Field where System_ID=".$SystemTableID;
$select .= " order by Priority";
$Result = mysql_query ($select, $LinkID);
if ($countObject_Fields=mysql_num_rows($Result)) {
?>
}
}
###############################################################################
function Object_FieldForm ($Object_FieldID, $SystemTableID)
{
global $LinkID;
if ($Object_FieldID) {
$select = "select Object_Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, Inheritance, DefaultState, TypeOfEdit_ID";
$select .= " from Object_Field where Object_Field_ID=".$Object_FieldID;
$Result = mysql_query($select,$LinkID);
$Array = mysql_fetch_assoc($Result);
mysql_free_result($Result);
} else {
$res = mysql_query("SELECT (Priority+1) FROM Object_Field WHERE System_ID=".$SystemTableID." ORDER BY Priority DESC LIMIT 1",$LinkID);
if (mysql_num_rows($res)) {
list($Priority) = mysql_fetch_row($res);
mysql_free_result($res);
$Array["Priority"] = $Priority;
}
}
print "";
}
###############################################################################
function Object_FieldCompleted ()
{
global $LinkID;
global $Object_FieldID,$SystemTableID,$Object_FieldName,$Description,$TypeOfDataID,$TypeOfEditID,$Format,$NotNull,$Priority,$Inheritance,$DefaultState;
$TableName = GetSystemTableName ($SystemTableID);
$NotNull += 0;
$Inheritance += 0;
$Priority += 0;
if (!$Object_FieldID) {
$SelectResult = mysql_query("show fields from ".$TableName." like '".$Object_FieldName."'",$LinkID);
if (mysql_num_rows($SelectResult)) return false;
$insert = "insert into Object_Field (System_ID,Object_Field_Name,Description,TypeOfData_ID,Format,NotNull,Priority,Inheritance,DefaultState,TypeOfEdit_ID) ";
$insert .= "values (".$SystemTableID.",'".$Object_FieldName."','".$Description."',".$TypeOfDataID.",'".$Format."',".$NotNull.",".$Priority.",".$Inheritance.",'".$DefaultState."',".$TypeOfEditID.")";
$Result = mysql_query ($insert, $LinkID);
$CurrentObject_FieldID = mysql_insert_id ();
ColumnInData ($CurrentObject_FieldID, 1, $LinkID);
} else {
$update = "update Object_Field set Description='".$Description."',TypeOfData_ID=".$TypeOfDataID.",Format='".$Format."',NotNull=".$NotNull.",Priority=".$Priority.",Inheritance=".$Inheritance.",DefaultState='".$DefaultState."',TypeOfEdit_ID=".$TypeOfEditID;
$update .= " where Object_Field_ID=".$Object_FieldID;
$Result = mysql_query ($update, $LinkID);
ColumnInData ($Object_FieldID, 2, $LinkID);
}
return true;
}
###############################################################################
function System_UpdateObject_FieldPriority ()
{
global $LinkID;
reset($_POST);
while (list($key, $val) = each($_POST)) {
if (substr($key,0,8)=="Priority") {
$field_id = substr($key,8,strlen($key)-8)+0;
$val += 0;
$update = "update Object_Field set Priority=".$val." where Object_Field_ID=".$field_id;
mysql_query($update,$LinkID);
}
}
}
###############################################################################
function DeleteObject_Fields ()
{
global $LinkID;
reset($_POST);
while (list($key, $val) = each($_POST)) {
if (substr($key,0,6)=="Delete" && $val) {
$val += 0;
$delete = "delete from Object_Field where Object_Field_ID=".$val;
ColumnInData ($val, 3, $LinkID);
mysql_query ($delete, $LinkID);
}
}
}
###############################################################################
?>PK `[w1
edit/index.phpnu W+A
require_once ("../../../../../cms.conf");
require_once ("../../../function.inc.php");
require_once ("function.inc.php");
if ( !isset($SystemTableID) ) $SystemTableID=GetSystemTableIDByObject_FieldID ($Object_FieldID);
$Delimeter = " > ";
$main_section = "settings";
$item_id = 1;
$Title1 = ""._LANG_TABLES_SYSTEM."";
$Title2 = _LANG_FIELDS." (".GetSystemTableRusName ($SystemTableID).")";
$Title3 = ""._LANG_FIELDS." (".GetSystemTableRusName ($SystemTableID).")";
$Title4 = _LANG_FIELD_ADD;
$Title5 = GetObject_FieldName ($Object_FieldID);
$Title6 = _LANG_FIELD_EDIT;
if (! ($perm->isSupervisor() || $perm->isGuest()) ) {
BeginHtml ($Title0, $Title1.$Delimeter.$Title2);
NoRightsMessage();
EndHtml ();
exit;
}
#print "step=".$step."
\n";
if (!isset($step)) $step=1;
switch ($step) {
case 1:
# покажем список полей класса
BeginHtml ($Title2, $Title1.$Delimeter.$Title2, 61);
Object_FieldList ($SystemTableID);
break;
case 2:
# покажем форму добавления поля
BeginHtml ($Title4, $Title1.$Delimeter.$Title3.$Delimeter.$Title4, 61);
Object_FieldForm (0, $SystemTableID);
break;
case 3:
# собственно добавим поле и покажем список
BeginHtml ($Title2, $Title1.$Delimeter.$Title2, 61);
$perm->ExitIfGuest ();
if (Object_FieldCompleted ()) {
Object_FieldList ($SystemTableID);
} else {
echo _LANG_FIELD_TITLE_ERROR;
Object_FieldForm (0, $SystemTableID);
}
break;
case 4:
# покажем форму редактирования поля
BeginHtml ($Title6, $Title1.$Delimeter.$Title3.$Delimeter.$Title5, 61);
Object_FieldForm ($Object_FieldID, $SystemTableID);
break;
case 5:
# собственно проапдейтим поле
BeginHtml ($Title2, $Title1.$Delimeter.$Title2, 61);
$perm->ExitIfGuest ();
Object_FieldCompleted ();
Object_FieldList ($SystemTableID);
break;
case 6:
# удалим поля и покажем список
BeginHtml ($Title2, $Title1.$Delimeter.$Title2, 61);
$perm->ExitIfGuest ();
if ($_REQUEST['no_delete']) System_UpdateObject_FieldPriority();
if (!$_REQUEST['no_delete']) DeleteObject_Fields ();
Object_FieldList ($SystemTableID, $_REQUEST['no_delete']?'Приоритеты полей изменены':'Поля удалены');
break;
}
EndHtml ();
?>PK `[X
c c index.phpnu W+A
require_once ("../../../../cms.conf");
require_once ("../../function.inc.php");
require_once ("../../object/function.inc.php");
$Delimeter = " > ";
$main_section = "settings";
$item_id = 1;
#$Title1 = "".$Delimeter." ";
$Title2 = _LANG_TABLES_SYSTEM;
$Title3 = ""._LANG_TABLES_SYSTEM."";
$Title8 = _LANG_EDIT;
#######################################################################
function SystemTableList ()
{
global $LinkID;
global $ADMIN_DOMAIN;
?>