<?php
class adodb {
var $dbPath = 'd:/doct.mdb'; //数据库路径
var $tabName; //表名
var $aryChar; //写入、查询操作时为列的集合,更新操作时为更新具体内容
var $aryText; //写入操作时为值的集合,更新、删除、查询操作时为更新的条件,批量请赋予1=1
var $showMessage; //操作返回的提示
var $pageCode = 1; //当前页,程序默认为1
var $pageSize = 10; //每页显示记录数,程序默认为10
var $pageUrl = '?'; //分页时传入的其它保留参数
var $pageViewText; //输出分页字符串
var $pageView = false; //是否显示分页,默认为不显示
var $bodyAry = Array(); //返回查询的数据
var $siteCode = Array( //返回提示的文字,目的:多语言
0 => '数据库连接成功!',
1 => '数据库连接失败!',
2 => '数据写入成功!',
3 => '数据更新成功!',
4 => '数据删除成功!',
5 => '数据查询失败!',
6 => '首页',
7 => '上一页',
8 => '下一页',
9 => '尾页'
);
var $bodyAryOne = Array(); //返回单个查询的数据
//数据库连接
function conn(){
try {
$this->conn = new com("ADODB.Connection");
$this->conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath($this->dbPath));
$this->showMessage = $this->siteCode[0];
}
catch(Exception $e){
$this->showMessage = $e->getMessage() . '<br />' . $this->siteCode[1];
}
}
//数据库关闭
function conn_close(){
$this->conn->close();
}
//写入数据
function setData(){
$this->conn();
$this->conn->execute("insert into $this->tabName ($this->aryChar) values($this->aryText)");
$this->showMessage = $this->siteCode[2];
$this->conn_close();
}
//更新数据
function upData(){
$this->conn();
$this->conn->execute("update $this->tabName set $this->aryChar where $this->aryText");
$this->showMessage = $this->siteCode[3];
$this->conn_close();
}
//删除数据
function delData(){
$this->conn();
$this->conn->execute("delete from $this->tabName where $this->aryText");
$this->showMessage = $this->siteCode[4];
$this->conn_close();
}
//查询数据
function getData(){
$this->conn();
$rs = $this->conn->execute("select $this->aryChar from $this->tabName where $this->aryText");
if(!$rs->Eof){
$j = 0;
$k = 0;
if(!preg_match("/^\d+$/" , $this->pageCode)){
$this->pageCode = 1;
}
while(!$rs->Eof){
$j ++;
//把记录写进当前需要显示的二维数组中
if(($j > ($this->pageCode - 1) * $this->pageSize) && ($j <= $this->pageCode * $this->pageSize)){
for($i = 0 ; $i < $rs->Fields->count ; $i ++){
$this->bodyAry[$k][$i] = $rs->Fields[$i]->value;
}
$k ++;
}
$rs->movenext();
}
//分页
if($this->pageView == true){
$this->pageViewText = '[共' . $j . '条][第' . $this->pageCode . '页/共' . ceil($j / $this->pageSize) . '页] ';
if($j > $this->pageSize){
if($this->pageCode > 1){
$this->pageViewText .= "<a href='" . $this->pageUrl . "page=1'>" . $this->siteCode[6] . "</a> ";
$this->pageViewText .= "<a href='" . $this->pageUrl . "page=" . ($this->pageCode - 1) . "'>" . $this->siteCode[7] . "</a> ";
}
else {
$this->pageViewText .= $this->siteCode[6] . " ";
$this->pageViewText .= $this->siteCode[7] . " ";;
}
if($this->pageCode < ceil($j / $this->pageSize)){
$this->pageViewText .= "<a href='" . $this->pageUrl . "page=" . ($this->pageCode + 1) . "'>" . $this->siteCode[8] . "</a> ";
$this->pageViewText .= "<a href='" . $this->pageUrl . "page=" . ceil($j / $this->pageSize) . "'>" . $this->siteCode[9] . "</a>";
}
else {
$this->pageViewText .= $this->siteCode[8] . " ";
$this->pageViewText .= $this->siteCode[9];
}
}
}
}
else {
$this->showMessage = $this->siteCode[5];
exit();
}
$rs->close();
$this->conn_close();
}
//查询数据
function getDataOne(){
$this->conn();
$rs = $this->conn->execute("select $this->aryChar from $this->tabName where $this->aryText");
if(!$rs->Eof){
while(!$rs->Eof){
for($i = 0 ; $i < $rs->Fields->count ; $i ++){
$this->bodyAryOne[$i] = $rs->Fields[$i]->value;
}
$rs->movenext();
}
}else {
$this->showMessage = $this->siteCode[5];
//exit();
}
$rs->close();
$this->conn_close();
}
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的购进药品检查验收记录系统源码.zip
共64个文件
gif:21个
js:13个
css:11个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 160 浏览量
2023-10-10
21:22:53
上传
评论
收藏 239KB ZIP 举报
温馨提示
基于PHP的购进药品检查验收记录系统源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的购进药品检查验收记录系统源码.zip (64个子文件)
132696305464435147
doct_v1.0
doct
adodb.php 5KB
js
jquery.dataForAjax.js 3KB
jquery.pagination.js 5KB
DatePicker
lang
zh-cn.js 383B
zh-tw.js 382B
en.js 415B
calendar.js 22KB
config.js 265B
My97DatePicker.htm 1KB
WdatePicker.js 7KB
skin
whyGreen
img.gif 2KB
bg.jpg 307B
datepicker.css 5KB
WdatePicker.css 171B
blue
navRight.gif 71B
right.gif 65B
left.gif 65B
bg.jpg 311B
navLeft.gif 71B
btnbg.jpg 536B
down.jpg 398B
qs.jpg 527B
up.jpg 402B
datepicker.css 5KB
default
img.gif 2KB
datepicker.css 4KB
datePicker.gif 1KB
func.js 36KB
AlphaPNG.js 2KB
my.js 2KB
jquery.js 93KB
jquery-compressed.js 21KB
main.php 3KB
ins.html 4KB
mnote.php 2KB
style
style.css 3KB
logout.gif 995B
login.png 452B
border_bl.gif 102B
title_bg.gif 43B
border.gif 43B
border_tl.gif 102B
border_br.gif 102B
css.css 3KB
border_tr.gif 101B
css
inbox.css 14KB
mybtn.css 891B
skin_blue.css 3KB
table_.css 2KB
globle_v1.css 42KB
login.html 2KB
out.php 4KB
index.php 1019B
images
theme.gif 22KB
loading.gif 2KB
f2.gif 3KB
f1_1.gif 24KB
163logo.gif 7KB
f1.gif 24KB
ico.gif 21KB
head.html 2KB
opti.php 4KB
db
doct.mdb 448KB
left.html 2KB
共 64 条
- 1
资源评论
易小侠
- 粉丝: 6481
- 资源: 9万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功