草根堂家教中介系统源码


#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=system/Dreamweaver.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=草根堂教师信息查询系统
#AutoIt3Wrapper_Res_Description=草根堂教师信息查询系统
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=梁伟
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <acn_skin.au3>
#Include <GuiListView.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiImageList.au3>
#include <Constants.au3>
#include <GuiTreeView.au3>
#include <_dButton.au3>
#Include <Date.au3>

Global $Msg, $hQuery, $aRow,$aRow2,$hQuery2,$Msg2
Opt("GUIOnEventMode", 1)
$g_szVersion = "caogentang_data"
If WinExists($g_szVersion) Then Exit ; 此脚本已经运行了
AutoItWinSetTitle($g_szVersion)
;----------------------------------------------------------创建数据库
$SQLdePath = "data/CGT.db"
$SQLdingdanpath="data/CGTDD.db"


_SQLite_Startup () ;加载 SQLite.dll

If Not FileExists($SQLdePath) Then
    SQLCreate()
EndIf

If Not FileExists($SQLdingdanpath) Then
    SQLDDHCreate()
EndIf

Local $datadir = @ScriptDir&"/data/data.mdb"
Local $acc_pwd = "supervisor9958123"
Local $lsbl1,$lsbl2,$lsbl3;临时变量
Local $jsbzt,$jsbzidaxiao,$yemian1,$yemian2

Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)
#Region ### START Koda GUI section ### Form=f:/au3学习/草根堂教师数据查询系统/form1.kxf
_USkinInit(@ScriptDir & "/system/DiyGreen.msstyles",@ScriptDir&"/system/USkin.dll")

 


$destination =@ScriptDir&"/system/LOGO.bmp"
SplashImageOn("", $destination,500,250,-1,-1,1)
Sleep(3000)
SplashOff()
TrayTip("提示:","欢迎使用草根堂家教信息咨询服务中心教师查询系统", 6, 1)
GUISetIcon(@ScriptDir&"/system/Dreamweaver.ico")
TraySetState()
$Form1 = GUICreate("草根堂家教信息咨询服务中心教师查询系统", 789, 497, @DesktopWidth/2-789/2, @DesktopHeight/2-497/2-50)
$ListView2 = GUICtrlCreateListView("订单编号|客户|教师编号|教师|客户电话|教师电话|时间|备注", 8, 8, 770, 190)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 0, 125)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 2, 85)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 3, 50)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 4, 100)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 5, 100)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 6, 180)
GUICtrlSendMsg($ListView2, $LVM_SETCOLUMNWIDTH, 7, 75)
GUICtrlSetOnEvent($ListView2, "MenuEvents")
GUICtrlSetState($ListView2,$GUI_HIDE)

 


$ListView1 = GUICtrlCreateListView("编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|教龄|联系电话|加盟时间", 8, 8, 770, 190)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 0, 100)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 2, 120)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 3, 43)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 4, 43)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 5, 50)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 6, 75)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 7, 43)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 8, 43)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 9, 43)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 10, 85)
GUICtrlSendMsg($ListView1, $LVM_SETCOLUMNWIDTH, 11, 70)
$menu1 = GUICtrlCreateContextMenu($ListView1)
$menu_01 = GUICtrlCreateMenuItem("好评", $menu1)
$menu_02 = GUICtrlCreateMenuItem("差评", $menu1)
$menu_02 = GUICtrlCreateMenuItem("取消", $menu1)
;_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
;$ListView1_0 = GUICtrlCreateListViewItem("001|梁伟|220602198303040973|男|26|计算机|8:00-17:00|忙碌|白金|70|13644392881|2009-5-16", $ListView1)
GUICtrlSetOnEvent(-1, "MenuEvents")
;$ListView1 = GUICtrlCreateListView("订单编号|客户名字|教师编号|教师名字|客户电话|教师电话|时间|备注", 8, 8, 770, 190)

 

$Group1 = GUICtrlCreateGroup("其他信息", 8, 208, 177, 73)
$Edit1 = GUICtrlCreateEdit("", 16, 224, 161, 49, BitOR($ES_AUTOVSCROLL,$ES_NOHIDESEL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
;GUICtrlSetData(-1, StringFormat("精通AU3,汇编,DELPHI,/r/n熟练操作数据库,为人师,表英俊潇洒,风流倜傥,高大威猛,器宇不凡,独此一家,别无分店!"))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth[2] = [150, -1]
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, "草根堂教师数据查询系统", 0)
_GUICtrlStatusBar_SetText($StatusBar1, @TAB & "作者梁伟为您打造第一流的办公软件--LiangWeiStudio--Version1.0            ", 1)
$Group2 = GUICtrlCreateGroup("查询", 8, 352, 177, 89)
GUICtrlSetTip(-1,"请输入查询内容")
$Input5 = GUICtrlCreateInput("", 17, 403, 97, 21)
$Button3 = GUICtrlCreateButton("速查", 121, 371, 51, 25, $WS_GROUP)
GUICtrlSetTip(-1,"最快的速度查询完全相匹配的一条内容。"&@CRLF&"主意:在[查看全部]模式中搜索栏不写任何内容代表查看全部的教师信息,在[订单查询]模式中,"&@CRLF&"[搜索栏]中不填写任何内容也是查看全部订单信息,[速查]订单只支持订单号查询。")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Combo3 = GUICtrlCreateCombo("查询类型", 17, 371, 97, 25)
GUICtrlSetData(-1, "查看全部|编号|姓名|身份证号|性别|年龄|学科|任教时间|级别|教龄|状态|联系电话|加盟时间|订单查询")
$Button9 = GUICtrlCreateButton("模糊", 120, 400, 51, 25, $WS_GROUP)
GUICtrlSetTip(-1,"模糊查询,查找的信息比较详细,但是速度相对较慢。")
GUICtrlSetOnEvent(-1, "MenuEvents")
GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group3 = GUICtrlCreateGroup("添加教师信息", 192, 208, 361, 265)
$Input1 = GUICtrlCreateInput("", 209, 253, 49, 21)
GUICtrlSetTip(-1,"请输入教师的名字")
$Label1 = GUICtrlCreateLabel("教师姓名", 209, 229, 52, 17)

$Label8 = GUICtrlCreateLabel("身份证号", 273, 229, 52, 17)
$Input6 = GUICtrlCreateInput("", 273, 253, 145, 21)
GUICtrlSetTip(-1,"请输入教师的身份证号")


$Combo1 = GUICtrlCreateCombo("男", 433, 253, 41, 25)
GUICtrlSetData(-1, "女")
$Label2 = GUICtrlCreateLabel("性别", 433, 229, 28, 17)


$Label3 = GUICtrlCreateLabel("年龄", 489, 229, 28, 17)
$Input2 = GUICtrlCreateInput("", 489, 253, 49, 21)
GUICtrlSetTip(-1,"请输入教师的年龄")

$Label4 = GUICtrlCreateLabel("学科", 209, 285, 28, 17)
$Input3 = GUICtrlCreateInput("", 209, 309, 65, 21)
GUICtrlSetTip(-1,"请输入教师能胜任的学科信息")


$Label5 = GUICtrlCreateLabel("级别", 289, 285, 28, 17)
$Combo2 = GUICtrlCreateCombo("普通", 289, 309, 65, 25)
GUICtrlSetData(-1, "白钻|金钻")


$Label6 = GUICtrlCreateLabel("教学教龄", 369, 285, 52, 17)
$Input4 = GUICtrlCreateInput("", 369, 309, 65, 21)
GUICtrlSetTip(-1,"请输入教师的教学教龄")


$Label7 = GUICtrlCreateLabel("备注", 305, 341, 28, 17)
; BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN)


