GithubHelp home page GithubHelp logo

datestrack's Introduction

货期查询网站

Intro

此网站用于追踪购买货期,请在内网连接SD_1F路由器后访问货期查询表

Prerequisites

你需要有一台安装了php7.0, sqlite3/MySql, Nginx/Apache环境的Linux机器。 在此版本中,将以Nginx+PhP+sqlite3为环境。

安装Nginx

sudo apt-get install nginx

安装php7.0和sqlite

sudo apt-get install php7.0
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0-sqlite
sudo apt-get install sqlite3

启动Nginx

sudo /etc/init.d/nginx start

修改nginx的配置文件

sudo nano /etc/nginx/sites-available/default

找到root行,修改目录,建议修改为:(此为在Orangepi上第一版本Nginx根目录)

/var/www

找到listen行, 修改如下:

listen 80; ## listen for ipv4

找到php的定义段,将这些行的注释去掉 ,修改后内容如下

location ~ \.php$ {
 fastcgi_pass unix:/var/run/php5-fpm.sock;
 fastcgi_index index.php;
 include fastcgi_params;
}

重新加载nginx的配置

sudo /etc/init.d/nginx reload

使用

第一次使用

下载或克隆这个repo到Linux机器,并把其中文件放入Nginx root目录下(/var/www)。 运行php编译器检查是否报错

php -f index.php
php -f mech_page.php

之后运行

ls /var/www

查看是否有Test.db数据库文件,如果Test.db文件存在,请运行chmod 777 /var/www/Test.db更改数据库权限至全用户可读写,或把root目录文件夹切换为全用户可读写。

打开浏览器,在地址栏输入Linux机器的固定ip访问网页。

关于sqlite

用户可以随时运行sqlite3 /var/www/Test.db 查看数据库情况。 默认表名字为COMPANY

进入sqlite3之后运行

.schema COMPANY

查看数据库中的表的完整信息。

运行

.header on
.mode column
select * from COMPANY;

查看表中数据

删除行:

DELETE FROM table_name
WHERE [condition];

添加行:

INSERT INTO TABLE_NAME (column1, column2, column3,...columnN)]  
VALUES (value1, value2, value3,...valueN);      
or     
INSERT INTO TABLE_NAME VALUES (value1,value2,value3,...valueN);

更新行:

UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];

默认表的详细信息

默认的表有11列。
1.ID:主键
2.NAME:产品名称
3.DEPARTMENT:部门
4.AMOUNT:采购数量
5.PURCHASE_DATE:购买日期
6.EXPECT_DATE:预计到货日期
7.ACTUAL_DATE:实际到货日期
8:BRAND:厂家
9.MAIL_DATE:发货日期
10.DELETE_F:删除旗标 //如果值为'DEL_F'该行不会在网站上显示出
11.comment:注释(未用)

License

本网站使用了Bootstrap。 Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)

datestrack's People

Contributors

junhao6503 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.