Changeset 646 for trunk/Modules/Export/Export.php
- Timestamp:
- Dec 14, 2013, 12:51:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r582 r646 22 22 $this->SourceDirRelative = $this->Config['Web']['SourceFolder']; 23 23 if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true); 24 $this->SaveAllUsers(); 25 } 26 27 function SaveAllUsers() { 28 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$this->Id); 29 $Export = $DbResult->fetch_assoc(); 30 if ($Export['AllUsers']) { 31 $DbResult2 = $this->System->Database->query('SELECT ID FROM `User` WHERE `ID` NOT IN(SELECT `User` FROM `ExportUser` WHERE `Export`='.$this->Id.')'); 32 while($UserLine = $DbResult2->fetch_assoc()) 33 { 34 $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID']; 35 $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence 36 if($DbResult->num_rows > 0) 37 { 38 // $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition); 39 } else 40 { 41 $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$this->Id.', '.$UserLine['ID'].', 0)'); 42 } 43 } 44 45 $this->System->Database->query('SET @I = 0'); 46 $this->System->Database->query('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$this->Id.' ORDER BY `Sequence`;'); 47 } 24 48 } 25 49
Note:
See TracChangeset
for help on using the changeset viewer.