$Label9 = GUICtrlCreateLabel("联系电话", 449, 285, 52, 17)
$Input7 = GUICtrlCreateInput("", 449, 309, 89, 21)
GUICtrlSetTip(-1,"请输入教师的联系电话")


$Label11 = GUICtrlCreateLabel("任教时间", 208, 344, 52, 17)
$Input8 = GUICtrlCreateInput("", 208, 368, 81, 21)
GUICtrlSetTip(-1,"教师可进行任教的时间,例:(8:00-17:00)")

$Edit2 = GUICtrlCreateEdit("", 305, 365, 233, 89, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetTip(-1,"请输入教师的备注信息,如没有可不填")

$Label10 = GUICtrlCreateLabel("加盟日期", 209, 397, 52, 17)
$Date1 = GUICtrlCreateDate("", 209, 421, 90, 21, BitOR($DTS_UPDOWN,$WS_TABSTOP))

GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label12 = GUICtrlCreateLabel("     www.caogentang.com  ", 8, 448, 178, 21)
GUICtrlSetOnEvent(-1, "MenuEvents")
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetBkColor(-1, 0xA4FA3B)
GUICtrlSetCursor (-1, 0)
GUICtrlSetOnEvent(-1, "MenuEvents")
$Group4 = GUICtrlCreateGroup("数据库操作", 560, 368, 217, 105)
$Button1 = GUICtrlCreateButton("添加", 576, 392, 43, 25, $WS_GROUP)
GUICtrlSetTip(-1,"向数据库添加信息")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button2 = GUICtrlCreateButton("删除", 624, 392, 43, 25, $WS_GROUP)
GUICtrlSetTip(-1,"删除在列表上选中的信息,并删除在数据库中的本条内容")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button4 = GUICtrlCreateButton("修改", 672, 392, 43, 25, $WS_GROUP)
GUICtrlSetTip(-1,"修改在列表上选中的信息,并修改在数据库中的本条内容")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button5 = GUICtrlCreateButton("信息复位", 576, 432, 67, 25, $WS_GROUP)
GUICtrlSetTip(-1,"清空各个数据输入框中的内容,并清空信息列表中的信息")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button6 = GUICtrlCreateButton("确认预约", 648, 432, 67, 25, $WS_GROUP)
GUICtrlSetTip(-1,"确定预约选中的教师,并生成订单号")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button7 = GUICtrlCreateButton("打印", 720, 392, 43, 25, $WS_GROUP)
GUICtrlSetTip(-1,"打印本次订单的内容")
GUICtrlSetOnEvent(-1, "MenuEvents")
$Button8 = GUICtrlCreateButton("统计", 720, 432, 43, 25, $WS_GROUP)
GUICtrlSetTip(-1,"统计数据,可进行周利润,月利润,年利润的查询")
GUICtrlSetOnEvent(-1, "MenuEvents")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group6 = GUICtrlCreateGroup("预约信息", 8, 282, 177, 73)
$Edit4 = GUICtrlCreateEdit("", 16, 298, 161, 49, BitOR($ES_AUTOVSCROLL,$ES_NOHIDESEL,$ES_WANTRETURN,$WS_VSCROLL))
;GUICtrlSetData(-1, StringFormat("目前正在任课/r/n客户:/r/n菲菲/r/n任课结束时间:/r/n2009-5-18/r/n19:30/r/n订单号:/r/n1968531489"))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("我要预约", 560, 208, 217, 153)
$Label13 = GUICtrlCreateLabel("客户姓名", 576, 232, 52, 17)
$Input9 = GUICtrlCreateInput("", 640, 232, 41, 21)
$Date2 = GUICtrlCreateDate("", 576, 296, 186, 21)
$Date4 = GUICtrlCreateDate("", 576, 296, 186, 21)
GUICtrlSetState(-1,$GUI_HIDE)
$Date3 = GUICtrlCreateDate("", 688, 232, 74, 21, BitOR($DTS_UPDOWN,$DTS_TIMEFORMAT))
$Date5 = GUICtrlCreateDate("", 688, 232, 74, 21, BitOR($DTS_UPDOWN,$DTS_TIMEFORMAT))
GUICtrlSetState(-1,$GUI_HIDE)
$Input10 = GUICtrlCreateInput("", 640, 328, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Label15 = GUICtrlCreateLabel("订单号", 576, 328, 40, 17)
$Label14 = GUICtrlCreateLabel("客户电话", 576, 264, 52, 17)
$Input11 = GUICtrlCreateInput("", 640, 264, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)

 GUISetState(@SW_MINIMIZE)
        GUISetState(@SW_SHOW)
        GUISetState(@SW_MINIMIZE)
        GUISetState(@SW_RESTORE)
GUICtrlSetState($Button8,$GUI_DISABLE)
GUISetOnEvent($GUI_EVENT_CLOSE, "MenuEvents")
#EndRegion ### END Koda GUI section ###
 GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY");注册鼠标键盘事件,很NB哦
;  _GUICtrlListView_SetHoverTime($ListView1, 1234)
Local $yans=0

;先遍历一次看看那个过期了!
shujubianli()

While 1
 Local $c
  If _Mouse_top($Form1,$Label12)=1 Then
   If $yans= 0 Then GUICtrlSetColor($Label12, 0xFF0000)
   $yans=1
  Else
   If $yans=1 Then GUICtrlSetColor($Label12, 0x000080)
   $yans=0
  EndIf
  
 Sleep(100)
WEnd

Func MenuEvents()
; GUICtrlDelete($bopopop);删除PIC
Local $Msg = @GUI_CtrlID
 Switch $Msg
   Case $GUI_EVENT_CLOSE
   Switch @GUI_WINHANDLE
    Case $Form1
     TraySetState ( 2 )
     ProcessClose(@AutoItPID)
    Case Else
      GUIDelete(@GUI_WINHANDLE)
            EndSwitch
  
 Case $GUI_EVENT_MINIMIZE
  Switch @GUI_WINHANDLE
                Case $Form1
      GUIDelete(@GUI_WINHANDLE)

     Case Else
                    GUIDelete(@GUI_WINHANDLE)
            EndSwitch
   
  Case $Button1;-------------------------写入数据库
   Local $sfyx=0,$zfc=""
  ; If GUICtrlRead($Input1)<>"" And GUICtrlRead($Input6)<>"" And GUICtrlRead($Input2)<>"" And GUICtrlRead($Input3)<>"" And GUICtrlRead($Input4)<>"" And GUICtrlRead($Input7)<>"" And GUICtrlRead($Input8)<>"" Then
  
   If  GUICtrlRead($Input1)="" Then
    $sfyx=1
    $zfc&="教师姓名未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input6)="" Then
    $sfyx=1
    $zfc&="身份证号未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input2)="" Then
    $sfyx=1
    $zfc&="教师年龄未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input3)="" Then
    $sfyx=1
    $zfc&="学科未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input4)="" Then
    $sfyx=1
    $zfc&="任教课时未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input7)="" Then
    $sfyx=1
    $zfc&="联系方式未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input8)="" Then
    $sfyx=1
    $zfc&="任教时间未填写"&@CRLF
    EndIf
  
  
  If $sfyx=1 Then
   TrayTip("提示:",$zfc, 6, 1)
  Else
            ;"编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|课时|联系电话|加盟时间|讲完课时间|备注
         ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
          If SQLiteSelect($SQLdePath,"SFZH",GUICtrlRead($Input6),1)= 100 Then ;速查,B=0为检查身份证号
            SQLiteInsert($SQLdePath,@YEAR&@MDAY&@HOUR&@MIN&@SEC, GUICtrlRead($Input1), GUICtrlRead($Input6),GUICtrlRead($Combo1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input8),"空闲",GUICtrlRead($Combo2),GUICtrlRead($Input4),GUICtrlRead($Input7),GUICtrlRead($Date1),"",GUICtrlRead($Edit2))
         ;SQLiteInsert($SQLdePath,$BH, $XM, $SFZH,$XB,$NL,$XK,$RJSJ,$ZT,$JB,$KS,$LXDH,$JMSJ,$JWKSJ,$BZ) 
          TrayTip("提示:","已成功添加到数据库!", 6, 1)
         Else
          TrayTip("提示:","请不要重复保存同一个人的信息!", 6, 1)
          EndIf
 
  EndIf
   
  Case $Button3;查询数据
    Local $a= GUICtrlRead($Input5)
    Switch GUICtrlRead($Combo3)
     Case "查看全部"
      If GUICtrlRead($Input5)="" Then
       fdd()
      SQLiteRead($SQLdePath)
     Else
      fdd()
      SQLiteSelect($SQLdePath,"BH",$a,0,1)
       SQLiteSelect($SQLdePath,"XM",$a,0,1)
       SQLiteSelect($SQLdePath,"SFZH",$a,0,1)
       SQLiteSelect($SQLdePath,"XB",$a,0,1)
       SQLiteSelect($SQLdePath,"NL",$a,0,1)
       SQLiteSelect($SQLdePath,"XK",$a,0,1)
       SQLiteSelect($SQLdePath,"RJSJ",$a,0,1)
       SQLiteSelect($SQLdePath,"ZT",$a,0,1)
       SQLiteSelect($SQLdePath,"JB",$a,0,1)
       SQLiteSelect($SQLdePath,"KS",$a,0,1)
       SQLiteSelect($SQLdePath,"LXDH",$a,0,1)
       SQLiteSelect($SQLdePath,"JMSJ",$a,0,1)
      EndIf
     
     Case "编号"
       fdd()
      If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"BH",$a)
     Case "姓名"
       fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"XM",$a)
      Case "身份证号"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"SFZH",$a)
      Case "性别"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"XB",$a)
      Case "年龄"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"NL",$a)
      Case "学科"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"XK",$a)
      Case "任教时间"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"RJSJ",$a)
      Case "状态"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"ZT",$a)
      Case "级别"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"JB",$a)
      Case "教龄"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"KS",$a)
      Case "联系电话"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"LXDH",$a)
      Case "加盟时间"
        fdd()
       If GUICtrlRead($Input5)<>"" Then SQLiteSelect($SQLdePath,"JMSJ",$a)
      Case "订单查询"
        If GUICtrlRead($Input5)="" Then
          dd()
           SQLiteRead2()
          Else
           dd()
            SQLiteSelect($SQLdingdanpath,"DDH",$a)
        EndIf
     
        
      ;SQLiteSelect($SQLdePath,"BH",$a)
      
    EndSwitch
  Case $Button2;------------------------------------------------删除数据
    If _GUICtrlListView_GetSelectionMark($ListView1)>=0 Then
    Switch GUICtrlRead($Combo3)
    Case "订单查询"
    Case Else
      $answerxz=MsgBox(262144+32+1+256,"提示:","您确定要删除编号为["&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1))&"]的教师信息吗?")
          Switch $answerxz
           Case 0
           Case 1
           SQLiteDelete($SQLdePath, _GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1)))
           EndSwitch
    EndSwitch
    EndIf
  Case $Button4;------------------------------------------------修改数据
       Local $sfyx=0,$zfc=""
  ; If GUICtrlRead($Input1)<>"" And GUICtrlRead($Input6)<>"" And GUICtrlRead($Input2)<>"" And GUICtrlRead($Input3)<>"" And GUICtrlRead($Input4)<>"" And GUICtrlRead($Input7)<>"" And GUICtrlRead($Input8)<>"" Then
  
   If  GUICtrlRead($Input1)="" Then
    $sfyx=1
    $zfc&="教师姓名未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input6)="" Then
    $sfyx=1
    $zfc&="身份证号未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input2)="" Then
    $sfyx=1
    $zfc&="教师年龄未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input3)="" Then
    $sfyx=1
    $zfc&="学科未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input4)="" Then
    $sfyx=1
    $zfc&="任教课时未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input7)="" Then
    $sfyx=1
    $zfc&="联系方式未填写"&@CRLF
    EndIf
   If  GUICtrlRead($Input8)="" Then
    $sfyx=1
    $zfc&="任教时间未填写"&@CRLF
    EndIf
  
  
  If $sfyx=1 Then
   TrayTip("提示:",$zfc, 6, 1)
  Else
            ;"编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|课时|联系电话|加盟时间|讲完课时间|备注
         ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
          If SQLiteSelect($SQLdePath,"SFZH",GUICtrlRead($Input6),1)= 100 Then ;速查,B=0为检查身份证号
          TrayTip("提示:","数据库并无此信息,请填写详细资料添加数据库!", 6, 1)
         Else
           ;$lsbl1=$aRow[0]
           ;$lsbl2=$aRow[12]
          $answerxz=MsgBox(262144+32+1+256,"提示:","您确定要修改编号为["&$lsbl1&"]的教师信息吗?")
          Switch $answerxz
           Case 0
           Case 1
             SQLiteInsert($SQLdePath,$lsbl1, GUICtrlRead($Input1), GUICtrlRead($Input6),GUICtrlRead($Combo1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input8),_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),7),GUICtrlRead($Combo2),GUICtrlRead($Input4),GUICtrlRead($Input7),GUICtrlRead($Date1),$lsbl2,GUICtrlRead($Edit2))
         ;SQLiteInsert($SQLdePath,$BH, $XM, $SFZH,$XB,$NL,$XK,$RJSJ,$ZT,$JB,$KS,$LXDH,$JMSJ,$JWKSJ,$BZ) 
          TrayTip("提示:","编号为["&$lsbl1&"]的教师信息修改完毕!", 6, 1)
           EndSwitch
          EndIf
 
  EndIf
  
 Case $Button5;-------------------------清除垃圾信息
  fdd()
   GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
   GUICtrlSendMsg($ListView2, $LVM_DELETEALLITEMS, 0, 0)
   GUICtrlSetData($Input1,"")
   GUICtrlSetData($Input2,"")
   GUICtrlSetData($Input3,"")
   GUICtrlSetData($Input4,"")
   GUICtrlSetData($Input5,"")
   GUICtrlSetData($Input6,"")
   GUICtrlSetData($Input7,"")
   GUICtrlSetData($Input8,"")
   GUICtrlSetData($Input9,"")
   GUICtrlSetData($Input10,"")
   GUICtrlSetData($Input11,"")
   GUICtrlSetData($Edit1,"")
   GUICtrlSetData($Edit2,"")
   GUICtrlSetData($Edit4,"")
   GUICtrlSetData($Combo1,"男")
   GUICtrlSetData($Combo2,"普通")
   GUICtrlSetData($Combo3,"查询类型")
   GUICtrlSetData($Date1,"")
   GUICtrlSetData($Date2,"")
   GUICtrlSetData($Date3,"")
  Case $Button6;-----------------------------------------------确认预约
        Select
         Case  _GUICtrlListView_GetSelectionMark($ListView1)<0
           TrayTip("提示:","您没有选择要下订单的教师!", 6, 1)
         Case GUICtrlRead($Input9)=""
           TrayTip("提示:","您没有填写客户姓名!", 6, 1)
         Case GUICtrlRead($Input11)=""
           TrayTip("提示:","您没有填写客户联系电话!", 6, 1)
         Case GUICtrlRead($Input10)<>""
           TrayTip("提示:","请先数据复位才能再下订单!", 6, 1)
         Case GUICtrlRead($Date2)=GUICtrlRead($Date4) And GUICtrlRead($Date3)=GUICtrlRead($Date5)
           TrayTip("提示:","请设置预约时间!", 6, 1)
           
         Case Else
           
           yuyue();预约
        EndSelect
           
           
          
  Case $Button7;打印
    ;MsgBox(0,_DateToDayValue(stringleft(guictrlread($Date4),4), stringmid(guictrlread($Date4),stringinstr(guictrlread($Date4),"年")+1,stringinstr(guictrlread($Date4),"月")-1-stringinstr(guictrlread($Date4),"年")), stringmid(guictrlread($Date4),stringinstr(guictrlread($Date4),"月")+1,stringinstr(guictrlread($Date4),"日")-1-stringinstr(guictrlread($Date4),"月"))),_DateToDayValue(stringleft(guictrlread($Date2),4), stringmid(guictrlread($Date2),stringinstr(guictrlread($Date2),"年")+1,stringinstr(guictrlread($Date2),"月")-1-stringinstr(guictrlread($Date2),"年")), stringmid(guictrlread($Date2),stringinstr(guictrlread($Date2),"月")+1,stringinstr(guictrlread($Date2),"日")-1-stringinstr(guictrlread($Date2),"月"))))
    ;MsgBox(0,"",_DateToDayValue(stringleft(guictrlread($Date1),4), stringmid(guictrlread($Date1),stringinstr(guictrlread($Date1),"-",0,1)+1,stringinstr(guictrlread($Date1),"-",0,2)-1-stringinstr(guictrlread($Date1),"-",0,1)), stringmid(guictrlread($Date1),stringinstr(guictrlread($Date1),"-",0,2)+1)))
     Local $sfyx=0,$zfc=""
  ; If GUICtrlRead($Input1)<>"" And GUICtrlRead($Input6)<>"" And GUICtrlRead($Input2)<>"" And GUICtrlRead($Input3)<>"" And GUICtrlRead($Input4)<>"" And GUICtrlRead($Input7)<>"" And GUICtrlRead($Input8)<>"" Then
    
   Select
    Case  _GUICtrlListView_GetSelectionMark($ListView1)<0
      $sfyx=1
           TrayTip("提示:","您没有选择要下订单的教师!", 6, 1)
    Case GUICtrlRead($Input9)=""
            $sfyx=1
           TrayTip("提示:","您没有填写客户姓名!", 6, 1)
    Case GUICtrlRead($Input11)=""
            $sfyx=1
            TrayTip("提示:","并没有生成订单信息!", 6, 1)
    Case GUICtrlRead($Input11)=""
            $sfyx=1
           TrayTip("提示:","您没有填写客户联系电话!", 6, 1)
    Case GUICtrlRead($Date2)=GUICtrlRead($Date4) And GUICtrlRead($Date3)=GUICtrlRead($Date5)
            $sfyx=1
      TrayTip("提示:","请设置预约时间!", 6, 1)
    EndSelect
  ;MsgBox(0,"",$sfyx)
  If  $sfyx=0 Then dayinprint()
  
  Case $Button8;-------------------------统计
   
  Case $Button9;-------------------------模糊查询
     If GUICtrlRead($Input5)<>"" Then
         If GUICtrlRead($Combo3)<> "订单查询" Then
          fdd()
          SQLiteMohu($SQLdePath,GUICtrlRead($Combo3),GUICtrlRead($Input5))
         Else
          dd()
          SQLiteMohu($SQLdingdanpath,GUICtrlRead($Combo3),GUICtrlRead($Input5))
          EndIf
     EndIf
  Case $Label12
     run(@ProgramFilesDir & "/Internet Explorer/IEXPLORE.EXE http://www.caogentang.com/")
 EndSwitch
