commit 3df8fc53b82e2acee784d6e03fc84cbfb4a48f75 Author: Developer Date: Mon Dec 17 17:50:23 2018 +0100 initializing git repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ab0e71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +config.php +downloads/ +pictures/ +log/ diff --git a/documentation/German/DeveloperGuide.odt b/documentation/German/DeveloperGuide.odt new file mode 100755 index 0000000..c1479c7 Binary files /dev/null and b/documentation/German/DeveloperGuide.odt differ diff --git a/documentation/German/DeveloperGuide.pdf b/documentation/German/DeveloperGuide.pdf new file mode 100755 index 0000000..66ab40f Binary files /dev/null and b/documentation/German/DeveloperGuide.pdf differ diff --git a/includes/globals.php b/includes/globals.php new file mode 100755 index 0000000..b3ab2f7 --- /dev/null +++ b/includes/globals.php @@ -0,0 +1,31 @@ + diff --git a/includes/java_scripts.php b/includes/java_scripts.php new file mode 100755 index 0000000..710bceb --- /dev/null +++ b/includes/java_scripts.php @@ -0,0 +1,19 @@ + + diff --git a/includes/language.php b/includes/language.php new file mode 100755 index 0000000..5158a55 --- /dev/null +++ b/includes/language.php @@ -0,0 +1,68 @@ + diff --git a/includes/load_config.php b/includes/load_config.php new file mode 100755 index 0000000..49b521c --- /dev/null +++ b/includes/load_config.php @@ -0,0 +1,39 @@ + diff --git a/includes/lock.php b/includes/lock.php new file mode 100755 index 0000000..572abb0 --- /dev/null +++ b/includes/lock.php @@ -0,0 +1,65 @@ + diff --git a/includes/log.php b/includes/log.php new file mode 100755 index 0000000..9d6a969 --- /dev/null +++ b/includes/log.php @@ -0,0 +1,60 @@ +$GlobalLogfileMaxLength) ? $Length-$GlobalLogfileMaxLength:0); $i<$Length;$i++) + fputs($FileHandler,$ExistingFileArray[$i]); + fclose($FileHandler); + } +} + +function LogClose () +{ + LogWriteToFile(); +} + +function LogFormatMessage ($Msg) +{ + global $GlobalTimeZone; + global $GlobalTimeFormat; + date_default_timezone_set($GlobalTimeZone); + $NewMsg = ""; + $NewMsg .= "[".date($GlobalTimeFormat,time())."]"; + $NewMsg .= $Msg . "\n"; + return $NewMsg; +} + +?> diff --git a/includes/message.php b/includes/message.php new file mode 100755 index 0000000..11acaaf --- /dev/null +++ b/includes/message.php @@ -0,0 +1,41 @@ + diff --git a/includes/mysql.php b/includes/mysql.php new file mode 100755 index 0000000..c104a27 --- /dev/null +++ b/includes/mysql.php @@ -0,0 +1,28 @@ + diff --git a/includes/nested_list_functions.php b/includes/nested_list_functions.php new file mode 100755 index 0000000..50d8955 --- /dev/null +++ b/includes/nested_list_functions.php @@ -0,0 +1,173 @@ +=$Id) && (strtolower($IdArray[$Id])=="true")) ? 1:0; + $Ret = (isset($IdArray[$Id]) && (strtolower($IdArray[$Id])=="true")) ? 1:0; + return $Ret; +} + +function NestedListVisibilityUnsetAllSubelements ($ParentId, $ListIdentifier, $TableName) +{ + if (!$TableName) return 0; + $ReturnValue=1; + global $GlobalMysqlHandler; + + $Query = "SELECT * FROM `$TableName` WHERE `ParentId` =$ParentId"; + $Query = mysqli_query($GlobalMysqlHandler, $Query); + while ($Item = mysqli_fetch_array($Query)) + { + NestedListVisibilityUnset ($Item['Id'], $ListIdentifier); + } + + return $ReturnValue; +} + +function NestedListVisibilityUnsetAllElements ($ListIdentifier) +{ + if (!$ListIdentifier) return; + if (!isset($_SESSION[$ListIdentifier])) + { + $EmptyArray = array(); + $_SESSION[$ListIdentifier] = $EmptyArray; + } + + $IdArray = $_SESSION[$ListIdentifier]; + for ($i=0; $i < count($IdArray); $i++) $IdArray[$i] = "False"; + $_SESSION[$ListIdentifier]=$IdArray; +} + +?> diff --git a/includes/other_functions.php b/includes/other_functions.php new file mode 100755 index 0000000..94b4280 --- /dev/null +++ b/includes/other_functions.php @@ -0,0 +1,132 @@ +=0; $i--) + { + if ($Integer[$i]=="E") break; + $Exponent = $Integer[$i] . $Exponent; + } + $Exponent = substr($Exponent,0,strlen($Exponent)-1); + //set si prefix + if ($Exponent>=18) return ($Integer/1000000000000000000)." E"; + if ($Exponent>=15) return ($Integer/1000000000000000)." P"; + if ($Exponent>=12) return ($Integer/1000000000000)." T"; + if ($Exponent>=9) return ($Integer/1000000000)." G"; + if ($Exponent>=6) return ($Integer/1000000)." M"; + if ($Exponent>=3) return ($Integer/1000)." k"; + if ($Exponent<3 && $Exponent>=0) return ($Integer/1)." "; + if ($Exponent<-15) return ($Integer*1000000000000000)." a"; + if ($Exponent<-12) return ($Integer*1000000000000000)." f"; + if ($Exponent<-9) return ($Integer*1000000000000)." p"; + if ($Exponent<-6) return ($Integer*1000000000)." n"; + if ($Exponent<-3) return ($Integer*1000000)." µ"; + if ($Exponent<0) return ($Integer*1000)." m"; +} + +function OtherGetIcon ($IconName,$CssClass) +{ + global $GlobalTemplate; + $IconDirectory='./templates/'.$GlobalTemplate.'/icons/'; + $Error = 0; + $RetVal = ""; + + if (file_exists($IconDirectory.$IconName.".png")) $IconFile=$IconName.".png"; + elseif (file_exists($IconDirectory.$IconName.".jpg")) $IconFile=$IconName.".jpg"; + elseif (file_exists($IconDirectory.$IconName.".gif")) $IconFile=$IconName.".gif"; + else + { + $Error = 1; + //log if template directory is existing - if not, anyone else will report this + if (file_exists("./templates/".$GlobalTemplate)) ErrorLog("Icon '$IconName' +[.png|.jpg|.gif] not found!"); + } + + if (!$Error) + { + $RetVal = ""; + } + + return $RetVal; +} + +?> diff --git a/includes/prepare_template.php b/includes/prepare_template.php new file mode 100755 index 0000000..654260f --- /dev/null +++ b/includes/prepare_template.php @@ -0,0 +1,158 @@ +'."\n"; +$TemplateMainMenu .= ' '."\n"; +$TemplateMainMenu .= ' '."\n"; +$TemplateMainMenu .= "\n"; + +$TemplateLogin = ""; +$TemplateLogin .= '
'."\n"; +if (!UserIsLoggedIn()) +{ + $TemplateLogin .= '
'."\n"; + $TemplateLogin .= ' '."\n"; + $TemplateLogin .= ' '."\n"; + $TemplateLogin .= ' '."\n"; + $TemplateLogin .= '
'."\n"; +} +$TemplateLogin .= '
'."\n"; + +/********** + messages +***********/ +$ShowMessageError = (MessageGetErrors()) ? 1:0; +$ShowMessageWarning = (MessageGetWarnings()) ? 1:0; +$ShowMessageSuccess = (MessageGetSuccess()) ? 1:0; + +$TemplateMessage = ""; +if ($ShowMessageError || $ShowMessageWarning || $ShowMessageSuccess) +{ + $TemplateMessage .= '
'; + if ($ShowMessageError) + $TemplateMessage .= '
'.nl2br(htmlentities(MessageGetErrors())).'
'; + if ($ShowMessageWarning) + $TemplateMessage .= '
'.nl2br(htmlentities(MessageGetWarnings())).'
'; + if ($ShowMessageSuccess) + $TemplateMessage .= '
'.nl2br(htmlentities(MessageGetSuccess())).'
'; + $TemplateMessage .= '
'; +} + +/*********************** + include java scripts +************************/ +$JSInclude = ""; +$JSFileArray = file ("./includes/java_scripts.php"); +foreach ($JSFileArray as $JSFileArrayLine) + $JSInclude .= $JSFileArrayLine; +$GlobalContent = $JSInclude.$GlobalContent; + + +/********** + Content +***********/ +$TemplateBody='
'."\n".$GlobalContent.'
'; + +?> diff --git a/includes/user.php b/includes/user.php new file mode 100755 index 0000000..0874dc4 --- /dev/null +++ b/includes/user.php @@ -0,0 +1,175 @@ +0) + { + global $GlobalMysqlHandler; + $RightsQuery = "SELECT `$Right` FROM `UserRights` WHERE `Id` =".$_SESSION['Id']; + $RightsQuery = mysqli_query($GlobalMysqlHandler, $RightsQuery); + if ($RightsQuery && mysqli_num_rows($RightsQuery)) + { + $RightData = mysqli_fetch_array($RightsQuery); + $Ret=(strtolower($RightData[$Right])=="true")? 1:0; + } + else + { + ErrorLog("[user.php] User with id '".$_SESSION['Id']."' not found in table 'UserRights' while asking for right '$Right'!"); + } + } + return ($Ret); +} + +function UserLoadSettings() +{ + $Ret=0; + global $GlobalMysqlHandler; + + global $GlobalTemplate; + global $CfgStdTemplate; + + global $GlobalLanguage; + global $CfgStdLanguage; + + if (isset($_SESSION['Id']) && $_SESSION['Id']>0) + { + $LoadQuery="SELECT `Template` , `Language` FROM `User` WHERE `Id` =".$_SESSION['Id']; + $LoadQuery=mysqli_query($GlobalMysqlHandler, $LoadQuery); + if ($LoadQuery) + { + $LoadValue=mysqli_fetch_array($LoadQuery); + $GlobalTemplate=($LoadValue['Template'])? $LoadValue['Template']:$CfgStdTemplate; + $GlobalLanguage=($LoadValue['Language'])? $LoadValue['Language']:$CfgStdLanguage; + $Ret=1; + } + else + { + ErrorLog("[user.php] Not able to load vars for user with id = ".$_SESSION['Id']."!"); + } + } + return $Ret; +} + +?> diff --git a/index.php b/index.php new file mode 100755 index 0000000..e1448a8 --- /dev/null +++ b/index.php @@ -0,0 +1,110 @@ +$StartTime s
\n"; + echo "Stop time: $StopTime s
\n"; + } + echo "Script execution time: $TimeSpan ms
\n"; +} +?> diff --git a/languages/English.lng b/languages/English.lng new file mode 100755 index 0000000..e2bb76c --- /dev/null +++ b/languages/English.lng @@ -0,0 +1,158 @@ +MenuHome = Home + +MenuParts = Parts +MenuPartsByType = Party By Type +MenuPartsByStore = Parts By Store +MenuPartsAddNewPart = Add New Part + +MenuAdmin = Administration +MenuAdminStores = Stores +MenuAdminTypes = Types +MenuAdminPacks = Packages +MenuAdminVendors = Vendors +MenuAdminUsers = Users +MenuAdminConfig = Config + +MenuTools = Tools +MenuToolsRepOrder = Repeat Order +MenuToolsPartStat = Part Statistic +MenuToolsConsCheck = Consistency Check + +MenuHelp = Help +MenuHelpUserGuide = User Guide +MenuHelpAdminGuide = Admin Guide +MenuHelpDeveloperGuide = Developer Guide +MenuHelpVersionHistory = Version History +MenuHelpAbout = About + +MenuUserSettings = User Settings +MenuUserLogout = Logout + +MenuLogin = Login +MenuLoginName = Login Name +MenuLoginPassword = Password + +ScentenceNoLoginSpecified = No login specified! +ScentenceLoggedAsRoot = Logged as root user. +ScentenceLoginFailed = Login failed! +ScentenceLoginTimeoutExpired = Login Timeout expired! +ScentenceLoginSucceeded = Login successfull. +ScentenceNoUserRights = You have not the required rights for this! +SentencePageNotFound = Page not found! +SentenceLoginForbidden = This login was not allowed! +SentencePasswordForbidden = This password was not allowed! +SentenceDatabaseError = Databse error! +SentenceNewUserAdded = New user has been added. +SentenceUserUpdated = User entry has been updated. +SentenceUserDeleted = User has been deleted. +SentencePasswordChangedWarning = User password has been changed! +SentenceTemplateNotFound = Template not found! +SentenceLockIsActive = Item is locked by another user. +SentenceUnknownError = Unkown error! +SentenceNestedListMoved = Element was moved. +SentencePleaseSelectPartType = Please select the type of the part. +SentencePleaseSelectPartStorage = Please select the store of the part. +SentencePleaseSelectPackage = Please select the package of the part. +SentencePleaseSpecifyPartValues = Please specify the values of the part. +SentenceNoNameOrValueOrDescriptionGiven = No name, value or description given! +SentenceNewPartAdded = New part was added to database. +SentencePartHasBeenUpdated = Part has been updated. +SentenceNoFileGiven = No file given! +SentenceNotEnoughDiskSpace = There is not enough free disk space! +SentenceFileAlreadyExist = File already exist! +SentenceCanNotCopyFile = Can not copy file! +SentenceFileHasBeenUploaded = File has been uploaded. +SentenceDownloadEdited = Download has been edited. +SentenceDownloadDeleted = Download deleted. +SentenceShureToDeletePart = Are you shure to remove the part from the database? +SentencePartDeleted = Part was removed from database. + +TagTitleEditUserLogin = Edit this users login name. +TagTitleEditUserPassword = Edit this users password or leave untouched to keep the old. +TagTitleEditUserRight = Check or uncheck to set or reset this users right. +TagTitleDeleteUser = Delete this user. +TagTitleDeleteEntry = Delete Item +TagTitleEdit = Edit Item +TagTitleDelete = Delete Item +TagTitleCancel = Cancel +TagTitleMove = Move Item +TagTitleMoveUp = Move Item Up + +ButtonEdit = Edit +ButtonSave = Save +ButtonNew = New +ButtonProceed = Proceed +ButtonUpload = Upload + +UserSettingsTableHead = user settings +UserSettingsSetNewPassword = set new password +UserSettingsConfirmNewPassword = confirm new password +UserSettingsLanguage = language +UserSettingsTemplate = template +UserSettingsDefault = default + +EditVendorsId = id +EditVendorsName = vendor +EditVendorsHomepage = homepage +EditVendorsMinBill = minimum bill +EditVendorsShippingCost = shipping cost +EditVendorsEdit = Edit +EditVendorsSentenceVendorNameRequired = Name of the Vendor is required! +EditVendorsSentenceVendorNewAdded = New vendor added. +EditVendorsSentenceVendorDeleted = Vendor deleted. +EditVendorsSentenceVendorUpated = Vendor updated. + +EditStoresNoStoreNameGiven = You need to give a name for the store! +EditStoresNewStoreAdded = New store added. +EditStoresStoreDeleted = Store deleted. + +EditPackagesNoPackageNameGiven = You need to give a name for the package! +EditPackagesNewPackageAdded = New package added. +EditPackagesPackageDeleted = Package deleted. + +EditTypesNoTypeNameGiven = You need to give a name for the type! +EditTypesNewTypeAdded = New type added. +EditTypesTypeDeleted = Type deleted. +EditTypesName = Name +EditTypesShortName = Abbr. +EditTypesNameValue1 = Value1 +EditTypesNameValue2 = Value2 +EditTypesNameValue3 = Value3 +EditTypesUnitValue1 = Unit1 +EditTypesUnitValue2 = Unit2 +EditTypesUnitValue3 = Unit3 + +PartsName = Name +PartsShortDescription = Short Description +PartsLongDescription = Long Description +PartsVendor = Vendor +PartsManufactorLink = Manufactor Link +PartsNotSpecified = not specified +PartsVendorLink = Vendor Link +PartsPackageUnit = Package Unit +PartsPrice = Price +PartsMinOrderQuantity = Minimum Order Quantity +PartsQuantity = Actual Quantity +PartsMinQuantity = Minimum Quantity +PartsPackage = Package +PartsObsolete = Obsolete +PartsObsoleteOnly = Only Obsolete +PartsObsoleteNon = Non Obsolete +PartsObsoleteAll = All Parts +PartsType = Type +PartsStorage = Store +PartsValues = Values +PartsDownloads = Downloads +PartsPicture = Picture + +DownloadsName = Name +DownloadsPath = Path +DownloadsSize = Size +DownloadsType = Type + +RepeatOrderPackagesToOrder = Packages To Order +RepeatOrderSumPrice = Sum Price + +ConsCheckCreateDatabaseStructure = Create Database Structure +ConsCheckRepairIncorrectType = Repair incorrect parts type +COnsCheckIncorrectTypeParts = Number of parts with incorrect types diff --git a/languages/German.lng b/languages/German.lng new file mode 100755 index 0000000..7682433 --- /dev/null +++ b/languages/German.lng @@ -0,0 +1,158 @@ +MenuHome = Startseite + +MenuParts = Bauteile +MenuPartsByType = Teile nach Typ +MenuPartsByStore = Teile nach Lager +MenuPartsAddNewPart = Neues Bauteil + +MenuAdmin = Administration +MenuAdminStores = Lager +MenuAdminTypes = Typen +MenuAdminPacks = Gehäuse +MenuAdminVendors = Lieferanten +MenuAdminUsers = Benutzer +MenuAdminConfig = Config + +MenuTools = Werkzeuge +MenuToolsRepOrder = Nachbestellung +MenuToolsPartStat = Bauteil Statistik +MenuToolsConsCheck = Konsistenz Prüfung + +MenuHelp = Hilfe +MenuHelpUserGuide = Benutzerhandbuch +MenuHelpAdminGuide = Administrationshandbuch +MenuHelpDeveloperGuide = Entwicklerhandbuch +MenuHelpVersionHistory = Versionsgeschichte +MenuHelpAbout = Über + +MenuUserSettings = Benutzer Einstellungen +MenuUserLogout = Logout + +MenuLogin = Login +MenuLoginName = Login Name +MenuLoginPassword = Passwort + +ScentenceNoLoginSpecified = Kein Login angegeben! +ScentenceLoggedAsRoot = Eingeloggt als root! +ScentenceLoginFailed = Login fehlgeschlagen! +ScentenceLoginTimeoutExpired = Login Zeitlimit überschritten! +ScentenceLoginSucceeded = Login erfolgreich. +ScentenceNoUserRights = Sie besitzen nicht die nötigen Benutzerrechte! +SentencePageNotFound = Die Seite wurde nicht gefunden! +SentenceLoginForbidden = Dieser Login ist nicht erlaubt! +SentencePasswordForbidden = Dieses Passwort ist nicht erlaubt! +SentenceDatabaseError = Datenbank fehler! +SentenceNewUserAdded = Neuer Benutzer wurde zugefügt. +SentenceUserUpdated = Benutzereintrag wurde gespeichert. +SentenceUserDeleted = Benutzer wurde gelöscht. +SentencePasswordChangedWarning = Benutzer Passwort wurde geändert! +SentenceTemplateNotFound = Das Template wurde nicht gefunden! +SentenceLockIsActive = Dieser Posten ist durch einen anderen Benutzer gesperrt. +SentenceUnknownError = Unbekannter Fehler! +SentenceNestedListMoved = Das Element wurde verschoben. +SentencePleaseSelectPartType = Bitte wählen sie den Typ des Bauteils. +SentencePleaseSelectPartStorage = Bitte wählen sie den Lagerort des Bauteils. +SentencePleaseSelectPackage = Bitte wählen sie den Gehäusetyp des Bauteils. +SentencePleaseSpecifyPartValues = Bitte geben sie die Werte des Bauteils ein. +SentenceNoNameOrValueOrDescriptionGiven = Kein Name, Wert oder Beschreibung angegeben! +SentenceNewPartAdded = Neues Bauteil wurde der Datenbank hinzugefügt. +SentencePartHasBeenUpdated = Bauteil wurde gespeichert. +SentenceNoFileGiven = Keine Datei angegeben! +SentenceNotEnoughDiskSpace = Nicht genügend Speicherplatz! +SentenceFileAlreadyExist = Die Datei existiert bereits! +SentenceCanNotCopyFile = Datei kann nicht kopiert werden! +SentenceFileHasBeenUploaded = Datei wurde hochgeladen. +SentenceDownloadEdited = Download wurde bearbeitet. +SentenceDownloadDeleted = Download wurde gelöscht. +SentenceShureToDeletePart = Sind sie sicher, dass sie das Bauteil aus der Datenbank löschen wollen? +SentencePartDeleted = Bauteil wurde aus der Datenbank gelöscht. + +TagTitleEditUserLogin = Benutzer login bearbeiten. +TagTitleEditUserPassword = Passwort ändern oder frei lassen. +TagTitleEditUserRight = Markieren setzt dieses Benutzerrecht. +TagTitleDeleteUser = Benutzer löschen. +TagTitleDeleteEntry = Eintrag löschen. +TagTitleEdit = Eintrag bearbeiten. +TagTitleDelete = Eintrag löschen. +TagTitleCancel = Abbrechen +TagTitleMove = Eintrag verschieben. +TagTitleMoveUp = Eintrag nach oben verschieben. + +ButtonEdit = Bearbeiten +ButtonSave = Speichern +ButtonNew = Neu +ButtonProceed = Fortfahren +ButtonUpload = Hochladen + +UserSettingsTableHead = Benutzer Einstellungen +UserSettingsSetNewPassword = Neues Passwort setzen +UserSettingsConfirmNewPassword = Neues Passwort bestätigen +UserSettingsLanguage = Sprache +UserSettingsTemplate = Template +UserSettingsDefault = Standart + +EditVendorsId = Id +EditVendorsName = Händler +EditVendorsHomepage = Homepage +EditVendorsMinBill = Mindestbestellwert +EditVendorsShippingCost = Versandkosten +EditVendorsEdit = Ändern +EditVendorsSentenceVendorNameRequired = Name des Händlers wird benötigt! +EditVendorsSentenceVendorNewAdded = Neuer Händler eingetragen. +EditVendorsSentenceVendorDeleted = Händler gelöscht. +EditVendorsSentenceVendorUpated = Händler geändert. + +EditStoresNoStoreNameGiven = Sie müssen einen Namen für das Lager angeben! +EditStoresNewStoreAdded = Neues Lager angelegt. +EditStoresStoreDeleted = Lager gelöscht. + +EditPackagesNoPackageNameGiven = Sie müssen einen Gehäusenamen angeben! +EditPackagesNewPackageAdded = Neues Gehäuse hinzugefügt. +EditPackagesPackageDeleted = Gehäuse gelöscht. + +EditTypesNoTypeNameGiven = Sie müssen einen Typennamen angeben! +EditTypesNewTypeAdded = Neuer Typ zugefügt. +EditTypesTypeDeleted = Typ gelöscht. +EditTypesName = Name +EditTypesShortName = Abk. +EditTypesNameValue1 = Wert1 +EditTypesNameValue2 = Wert2 +EditTypesNameValue3 = Wert2 +EditTypesUnitValue1 = Einheit1 +EditTypesUnitValue2 = Einheit2 +EditTypesUnitValue3 = Einheit3 + +PartsName = Name +PartsShortDescription = kuzre Beschreibung +PartsLongDescription = lange Beschreibung +PartsVendor = Händler +PartsManufactorLink = Hersteller Link +PartsNotSpecified = nicht angegeben +PartsVendorLink = Händler Link +PartsPackageUnit = Verpackungseinheit +PartsPrice = Preis +PartsMinOrderQuantity = Mindestbestellmenge +PartsQuantity = Aktuelle Anzahl +PartsMinQuantity = Mindest Anzahl +PartsPackage = Gehäuse +PartsObsolete = Obsolet +PartsObsoleteOnly = nur Obsolet +PartsObsoleteNon = keine Obsolete +PartsObsoleteAll = alle Bauteile +PartsType = Typ +PartsStorage = Lager +PartsValues = Werte +PartsDownloads = Downloads +PartsPicture = Bild + +DownloadsName = Name +DownloadsPath = Pfad +DownloadsSize = Größe +DownloadsType = Typ + +RepeatOrderPackagesToOrder = Bestellmenge +RepeatOrderSumPrice = Gesamtpreis + +ConsCheckCreateDatabaseStructure = Datenbank Struktur erzeugen +ConsCheckRepairIncorrectType = Kaputte Bauteiltypen reparieren +COnsCheckIncorrectTypeParts = Anzahl kaputter Bauteiltypen diff --git a/pages/add_part.php b/pages/add_part.php new file mode 100755 index 0000000..9f8f030 --- /dev/null +++ b/pages/add_part.php @@ -0,0 +1,125 @@ + diff --git a/pages/add_part_package.php b/pages/add_part_package.php new file mode 100755 index 0000000..2b984b5 --- /dev/null +++ b/pages/add_part_package.php @@ -0,0 +1,73 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'AddPartPackage'); + } + else + { + ErrorLog("[add_part1.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPackage').'

'; + $GlobalContent .= '
'; + WritePackageList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/add_part_storage.php b/pages/add_part_storage.php new file mode 100755 index 0000000..2f0b463 --- /dev/null +++ b/pages/add_part_storage.php @@ -0,0 +1,73 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'AddPartStorage'); + } + else + { + ErrorLog("[add_part1.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPartStorage').'

