push_check.php 807 B

1234567891011121314151617181920212223
  1. <?php
  2. require_once "doctrine/bootstrap.php";
  3. //require_once 'api/vendor/autoload.php';
  4. //require_once 'api/vendor/yiisoft/yii2/Yii.php';
  5. //$config = require_once 'api/config/web.php';
  6. //
  7. //(new yii\web\Application($config));
  8. if (!isset($db_hostname))
  9. {
  10. require_once 'auth.php';
  11. }
  12. require_once 'functions.php';
  13. //$str = "select * from accounts where last_push_message_sent IS NOT NULL and (last_push_message_sent - last_seen_mobile) > 30 and (NOW() - last_seen_mobile) < 3600";
  14. $str = "select * from accounts where last_push_message_sent IS NOT NULL and (last_push_message_sent - last_seen_mobile) > 30 and (NOW() - last_seen_mobile) < 600";
  15. $q = mysqli_query($link, $str);
  16. while($acc = mysqli_fetch_array($q))
  17. {
  18. SendPush($acc['id'], "Check your SMoPP application!", 666);
  19. }