EndFunc

Func dayinprint()
 Local $file
 $file=FileOpen ( "record/"&GUICtrlRead($Input10)&".txt", 2+8)
 FileWriteLine ($file, "-=★=-草根堂家教咨询服务中心-=★=-")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "    定单编号:"&GUICtrlRead($Input10))
 FileWriteLine ($file, "    家教科目:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),5))
 FileWriteLine ($file, "    预定日期:"&GUICtrlRead($Date2))
 FileWriteLine ($file, "    预定时间:"&GUICtrlRead($Date3))
 FileWriteLine ($file, "")
 FileWriteLine ($file, "         -=-教师信息-=-")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "    教师编号:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1)))
 FileWriteLine ($file, "    教师姓名:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),1))
 FileWriteLine ($file, "    教师电话:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),10))
 FileWriteLine ($file, "    草根级别:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),8))
 FileWriteLine ($file, "    从教年龄:"&_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),9))
 FileWriteLine ($file, "")
 FileWriteLine ($file, "        -=-客户信息-=-")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "    客户姓名:"&GUICtrlRead($Input9))
 FileWriteLine ($file, "    客户电话:"&GUICtrlRead($Input11))
 FileWriteLine ($file, "")
 FileWriteLine ($file, "        -=-回执信息-=-")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "是否满意:□满意  □一般 □不满意")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "客户意见:_______________________")
 FileWriteLine ($file, "")
 FileWriteLine ($file, "教师意见:_______________________")
 FileWriteLine ($file, "")
 FileWriteLine ($file, GUICtrlRead($Date2))
 FileClose($file)
 jsbzijl();记事本字体记录
 jsbztxg();记事本字体修改
 ShellExecuteWait("record/"&GUICtrlRead($Input10)&".txt", "", @ScriptDir, "print",@SW_HIDE)
 jsbzihy();记事本字体还原
 EndFunc

 