'; + $GlobalContent .= '
'; + WriteStorageList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/add_part_type.php b/pages/add_part_type.php new file mode 100755 index 0000000..f1ab74a --- /dev/null +++ b/pages/add_part_type.php @@ -0,0 +1,75 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'AddPartType'); + } + else + { + ErrorLog("[add_part1.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + ////////// + // Content + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPartType').'

'; + $GlobalContent .= '
'; + WriteTypeList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/add_part_values.php b/pages/add_part_values.php new file mode 100755 index 0000000..9a84bd7 --- /dev/null +++ b/pages/add_part_values.php @@ -0,0 +1,107 @@ +'.LangSpellHtml('SentencePleaseSpecifyPartValues').''; + $GlobalContent .= '
'; + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + if ($TypeValues[0][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + if ($TypeValues[1][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + if ($TypeValues[2][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= '
'.LangSpellHtml('PartsObsolete').''; + $GlobalContent .= '
'.LangSpellHtml('PartsName').''; + $GlobalContent .= '
'.$TypeValues[0][0].''; + $GlobalContent .= ' '.$TypeValues[0][1].'
'.$TypeValues[1][0].''; + $GlobalContent .= ' '.$TypeValues[1][1].'
'.$TypeValues[2][0].''; + $GlobalContent .= ' '.$TypeValues[2][1].'
'.LangSpellHtml('PartsShortDescription').''; + $GlobalContent .= '
'.LangSpellHtml('PartsLongDescription').''; + $GlobalContent .= '
'.LangSpellHtml('PartsVendor').''; + $GlobalContent .= '
'.LangSpellHtml('PartsVendorLink').''; + $GlobalContent .= '
'.LangSpellHtml('PartsManufactorLink').''; + $GlobalContent .= '
'.LangSpellHtml('PartsPackageUnit').''; + $GlobalContent .= '
'.LangSpellHtml('PartsPrice').''; + $GlobalContent .= '
'.LangSpellHtml('PartsMinOrderQuantity').''; + $GlobalContent .= '
'.LangSpellHtml('PartsQuantity').''; + $GlobalContent .= '
'.LangSpellHtml('PartsMinQuantity').''; + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= '
'; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/consistency_check.php b/pages/consistency_check.php new file mode 100755 index 0000000..9c73705 --- /dev/null +++ b/pages/consistency_check.php @@ -0,0 +1,4 @@ + diff --git a/pages/consistency_check_databse.php b/pages/consistency_check_databse.php new file mode 100755 index 0000000..9450915 --- /dev/null +++ b/pages/consistency_check_databse.php @@ -0,0 +1,146 @@ +".LangSpellHtml('ConsCheckCreateDatabaseStructure').""; + $GlobalContent .= ''.LangSpellHtml('ButtonProceed').''; + } +} +?> diff --git a/pages/consistency_check_incorrect_types.php b/pages/consistency_check_incorrect_types.php new file mode 100755 index 0000000..1fe0dbe --- /dev/null +++ b/pages/consistency_check_incorrect_types.php @@ -0,0 +1,81 @@ +".LangSpellHtml('ConsCheckRepairIncorrectType').""; + $GlobalContent .= LangSpellHtml('COnsCheckIncorrectTypeParts') . ": " . $IncorrectTypes . "
"; + $GlobalContent .= ''.LangSpellHtml('ButtonProceed').''; +} +?> diff --git a/pages/edit_config.php b/pages/edit_config.php new file mode 100755 index 0000000..ef6e622 --- /dev/null +++ b/pages/edit_config.php @@ -0,0 +1,165 @@ +\n"); + fclose($ConfigFileHandler); + } + include("./includes/load_config.php"); +} + + +if (UserGetLogin()=="root") +{ + ////////////////// + //global content + include ("config.php"); + $GlobalContent.='
'."\n"; + $GlobalContent.=''."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.='
CfgStdTemplate'."\n"; + $GlobalContent.='
CfgStdLanguage'."\n"; + $GlobalContent.='
CfgStdTimeZone'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.OtherGetIcon('Help',"Button")."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
CfgStdTimeFormat'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.OtherGetIcon('Help',"Button")."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'.LangSpellHtml('UserSettingsSetNewPassword').'
'.LangSpellHtml('UserSettingsConfirmNewPassword').'
CfgLogfile
CfgLogfileMaxLines
CfgSetDebugMode
CfgMysqlHost
CfgMysqlUser
CfgMysqlPwd
CfgMysqlDatabase
CfgLoginTimeout
CfgLockAutoReleaseTime
'.LangSpellHtml('ButtonSave').'
'."\n"; + $GlobalContent.='
'."\n"; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/edit_packages.php b/pages/edit_packages.php new file mode 100755 index 0000000..a5b71e8 --- /dev/null +++ b/pages/edit_packages.php @@ -0,0 +1,299 @@ +\n"; + else + $GlobalContent .= "\n"; +} + +if (UserHasRight('EditPackages')) +{ + ///////////////// + //edit package save + if ($ToDo=="EditpackageSave") + { + if (isset($_POST['Id']) && $_POST['Id'] && isset($_POST['Name']) && $_POST['Name']) + { + global $GlobalMysqlHandler; + $Id = $_POST['Id']; + $Name = $_POST['Name']; + $MoveId = (isset($_POST['MoveToId']))? $_POST['MoveToId']:0; + + if ($MoveId) + { + $MoveQuery = ""; + if ($MoveId=="#MOVE#ITEM#UP#") + { + $FirstParentId = NestedListGetParentId($Id,'Packages'); + $MoveId = NestedListGetParentId($FirstParentId,'Packages'); + } + else + { + $FirstParentId = NestedListGetParentId($Id,'Packages'); + } + + $MoveQuery="UPDATE `Packages` SET `ParentId` = '$MoveId' WHERE `Id` =$Id LIMIT 1 ;"; + + if (mysqli_query($GlobalMysqlHandler, $MoveQuery)) + { + MessageSuccess(LangSpell('SentenceNestedListMoved')); + NestedListVisibilityUnset($FirstParentId,'EditPackages'); + NestedListVisibilitySet($MoveId,'EditPackages'); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_pacakges.php] Db error on moving element with id $Id to parent id $MoveId"); + } + } + + $ChangeNameQuery="UPDATE `Packages` SET `Name` = '$Name' WHERE `Id` =$Id LIMIT 1 ;"; + if (!mysqli_query($GlobalMysqlHandler, $ChangeNameQuery)) + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_pacakges.php] Db error on naming element with id $Id"); + } + } + else + { + if (isset($_POST['Name']) && !trim($_POST['Name'])) + MessageError(LangSpell('EditPackagesNoPackageNameGiven')); + else + { + ErrorLog("[edit_pacakges.php] No Id to move down!"); + MessageError(LangSpell('SentenceUnknownError')); + } + } + + $ToDo=""; + } + + ///////////////// + // delete package + if ($ToDo=="DeletePackage") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $Id = $_GET['Id']; + if (!LockIsActive('Packages',$Id)) + { + global $GlobalMysqlHandler; + $DeleteQuery="DELETE FROM `Packages` WHERE `Id` = $Id LIMIT 1"; + if (mysqli_query($GlobalMysqlHandler, $DeleteQuery)) + { + MessageSuccess(LangSpell('EditPackagesPackageDeleted')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_pacakges.php] No Id to delete package!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + //////////////// + // add new package + if ($ToDo=="NewPackage") + { + if (isset($_GET['ParentId']) && isset($_POST['NewPackageName'])) + { + $ParentId = $_GET['ParentId']; + $NewPackageName = $_POST['NewPackageName']; + if (LockActivate('Packages',$ParentId)) + { + if (trim($NewPackageName)!="") + { + global $GlobalMysqlHandler; + $InsertQuery="INSERT INTO `Packages` ( `Name` , `ParentId` ) VALUES ( '$NewPackageName', '$ParentId' );"; + if (mysqli_query($GlobalMysqlHandler, $InsertQuery)) + { + MessageSuccess(LangSpell('EditPackagesNewPackageAdded')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('EditPackagesNoPackageNameGiven')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + if (!isset($_GET['ParentId'])) + ErrorLog("[edit_pacakges.php] No ParentId to add new package!"); + if (!isset($_POST['NewPackageName'])) + ErrorLog("[edit_pacakges.php] No NewPackageName to add new package!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + /////////////// + // edit package + if ($ToDo=="EditPackage") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockActivate('Packages',$EditId)) + { + $EditPackagesEditId=$EditId; + //NestedListVisibilityUnset($EditId, 'EditPackages'); + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_pacakges.php] No Id to edit package"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } + + ////////////////////// + // cancel edit package + if ($ToDo=="CancelEditPackage") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockRelease('Packages',$EditId)) + { + $EditPackagesEditId=0; + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_pacakges.php] No Id to release loack on package"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } +} + +if (UserHasRight('EditPackages') || UserHasRight('ViewSTPV')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'EditPackages'); + } + else + { + ErrorLog("[edit_pacakges.php] No SublistId to open package!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + /////////////// + // sow packages + if ($ToDo=="") + WritePackagesList(0,0); +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/edit_stores.php b/pages/edit_stores.php new file mode 100755 index 0000000..8b05798 --- /dev/null +++ b/pages/edit_stores.php @@ -0,0 +1,299 @@ +\n"; + else + $GlobalContent .= "\n"; +} + +if (UserHasRight('EditStores')) +{ + ///////////////// + //edit store save + if ($ToDo=="EditStoreSave") + { + if (isset($_POST['Id']) && $_POST['Id'] && isset($_POST['Name']) && $_POST['Name']) + { + global $GlobalMysqlHandler; + $Id = $_POST['Id']; + $Name = $_POST['Name']; + $MoveId = (isset($_POST['MoveToId']))? $_POST['MoveToId']:0; + + if ($MoveId) + { + $MoveQuery = ""; + if ($MoveId=="#MOVE#ITEM#UP#") + { + $FirstParentId = NestedListGetParentId($Id,'Storages'); + $MoveId = NestedListGetParentId($FirstParentId,'Storages'); + } + else + { + $FirstParentId = NestedListGetParentId($Id,'Storages'); + } + + $MoveQuery="UPDATE `Storages` SET `ParentId` = '$MoveId' WHERE `Id` =$Id LIMIT 1 ;"; + + if (mysqli_query($GlobalMysqlHandler, $MoveQuery)) + { + MessageSuccess(LangSpell('SentenceNestedListMoved')); + NestedListVisibilityUnset($FirstParentId,'EditStorage'); + NestedListVisibilitySet($MoveId,'EditStorage'); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_stored.php] Db error on moving element with id $Id to parent id $MoveId"); + } + } + + $ChangeNameQuery="UPDATE `Storages` SET `Name` = '$Name' WHERE `Id` =$Id LIMIT 1 ;"; + if (!mysqli_query($GlobalMysqlHandler, $ChangeNameQuery)) + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_stored.php] Db error on naming element with id $Id"); + } + } + else + { + if (isset($_POST['Name']) && !trim($_POST['Name'])) + MessageError(LangSpell('EditStoresNoStoreNameGiven')); + else + { + ErrorLog("[edit_stores.php] No Id to move!"); + MessageError(LangSpell('SentenceUnknownError')); + } + } + + $ToDo=""; + } + + /////////////// + // delete store + if ($ToDo=="DeleteStore") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $Id = $_GET['Id']; + if (!LockIsActive('Storages',$Id)) + { + global $GlobalMysqlHandler; + $DeleteQuery="DELETE FROM `Storages` WHERE `Id` = $Id LIMIT 1"; + if (mysqli_query($GlobalMysqlHandler, $DeleteQuery)) + { + MessageSuccess(LangSpell('EditStoresStoreDeleted')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_stores.php] No Id to delete store!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + //////////////// + // add new store + if ($ToDo=="NewStore") + { + if (isset($_GET['ParentId']) && isset($_POST['NewStoreName'])) + { + $ParentId = $_GET['ParentId']; + $NewStoreName = $_POST['NewStoreName']; + if (LockActivate('Storages',$ParentId)) + { + if (trim($NewStoreName)!="") + { + global $GlobalMysqlHandler; + $InsertQuery="INSERT INTO `Storages` ( `Name` , `ParentId` ) VALUES ( '$NewStoreName', '$ParentId' );"; + if (mysqli_query($GlobalMysqlHandler, $InsertQuery)) + { + MessageSuccess(LangSpell('EditStoresNewStoreAdded')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('EditStoresNoStoreNameGiven')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + if (!isset($_GET['ParentId'])) + ErrorLog("[edit_stores.php] No ParentId to add new store!"); + if (!isset($_POST['NewStoreName'])) + ErrorLog("[edit_stores.php] No NewStoreName to add new store!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + ///////////// + // edit store + if ($ToDo=="EditStore") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockActivate('Storages',$EditId)) + { + $EditStoresEditId=$EditId; + //NestedListVisibilityUnset($EditId, 'EditStorage'); + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_stores.php] No Id to edit store"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } + + //////////////////// + // cancel edit store + if ($ToDo=="CancelEditStore") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockRelease('Storages',$EditId)) + { + $EditStoresEditId=0; + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_stores.php] No Id to release loack on storage"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } +} + +if (UserHasRight('EditStores') || UserHasRight('ViewSTPV')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'EditStorage'); + } + else + { + ErrorLog("[edit_stores.php] No SublistId to open store!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + /////////////// + // sow stores + if ($ToDo=="") + WriteStoreList(0,0); +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/edit_types.php b/pages/edit_types.php new file mode 100755 index 0000000..b2c6ec9 --- /dev/null +++ b/pages/edit_types.php @@ -0,0 +1,310 @@ +\n"; + else + $GlobalContent .= "\n"; +} + +if (UserHasRight('EditTypes')) +{ + ///////////////// + //edit type save + if ($ToDo=="EditTypeSave") + { + if (isset($_POST['Id']) && $_POST['Id'] && isset($_POST['Name']) && $_POST['Name'] + && isset($_POST['ShortName']) + && isset($_POST['NameValue1']) && isset($_POST['NameValue2']) && isset($_POST['NameValue3']) + && isset($_POST['UnitValue1']) && isset($_POST['UnitValue2']) && isset($_POST['UnitValue3']) + ) + { + global $GlobalMysqlHandler; + $Id = $_POST['Id']; + $Name = $_POST['Name']; + $MoveId = (isset($_POST['MoveToId']))? $_POST['MoveToId']:0; + + if ($MoveId) + { + $MoveQuery = ""; + if ($MoveId=="#MOVE#ITEM#UP#") + { + $FirstParentId = NestedListGetParentId($Id,'Types'); + $MoveId = NestedListGetParentId($FirstParentId,'Types'); + } + else + { + $FirstParentId = NestedListGetParentId($Id,'Types'); + } + + $MoveQuery="UPDATE `Types` SET `ParentId` = '$MoveId' WHERE `Id` =$Id LIMIT 1 ;"; + + if (mysqli_query($GlobalMysqlHandler, $MoveQuery)) + { + MessageSuccess(LangSpell('SentenceNestedListMoved')); + NestedListVisibilityUnset($FirstParentId,'EditTypes'); + NestedListVisibilitySet($MoveId,'EditTypes'); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_types.php] Db error on moving element with id $Id to parent id $MoveId"); + } + } + + //$ChangeItemQuery="UPDATE `Types` SET `Name` = '$Name' WHERE `Id` =$Id LIMIT 1 ;"; + $ChangeItemQuery="UPDATE `Types` SET `Name` = '$Name', `ShortName` = '".$_POST['ShortName']."', `NameValue1` = '".$_POST['NameValue1']."', `NameValue2` = '".$_POST['NameValue2']."', `NameValue3` = '".$_POST['NameValue3']."', `UnitValue1` = '".$_POST['UnitValue1']."', `UnitValue2` = '".$_POST['UnitValue2']."', `UnitValue3` = '".$_POST['UnitValue3']."' WHERE `Id` =$Id LIMIT 1 ;"; + if (!mysqli_query($GlobalMysqlHandler, $ChangeItemQuery)) + { + MessageError(LangSpell('SentenceDatabaseError')); + ErrorLog("[edit_types.php] Db error on updating element with id $Id"); + } + } + else + { + if (isset($_POST['Name']) && !trim($_POST['Name'])) + MessageError(LangSpell('EditTypesNoTypeNameGiven')); + else + { + ErrorLog("[edit_types.php] No Id to move down!"); + MessageError(LangSpell('SentenceUnknownError')); + } + } + $ToDo=""; + } + + /////////////// + // delete type + if ($ToDo=="DeleteType") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $Id = $_GET['Id']; + if (!LockIsActive('Types',$Id)) + { + global $GlobalMysqlHandler; + $DeleteQuery="DELETE FROM `Types` WHERE `Id` = $Id LIMIT 1"; + if (mysqli_query($GlobalMysqlHandler, $DeleteQuery)) + { + MessageSuccess(LangSpell('EditTypesTypeDeleted')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_types.php] No Id to delete type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + //////////////// + // add new type + if ($ToDo=="NewType") + { + if (isset($_GET['ParentId']) && isset($_POST['NewTypeName'])) + { + $ParentId = $_GET['ParentId']; + $NewTypeName = $_POST['NewTypeName']; + if (LockActivate('Types',$ParentId)) + { + if (trim($NewTypeName)!="") + { + global $GlobalMysqlHandler; + $InsertQuery="INSERT INTO `Types` ( `Name` , `ParentId` ) VALUES ( '$NewTypeName', '$ParentId' );"; + if (mysqli_query($GlobalMysqlHandler, $InsertQuery)) + { + MessageSuccess(LangSpell('EditTypesNewTypeAdded')); + } + else + { + MessageError(LangSpell('SentenceDatabaseError')); + } + } + else + { + MessageError(LangSpell('EditTypesNoTypeNameGiven')); + } + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + if (!isset($_GET['ParentId'])) + ErrorLog("[edit_types.php] No ParentId to add new type!"); + if (!isset($_POST['NewTypeName'])) + ErrorLog("[edit_types.php] No NewTypeName to add new type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + ///////////// + // edit type + if ($ToDo=="EditType") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockActivate('Types',$EditId)) + { + $EditTypesEditId=$EditId; + //NestedListVisibilityUnset($EditId, 'EditTypes'); + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_types.php] No Id to edit type."); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } + + //////////////////// + // cancel edit type + if ($ToDo=="CancelEditType") + { + if (isset($_GET['Id']) && $_GET['Id']) + { + $EditId = $_GET['Id']; + if (LockRelease('Types',$EditId)) + { + $EditTypesEditId=0; + } + else + { + MessageError(LangSpell('SentenceLockIsActive')); + } + } + else + { + ErrorLog("[edit_types.php] No Id to release loack on storage"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo = ""; + } +} + +if (UserHasRight('EditTypes') || UserHasRight('ViewSTPV')) +{ + /////////////// + // open sublist + if ($ToDo=="OpenSublist") + { + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + NestedListVisibilityToggle($_GET['SublistId'], 'EditTypes'); + } + else + { + ErrorLog("[edit_types.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; + } + + /////////////// + // sow types + if ($ToDo=="") + WriteTypeList(0,0); +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/edit_users.php b/pages/edit_users.php new file mode 100755 index 0000000..525fc45 --- /dev/null +++ b/pages/edit_users.php @@ -0,0 +1,261 @@ +'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' Id'."\n"; + $GlobalContent.=' Login'."\n"; + $GlobalContent.=' Password'."\n"; + for ($i=1;$i'."\n"; + } + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + //existing users + while ($UserRecord=mysqli_fetch_array($UserQuery)) + { + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '.$UserRecord['Id'].''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + + $RightsQuery="SELECT * FROM `UserRights` WHERE `Id` = ".$UserRecord['Id']." LIMIT 1"; + if (!$RightsQuery=mysqli_query($GlobalMysqlHandler, $RightsQuery)) + ErrorLog('[edit_users.php-$RightsQuery] Database error or user id '.$UserRecord['Id'].' not found in UserRights'); + $RightsRecord=mysqli_fetch_row($RightsQuery); + for ($i=1;$i<(mysqli_num_fields($RightsQuery));$i++) + { + $GlobalContent.=' '."\n"; + } + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.OtherGetIcon('Delete',0).''."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + } + + //new user entry + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '.$UserRecord[$i].''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + for ($i=1;$i<(mysqli_num_fields($RightsQuery));$i++) + { + $GlobalContent.=' '."\n"; + } + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + + $GlobalContent.=''."\n"; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/edit_vendors.php b/pages/edit_vendors.php new file mode 100755 index 0000000..aa2850a --- /dev/null +++ b/pages/edit_vendors.php @@ -0,0 +1,199 @@ +'."\n"; + + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.LangSpellHtml('EditVendorsId').''."\n"; + $GlobalContent.=' '.LangSpellHtml('EditVendorsName').''."\n"; + $GlobalContent.=' '.LangSpellHtml('EditVendorsHomepage').''."\n"; + $GlobalContent.=' '.LangSpellHtml('EditVendorsMinBill').''."\n"; + $GlobalContent.=' '.LangSpellHtml('EditVendorsShippingCost').''."\n"; + if (UserHasRight('EditVendors')) + $GlobalContent.=' '.LangSpellHtml('EditVendorsEdit').''."\n"; + $GlobalContent.=' '."\n"; + + $VendorQuery = "SELECT * FROM `Vendors`"; + $VendorQuery = mysqli_query($GlobalMysqlHandler, $VendorQuery); + while ($Vendor=mysqli_fetch_array($VendorQuery)) + { + if ( ($EditVendorId==$Vendor['Id']) ) + { + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.$Vendor['Id'].''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.OtherGetIcon('Cancel',"Button").''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + } + else + { + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.$Vendor['Id'].''."\n"; + $GlobalContent.=' '.$Vendor['Name'].''."\n"; + $GlobalContent.=' '.$Vendor['Homepage'].''."\n"; + $GlobalContent.=' '.$Vendor['MinBill'].''."\n"; + $GlobalContent.=' '.$Vendor['ShippingCost'].''."\n"; + if (LockIsActive("Vendors",$Vendor['Id'])) + $GlobalContent.=' '.OtherGetIcon('LockActive.png').''."\n"; + elseif (UserHasRight('EditVendors')) + { + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.OtherGetIcon('Delete',"Button").''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + } + $GlobalContent.=' '."\n"; + } + } + + if (!$EditVendorId && UserHasRight('EditVendors')) + { + $GlobalContent.='
'."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '.$Vendor['Id'].''."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.=' '."\n"; + $GlobalContent.='
'."\n"; + } + + $GlobalContent.=''."\n"; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/home.php b/pages/home.php new file mode 100755 index 0000000..736132b --- /dev/null +++ b/pages/home.php @@ -0,0 +1,5 @@ + diff --git a/pages/parts_by_store.php b/pages/parts_by_store.php new file mode 100755 index 0000000..e39b6b3 --- /dev/null +++ b/pages/parts_by_store.php @@ -0,0 +1,155 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + + /////////////// +// open sublist +if ($ToDo=="ToggleTypeSelectorVisibility") +{ + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + $ParentId = NestedListGetParentId($_GET['SublistId'], 'Storages'); + NestedListVisibilityUnsetAllElements('PartStoreSelector'); + NestedListVisibilitySetAllParents($_GET['SublistId'], 'PartStoreSelector', 'Storages'); + NestedListVisibilitySet($_GET['SublistId'], 'PartStoreSelector'); + $_SESSION['PartsByStoreStoreId'] = $_GET['SublistId']; + } + else + { + ErrorLog("[parts_by_type.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; +} + + + /////////// +// Selector +$GlobalContent .= '
'; +$GlobalContent .= WriteTypeSelector (0); +$GlobalContent .= '
'."\n"; + + //////////////// +// Sort Partlist +if (!isset($_SESSION['SortPartListBy'])) $_SESSION['SortPartListBy']="Name"; +if (!isset($_SESSION['SortPartListOrder'])) $_SESSION['SortPartListOrder']="ASC"; +if (isset($_GET['SortBy'])) +{ + if ($_SESSION['SortPartListBy']==$_GET['SortBy']) //set order direction + { + if ($_SESSION['SortPartListOrder']=="ASC") $_SESSION['SortPartListOrder']="DESC"; + else $_SESSION['SortPartListOrder']="ASC"; + } + else //set order by + { + $_SESSION['SortPartListBy']=$_GET['SortBy']; + $_SESSION['SortPartListOrder']="ASC"; + } +} + + ////////////////// +// Part List Begin +$GlobalContent .= '
'; +$GlobalContent .= ''."\n"; + + ////////////////////// +// PartList Table Head +$GlobalContent .= ''; + +//Name +$GlobalContent .= ''; +//Package +$GlobalContent .= ''; +//Quantity +$GlobalContent .= ''; +//Price +$GlobalContent .= ''; +//Obsolete +$GlobalContent .= ''; +$GlobalContent .= ''; + + ////////////////////////// +// generate Partlist query +$PartListQuery = "SELECT * FROM `Parts` WHERE `StorageId` = ".$_SESSION['PartsByStoreStoreId'].""; +$PartListQuery .= " ORDER BY `".$_SESSION['SortPartListBy']."` ".$_SESSION['SortPartListOrder']; +//echo $PartListQuery; + + ///////////////// +// Part List List +$PartListQuery = mysqli_query($GlobalMysqlHandler, $PartListQuery); +while ($Parts = mysqli_fetch_array($PartListQuery)) +{ +$GlobalContent .= ' '; +$GlobalContent .= ' '; + ////////// + // Package + $PackageQuery = "SELECT `Name` FROM `Packages` WHERE `Id` = ".$Parts['PackageId']; + $PackageQuery = mysqli_query($GlobalMysqlHandler, $PackageQuery); + if (mysqli_num_rows($PackageQuery)) + { + $Package=mysqli_fetch_array($PackageQuery); + $GlobalContent .= ''; + } + else + { + $GlobalContent .= ''; + } +$GlobalContent .= ''; +$GlobalContent .= ''; +$GlobalContent .= ''; +$GlobalContent .= ' '; +} + +$GlobalContent .= '
'; +$GlobalContent .= LangSpellHtml('PartsName')." "; +if ($_SESSION['SortPartListBy']=="Name" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Name" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsPackage')." "; +if ($_SESSION['SortPartListBy']=="PackageId" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="PackageId" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsQuantity')." "; +if ($_SESSION['SortPartListBy']=="Qty" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Qty" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsPrice')." "; +if ($_SESSION['SortPartListBy']=="Price" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Price" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''.LangSpellHtml('PartsObsolete').'
'.$Parts['Name'].' '.$Parts['ShortDesc'].' '.$Package['Name'].'-'.$Parts['Qty'].(($Parts['MinQty'])? "/".$Parts['MinQty']:"").''.OtherFormatPrice($Parts['Price']).''.((strtolower($Parts['Obsolete'])=="true")? LangSpellHtml('PartsObsolete'):"").'
'."\n"; +$GlobalContent .= '
'."\n"; + +?> diff --git a/pages/parts_by_type.php b/pages/parts_by_type.php new file mode 100755 index 0000000..4be3350 --- /dev/null +++ b/pages/parts_by_type.php @@ -0,0 +1,241 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + ////////////// +// Delete Part +if ($ToDo=="ToggleTypeSelectorVisibility" && UserHasRight('EditParts') + && isset($_POST['DeletePartId']) && $_POST['DeletePartId'] + && isset($_POST['DeletePartShure']) && $_POST['DeletePartShure']=="True" + && isset($_GET['SublistId']) && $_GET['SublistId'] + ) +{ + if (LockIsActive('Parts',$_POST['DeletePartId'])) + { + MessageError(LangSpellHtml('SentenceLockIsActive')); + } + else + { + if (mysqli_query($GlobalMysqlHandler, "DELETE FROM `Parts` WHERE `Id` = ".$_POST['DeletePartId']." LIMIT 1")) + { + MessageSuccess(LangSpellHtml('SentencePartDeleted')); + } + else + { + MessageError(LangSpellHtml('SentenceDatabaseError')); + } + } +} + + /////////////// +// open sublist +if ($ToDo=="ToggleTypeSelectorVisibility") +{ + if (isset($_GET['SublistId']) && $_GET['SublistId']) + { + $ParentId = NestedListGetParentId($_GET['SublistId'], 'Types'); + NestedListVisibilityUnsetAllElements('PartTypeSelector'); + NestedListVisibilitySetAllParents($_GET['SublistId'], 'PartTypeSelector', 'Types'); + NestedListVisibilitySet($_GET['SublistId'], 'PartTypeSelector'); + $_SESSION['PartsByTypeTypeId'] = $_GET['SublistId']; + } + else + { + ErrorLog("[parts_by_type.php] No SublistId to open type!"); + MessageError(LangSpell('SentenceUnknownError')); + } + $ToDo=""; +} + + ///////////// +// Type Array +$TypeQuery = "SELECT * FROM `Types` WHERE `Id` = ".$_SESSION['PartsByTypeTypeId']; +$TypeQuery = mysqli_query($GlobalMysqlHandler, $TypeQuery); +$TypeValues = array(); +if (mysqli_num_rows($TypeQuery)) +{ + $TypeItem = mysqli_fetch_array($TypeQuery); + $TypeValues[0][0] = $TypeItem['NameValue1']; + $TypeValues[0][1] = $TypeItem['UnitValue1']; + $TypeValues[1][0] = $TypeItem['NameValue2']; + $TypeValues[1][1] = $TypeItem['UnitValue2']; + $TypeValues[2][0] = $TypeItem['NameValue3']; + $TypeValues[2][1] = $TypeItem['UnitValue3']; +} + + /////////// +// Selector +$GlobalContent .= '
'; +$GlobalContent .= WriteTypeSelector (0); +$GlobalContent .= '
'."\n"; + + ///////// +// Filter +$GlobalContent .= '
'."\n"; +//Obsolete Filter +if (!isset($_SESSION['FilterObsolete'])) $_SESSION['FilterObsolete']="NonObsolete"; +if (isset($_POST['FilterObsolete'])) $_SESSION['FilterObsolete']=$_POST['FilterObsolete']; +$GlobalContent .= '
'."\n"; +$GlobalContent .= ' '.LangSpellHtml('PartsObsoleteNon')."\n"; +$GlobalContent .= ' '.LangSpellHtml('PartsObsoleteOnly')."\n"; +$GlobalContent .= ' '.LangSpellHtml('PartsObsoleteAll')."\n"; +$GlobalContent .= '
'."\n"; +$GlobalContent .= '
'."\n"; + + //////////////// +// Sort Partlist +if (!isset($_SESSION['SortPartListBy'])) $_SESSION['SortPartListBy']="Name"; +if (!isset($_SESSION['SortPartListOrder'])) $_SESSION['SortPartListOrder']="ASC"; +if (isset($_GET['SortBy'])) +{ + if ($_SESSION['SortPartListBy']==$_GET['SortBy']) //set order direction + { + if ($_SESSION['SortPartListOrder']=="ASC") $_SESSION['SortPartListOrder']="DESC"; + else $_SESSION['SortPartListOrder']="ASC"; + } + else //set order by + { + $_SESSION['SortPartListBy']=$_GET['SortBy']; + $_SESSION['SortPartListOrder']="ASC"; + } +} + + ////////////////// +// Part List Begin +$GlobalContent .= '
'; +$GlobalContent .= ''."\n"; + + ////////////////////// +// PartList Table Head +$GlobalContent .= ''; + +//Name +$GlobalContent .= ''; +//Value 1 +if (isset($TypeValues[0][0]) && $TypeValues[0][0]) +{ + $GlobalContent .= ''; +} +//Value2 +if (isset($TypeValues[1][0]) && $TypeValues[1][0]) +{ + $GlobalContent .= ''; +} +//Value3 +if (isset($TypeValues[2][0]) && $TypeValues[2][0]) +{ + $GlobalContent .= ''; +} +//Package +$GlobalContent .= ''; +//Quantity +$GlobalContent .= ''; +//Price +$GlobalContent .= ''; +//Obsolete +$GlobalContent .= ''; +$GlobalContent .= ''; + + ////////////////////////// +// generate Partlist query +$PartListQuery = "SELECT * FROM `Parts` WHERE `TypeId` = ".$_SESSION['PartsByTypeTypeId'].""; +if ($_SESSION['FilterObsolete']=="OnlyObsolete") $PartListQuery .= " AND `Obsolete` LIKE 'TRUE'"; +if ($_SESSION['FilterObsolete']=="NonObsolete") $PartListQuery .= " AND `Obsolete` LIKE 'FALSE'"; +$PartListQuery .= " ORDER BY `".$_SESSION['SortPartListBy']."` ".$_SESSION['SortPartListOrder']; +//echo $PartListQuery; + + ///////////////// +// Part List List +$PartListQuery = mysqli_query($GlobalMysqlHandler, $PartListQuery); +while ($Parts = mysqli_fetch_array($PartListQuery)) +{ +$GlobalContent .= ' '; +$GlobalContent .= ' '; +if (isset($TypeValues[0][0]) && $TypeValues[0][0]) $GlobalContent .= ' '; +if (isset($TypeValues[1][0]) && $TypeValues[1][0]) $GlobalContent .= ' '; +if (isset($TypeValues[2][0]) && $TypeValues[2][0]) $GlobalContent .= ' '; + ////////// + // Package + $PackageQuery = "SELECT `Name` FROM `Packages` WHERE `Id` = ".$Parts['PackageId']; + $PackageQuery = mysqli_query($GlobalMysqlHandler, $PackageQuery); + if (mysqli_num_rows($PackageQuery)) + { + $Package=mysqli_fetch_array($PackageQuery); + $GlobalContent .= ''; + } + else + { + $GlobalContent .= ''; + } +$GlobalContent .= ''; +$GlobalContent .= ''; +$GlobalContent .= ''; +$GlobalContent .= ' '; +} + +$GlobalContent .= '
'; +$GlobalContent .= LangSpellHtml('PartsName')." "; +if ($_SESSION['SortPartListBy']=="Name" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Name" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; + $GlobalContent .= $TypeValues[0][0]." "; + if ($_SESSION['SortPartListBy']=="Value1" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); + if ($_SESSION['SortPartListBy']=="Value1" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); + $GlobalContent .= ''; + $GlobalContent .= $TypeValues[1][0]." "; + if ($_SESSION['SortPartListBy']=="Value2" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); + if ($_SESSION['SortPartListBy']=="Value2" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); + $GlobalContent .= ''; + $GlobalContent .= $TypeValues[2][0]." "; + if ($_SESSION['SortPartListBy']=="Value3" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); + if ($_SESSION['SortPartListBy']=="Value3" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); + $GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsPackage')." "; +if ($_SESSION['SortPartListBy']=="PackageId" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="PackageId" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsQuantity')." "; +if ($_SESSION['SortPartListBy']=="Qty" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Qty" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''; +$GlobalContent .= LangSpellHtml('PartsPrice')." "; +if ($_SESSION['SortPartListBy']=="Price" && $_SESSION['SortPartListOrder']=="ASC") $GlobalContent .= OtherGetIcon('SortUp',0); +if ($_SESSION['SortPartListBy']=="Price" && $_SESSION['SortPartListOrder']=="DESC") $GlobalContent .= OtherGetIcon('SortDown',0); +$GlobalContent .= ''.LangSpellHtml('PartsObsolete').'
'.$Parts['Name'].' '.$Parts['ShortDesc'].' '.OtherFloatToSiPrefix ($Parts['Value1']).$TypeValues[0][1].''.OtherFloatToSiPrefix ($Parts['Value2']).$TypeValues[1][1].''.OtherFloatToSiPrefix ($Parts['Value3']).$TypeValues[2][1].''.$Package['Name'].'-'.$Parts['Qty'].(($Parts['MinQty'])? "/".$Parts['MinQty']:"").''.OtherFormatPrice($Parts['Price']).''.((strtolower($Parts['Obsolete'])=="true")? LangSpellHtml('PartsObsolete'):"").'
'."\n"; +$GlobalContent .= '
'."\n"; + +?> diff --git a/pages/repeat_order.php b/pages/repeat_order.php new file mode 100755 index 0000000..31d1fd3 --- /dev/null +++ b/pages/repeat_order.php @@ -0,0 +1,73 @@ +'; + $GlobalContent .= ' '; + $GlobalContent .= ' {'.$VendorId.'} '.$VendorName.''; + $GlobalContent .= ' '; + $GlobalContent .= ' '; + $GlobalContent .= ' '.LangSpellHtml('PartsName').''; + $GlobalContent .= ' '.LangSpellHtml('PartsQuantity').''; + $GlobalContent .= ' '.LangSpellHtml('PartsMinQuantity').''; + $GlobalContent .= ' '.LangSpellHtml('PartsPackageUnit').''; + $GlobalContent .= ' '.LangSpellHtml('PartsPrice').''; + $GlobalContent .= ' '.LangSpellHtml('PartsVendorLink').''; + $GlobalContent .= ' '.LangSpellHtml('RepeatOrderPackagesToOrder').''; + $GlobalContent .= ' '.LangSpellHtml('RepeatOrderSumPrice').''; + $GlobalContent .= ' '; + $ShowTable = 1; + } + + $AllSumPrice=0; + while ($Part = mysqli_fetch_array($RepOrdQuery)) + { + if (!$Part['PackageUnit']) $Part['PackageUnit']=1; + $Price=OtherFormatPrice($Part['Price']); + $VendorLink=($Part['VendorLink'])? '':'-'; + $OrderPackages = ceil(($Part['MinQty']-$Part['Qty'])/$Part['PackageUnit']); + $SumPrice = OtherFormatPrice($OrderPackages * $Part['Price']); + $AllSumPrice += $OrderPackages * $Part['Price']; + + $GlobalContent .= ' '; + $GlobalContent .= ' '.$Part['Name'].''; + $GlobalContent .= ' '.$Part['Qty'].''; + $GlobalContent .= ' '.$Part['MinQty'].''; + $GlobalContent .= ' '.$Part['PackageUnit'].''; + $GlobalContent .= ' '.$Price.''; + $GlobalContent .= ' '.$VendorLink.''; + $GlobalContent .= ' '.$OrderPackages.''; + $GlobalContent .= ' '.OtherFormatPrice($SumPrice).''; + $GlobalContent .= ' '; + } + if ($ShowTable) + { + $GlobalContent .= ' '; + $GlobalContent .= ' '.OtherFormatPrice($AllSumPrice).''; + $GlobalContent .= ' '; + $GlobalContent .= ''; + } +} + +global $GlobalMysqlHandler; + + +$VendorQuery = "SELECT * FROM `Vendors` ORDER BY `Name` ASC"; +$VendorQuery = mysqli_query($GlobalMysqlHandler, $VendorQuery); +RepeatOrderTableByVendor(LangSpellHtml('PartsNotSpecified'),0); +while ($Vendor = mysqli_fetch_array($VendorQuery)) +{ + RepeatOrderTableByVendor($Vendor['Name'],$Vendor['Id']); +} + + +?> diff --git a/pages/show_part.php b/pages/show_part.php new file mode 100755 index 0000000..0af0ba2 --- /dev/null +++ b/pages/show_part.php @@ -0,0 +1,398 @@ +'."\n"; + + if ($ToDo=="EditType" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_edit_type.php"; + } + elseif ($ToDo=="EditPackage" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_edit_package.php"; + } + elseif ($ToDo=="EditStorage" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_edit_storage.php"; + } + elseif ($ToDo=="EditValues" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_edit_values.php"; + } + elseif ($ToDo=="EditDownloads" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_edit_downloads.php"; + } + elseif ($ToDo=="DeletePart" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + include "./pages/show_part_delete_part.php"; + } + else + { + include "./pages/show_part_show.php"; + } + + $GlobalContent .= ''."\n"; +} +else +{ + MessageError(LangSpell("SentenceDatabaseError")); + ErrorLog("[show_part.php] Part Id '$PartId' not found!"); +} +?> diff --git a/pages/show_part_delete_part.php b/pages/show_part_delete_part.php new file mode 100755 index 0000000..f841ae7 --- /dev/null +++ b/pages/show_part_delete_part.php @@ -0,0 +1,22 @@ +".LangSpellHtml('SentenceShureToDeletePart').""; + $GlobalContent .= "".$Part['Name']." ".$Part['ShortDesc']."

