1 Star 0 Fork 4

baxtax / 在线excel

forked from xu99 / 在线excel 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.php 2.81 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
xu99 提交于 2017-11-16 15:45 . 在线协作电子表格
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<?php
require "include.php";
?>
<!--相关操作-->
<div align="right">
<a href="input_excel.html">导入excel<<<</a><br>
<?php
if(isset($_GET['type'])){
echo "<a href='output.php?type={$_GET['type']}'>".'导出excel>>>'.'</a>'.'<br>';
echo "<a href='input_word.php?type={$_GET['type']}'>".'添加信息'.'</a>'.'<br>';
echo "<a href='api.php?act=form_del&type={$_GET['type']}'>".'删除这张表'.'</a>'.'<br>';
}
?>
</div>
<!--展示目前数据库拥有的表-->
<div align="left">
<?php
$rs = new DBHelper();
$sql = 'select * from type';
$res = $rs->fetch_all($sql);
if(mysqli_num_rows($res) > 0) {
while ($row = mysqli_fetch_array($res)) {
echo "<a href='index.php?type={$row['type']}'>".$row['type'].'</a>'.'<br>';
}
}
?>
</div>
<!--所点击表的详情-->
<div align="center">
<?php
require "include.php";
$rs = new DBHelper();
if(!isset($_GET['type'])){
echo '<h1>'."请选择左侧一张表".'</h1>';
}else{
$rs = new DBHelper();
$sql = "select * from type where type='{$_GET['type']}'";
$result = $rs->query_one($sql);
if($result!=null){
$res = $rs->fetch_all("SHOW COLUMNS FROM `{$_GET['type']}`");
$sql = "select * from {$_GET['type']}";
$result = $rs->fetch_all($sql);
$rt = array();
if ($res instanceof mysqli_result)
{
while (($row = $res->fetch_assoc()) != FALSE)
{
$row['CanBeNull'] = $row['Null'] === 'YES'; //字段值是否可以为空,是的话值为'YES'
$rt[] = $row;
}
}
$ss=count($rt);
echo '<h1>'.$_GET['type'].'</h1>';
echo '<table border="1" cellpadding="0" cellspacing="0" width="80%" align="center" >';
/*打印标题*/
echo '<tr>';
for ($i = 0; $i < $ss; $i++) {
echo '<td>'.$rt[$i]['Field'].'</td>';
}
echo '<td>'."操作".'</td>';
echo '<tr>';
echo "</br>";
/*打印内容*/
while ($arr = mysqli_fetch_array($result)) {
echo '<tr>';
for ($i = 0; $i < $ss; $i++) {
echo '<td>'.$arr[$i].'</td>';
}
echo "<td>"."<a href='api.php?act=delete&type={$_GET['type']}&id={$arr[0]}'>删除</a>/<a href='update.php?type={$_GET['type']}&id={$arr[0]}'>修改</a>"."</td>";
echo '</tr>';
}
echo '</table>';
}else{
echo '<h1>'."此表已被删除".'</h1>';
}
}
?>
</div>
</body>
</html>
PHP
1
https://gitee.com/baxtax/ZaiXianexcel.git
git@gitee.com:baxtax/ZaiXianexcel.git
baxtax
ZaiXianexcel
在线excel
master

搜索帮助