Func SQLiteMohu($sjk,$a,$b);,模糊查询;数据库;B是子串
 Local $ms
 If GUICtrlRead($Combo3)<>"订单查询" Then
  $ms="BH"
 Else
  $ms="DDH"
  EndIf
 
 GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
 GUICtrlSendMsg($ListView2, $LVM_DELETEALLITEMS, 0, 0)
; _GUICtrlListView_DeleteAllItems($ListView1)
    _SQLite_Open ($sjk)
    _SQLite_Query(-1, "SELECT * FROM TestTable ORDER BY "&$ms&" DESC;",$hQuery)
 While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
   ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
   ; 0        1        2               3       4       5      6               7       8       9        10             11             12                13
 If $a<>"查询类型" And $b<>"" Then;可查询
  
     If fanhuileixing($a)<>100  And fanhuileixing($a)<>12 Then
      Local $numreplacements=0
         $text = StringReplace($aRow[fanhuileixing($a)], $b, $b)
           $numreplacements = @extended
            If $numreplacements>0 Then
                 If  GUICtrlRead($Combo3)<>"订单查询" Then
                GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7]&"|"&$aRow[8]&"|"&$aRow[9]&"|"&$aRow[10]&"|"&$aRow[11], $ListView1)
                GUICtrlSetColor(-1, sfkxck($aRow[7]))
                GUICtrlSetImage(-1, imgico($aRow[8]))  
                GUICtrlSetOnEvent(-1, "ListView1cilck") 
                Else
                GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7], $ListView2) 
                GUICtrlSetColor(-1,0xff0080)
                EndIf
                
            
            EndIf
      ;GUICtrlSetData($Edit1,$aRow[13])
      
      
     Else
      Local $xxcc=11
       If fanhuileixing($a)=12 Then $xxcc=7;模糊查询的AROW行数
         For $i=0 To $xxcc
          Local $numreplacements=0
          $text = StringReplace($aRow[$i], $b, $b)
          $numreplacements = @extended
               If $numreplacements>0 Then
                  If  GUICtrlRead($Combo3)<>"订单查询" Then
                  GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7]&"|"&$aRow[8]&"|"&$aRow[9]&"|"&$aRow[10]&"|"&$aRow[11], $ListView1)
                  GUICtrlSetColor(-1, sfkxck($aRow[7]))
                  GUICtrlSetImage(-1, imgico($aRow[8]))  
                  GUICtrlSetOnEvent(-1, "ListView1cilck") 
                  Else
                  GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7], $ListView2) 
                  GUICtrlSetColor(-1,0xff0080)
                  EndIf
              ExitLoop
              EndIf
         Next
     EndIf
 
 EndIf
    WEnd
    _SQLite_Close ()