\n"; + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= LangSpellHtml('SentenceShureToDeletePart').': '; + $GlobalContent .= ' '; + $GlobalContent .= '
'; + +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_edit_downloads.php b/pages/show_part_edit_downloads.php new file mode 100755 index 0000000..755cc29 --- /dev/null +++ b/pages/show_part_edit_downloads.php @@ -0,0 +1,63 @@ +'; + + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''.LangSpellHtml('DownloadsName').''; + $GlobalContent .= ''.LangSpellHtml('DownloadsPath').''; + $GlobalContent .= ''.LangSpellHtml('DownloadsSize').''; + $GlobalContent .= ''.LangSpellHtml('DownloadsType').''; + $GlobalContent .= ''.LangSpellHtml('ButtonEdit').''; + $GlobalContent .= ''; + + $DownloadQuery = "SELECT * FROM `Downloads` WHERE `PartId` = $PartId"; + $DownloadQuery = mysqli_query($GlobalMysqlHandler, $DownloadQuery); + while ($Download = mysqli_fetch_array($DownloadQuery)) + { + $Size="-"; + if (file_exists($GlobalDownloadDir."/".$Download['Path'])) $Size=sprintf("%.2f",filesize($GlobalDownloadDir."/".$Download['Path'])/(1024*1024))." MB"; + + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= '{'.$Download['Id'].'}'; + $GlobalContent .= ''; + $GlobalContent .= ''.$Download['Path'].''; + $GlobalContent .= ''.$Size.''; + $GlobalContent .= ''.$Download['Type'].''; + $GlobalContent .= ''; + $GlobalContent .= ''.OtherGetIcon('Delete',"Button").' '; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= '
'; + } + + + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= '
'; + + $GlobalContent .= ''; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_edit_package.php b/pages/show_part_edit_package.php new file mode 100755 index 0000000..f7dce23 --- /dev/null +++ b/pages/show_part_edit_package.php @@ -0,0 +1,72 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if (isset($_GET['OpenSublistId']) && $_GET['OpenSublistId']) + { + NestedListVisibilityToggle($_GET['OpenSublistId'], 'EditPartPackage'); + } + else + { + NestedListVisibilityUnsetAllElements ('EditPartPackage'); + NestedListVisibilitySetAllParents ($Part['PackageId'], 'EditPartPackage', 'Packages'); + NestedListVisibilitySet ($Part['PackageId'], 'EditPartPackage'); + } + + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPackage').'

