Просмотр файла admin/mysql/from_file.php

Размер файла: 1.52Kb
  1. <?php
  2. include '../../engine/includes/start.php';
  3. if (!$creator)
  4. Core::stop();
  5.  
  6. $set['title'] = 'Сделать запрос из файла';
  7. include incDir.'head.php';
  8.  
  9. if (isset($_POST['exec']))
  10. {
  11. $sql->from_file($_FILES['file']['tmp_name']);
  12. Core::msg_show('Запросы выполнены', 'menu_razd');
  13. }
  14. elseif (isset($_GET['file']) && file_exists(H . 'engine/files/backup/mysql/'.$_GET['file']))
  15. {
  16. if (isset($_POST['query']))
  17. {
  18. $sql->from_file(H . 'engine/files/backup/mysql/'.$_GET['file']);
  19. if (Core::form('delete') == 1)
  20. unlink(H . 'engine/files/backup/mysql/'.$_GET['file']);
  21. Core::msg_show('Запросы выполнены', 'menu_razd');
  22. }
  23. else
  24. {
  25. echo
  26. 'Вы действительно хотите выполнить запрос из файла '.$_GET['file'].'?'.
  27. '<form method="post"><label><input type="checkbox" name="delete" checked="checked" value="1"/> Удалить файл</label><br /><input type="submit" name="query" value="Выполнить"/></form>';
  28. }
  29. }
  30.  
  31. ?>
  32. Сделать запрос из sql файла
  33. <form method="post" enctype="multipart/form-data">
  34. <input type="file" name="file"/><br />
  35. <input value = "Выполнить" name="exec" type="submit" />
  36. </form>
  37. <a href="/admin/?act=mysql"><div class="menu_razd" style="width:45%;display:inline-block">MySQL</div></a>
  38. <a href="/admin/"><div class="menu_razd" style="width:48%;display:inline-block">Админка</div></a>
  39. <?
  40. include incDir.'foot.php';