_log.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. if (!$logged_me_in_successfully234)
  8. return;
  9. /*defined('YII_DEBUG') or define('YII_DEBUG', true);
  10. defined('YII_ENV') or define('YII_ENV', 'dev');
  11. require __DIR__ . '/api/vendor/autoload.php';
  12. require __DIR__ . '/api/vendor/yiisoft/yii2/Yii.php';
  13. $config = require __DIR__ . '/api/config/web.php';
  14. (new yii\web\Application($config));
  15. use Yii;
  16. use yii\base\Model;
  17. use app\models\entity\ProjectsLocotech;
  18. use app\models\entity\Tasks;
  19. use app\models\entity\Tasknotes;
  20. use app\models\LocomotiveModel;
  21. use app\models\EmployeesModel;/**/
  22. /*echo '<html><head><title>';
  23. echo 'Тестирование интеграции SMoPP - АСУ СГ';
  24. echo '</title>';
  25. echo '</head>
  26. <body>';/**/
  27. $action = filter_input(INPUT_GET, 'action');
  28. if (1 == $action)
  29. {
  30. $str = $_POST['text'];
  31. if ($str)
  32. {
  33. //$safestr = mysqli_real_escape_string($str);
  34. $res = Yii::$app->db->createCommand()
  35. ->insert('text_log',
  36. ['msg' => $str]
  37. )->execute();
  38. //'insert into text_log (msg) values (\''
  39. //. $safestr . '\')')->execute();
  40. if ($res)
  41. echo 'Записано.<br/>';
  42. else
  43. echo 'Не записано.<br/>';
  44. }
  45. }
  46. echo '<h2>Внесите текст:</h2>
  47. <br/>
  48. <form action="?act=_log&action=1" method="post">
  49. <textarea name="text" style="width:100%"></textarea>
  50. <p><input type="submit" /></p>
  51. </form>';
  52. //echo '</body>';