'; + $GlobalContent .= '
'; + WritePackageList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_edit_storage.php b/pages/show_part_edit_storage.php new file mode 100755 index 0000000..6830716 --- /dev/null +++ b/pages/show_part_edit_storage.php @@ -0,0 +1,72 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if (isset($_GET['OpenSublistId']) && $_GET['OpenSublistId']) + { + NestedListVisibilityToggle($_GET['OpenSublistId'], 'EditPartStorage'); + } + else + { + NestedListVisibilityUnsetAllElements ('EditPartStorage'); + NestedListVisibilitySetAllParents ($Part['StorageId'], 'EditPartStorage', 'Storages'); + NestedListVisibilitySet ($Part['StorageId'], 'EditPartStorage'); + } + + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPartStorage').'

'; + $GlobalContent .= '
'; + WriteStorageList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_edit_type.php b/pages/show_part_edit_type.php new file mode 100755 index 0000000..7498e2d --- /dev/null +++ b/pages/show_part_edit_type.php @@ -0,0 +1,74 @@ +\n"; + else + $GlobalContent .= "\n"; +} + + +if (UserHasRight('EditParts')) +{ + /////////////// + // open sublist + if (isset($_GET['OpenSublistId']) && $_GET['OpenSublistId']) + { + NestedListVisibilityToggle($_GET['OpenSublistId'], 'EditPartType'); + } + else + { + NestedListVisibilityUnsetAllElements ('EditPartType'); + NestedListVisibilitySetAllParents ($Part['TypeId'], 'EditPartType', 'Types'); + NestedListVisibilitySet ($Part['TypeId'], 'EditPartType'); + } + + ////////// + // Content + $GlobalContent .= '