EndFunc

Func fanhuileixing($v);返回类型
 Switch $v
  Case "查看全部"
   Return(100)
  Case "编号"
   Return(0)
  Case "姓名"
   Return(1)
  Case "身份证号"
   Return(2)
  Case "性别"
   Return(3)
  Case "年龄"
   Return(4)
  Case "学科"
   Return(5)
  Case "任教时间"
   Return(6)
  Case "状态"
   Return(7)
  Case "级别"
   Return(8)
  Case "教龄"
   Return(9)
  Case "联系电话"
   Return(10)
  Case "加盟时间"
   Return(11)
  Case "订单查询"
   Return(12)
  EndSwitch
 
 EndFunc
Func _login() ;管理登陆窗口
 
      $login_gui = GUICreate("管理登陆", 329, 154)
         GUICtrlCreateLabel("用户名:", 136, 32, 52, 17)
         GUICtrlCreateLabel("密  码:", 136, 65, 52, 17)
         $login_Checkbox = GUICtrlCreateCheckbox("记住密码", 136, 104, 73, 17)
   $User_Input = GUICtrlCreateInput("", 192, 30, 105, 21)
         $Pass_Input = GUICtrlCreateInput("", 192, 60, 105, 21,$ES_PASSWORD)
         $Login_Button = GUICtrlCreateButton("登陆", 240, 103, 57, 21)
   ;GUICtrlSetBkColor(-1, 0xCAE1FF)
   GUICtrlSetState(-1,$GUI_DEFBUTTON)
         GUICtrlCreateGroup("", 8, 8, 313, 137)
         $Pic1 = GUICtrlCreatePic(@ScriptDir&"/data/login.jpg", 18, 30, 95, 95)
         GUICtrlCreateGroup("", -99, -99, 1, 1)
         GUISetState(@SW_SHOW)
  ; GUISetBkColor (0xCAE1FF)
   $login_User_ini = IniRead ( @ScriptDir&"/data/config.ini", "登陆配置", "用户名", "")
   GUICtrlSetData($User_Input,$login_User_ini)
   if  IniRead ( @ScriptDir&"/data/config.ini", "登陆配置", "记住密码", "") = "是" then  GUICtrlSetState($login_Checkbox,$GUI_CHECKED)
            IF GUICtrlRead ($login_Checkbox) = 1 then
        $login_Pass_ini = _pass_mm(IniRead ( @ScriptDir&"/data/config.ini", "登陆配置", "密码", ""),1)
                 GUICtrlSetData($Pass_Input,$login_Pass_ini)
            EndIf
         While 1
             $msg_login = GUIGetMsg()
   Select
    Case $msg_login = $GUI_EVENT_CLOSE
       Return 1
                      ExitLoop
      Case $msg_login = $Login_Button
       $login_User = GUICtrlRead($User_Input)
       $login_Pass = GUICtrlRead($Pass_Input)
       if $login_Pass = "" or $login_User = "" Then
