make.php 771 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\admin;
  4. class make extends Base
  5. {
  6. public function initialize()
  7. {
  8. parent::initialize();
  9. $this->Administrator(3);
  10. }
  11. function index()
  12. {
  13. $tid = intval(SafeRequest("tid", "get"));
  14. $num = intval(SafeRequest("num", "get"));
  15. echo '<textarea rows="6" cols="50" style="width:100%;height:100%">';
  16. $n = 0;
  17. $c = NULL;
  18. $t = time();
  19. $p = $tid > 1 ? $tid > 2 ? 'year-' : 'quarter-' : 'month-';
  20. for ($i = 1; $i < $num + 1; $i++) {
  21. $n += 1;
  22. $code = $p . md5($_SERVER['HTTP_HOST'] . '_' . $n . '_' . $t);
  23. db('key')->insert(array('in_tid' => $tid, 'in_code' => $code, 'in_state' => 0, 'in_time' => $t));
  24. $c .= $code . "\r\n";
  25. }
  26. echo trim($c);
  27. echo '</textarea>';
  28. }
  29. }