'.LangSpellHtml('SentencePleaseSelectPartType').'

'; + $GlobalContent .= '
'; + WriteTypeList(0, 0); + $GlobalContent .= ''; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_edit_values.php b/pages/show_part_edit_values.php new file mode 100755 index 0000000..8ca7bee --- /dev/null +++ b/pages/show_part_edit_values.php @@ -0,0 +1,119 @@ +'.LangSpellHtml('SentencePleaseSpecifyPartValues').''; + $GlobalContent .= '
'; + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + if ($TypeValues[0][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + if ($TypeValues[1][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + if ($TypeValues[2][0]) + { + $GlobalContent .= ''; + $GlobalContent .= ''; + } + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= ''; + + $GlobalContent .= '
'.LangSpellHtml('PartsObsolete').''; + $GlobalContent .= '
'.LangSpellHtml('PartsName').''; + $GlobalContent .= '
'.$TypeValues[0][0].''; + $GlobalContent .= ' '.$TypeValues[0][1].'
'.$TypeValues[1][0].''; + $GlobalContent .= ' '.$TypeValues[1][1].'
'.$TypeValues[2][0].''; + $GlobalContent .= ' '.$TypeValues[2][1].'
'.LangSpellHtml('PartsShortDescription').''; + $GlobalContent .= '
'.LangSpellHtml('PartsLongDescription').''; + $GlobalContent .= '
'.LangSpellHtml('PartsQuantity').''; + $GlobalContent .= '
'.LangSpellHtml('PartsMinQuantity').''; + $GlobalContent .= '
'.LangSpellHtml('PartsPackageUnit').''; + $GlobalContent .= '
'.LangSpellHtml('PartsMinOrderQuantity').''; + $GlobalContent .= '
'.LangSpellHtml('PartsPrice').''; + $GlobalContent .= '
'.LangSpellHtml('PartsVendor').''; + $GlobalContent .= '
'.LangSpellHtml('PartsVendorLink').''; + $GlobalContent .= '
'.LangSpellHtml('PartsManufactorLink').''; + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= '
'; + $GlobalContent .= '
'; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/show_part_show.php b/pages/show_part_show.php new file mode 100755 index 0000000..f6ce0e0 --- /dev/null +++ b/pages/show_part_show.php @@ -0,0 +1,178 @@ +'."\n"; + //Part Head + $GlobalContent .= '