;~         MsgBox(64,"提示:","登陆名或密码不能为空!")
       Else
       IF  _Sql_login($login_User,$login_Pass) = 0 Then;如果登陆密码正确,记录密码到INI,
            IniWrite ( @ScriptDir&"/data/config.ini", "登陆配置", "用户名",$login_User )
        if GUICtrlRead ($login_Checkbox) = 1 then
            IniWrite ( @ScriptDir&"/data/config.ini", "登陆配置", "记住密码", "是" )
         IniWrite ( @ScriptDir&"/data/config.ini", "登陆配置", "密码", _pass_mm($login_Pass,0) )
        Else
         IniWrite ( @ScriptDir&"/data/config.ini", "登陆配置", "记住密码", "否" )
            IniWrite ( @ScriptDir&"/data/config.ini", "登陆配置", "密码", "" )
      EndIf
       GUIDelete($login_gui)
                WinActivate("管理登陆")
      ; GUISetState(@SW_ENABLE, $Form1)
       Return $login_user
       ExitLoop
       Else
        MsgBox(64,"提示:","用户名不存在或密码错误,请重新输入!")
                         EndIf
      
      EndIf
      EndSelect
         WEnd
EndFunc

Func _Sql_login($login_User,$login_Pass);判读登陆的用户名密码是否正确,正确输出0,否则输出1
 Local $login_Pass_data = ""
 $conn = ObjCreate("ADODB.Connection")
 $RS = ObjCreate("ADODB.Recordset")
 $conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir& ";Jet Oledb:Database Password="&$acc_pwd)
 $RS.ActiveConnection = $conn
 $RS.Open ('Select * From S_user where ' & "user_name" & ' = '& '"' & $login_User & '"')
 While (Not $RS.eof And Not $RS.bof)
  $login_Pass_data = $RS.Fields (2).value
 $RS.movenext
 WEnd
 $RS.close
 $conn.close 
 if $login_Pass = $login_Pass_data then
  Return 0
 Else
  Return 1
 EndIf
EndFunc
Func _pass_mm($pass,$var);简单密码加密处理
 if $var = 0 then
  Return StringToBinary($pass);加密
 Else
  Return BinaryToString($pass);解密
 EndIf
EndFunc

Func SQLCreate();建立教师信息数据库
    _SQLite_Open ($SQLdePath)
 ;"编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|课时|联系电话|加盟时间|讲完课时间|备注
 ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
    _SQLite_Exec(-1, "Create Table IF NOT Exists TestTable (BH Text PRIMARY KEY, XM Text, SFZH Text, XB Text, NL Text,XK Text, RJSJ Text, ZT Text, JB Text, KS Text, LXDH Text, JMSJ Text, JWKSJ Text, BZ Text);")
    _SQLite_Close ()
EndFunc

Func SQLDDHCreate();建立定单数据库
    _SQLite_Open ($SQLdingdanpath)
 ;订单编号,客户名字,教师编号,教师名字,客户电话,教师电话,时间,备注
;DDH,      KHMZ    ,JSBH     ,JSMZ     ,KHDH     ,JSDH     ,SJ   ,BZ
    _SQLite_Exec(-1, "Create Table IF NOT Exists TestTable (DDH Text PRIMARY KEY, KHMZ Text, JSBH Text, JSMZ Text, KHDH Text,JSDH Text, SJ Text, BZ Text);")
    _SQLite_Close ()
EndFunc

         ;"编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|课时|联系电话|加盟时间|讲完课时间|备注
         ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
Func SQLiteInsert($sjk,$BH, $XM, $SFZH,$XB,$NL,$XK,$RJSJ,$ZT,$JB,$KS,$LXDH,$JMSJ,$JWKSJ,$BZ)
    _SQLite_Open ($sjk)
 _SQLite_QuerySingleRow(-1, "SELECT BH FROM TestTable WHERE BH = '" & $BH & "';", $aRow)
    $Temp = $aRow[0]
 If $Temp = "" Then
 _SQLite_Exec(-1, "Insert into TestTable (BH) values ('" & $BH & "');")
EndIf
 _SQLite_Exec(-1, "UPDATE TestTable SET XM = '" & $XM & "' WHERE BH = '" & $BH & "';")
    _SQLite_Exec(-1, "UPDATE TestTable SET SFZH = '" & $SFZH & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET XB = '" & $XB & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET NL = '" & $NL & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET XK = '" & $XK & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET RJSJ = '" & $RJSJ & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET ZT = '" & $ZT & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET JB = '" & $JB & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET KS = '" & $KS & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET LXDH = '" & $LXDH & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET JMSJ = '" & $JMSJ & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET JWKSJ = '" & $JWKSJ & "' WHERE BH = '" & $BH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET BZ = '" & $BZ & "' WHERE BH = '" & $BH & "';")
    _SQLite_Close ()
EndFunc

Func SQLiteRead($sjk,$v=0);$V=0正常读取,=1是鼠标点击控件事件,显示
 GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
; _GUICtrlListView_DeleteAllItems($ListView1)
    _SQLite_Open ($sjk)
    _SQLite_Query(-1, "SELECT * FROM TestTable ORDER BY BH DESC;",$hQuery)
 While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
   ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
   ; 0        1        2               3       4       5      6               7       8       9        10             11             12                13
  GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7]&"|"&$aRow[8]&"|"&$aRow[9]&"|"&$aRow[10]&"|"&$aRow[11], $ListView1)
 GUICtrlSetColor(-1, sfkxck($aRow[7]))
 GUICtrlSetImage(-1, imgico($aRow[8]))  
 GUICtrlSetOnEvent(-1, "ListView1cilck") 
  ;GUICtrlSetData($Edit1,$aRow[13])
    WEnd
    _SQLite_Close ()
EndFunc

Func SQLiteRead2($v=0);$V=0正常读取,=1是鼠标点击控件事件,显示
 GUICtrlSendMsg($ListView2, $LVM_DELETEALLITEMS, 0, 0)
; _GUICtrlListView_DeleteAllItems($ListView1)
    _SQLite_Open ($SQLdingdanpath)
    _SQLite_Query(-1, "SELECT * FROM TestTable ORDER BY DDH DESC;",$hQuery)
 While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
   ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
   ; 0        1        2               3       4       5      6               7       8       9        10             11             12                13
  GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7], $ListView2)
 GUICtrlSetColor(-1,0xff0080)
 ;GUICtrlSetImage(-1, imgico($aRow[8]))  
 ;GUICtrlSetOnEvent(-1, "ListView1cilck") 
  ;GUICtrlSetData($Edit1,$aRow[13])
    WEnd
    _SQLite_Close ()
