12345678910111213141516171819202122232425262728293031 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- namespace app\admin;
- class make extends Base
- {
- public function initialize()
- {
- parent::initialize();
- $this->Administrator(3);
- }
- function index()
- {
- $tid = intval(SafeRequest("tid", "get"));
- $num = intval(SafeRequest("num", "get"));
- echo '<textarea rows="6" cols="50" style="width:100%;height:100%">';
- $n = 0;
- $c = NULL;
- $t = time();
- $p = $tid > 1 ? $tid > 2 ? 'year-' : 'quarter-' : 'month-';
- for ($i = 1; $i < $num + 1; $i++) {
- $n += 1;
- $code = $p . md5($_SERVER['HTTP_HOST'] . '_' . $n . '_' . $t);
- db('key')->insert(array('in_tid' => $tid, 'in_code' => $code, 'in_state' => 0, 'in_time' => $t));
- $c .= $code . "\r\n";
- }
- echo trim($c);
- echo '</textarea>';
- }
- }
|