{'.$Part['Id'].'} '.$Part['Name'].'

'."\n"; + //Type + $TypeId = $Part['TypeId']; + $TypeString = ""; + while ($TypeId) + { + $LocalTypeString = ""; + $LocalTypeString = NestedListGetName($TypeId,'Types'); + $LocalTypeString = ''.$LocalTypeString . ""; + $TypeId = NestedListGetParentId ($TypeId,'Types'); + if ($TypeId) $LocalTypeString = " > " . $LocalTypeString; + $TypeString = $LocalTypeString . $TypeString; + } + $GlobalContent .= ''.LangSpellHtml('PartsType').": ".$TypeString."
"."\n"; + //Storage + $StorageId = $Part['StorageId']; + $StorageString = ""; + while ($StorageId) + { + $LocalStorageString = ""; + $LocalStorageString = NestedListGetName($StorageId,'Storages'); + $LocalStorageString = ''.$LocalStorageString . ""; + $StorageId = NestedListGetParentId ($StorageId,'Storages'); + if ($StorageId) $LocalStorageString = " > " . $LocalStorageString; + $StorageString = $LocalStorageString . $StorageString; + } + $GlobalContent .= ''.LangSpellHtml('PartsStorage').": ".$StorageString."
"."\n"; + //Package + $PackageId = $Part['PackageId']; + $PackageString = ""; + while ($PackageId) + { + $LocalPackageString = ""; + $LocalPackageString = NestedListGetName($PackageId,'Packages'); + $PackageId = NestedListGetParentId ($PackageId,'Packages'); + if ($PackageId) $LocalPackageString = " > " . $LocalPackageString; + $PackageString = $LocalPackageString . $PackageString; + } + $GlobalContent .= ''.LangSpellHtml('PartsPackage').": ".$PackageString."
"."\n"; + //Edit Button + if (UserHasRight('EditParts')) + { + if (LockIsActive('Parts',$PartId)) + { + $GlobalContent .= ''.LangSpellHtml('ButtonEdit').': '; + $GlobalContent .= OtherGetIcon('LockActive')."\n"; + } + else + { + $GlobalContent .= ''.LangSpellHtml('ButtonEdit').': '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsType').' '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsPackage').' '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsStorage').' '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsValues').' '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsDownloads').' '."\n"; + $GlobalContent .= ''.LangSpellHtml('PartsPicture').' '."\n"; + $GlobalContent .= ''.OtherGetIcon('Delete',"Button").' '."\n"; + } + } + $GlobalContent .= ''."\n"; + + /////////// + // Pictures + $GlobalContent .= '
'."\n"; + if ($ToDo=="EditPicture" && UserHasRight('EditParts') && LockActivate('Parts',$PartId)) + { + $GlobalContent .= '
'; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= ''; + $GlobalContent .= '

'; + } + $GlobalContent .= '