EndFunc

Func ListView1cilck()
If GUICtrlRead($Combo3)<>"订单查询" Then
 _SQLite_Open ($SQLdePath)
 _SQLite_QuerySingleRow(-1, "SELECT * FROM TestTable WHERE BH = '" & _GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1)) & "';", $aRow)
    $Temp = $aRow[0]
 If $Temp = "" Then
    Else
     $lsbl3=$aRow[13];将看不见的备注信息
  GUICtrlSetData($Edit1,$aRow[13])
  GUICtrlSetColor($Edit1, 0x0080FF)
  GUICtrlSetData($Edit4,$aRow[12])
  GUICtrlSetColor($Edit4, 0x0080FF)
  EndIf
  ;WEnd
    _SQLite_Close ()
EndIf
 EndFunc

Func imgico($v);图标样子
 Switch $v
  Case "白钻"
   Return("system/WHITE.ICO")
  Case "金钻"
   Return("system/ORANGE.ICO")
  Case Else
   Return("system/3.ICO")
 EndSwitch
EndFunc

Func sfkxck($v);是否空闲查看
 Switch $v
  Case "繁忙"
   Return(0x0080FF)
  Case "空闲"
   Return(0x65ba00)
 EndSwitch
EndFunc

Func SQLiteDelete($sql,$a)
    _SQLite_Open ($sql)
    _SQLite_Exec(-1, "DELETE FROM  TestTable WHERE BH = '" & $a & "';")
    _SQLite_Close ()
 TrayTip("提示:","已删除数据库中编号为 [" & $a & "] 的教师记录!", 6, 1)
EndFunc

Func SQLiteSelect($sql,$lx,$a,$b=0,$c=0);$sql数据库名字,$lx项目名称,$a查询内容,速查,B=0为检查身份证号,c=1提示
    _SQLite_Open ($sql)
 _SQLite_QuerySingleRow(-1, "SELECT * FROM TestTable WHERE "&$lx&" = '" & $a & "';", $aRow)
    $Temp = $aRow[0]
 If $Temp = "" Then
  If $b=1 Then Return 100
  If $c= 0 Then MsgBox(262208, "查找结果...", "数据库中"&GUICtrlRead($Combo3)&"为 [" & $a & "] 的记录不存在!")
    Else
  If $b=1 Then Return $aRow[7];检查到身份证号为重复的
  
         If GUICtrlRead($Combo3)<>"订单查询" Then
           GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
           GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7]&"|"&$aRow[8]&"|"&$aRow[9]&"|"&$aRow[10]&"|"&$aRow[11], $ListView1)
          ; _GUICtrlListView_SetTextColor(-1,GUICtrlSetColor(-1, sfkxck($aRow[7])))
           GUICtrlSetColor(-1, sfkxck($aRow[7]))
           GUICtrlSetImage(-1, imgico($aRow[8]))  
           GUICtrlSetOnEvent(-1, "ListView1cilck") 
          Else ;--------------------------------------订单查询
            GUICtrlSendMsg($ListView2, $LVM_DELETEALLITEMS, 0, 0)
             GUICtrlCreateListViewItem($aRow[0]&"|"&$aRow[1]&"|"&$aRow[2]&"|"&$aRow[3]&"|"&$aRow[4]&"|"&$aRow[5]&"|"&$aRow[6]&"|"&$aRow[7], $ListView2)
            ; _GUICtrlListView_SetTextColor(-1,GUICtrlSetColor(-1, sfkxck($aRow[7])))
            GUICtrlSetColor(-1,0xff0080)
         EndIf
   _SQLite_QueryFinalize ($hQuery)
  TrayTip("提示:","本次查询完毕!", 6, 1)
  EndIf
  ;WEnd
    _SQLite_Close ()
