Changeset 23292
- Timestamp:
- Jun 17, 2013, 8:08:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/BatchDownloader/admin/sets.php
r23280 r23292 5 5 if (isset($_GET['delete'])) 6 6 { 7 $ BatchDownloader= new BatchDownloader($_GET['delete']);8 $ BatchDownloader->delete();9 unset($ BatchDownloader);7 $set = new BatchDownloader($_GET['delete']); 8 $set->delete(); 9 unset($set); 10 10 } 11 11 if (isset($_GET['cancel'])) 12 12 { 13 $BatchDownloader = new BatchDownloader($_GET['cancel']); 14 $BatchDownloader->updateParam('total_size', $BatchDownloader->getEstimatedTotalSize()); 15 $BatchDownloader->updateParam('status', 'done'); 16 $BatchDownloader->deleteLastArchive(); 17 $BatchDownloader->clearImages(); 18 unset($BatchDownloader); 13 $set = new BatchDownloader($_GET['cancel']); 14 $set->updateParam('total_size', $set->getEstimatedTotalSize()); 15 $set->updateParam('nb_zip', $set->getEstimatedArchiveNumber()); 16 $set->updateParam('status', 'done'); 17 $set->deleteLastArchive(); 18 $set->clearImages(); 19 unset($set); 19 20 } 20 21 if (isset($_POST['delete_done'])) 21 22 { 22 23 $query = ' 23 DELETE s, i 24 FROM '.BATCH_DOWNLOAD_TSETS.' AS s 25 LEFT JOIN '.BATCH_DOWNLOAD_TIMAGES.' AS i 26 ON i.set_id = s.id 24 SELECT id 25 FROM '.BATCH_DOWNLOAD_TSETS.' 27 26 WHERE 28 27 status = "done" AND 29 28 date_creation < DATE_SUB(NOW(), INTERVAL 1 HOUR) 30 29 ;'; 31 pwg_query($query); 30 31 $sets = array_from_query($query, 'id'); 32 33 foreach ($sets as $set_id) 34 { 35 $set = new BatchDownloader($set_id); 36 $set->delete(); 37 unset($set); 38 } 32 39 } 33 40
Note: See TracChangeset
for help on using the changeset viewer.