'; + echo "IMAGE: " . $Part['PicturePath'] . "
\n"; + $GlobalContent .= '
'."\n"; + + //////////////// + // Detail Values + $GlobalContent .= '
'."\n"; + $GlobalContent .= ''; + //Obsolete + if (strtolower($Part['Obsolete'])=="true") + $GlobalContent .= ' '; + //Value1 + if ($TypeValues[0][0]) + $GlobalContent .= ' '; + //Value2 + if ($TypeValues[1][0]) + $GlobalContent .= ' '; + //Value3 + if ($TypeValues[2][0]) + $GlobalContent .= ' '; + //Empty Row + $GlobalContent .= ' '; + + //Quantity + if (UserHasRight('EditParts') || UserHasRight('EditPartQuantity')) + { + $GlobalContent .= ' '; + } + else + { + $GlobalContent .= ' '; + } + //Minimum Quantity + $GlobalContent .= ' '; + //Empty Row + $GlobalContent .= ' '; + + //Package Unit + $GlobalContent .= ' '; + //Min Order Quantity + $GlobalContent .= ' '; + //Price + $GlobalContent .= ' '; + //Vendor + $VendorQuery = "SELECT `Name` FROM `Vendors` WHERE `Id`= ".$Part['VendorId']; + $VendorQuery = mysqli_query($GlobalMysqlHandler, $VendorQuery); + if (mysqli_num_rows($VendorQuery)) + { + $Vendor=mysqli_fetch_array($VendorQuery); + $GlobalContent .= ' '; + } + else + { + $GlobalContent .= ' '; + } + //Vendor Link + $GlobalContent .= ' '; + //Manufactor + $GlobalContent .= ' '; + //End + $GlobalContent .= '
'.LangSpellHtml('PartsObsolete').'
'.$TypeValues[0][0].''.OtherFloatToSiPrefix($Part['Value1']).$TypeValues[0][1].'
'.$TypeValues[1][0].''.OtherFloatToSiPrefix($Part['Value2']).$TypeValues[1][1].'
'.$TypeValues[2][0].''.OtherFloatToSiPrefix($Part['Value3']).$TypeValues[2][1].'
'.LangSpellHtml('PartsQuantity').''; + $GlobalContent .= '
'; + $GlobalContent .= ' '; + $GlobalContent .= '
'.LangSpellHtml('PartsQuantity').''.$Part['Qty'].'
'.LangSpellHtml('PartsMinQuantity').''.$Part['MinQty'].'
'.LangSpellHtml('PartsPackageUnit').''.$Part['PackageUnit'].'
'.LangSpellHtml('PartsMinOrderQuantity').''.$Part['MinOrderQty'].'
'.LangSpellHtml('PartsPrice').''.OtherFormatPrice($Part['Price']).'
'.LangSpellHtml('PartsVendor').''.$Vendor['Name'].'
'.LangSpellHtml('PartsVendor').'-
'.LangSpellHtml('PartsVendorLink').''; + if ($Part['VendorLink']) $GlobalContent .= ''; + $GlobalContent .= substr($Part['VendorLink'],0,(strlen($Part['VendorLink'])<=20)? strlen($Part['VendorLink']):20); + if ($Part['VendorLink']) $GlobalContent .= ''; + $GlobalContent .= '
'.LangSpellHtml('PartsManufactorLink').''; + if ($Part['ManufactorLink']) $GlobalContent .= ''; + $GlobalContent .= substr($Part['ManufactorLink'],0,(strlen($Part['ManufactorLink'])<=20)? strlen($Part['ManufactorLink']):20); + if ($Part['ManufactorLink']) $GlobalContent .= ''; + $GlobalContent .= '
'; + $GlobalContent .= '
'."\n"; + + ///////////////////////// + // Description, Downloads + $GlobalContent .= '
'."\n"; + $GlobalContent .= LangStr2Html($Part['ShortDesc']).'

'; + $GlobalContent .= LangStr2Html($Part['LongDesc']).'

'; + $GlobalContent .= ''.LangSpellHtml('PartsDownloads').':'."\n
    "; + $DownloadQuery = "SELECT * FROM `Downloads` WHERE `PartId` = $PartId"; + $DownloadQuery = mysqli_query($GlobalMysqlHandler, $DownloadQuery); + while ($Download = mysqli_fetch_array($DownloadQuery)) + { + $Size="-"; + $FileExist = (file_exists($GlobalDownloadDir."/".$Download['Path']))? 1:0; + if ($FileExist) $Size=sprintf("%.2f",filesize($GlobalDownloadDir."/".$Download['Path'])/(1024*1024))." MB"; + + $GlobalContent .= "
  • "; + if ($FileExist) $GlobalContent .= ''; + $GlobalContent .= $Download['Name']." (".$Size.")"; + if ($FileExist) $GlobalContent .= ''; + $GlobalContent .= "
  • "; + } + $GlobalContent .= '