EndFunc

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
 #forceref $hWnd, $iMsg, $iwParam
 Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
 $hWndListView = $ListView1
 If Not IsHWnd($ListView1) Then $hWndListView = GUICtrlGetHandle($ListView1)

 $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
 $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
 $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
 $iCode = DllStructGetData($tNMHDR, "Code")
 Switch $hWndFrom
  Case $hWndListView
   Switch $iCode
    Case $LVS_EX_TWOCLICKACTIVATE

    Case $LVN_COLUMNCLICK ; A column was clicked
    Case $LVN_DELETEITEM ; An item is about to be deleted
    Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item
    Case $LVN_KEYDOWN ; A key has been pressed
    Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
    Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
     If _GUICtrlListView_GetSelectionMark($ListView1)>=0 And GUICtrlRead($Combo3)<>"订单查询" Then
     $lsbl1=$aRow[0]
     $lsbl2=$aRow[12]
     ;$lsbl3=_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),0)
     GUICtrlSetData($Input1,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),1))
     GUICtrlSetData($Input2,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),4))
     GUICtrlSetData($Input3,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),5))
     GUICtrlSetData($Input4,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),9))
     GUICtrlSetData($Input6,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),2))
     GUICtrlSetData($Input7,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),10))
     GUICtrlSetData($Input8,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),6))
     
     GUICtrlSetData($Combo1,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),3))
     GUICtrlSetData($Combo2,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),8))
     GUICtrlSetData($Date1,_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),11))
     GUICtrlSetData($Edit2,$aRow[13])
     EndIf
    Case $NM_KILLFOCUS ; The control has lost the input focus
    Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button
    Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button
    Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key
    Case $NM_SETFOCUS ; The control has received the input focus
   EndSwitch
 EndSwitch
 Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func SQLDDIST($sjk,$DDH, $KHMZ, $JSBH,$JSMZ,$KHDH,$JSDH,$SJ,$BZ);订单输入
    _SQLite_Open ($sjk)
 _SQLite_QuerySingleRow(-1, "SELECT DDH FROM TestTable WHERE DDH = '" & $DDH & "';", $aRow2)
    $Temp = $aRow2[0]
 If $Temp = "" Then
 _SQLite_Exec(-1, "Insert into TestTable (DDH) values ('" & $DDH & "');")
 EndIf

 _SQLite_Exec(-1, "UPDATE TestTable SET KHMZ = '" & $KHMZ & "' WHERE DDH  = '" & $DDH & "';")
    _SQLite_Exec(-1, "UPDATE TestTable SET JSBH = '" & $JSBH & "' WHERE DDH  = '" & $DDH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET JSMZ = '" & $JSMZ & "' WHERE DDH  = '" & $DDH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET KHDH = '" & $KHDH & "' WHERE DDH  = '" & $DDH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET JSDH = '" & $JSDH & "' WHERE DDH  = '" & $DDH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET SJ = '" & $SJ & "' WHERE DDH  = '" & $DDH & "';")
 _SQLite_Exec(-1, "UPDATE TestTable SET BZ = '" & $BZ & "' WHERE DDH  = '" & $DDH & "';")
    _SQLite_Close ()
EndFunc

Func yuyue();预约
  If SQLiteSelect($SQLdingdanpath,"JSBH", lstfhz(0),1)= 100 Or _DateToDayValue(@YEAR, @MON, @MDAY)>SQLiteSelect($SQLdingdanpath,"JSBH", lstfhz(0),1) Then ;速查,B=0为检查身份证号
  ; MsgBox(0,_DateToDayValue(@YEAR, @MON, @MDAY),SQLiteSelect($SQLdingdanpath,"JSBH", lstfhz(0),1))
   GUICtrlSetData($Input10,"CGT"&@YEAR&@MON&@MDAY&@HOUR&@MIN&@SEC)
                  ;订单编号,客户名字,教师编号,教师名字,客户电话,教师电话,时间,备注
   SQLDDIST($SQLdingdanpath,GUICtrlRead($Input10),GUICtrlRead($Input9),_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),0),_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),1),GUICtrlRead($Input11),_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),10),GUICtrlRead($Date2)&" "&GUICtrlRead($Date3),_DateToDayValue(stringleft(guictrlread($Date2),4), stringmid(guictrlread($Date2),stringinstr(guictrlread($Date2),"年")+1,stringinstr(guictrlread($Date2),"月")-1-stringinstr(guictrlread($Date2),"年")), stringmid(guictrlread($Date2),stringinstr(guictrlread($Date2),"月")+1,stringinstr(guictrlread($Date2),"日")-1-stringinstr(guictrlread($Date2),"月"))))
    ;"编号|姓名|身份证号|性别|年龄|学科|任教时间|状态|级别|课时|联系电话|加盟时间|讲完课时间|备注
    ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
   SQLiteInsert($SQLdePath,lstfhz(0),lstfhz(1),lstfhz(2),lstfhz(3),lstfhz(4),lstfhz(5),lstfhz(6),"繁忙",lstfhz(8),lstfhz(9),lstfhz(10),lstfhz(11),GUICtrlRead($Date2)&" "&GUICtrlRead($Date3)&@CRLF&GUICtrlRead($Input10),GUICtrlRead($Edit1))
  ;SQLiteInsert($SQLdePath,$BH, $XM, $SFZH,$XB,$NL,$XK,$RJSJ,$ZT,$JB,$KS,$LXDH,$JMSJ,$JWKSJ,$BZ) 
   TrayTip("提示:","订单信息已成功添加到数据库!", 6, 1)
  Else
   TrayTip("提示:","此教师已被预约!", 6, 1)
  ; MsgBox(0,_DateToDayValue(@YEAR, @MON, @MDAY),SQLiteSelect($SQLdingdanpath,"JSBH", lstfhz(0),1))
  EndIf
 EndFunc
 
 Func shujubianli();数据遍历
; _GUICtrlListView_DeleteAllItems($ListView1)
    _SQLite_Open ($SQLdePath)
    _SQLite_Query(-1, "SELECT * FROM TestTable ORDER BY BH DESC;",$hQuery)
 While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK
   ;"BH   |XM  |SFZH      |XB    |NL   |XK   |RJSJ      |ZT    |JB    |KS  |LXDH      |JMSJ      |JWKSJ        |BZ
   ; 0        1        2               3       4       5      6              7       8       9        10             11             12                13
      If $aRow[7]="繁忙" Then
            If _DateToDayValue(@YEAR, @MON, @MDAY)>_DateToDayValue(stringleft($aRow[12],4), stringmid($aRow[12],stringinstr($aRow[12],"年")+1,stringinstr($aRow[12],"月")-1-stringinstr($aRow[12],"年")), stringmid($aRow[12],stringinstr($aRow[12],"月")+1,stringinstr($aRow[12],"日")-1-stringinstr($aRow[12],"月"))) Then
                 _SQLite_Exec(-1, "UPDATE TestTable SET ZT = '" & "空闲" & "' WHERE BH = '" & $aRow[0] & "';")
                 _SQLite_Exec(-1, "UPDATE TestTable SET JWKSJ = '" & "" & "' WHERE BH = '" & $aRow[0] & "';")
           EndIf
      EndIf
      ;GUICtrlSetData($Edit1,$aRow[13])
      
    WEnd
    _SQLite_Close ()
EndFunc
 
 Func lstfhz($v);LISTVIEW返回值
  Return(_GUICtrlListView_GetItemText($ListView1,_GUICtrlListView_GetSelectionMark($ListView1),$v))
 EndFunc
 
Func fdd()
  GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
GUICtrlSetState($ListView2,$GUI_HIDE)
GUICtrlSetState($ListView1,$GUI_SHOW)
GUICtrlSetState($Button1,$GUI_ENABLE)
GUICtrlSetState($Button2,$GUI_ENABLE)
GUICtrlSetState($Button4,$GUI_ENABLE)
GUICtrlSetState($Button6,$GUI_ENABLE)
GUICtrlSetState($Button7,$GUI_ENABLE)
;GUICtrlSetState($Button8,$GUI_ENABLE)
EndFunc

Func dd()
  GUICtrlSendMsg($ListView2, $LVM_DELETEALLITEMS, 0, 0)
GUICtrlSetState($ListView1,$GUI_HIDE)
GUICtrlSetState($ListView2,$GUI_SHOW)
GUICtrlSetState($Button1,$GUI_DISABLE)
GUICtrlSetState($Button2,$GUI_DISABLE)
GUICtrlSetState($Button4,$GUI_DISABLE)
GUICtrlSetState($Button6,$GUI_DISABLE)
GUICtrlSetState($Button7,$GUI_DISABLE)
;GUICtrlSetState($Button8,$GUI_DISABLE)
 EndFunc


Func jsbzijl();记事本字体记录
 $jsbzt=RegRead("HKEY_CURRENT_USER/Software/Microsoft/Notepad","lfFaceName")
 $jsbzidaxiao=RegRead("HKEY_CURRENT_USER/Software/Microsoft/Notepad","iPointSize")
EndFunc

Func jsbztxg();记事本字体修改
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "lfFaceName", "REG_SZ", "幼圆")
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "iPointSize", "REG_DWORD", 0xf0)
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "szHeader", "REG_SZ", "")
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "szTrailer", "REG_SZ", "")
EndFunc

Func jsbzihy();记事本字体还原
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "lfFaceName", "REG_SZ",$jsbzt)
 RegWrite("HKEY_CURRENT_USER/Software/Microsoft/Notepad", "iPointSize", "REG_DWORD", $jsbzidaxiao)
 EndFunc

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值