'."\n"; + +?> diff --git a/pages/user_settings.php b/pages/user_settings.php new file mode 100755 index 0000000..ba9c596 --- /dev/null +++ b/pages/user_settings.php @@ -0,0 +1,121 @@ +'."\n"; + $GlobalContent .= ''."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + $GlobalContent .= ' '."\n"; + + $GlobalContent .= '
'.LangSpellHtml('UserSettingsTableHead').'
Id'.$UserRecord['Id'].'
'.LangSpellHtml('MenuLogin').'
'.LangSpellHtml('UserSettingsSetNewPassword').'
'.LangSpellHtml('UserSettingsConfirmNewPassword').'
'.LangSpellHtml('UserSettingsLanguage').'
'.LangSpellHtml('UserSettingsTemplate').'
'."\n"; + $GlobalContent .= ''."\n"; +} +else +{ + MessageError(LangSpell("ScentenceNoUserRights")); +} +?> diff --git a/pages/version_history.php b/pages/version_history.php new file mode 100755 index 0000000..5ba01cc --- /dev/null +++ b/pages/version_history.php @@ -0,0 +1,66 @@ +'."\n"; +$GlobalContent .='
  • '."\n"; +$GlobalContent .=' Version 0'."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .=' Subversion 5'."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • 2010-11-11 Consistency check - repair incorrect parts type, Guide download (only german DeveloperGuide.pdf at this stage).
      • '."\n"; +$GlobalContent .='
      • 2010-11-10 Repeat order list, creating only one ErrorLog() out of LogShort() and LogLong().
      • '."\n"; +$GlobalContent .='
      • 2010-11-09 OtherGetIcon() for better icon control.
      • '."\n"; +$GlobalContent .='
      • 2010-11-05 Changed milestones, building helpsection as last milestone.
      • '."\n"; +$GlobalContent .='
      • 2010-11-05 Milestone 3 reached, gradation to subversion 5.
      • '."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .=' Subversion 4'."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • 2010-11-05 Consistency check - create database structure - ready for first testing.
      • '."\n"; +$GlobalContent .='
      • 2010-11-04 Handling downloads and parts picture, parts by store view.
      • '."\n"; +$GlobalContent .='
      • 2010-11-03 View and edit part (type, package, store and values).
      • '."\n"; +$GlobalContent .='
      • 2010-11-02 Adding new parts is possible, first partlist view (parts by type.
      • '."\n"; +$GlobalContent .='
      • 2010-10-04 Added ViewSTPV Rights.
      • '."\n"; +$GlobalContent .='
      • 2010-09-20 Milestone 2 reached, gradation to subversion 4.
      • '."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .=' Subversion 3'."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • 2010-09-20 Edit Stores, Types and packages.
      • '."\n"; +$GlobalContent .='
      • 2010-09-08 Add new stores, delete stores.
      • '."\n"; +$GlobalContent .='
      • 2010-08-31 Vendor editing.
      • '."\n"; +$GlobalContent .='
      • 2010-08-26 Milestone 1 reached, gradation to subversion 3.
      • '."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .=' Subversion 2'."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • 2010-08-26 Config editing.
      • '."\n"; +$GlobalContent .='
      • 2010-08-17 User settings.
      • '."\n"; +$GlobalContent .='
      • 2010-08-16 User management.
      • '."\n"; +$GlobalContent .='
      • 2010-08-15 Definition of milestones.'."\n"; +$GlobalContent .='
          '."\n"; +$GlobalContent .='
        1. Basic system administration (config editing, user management, user settings).
        2. '."\n"; +$GlobalContent .='
        3. Part administration (stores, types, vendors, packages).
        4. '."\n"; +$GlobalContent .='
        5. Parts handling (view, edit, add, downloads, pictures).
        6. '."\n"; +$GlobalContent .='
        7. Tools (repeat order, stats, check).
        8. '."\n"; +$GlobalContent .='
        9. Global test by creating own partstock.
        10. '."\n"; +$GlobalContent .='
        11. Build final Templates. Guide for publishing.
        12. '."\n"; +$GlobalContent .='
        13. Help section / User Guides.
        14. '."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • '."\n"; +$GlobalContent .='
      • 2010-08-14 Creation of the Version History
      • '."\n"; +$GlobalContent .='
      • before: Basic system like template design, login functionality, language functionality, message logging, etc.
      • '."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .=' Subversion 1'."\n"; +$GlobalContent .='
        '."\n"; +$GlobalContent .='
      • A simple GUI for to the database (some primary testings).
      • '."\n"; +$GlobalContent .='
      '."\n"; +$GlobalContent .='
    • '."\n"; +$GlobalContent .='
    '."\n"; +$GlobalContent .='
  • '."\n"; +$GlobalContent .=''."\n"; +?> diff --git a/templates/GreenPartstock0/Error.png b/templates/GreenPartstock0/Error.png new file mode 100755 index 0000000..7640cd5 Binary files /dev/null and b/templates/GreenPartstock0/Error.png differ diff --git a/templates/GreenPartstock0/Ok.png b/templates/GreenPartstock0/Ok.png new file mode 100755 index 0000000..b9e2389 Binary files /dev/null and b/templates/GreenPartstock0/Ok.png differ diff --git a/templates/GreenPartstock0/Warning.png b/templates/GreenPartstock0/Warning.png new file mode 100755 index 0000000..46834b9 Binary files /dev/null and b/templates/GreenPartstock0/Warning.png differ diff --git a/templates/GreenPartstock0/icons/.directory b/templates/GreenPartstock0/icons/.directory new file mode 100755 index 0000000..6ddf3ab --- /dev/null +++ b/templates/GreenPartstock0/icons/.directory @@ -0,0 +1,3 @@ +[Dolphin] +ShowPreview=true +Timestamp=2010,8,30,23,22,50 diff --git a/templates/GreenPartstock0/icons/1license.txt b/templates/GreenPartstock0/icons/1license.txt new file mode 100755 index 0000000..c76165e --- /dev/null +++ b/templates/GreenPartstock0/icons/1license.txt @@ -0,0 +1,17 @@ +The icons are free for personal use and also free for commercial use, but we require linking to our web site. + +http://creativecommons.org/licenses/by-sa/3.0/ + +You are free: +* to Share — to copy, distribute and transmit the work + +Under the following conditions: +Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). + +Attribute this work: +What does "Attribute this work" mean? +The page you came from contained embedded licensing metadata, including how the creator wishes to be attributed for re-use. You can use the HTML here to cite the work. Doing so will also include metadata on your page so that others can find the original work as well. +Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. + +led24.de +31/05/2009 \ No newline at end of file diff --git a/templates/GreenPartstock0/icons/About.png b/templates/GreenPartstock0/icons/About.png new file mode 100755 index 0000000..466be2a Binary files /dev/null and b/templates/GreenPartstock0/icons/About.png differ diff --git a/templates/GreenPartstock0/icons/AdminGuide.png b/templates/GreenPartstock0/icons/AdminGuide.png new file mode 100755 index 0000000..0ac1ddb Binary files /dev/null and b/templates/GreenPartstock0/icons/AdminGuide.png differ diff --git a/templates/GreenPartstock0/icons/Administration.png b/templates/GreenPartstock0/icons/Administration.png new file mode 100755 index 0000000..0ac1ddb Binary files /dev/null and b/templates/GreenPartstock0/icons/Administration.png differ diff --git a/templates/GreenPartstock0/icons/Cancel.png b/templates/GreenPartstock0/icons/Cancel.png new file mode 100755 index 0000000..b622e16 Binary files /dev/null and b/templates/GreenPartstock0/icons/Cancel.png differ diff --git a/templates/GreenPartstock0/icons/Config.png b/templates/GreenPartstock0/icons/Config.png new file mode 100755 index 0000000..a01513d Binary files /dev/null and b/templates/GreenPartstock0/icons/Config.png differ diff --git a/templates/GreenPartstock0/icons/ConsistencyCheck.png b/templates/GreenPartstock0/icons/ConsistencyCheck.png new file mode 100755 index 0000000..c5c12f4 Binary files /dev/null and b/templates/GreenPartstock0/icons/ConsistencyCheck.png differ diff --git a/templates/GreenPartstock0/icons/Delete.png b/templates/GreenPartstock0/icons/Delete.png new file mode 100755 index 0000000..f9aaf5c Binary files /dev/null and b/templates/GreenPartstock0/icons/Delete.png differ diff --git a/templates/GreenPartstock0/icons/DeveloperGuide.png b/templates/GreenPartstock0/icons/DeveloperGuide.png new file mode 100755 index 0000000..9b4ea46 Binary files /dev/null and b/templates/GreenPartstock0/icons/DeveloperGuide.png differ diff --git a/templates/GreenPartstock0/icons/Edit.png b/templates/GreenPartstock0/icons/Edit.png new file mode 100755 index 0000000..7d875fa Binary files /dev/null and b/templates/GreenPartstock0/icons/Edit.png differ diff --git a/templates/GreenPartstock0/icons/Help.png b/templates/GreenPartstock0/icons/Help.png new file mode 100755 index 0000000..1d15c7b Binary files /dev/null and b/templates/GreenPartstock0/icons/Help.png differ diff --git a/templates/GreenPartstock0/icons/Home.png b/templates/GreenPartstock0/icons/Home.png new file mode 100755 index 0000000..8df234f Binary files /dev/null and b/templates/GreenPartstock0/icons/Home.png differ diff --git a/templates/GreenPartstock0/icons/LockActive.png b/templates/GreenPartstock0/icons/LockActive.png new file mode 100755 index 0000000..3a52863 Binary files /dev/null and b/templates/GreenPartstock0/icons/LockActive.png differ diff --git a/templates/GreenPartstock0/icons/Login.png b/templates/GreenPartstock0/icons/Login.png new file mode 100755 index 0000000..c4b84e2 Binary files /dev/null and b/templates/GreenPartstock0/icons/Login.png differ diff --git a/templates/GreenPartstock0/icons/Logout.png b/templates/GreenPartstock0/icons/Logout.png new file mode 100755 index 0000000..3120f55 Binary files /dev/null and b/templates/GreenPartstock0/icons/Logout.png differ diff --git a/templates/GreenPartstock0/icons/New.png b/templates/GreenPartstock0/icons/New.png new file mode 100755 index 0000000..9883e31 Binary files /dev/null and b/templates/GreenPartstock0/icons/New.png differ diff --git a/templates/GreenPartstock0/icons/Packages.png b/templates/GreenPartstock0/icons/Packages.png new file mode 100755 index 0000000..e24a47c Binary files /dev/null and b/templates/GreenPartstock0/icons/Packages.png differ diff --git a/templates/GreenPartstock0/icons/PartStatistic.png b/templates/GreenPartstock0/icons/PartStatistic.png new file mode 100755 index 0000000..cd273e8 Binary files /dev/null and b/templates/GreenPartstock0/icons/PartStatistic.png differ diff --git a/templates/GreenPartstock0/icons/Parts.png b/templates/GreenPartstock0/icons/Parts.png new file mode 100755 index 0000000..729f936 Binary files /dev/null and b/templates/GreenPartstock0/icons/Parts.png differ diff --git a/templates/GreenPartstock0/icons/RepeatOrder.png b/templates/GreenPartstock0/icons/RepeatOrder.png new file mode 100755 index 0000000..3eae92d Binary files /dev/null and b/templates/GreenPartstock0/icons/RepeatOrder.png differ diff --git a/templates/GreenPartstock0/icons/SortDown.png b/templates/GreenPartstock0/icons/SortDown.png new file mode 100755 index 0000000..c961563 Binary files /dev/null and b/templates/GreenPartstock0/icons/SortDown.png differ diff --git a/templates/GreenPartstock0/icons/SortUp.png b/templates/GreenPartstock0/icons/SortUp.png new file mode 100755 index 0000000..5b41855 Binary files /dev/null and b/templates/GreenPartstock0/icons/SortUp.png differ diff --git a/templates/GreenPartstock0/icons/Stores.png b/templates/GreenPartstock0/icons/Stores.png new file mode 100755 index 0000000..1b5cd0c Binary files /dev/null and b/templates/GreenPartstock0/icons/Stores.png differ diff --git a/templates/GreenPartstock0/icons/Tools.png b/templates/GreenPartstock0/icons/Tools.png new file mode 100755 index 0000000..013f021 Binary files /dev/null and b/templates/GreenPartstock0/icons/Tools.png differ diff --git a/templates/GreenPartstock0/icons/Types.png b/templates/GreenPartstock0/icons/Types.png new file mode 100755 index 0000000..be0efda Binary files /dev/null and b/templates/GreenPartstock0/icons/Types.png differ diff --git a/templates/GreenPartstock0/icons/UserAdmin.png b/templates/GreenPartstock0/icons/UserAdmin.png new file mode 100755 index 0000000..0ee7cf5 Binary files /dev/null and b/templates/GreenPartstock0/icons/UserAdmin.png differ diff --git a/templates/GreenPartstock0/icons/UserGuide.png b/templates/GreenPartstock0/icons/UserGuide.png new file mode 100755 index 0000000..c4b84e2 Binary files /dev/null and b/templates/GreenPartstock0/icons/UserGuide.png differ diff --git a/templates/GreenPartstock0/icons/UserSettings.png b/templates/GreenPartstock0/icons/UserSettings.png new file mode 100755 index 0000000..041e71a Binary files /dev/null and b/templates/GreenPartstock0/icons/UserSettings.png differ diff --git a/templates/GreenPartstock0/icons/Vendors.png b/templates/GreenPartstock0/icons/Vendors.png new file mode 100755 index 0000000..07e238f Binary files /dev/null and b/templates/GreenPartstock0/icons/Vendors.png differ diff --git a/templates/GreenPartstock0/icons/VersionHistory.png b/templates/GreenPartstock0/icons/VersionHistory.png new file mode 100755 index 0000000..2cc81ca Binary files /dev/null and b/templates/GreenPartstock0/icons/VersionHistory.png differ diff --git a/templates/GreenPartstock0/menu.css b/templates/GreenPartstock0/menu.css new file mode 100755 index 0000000..7181648 --- /dev/null +++ b/templates/GreenPartstock0/menu.css @@ -0,0 +1,67 @@ +/*********** + MainMenu +************/ +div#MainMenu { + margin-bottom:0px; + padding:1px; + white-space:nowrap; + display:inline-block; +} + +#MainMenu ul { + margin:0px; + margin-left:4px; + padding:0px; + list-style-type:none; + list-style-position:inside; +} + +#MainMenu li { + padding-top:0px; + display:inline-block; + margin:0px; +} + +#MainMenu ul li ul { + margin:0px; + margin-top:1px; + position:absolute; + visibility:hidden; + padding-top:2px; +} + +#MainMenu li ul li { + display:block; +} + +#MainMenu ul li:hover ul { + visibility:visible; +} + +#MainMenu a { + border:1px solid #198533; + padding:1px 3px 1px 3px; + background-color:#cded9d; + font-weight:bold; + color:#198533; + text-decoration:none; +} + +#MainMenu a:hover { + background-color:#629e1f; + color:#cded9d; +} + +#MainMenu ul li ul li a { + border-bottom:1px solid #198533; + display:block; + width:100%; +} + +#MainMenu img { + border:0px; + vertical-align:middle; + margin-right:4px; + margin-left:2px; + /*display:none;*/ +} diff --git a/templates/GreenPartstock0/message.css b/templates/GreenPartstock0/message.css new file mode 100755 index 0000000..4637c6b --- /dev/null +++ b/templates/GreenPartstock0/message.css @@ -0,0 +1,49 @@ +/***************** + Message +*****************/ +#Message { + padding:4px; + border-bottom:2px solid #198533; +} + +#Message #Error{ + margin:0px; + background-image:url(./Error.png); + background-repeat:no-repeat; + background-position:7px 2px; + padding-left:30px; + border-width:2px; + border-style:solid; + border-color:#bb2222; + color:#bb2222; + background-color:#ffaaaa; + font-weight:bold; +} + +#Message #Warning { + margin:0px; + background-image:url(./Warning.png); + background-repeat:no-repeat; + background-position:7px 2px; + padding-left:30px; + border-width:2px; + border-style:solid; + border-color:#ffbb00; + color:#ffbb00; + background-color:#ffffaa; + font-weight:bold; +} + +#Message #Success { + margin:0px; + background-image:url(./Ok.png); + background-repeat:no-repeat; + background-position:7px 2px; + padding-left:30px; + border-width:2px; + border-style:solid; + border-color:#00bb00; + color:#00bb00; + background-color:#aaffaa; + font-weight:bold; +} diff --git a/templates/GreenPartstock0/partview.css b/templates/GreenPartstock0/partview.css new file mode 100755 index 0000000..c3ee38b --- /dev/null +++ b/templates/GreenPartstock0/partview.css @@ -0,0 +1,56 @@ +div#PartSelector { + float:left; + padding:0px; + font-size:0.8em; + border:1px solid #198533; + background-color:#cded9d; + margin:0px; + margin-right:10px; + font-weight:bold; +} + +div#PartSelector a { + font-weight:normal; +} + +div#PartSelector ul { + list-style-type:none; + padding:2px; + margin:0px; +} + +div#PartSelector ul ul{ + margin-left:10px; +} + +div#PartFilter { + font-size:0.8em; +} + +div#PartList { + float:none; +} + +div#PartList img { + border:0px; +} + +div#PartList th a { + color:#cded9d; +} + +div#PartList th a:hover { + color:#141; + text-decoration:none; +} + + +div#ShowPartHead { + margin-bottom:10px; + font-size:0.8em; +} + +div#ShowPartDownloads { + margin-left:20px; + margin-right:20px; +} diff --git a/templates/GreenPartstock0/style.css b/templates/GreenPartstock0/style.css new file mode 100755 index 0000000..f752d8d --- /dev/null +++ b/templates/GreenPartstock0/style.css @@ -0,0 +1,137 @@ +/***************** + Global Design +*****************/ +body { + background-color:#bddd8d; + color:#198533; + font-size:1.0em; + color: #198533; +} + +table { + background-color:#cded9d; + text-align:center; +} + +th { + background-color:#a26e1a; + color:#cded9d; + margin:1px; + padding-left:2px; + padding-right:2px; +} + +td { + padding:2px; + border-bottom:1px dashed #629e1f; +} + +form { + display:inline; +} + +input { + background-color:#cded9d; + border:1px solid #198533; + color: #198533; + text-align:center; +} + +textarea { + background-color:#cded9d; + border:1px solid #198533; + color: #198533; +} + +img { + vertical-align:middle; +} + +li { + padding-top: 2px; +} + +a{ + color: #198533; + text-decoration: none; +} + +a:hover{ + color: #198533; + text-decoration: underline; +} + +h1 { + font-size:1.4em; +} + +/*submit buttons are in Button-class */ +.Button { + background-color:#cded9d; + color:#198533; + text-decoration:none; + border:1px solid #198533; + padding-left:2px; + padding-right:2px; +} + +.Button:hover { + background-color:#629e1f; + color:#cded9d; + text-decoration:none; +} + +div#HeadContainer { + border-bottom:2px solid #2f8f00; + white-space:nowrap; + display:block; + margin:0px; + padding:0px; +} + + +/***************** + Login +*****************/ +div#Login { + margin:0px; + margin-left:20px; + padding:0px; + white-space:nowrap; + display:inline-block; + height:20px; +} + +#Login input { + max-width:70px; +} + +#Login img { + border:0px; + vertical-align:middle; + margin-right:4px; + margin-left:2px; +} + +#Login a { + border:1px solid #198533; + padding:1px 3px 1px 3px; + background-color:#cded9d; + font-weight:bold; + color:#198533; + text-decoration:none; +} + +#Login a:hover { + background-color:#629e1f; + color:#cded9d; +} + +/***************** + Body +*****************/ +div#Body { + padding:4px; +} + + diff --git a/templates/GreenPartstock0/template.php b/templates/GreenPartstock0/template.php new file mode 100755 index 0000000..4d0f63b --- /dev/null +++ b/templates/GreenPartstock0/template.php @@ -0,0 +1,21 @@ + + + + ldPtartstock + + + + + + + + +
    + + +
    + + + + + diff --git a/todo.txt b/todo.txt new file mode 100755 index 0000000..ab1d538 --- /dev/null +++ b/todo.txt @@ -0,0 +1,4 @@ +-LED Icons credits ins template einbauen http://led24.de/iconset/ +-Delete Storages, überlegen ob das immer geht +-EditStorages - MoveDown über dropdown selector ??? +