js+script+text+html,执行插入.innerHTML的<script>元素

执行插入.innerHTML的

我有一个脚本,它可以在元素中插入一些内容innerHTML.

例如,内容可以是:test

问题是,

是否有人获得执行所有

编辑:

通过查看jQuery代码,我找到了jQuery是如何实现的,这导致了以下代码:Demo:

<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>会计信息管理系统</title> <style> body { font-family: "Microsoft YaHei", sans-serif; background-color: #f4f6f9; margin: 0; padding: 0; color: #333; } header { background-color: #2c3e50; color: white; padding: 20px; text-align: center; } nav { background-color: #34495e; overflow: hidden; } nav a { float: left; display: block; color: white; text-align: center; padding: 14px 20px; text-decoration: none; } nav a:hover { background-color: #ddd; color: black; } .container { max-width: 1200px; margin: 20px auto; padding: 20px; background-color: white; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } /* 卡片样式 */ .card-container { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; } .card { flex: 1; min-width: 250px; border: 1px solid #ddd; border-radius: 8px; padding: 20px; background-color: #f8f9fa; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.3s ease; } .card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .card h3 { color: #2c3e50; margin-top: 0; } .card p { color: #666; line-height: 1.6; } table { width: 100%; border-collapse: collapse; margin-top: 20px; } table, th, td { border: 1px solid #ccc; } th, td { padding: 12px; text-align: center; } th { background-color: #ecf0f1; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; } .form-group input, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; } button { background-color: #27ae60; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #219a52; } .btn-group { margin: 20px 0; } .btn { display: inline-block; padding: 10px 18px; background-color: #3498db; color: white; text-decoration: none; border-radius: 4px; margin-right: 10px; font-size: 14px; } .btn:hover { background-color: #2980b9; } .chart-container { margin-top: 30px; text-align: center; } footer { text-align: center; padding: 20px; background-color: #2c3e50; color: white; margin-top: 40px; } /* 隐藏非当前页面 */ .container > section { display: none; } </style> </head> <body> <header> <h1>会计信息网络化管理系统</h1> <p>实时财务数据 · 安全高效 · 多端同步</p> </header> <nav> <a href="#home">首页</a> <a href="#balance-sheet">资产负债表</a> <a href="#income-statement">利润表</a> <a href="#entry">凭证录入</a> <a href="#charts">数据可视化</a> </nav> <div class="container"> <!-- ============ 首页内容 ============ --> <section id="home"> <h2>欢迎使用会计信息管理系统</h2> <p>本系统提供企业财务数据的在线录入、查询、分析与可视化功能,支持多用户权限管理和数据加密传输。</p> <!-- 功能卡片 --> <div class="card-container"> <div class="card"> <h3>📊 财务报表</h3> <p>一键生成资产负债表、利润表、现金流量表,支持导出为 Excel 或 PDF 格式。</p> </div> <div class="card"> <h3>📝 凭证管理</h3> <p>支持会计凭证的增删改查,自动校验借贷平衡,确保账务准确无误。</p> </div> <div class="card"> <h3>📈 数据可视化</h3> <p>通过图表直观展示收入、支出、利润趋势,辅助管理层决策。</p> </div> <div class="card"> <h3>🔐 权限控制</h3> <p>支持多角色登录(管理员、会计、出纳),不同角色拥有不同操作权限。</p> </div> </div> <!-- 快捷操作 --> <div class="btn-group"> <a href="#entry" class="btn">➕ 录入新凭证</a> <a href="#balance-sheet" class="btn">📄 查看资产负债表</a> <a href="#income-statement" class="btn">📉 查看利润表</a> <a href="#charts" class="btn">📊 查看图表分析</a> </div> <!-- 最近凭证记录 --> <h3>近期凭证记录(模拟)</h3> <table> <thead> <tr> <th>编号</th> <th>日期</th> <th>摘要</th> <th>科目</th> <th>借方金额</th> <th>贷方金额</th> </tr> </thead> <tbody> <tr><td>PZ001</td><td>2025-04-01</td><td>销售商品收款</td><td>银行存款</td><td>50,000.00</td><td>-</td></tr> <tr><td>PZ002</td><td>2025-04-02</td><td>采购原材料</td><td>应付账款</td><td>-</td><td>30,000.00</td></tr> <tr><td>PZ003</td><td>2025-04-03</td><td>支付工资</td><td>银行存款</td><td>20,000.00</td><td>-</td></tr> <tr><td>PZ004</td><td>2025-04-04</td><td>收到投资款</td><td>实收资本</td><td>-</td><td>100,000.00</td></tr> </tbody> </table> </section> <!-- ============ 凭证录入 ============ --> <section id="entry"> <h3>会计凭证录入</h3> <form id="accountingForm"> <div class="form-group"> <label>凭证编号</label> <input type="text" id="voucherNo" required placeholder="如:PZ005" /> </div> <div class="form-group"> <label>日期</label> <input type="date" id="date" required /> </div> <div class="form-group"> <label>摘要</label> <input type="text" id="summary" placeholder="如:销售商品收入" required /> </div> <div class="form-group"> <label>科目</label> <select id="account" required> <option value="">--选择会计科目--</option> <option value="cash">库存现金</option> <option value="bank">银行存款</option> <option value="revenue">主营业务收入</option> <option value="payable">应付账款</option> <option value="receivable">应收账款</option> <option value="expense">管理费用</option> </select> </div> <div class="form-group"> <label>借方金额</label> <input type="number" id="debit" step="0.01" placeholder="请输入借方金额" /> </div> <div class="form-group"> <label>贷方金额</label> <input type="number" id="credit" step="0.01" placeholder="请输入贷方金额" /> </div> <button type="submit">保存凭证</button> </form> </section> <!-- ============ 资产负债表 ============ --> <section id="balance-sheet"> <h3>资产负债表(示例)</h3> <table> <thead> <tr> <th>项目</th> <th>期末余额(元)</th> <th>期初余额(元)</th> </tr> </thead> <tbody> <tr><td>货币资金</td><td>150,000.00</td><td>130,000.00</td></tr> <tr><td>应收账款</td><td>80,000.00</td><td>75,000.00</td></tr> <tr><td>存货</td><td>200,000.00</td><td>190,000.00</td></tr> <tr><td><strong>资产合计</strong></td><td><strong>430,000.00</strong></td><td><strong>395,000.00</strong></td></tr> <tr><td>应付账款</td><td>60,000.00</td><td>55,000.00</td></tr> <tr><td>应交税费</td><td>20,000.00</td><td>18,000.00</td></tr> <tr><td><strong>负债合计</strong></td><td><strong>80,000.00</strong></td><td><strong>73,000.00</strong></td></tr> <tr><td><strong>所有者权益</strong></td><td><strong>350,000.00</strong></td><td><strong>322,000.00</strong></td></tr> </tbody> </table> </section> <!-- ============ 利润表 ============ --> <section id="income-statement"> <h3>利润表(示例)</h3> <table> <thead> <tr> <th>项目</th> <th>本期金额(元)</th> <th>上期金额(元)</th> </tr> </thead> <tbody> <tr><td>一、营业收入</td><td>500,000.00</td><td>450,000.00</td></tr> <tr><td>减:营业成本</td><td>300,000.00</td><td>270,000.00</td></tr> <tr><td>税金及附加</td><td>20,000.00</td><td>18,000.00</td></tr> <tr><td>销售费用</td><td>30,000.00</td><td>28,000.00</td></tr> <tr><td>管理费用</td><td>40,000.00</td><td>38,000.00</td></tr> <tr><td><strong>二、营业利润</strong></td><td><strong>110,000.00</strong></td><td><strong>96,000.00</strong></td></tr> <tr><td>加:营业外收入</td><td>5,000.00</td><td>4,000.00</td></tr> <tr><td><strong>三、利润总额</strong></td><td><strong>115,000.00</strong></td><td><strong>100,000.00</strong></td></tr> <tr><td>减:所得税费用</td><td>28,750.00</td><td>25,000.00</td></tr> <tr><td><strong>四、净利润</strong></td><td><strong>86,250.00</strong></td><td><strong>75,000.00</strong></td></tr> </tbody> </table> </section> <!-- ============ 数据可视化 ============ --> <section id="charts" class="chart-container"> <h3>财务数据可视化</h3> <p>此处可集成 ECharts 或 Chart.js 实现柱状图、折线图等。</p> <img src="https://via.placeholder.com/600x300?text=收入+支出+趋势图" alt="图表占位图" style="max-width: 100%;" /> <p><small>提示:可添加月度收入对比图、利润变化趋势图等。</small></p> </section> </div> <footer> © 2025 会计信息网络化管理系统 | 技术支持:Web开发团队 </footer> <script> // 页面切换逻辑 document.querySelectorAll('nav a').forEach(link => { link.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href').substring(1); // 隐藏所有 section document.querySelectorAll('.container > section').forEach(section => { section.style.display = 'none'; }); // 显示目标页面 if (targetId === 'home') { document.getElementById('home').style.display = 'block'; } else { const targetSection = document.getElementById(targetId); if (targetSection) targetSection.style.display = 'block'; } }); }); // 表单提交处理 document.getElementById('accountingForm').addEventListener('submit', function(e) { e.preventDefault(); const voucherNo = document.getElementById('voucherNo').value; const date = document.getElementById('date').value; const summary = document.getElementById('summary').value; const account = document.getElementById('account').value; const debit = parseFloat(document.getElementById('debit').value || 0).toFixed(2); const credit = parseFloat(document.getElementById('credit').value || 0).toFixed(2); alert(`凭证已保存!\n编号:${voucherNo}\n摘要:${summary}\n借方:${debit}元\n贷方:${credit}元`); // 可在此处添加将数据插入“最近凭证记录”表格的逻辑 // 示例:动态添加一行到首页的表格中(略) }); // 默认显示首页 window.onload = () => { document.querySelectorAll('.container > section').forEach(s => s.style.display = 'none'); document.getElementById('home').style.display = 'block'; }; </script> </body> </html> 首页点击录入新凭证跳转录入凭证框,我需要完整代码
10-18
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>商品管理</title> <script src="./js/echarts.js"></script> <link rel="stylesheet" href="./css/public.css" /> <link rel="stylesheet" href="./css/goodschild.css" /> <link rel="stylesheet" href="./css/myPagination.css"> <script src="./js/jquery-3.7.1.min.js"></script> <script type="text/javascript" charset="utf-8" src="./ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="./ueditor/ueditor.all.min.js"> </script> <script type="text/javascript" charset="utf-8" src="./ueditor/lang/zh-cn/zh-cn.js"></script> </head> <body> <!-- 预览的幕布 --> <div id="imagePreview" class="preview_modal" onclick="previewCancel()"> <!-- 预览的图片 --> <img id="previewImage" src="" alt="Preview Image"> </div> <!-- 顶部下拉框 --> <div class="top_box" id="top_box"> <div class="top_left"> <input type="text" placeholder="请输入产品名称搜索" id="searchInput"> </div> <div class="top_right"> <button id="searchBtn">搜索</button> <button id="resetBtn">重置</button> </div> </div> <!-- 按钮区域 --> <div class="top_boxs"> <div class="top_button"> <button id="addition" class="icon-btns"> <img src="./img/返回.png" alt="图标描述" width="15" height="15"> <p>返回</p> </button> <button id="additionst" class="icon-btns"> <img src="./img/加号.png" alt="图标描述" width="20" height="20"> <p>新增</p> </button> <button id="expurgate" class="icon-btn" disabled> <p>全部</p> <span class="badge" id="badge_first"></span> </button> <button id="search" class="icon-btn" disabled> <p>待审核</p> <span class="badge" id="badge_second"></span> </button> <button id="searchsa" class="icon-btn" disabled> <p>回收站</p> <span class="badge" id="badge_seconds"></span> </button> <button id="additions" class="icon-btns"> <p>批量审核</p> </button> <button id="expurgates" class="icon-btn"> <img src="./img/删除.png" alt="图标描述" width="20" height="20"> <p>批量删除</p> </button> </div> <div class="screen" id="refreshs"> <div class="screen_box"> <img src="./img/搜索-灰色.png" alt="刷新" class="renovate" id="searchs" /> </div> <div class="screen_box"> <img src="./img/刷新.png" alt="刷新" class="renovate" id="refresh" /> </div> <div class="screen_box"> <div class="screen_img"> <img src="./img/设置-灰色.png" alt="刷新" class="renovate" id="install" /> </div> <div class="setting_box"> <p class="setting_title">显示设置</p> <div class="setting_items"> <label> <input type="checkbox" value="id" checked> ID </label> <label> <input type="checkbox" value="company" checked> 公司名称 </label> <label> <input type="checkbox" value="tradeid" checked> 产品名称 </label> <label> <input type="checkbox" value="img" checked> 商品图片 </label> <label> <input type="checkbox" value="name" checked>行业 </label> <label> <input type="checkbox" value="status" checked> 审核状态 </label> <label> <input type="checkbox" value="type" checked> 上架状态 </label> <label> <input type="checkbox" value="create_time" checked> 创建时间 </label> </div> </div> </div> </div> </div> <div class="base_box"> <div id="base_package"> <table class="table_table-bordered"> <thead> <tr> <th> <input type="checkbox" id="selectAll" name="check-all"> </th> <th>id</th> <th>公司名称</th> <th>产品名称</th> <th>商品图片</th> <th>行业</th> <th>审核状态</th> <th>上架状态</th> <th>创建时间</th> <th>操作</th> </tr> </thead> <tbody> </tbody> </table> </div> <!-- 底部分页 --> <div class="pagination_box"> <div id="pagination" class="pagination"></div> </div> </div> <!-- 新增弹窗 --> <div class="windows_box"> <div class="paddle_box"> <p class="title">添加/编辑</p> <div class="form-item"> <p>*产品名称</p> <input type="text" name="productName" id="productName" placeholder="请输入内容名称"> </div> <div class="form-item"> <p>*产品图片</p> <div class="img_pop"> <form id="myForm"> <label> <input type="file" name="file" id="file" style="display: none;" onchange="upload(true)" accept="image/*"> <img src="./img/10050.png" id="pic"> </label> </form> <p class="error" id="img_error">图片</p> </div> </div> <div class="form-item"> <p>*产品介绍</p> <div class="described"> <div class="texta" id="editor"></div> <p class="error" id="text_error">详情</p> </div> </div> <div id="parcel" class="parcel"> <div class="radio-group"> <p>*上下架</p> <input type="radio" name="shelf" value="on" checked> <span>上架</span> <input type="radio" name="shelf" value="off"> <span>不需要</span> </div> <!-- 操作按钮 --> <div class="hint_button"> <button class="hint_right" onclick="zxc()">确认</button> <button class="hint_left" onclick="asd()">确定并继续添加</button> </div> </div> </div> </div> <!-- 删除弹窗 --> <div class="delete-mask" id="deleteMask"> <div class="delete-dialog" id="deleteDialog"> <div class="dialog-content" id="dialogContent"> <h3>确定要删除选中的行业吗?</h3> </div> <div class="dialog-actions" id="dialogActions"> <button class="action-cancel" id="cancelBtn" onclick="cancelDelete()">取消</button> <button class="action-confirm" id="confirmBtn" onclick="confirmDelete()">确定</button> </div> </div> </div> <!-- 失败 --> <div id="error"> <div class="errorCenter"> <img id="errorImg" src="./img/error.png" alt="" /> <span class="errorText"></span> </div> </div> <!-- 成功 --> <div id="success"> <div class="successCenter"> <img id="successImg" src="./img/yes.png" alt="" /> <span class="successText"></span> </div> </div> <script src="./js/public.js"></script> <script src="./js/goodschild.js"></script> <!-- 分页插件 --> <script src="./js/myPagination.js"></script> <!-- 富文本编辑器容器 --> <div class="texta" id="editor"></div> <script> // 初始化 UEditor 富文本编辑器 var ue = UE.getEditor('editor', { initialContent: '<span style="color: #999">请输入内容...</span>', // 初始占位符文本 autoHeight: false, }); // 监听编辑器准备就绪事件,为聚焦、失焦绑定占位符处理逻辑 ue.ready(() => { // 聚焦时,若内容是初始占位符则清空 ue.addListener('focus', () => { if (ue.getContent() === '<p><span style="color: #999">请输入内容...</span></p>') { ue.setContent(''); } }); // 失焦时,若内容为空或仅含换行则恢复占位符 ue.addListener('blur', () => { if (ue.getContent() === '' || ue.getContent() === '<p><br></p>') { ue.setContent('<span style="color: #999">请输入内容...</span>'); } }); }); </script> </body>
08-13
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!--#Include file="include/db.inc"--> <% '============================================================================= ' *检验是否没有从登陆页面登陆而非法浸入* '----------------------------------------------------------------------------- if Session("in_employee")="" then Response.Redirect("index.asp") end if %> <% employee_no=session("in_employee") passwd=session("in_passwd") Y=year(Now()) M=month(Now()) D=day(Now()) TM=Time() if M<10 then M="0"&M else M=M end if if D<10 then D="0"&D else D=D end if start_time=Y&"-"&M&"-"&D&" "&TM ' response.write "start_time=" & start_time & "<br>" session("b_time")=start_time kt1sql="select * from MFG_TB_TRAINING_TEST_TIME" set kt1rs=conn.execute(kt1sql) 'response.write"kt1sql="&kt1sql&"<br>" st_time=kt1rs("eTime") function sqlstr(data) sqlstr="'" & replace(data,"'","''") & "'" end function %> <!============================================================================== *生成动态时间,包括时间到自动跳回index页面* -------------------------------------------------------------------------------> <script language="javascript"> hours=0; minutes=0; seconds=0; flag=0; setTimeout("update()",1000); function autosubmit() {document.form1.submit();} function update(){ now = new Date(); hours=now.getHours(); minutes=now.getMinutes(); seconds=now.getSeconds(); if(hours<10) hours="0"+now.getHours(); else hours=now.getHours(); if(minutes<10) minutes="0"+now.getMinutes(); else minutes=now.getMinutes(); if(seconds<10) seconds="0"+now.getSeconds(); else seconds=now.getSeconds(); myclock=hours+":"+minutes+":"+seconds if (myclock>"<%=st_time%>") location.replace ("ks_skip.asp"); if(document.layers) { document.layers.liveclock.document.write(myclock) liveclock.document.write(myclock) document.layers.liveclock.document.close() } else if(document.all) liveclock.innerHTML=myclock setTimeout("update()",1000); } </script> <html> <head> <title>New MA考试科目列表</title> <link href="images/cssexamin.css" rel="stylesheet" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> </head> <script language="JavaScript"> function newwin(url) { var newwin=window.open(url,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600"); newwin.focus(); return false; } </script> <% '=============================================================================== ' *从User表单抓出用户名子,并存入Session* '------------------------------------------------------------------------------- consql1="select * from MFG_TB_TRAINING_TEST_TIME" set conrs1=conn.execute(consql1) sql="select * from MFG_TB_TRAINING_USER where employee_no='"&employee_no&"' and password='"&passwd&"'" Set rs=conn.execute(sql) 'response.write"sql="&sql&"<br>" ks_name=rs("name") ks_title=rs("title") ks_sect=Ucase(rs("sect")) if ks_sect="GETCH" THEN ks_sect="ETCH" elseif ks_sect="GTF" THEN ks_sect="TF" end if if not rs.eof then session("in_name")=ks_name session("in_emptype")=ks_title else end if rs.close set rs = nothing %> <body class="banquan" background="images/11-07.gif"> <div id="layerinfo" align="center" style="position:absolute; width:100%; height:100%; z-index:3; left: 0px; top: 25px;"> <span id="liveclock" style="width:1335px; color:red; position:absolute; top:22px"></span> <% session("N_eTime")=now() '================================================================================= ' *显示用户基本信息,动态时间* '--------------------------------------------------------------------------------- response.write "<table class='banquan' width=640 height='60' border='0' cellpadding='0' cellpadding='0' align='center' background='images/km_background.jpg'>" response.write "<tr><td align='right'>" response.write "<table class='banquan' border='0' align='right'>" response.write "<tr><td align='right'><b><font color='black' size='2' face='宋体'>Hi,</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>" & ks_name & "</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>(</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>" & employee_no & "</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>)</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>您好!</font></td>" response.write "<td align='left'><b><font color='black' size='2' face='宋体'>当前时间:</font></td></tr></table></td></tr></table>" response.write "<br>" response.write "<table class='banquan' width=450 border='0' cellpadding='0' cellpadding='0' align='center'>" response.write "<tr><td align='center'><b><font color='#018ec6' size='4' face='宋体'>-- MA考试科目一览表 --</font></td></tr></table>" response.write "<br>" '=================================================================================== ' *从Mapping数据库中抓出指定要考试的科目* '----------------------------------------------------------------------------------- response.write "<table class='banquan' bgcolor='#018ec6' width=1200 border='2' cellpadding='0' cellpadding='1' align='center' bgcolor='#6665ff' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr><td width='8%' align='center'><b><font color='white' size='2' face='宋体'>考试类型</font></td>" response.write "<td width='7%' align='center'><b><font color='white' size='2' face='宋体'>考试阶段</font></td>" response.write "<td width='34%' align='center'><b><font color='white' size='2' face='宋体'>考试科目</font></td>" response.write "<td width='8%' align='center'><b><font color='white' size='2' face='宋体'>考试状况</font></td>" response.write "<td width='8%' align='center'><b><font color='white' size='2' face='宋体'>考试分数</font></td>" response.write "<td width='15%' align='center'><b><font color='white' size='2' face='宋体'>考试时间</font></td>" response.write "<td width='15%' align='center'><b><font color='white' size='2' face='宋体'>补考日期</font></td>" response.write "<td width='5%' align='center'><b><font color='white' size='2' face='宋体'>课件</font></td></tr></table>" '抓出user需考的课程 sql4 =" SELECT * FROM mfg_tb_newtraining_final_result WHERE group_name='Basic' AND wr_certify=0 AND empno='"&employee_no&"' " set rs4=conn.execute(sql4) if not (rs4.eof) then Condition1=" AND A.group_name='Basic' " else sql5 =" SELECT * FROM mfg_tb_newtraining_final_result WHERE group_name='Compulsory' AND wr_certify=0 AND empno='"&employee_no&"' " set rs5=conn.execute(sql5) if not (rs5.eof) then Condition1=" AND A.group_name IN ('Basic','Compulsory') " else Condition1=" " end if rs5.close set rs5 = nothing end if rs4.close set rs4 = nothing 'response.write"Condition1========="&Condition1&"<br>" sql1=" SELECT CASE WHEN group_name='Basic' THEN 1 WHEN group_name='Compulsory' THEN 2 WHEN certifygroup_type='Main Group' THEN 3 ELSE 4 END sn, a.* FROM ( "_ &" SELECT A.course_id, '笔试' certify_type, CASE WHEN A.group_name='Basic' THEN '新人训' WHEN A.group_name='Compulsory' THEN '部门必修' "_ &" WHEN A.group_name NOT IN ('Basic','Compulsory') AND certifygroup_type='Main Group' THEN '本岗位' ELSE '跨岗位' END course_group, "_ &" A.group_name, course_name, course_type, certifygroup_type, wr_certify, op_certify, materialurl, 'wr' question_type "_ &" FROM mfg_tb_newtraining_final_result A, mfg_tb_newtraining_course B WHERE A.course_id=B.course_id AND status=0 and B.group_name <> 'Safe' AND empno='"&employee_no&"' "&Condition1&" ) a ORDER BY sn, course_name, certify_type " 'response.write"Condition1========="&sql1&"<br>" set rs1=conn.execute(sql1) while not(rs1.eof) course_id=rs1("course_id") certify_type=rs1("certify_type") course_group=rs1("course_group") group_name=rs1("group_name") course_name=rs1("course_name") course_type=rs1("course_type") certifygroup_type=rs1("certifygroup_type") wr_certify=rs1("wr_certify") op_certify=rs1("op_certify") materialurl=rs1("materialurl") question_type=rs1("question_type") ' response.write"wr_certify===="&wr_certify&"<br>" '抓出user考过的课程考试次数和最后一次考试时间 sql2 =" SELECT To_Char(max(To_Date(end_time,'yyyy-mm-dd hh24:mi:ss')),'yyyy-mm-dd hh24:mi:ss') as end_time, count(end_time) ks_count FROM mfg_tb_newtraining_score "_ &" WHERE examiner='"&employee_no&"' and course_id='"&course_id&"' and question_type='"&question_type&"' and wr_flag=1 " set rs2=conn.execute(sql2) 'response.write"wr_certify===="&sql2&"<br>" if not (rs2.eof or IsNull(rs2("end_time"))) then end_time=rs2("end_time") ks_count=rs2("ks_count") 'response.write"end_time===="&end_time&"<br>" '课程如果有考试记录抓出得分 sql3=" SELECT final_score FROM mfg_tb_newtraining_score WHERE examiner='"&employee_no&"' and course_id='"&course_id&"' and question_type='"&question_type&"' "_ &" and wr_flag=1 and To_Char(To_Date(end_time,'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss')='"&end_time&"' " set rs3=conn.execute(sql3) final_score=rs3("final_score") rs3.close set rs3 = nothing ' response.write"final_score===="&final_score&"<br>" else end_time=NULL ks_count="N/A" end if rs2.close set rs2 = nothing '成绩为1显示已考过,为0显示需补考 if cInt(wr_certify)=cInt(1) then sql5 = " SELECT * FROM certify_tb_item_mapping WHERE pesuper IS NOT NULL AND item = '"&course_name&"' " set rs5 = conn.execute(sql5) If Not rs5.EOF Then ' ========== 新增:查询该课程的操作考状态与最高分 ========== Dim op_passed, op_max_score op_passed = False op_max_score = "N/A" ' 查询是否已通过操作考(STATUS='Y' 或 SCORE>=60) sql_op = "SELECT MAX(SCORE) AS max_score FROM certify_od_rating_list " & _ "WHERE EMPLOYEE_ID = " & sqlstr(employee_no) & " " & _ "AND COURSE_ID = " & sqlstr(course_id) & " " & _ "AND (STATUS = 'Y' OR SCORE >= 60)" Set rs_op = conn.Execute(sql_op) If Not rs_op.EOF And Not IsNull(rs_op("max_score")) Then op_passed = True op_max_score = FormatNumber(rs_op("max_score"), 1) End If rs_op.Close : Set rs_op = Nothing ' ======================================================== ' 构造操作考按钮或状态文本 Dim opText If op_passed Then opText = "<span style='background:yellow; padding:2px 6px; font-weight:bold;'>✔ 已通过</span>" Else opText = "<a href='javascript:void(0);' onclick=""openOpExam('" & course_id & "')"" style='color:green;'>操作考</a>" End If ' ========== 输出表格(新增两列)========== response.write "<table class='banquan' width=1300 border='2' cellpadding='0' cellspacing='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'> " & course_name & "</font></b></td>" response.write "<td width='8%' align='center'><b><font size='2' color='green' face='宋体'>100</font></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>" & end_time & "</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" ' === 新增两列:操作考状态 + 成绩 === response.write "<td width='8%' align='center'><b>" & opText & "</b></td>" ' 操作考状态 response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & op_max_score & "</font></b></td>" ' 操作考成绩 response.write "<td width='5%' align='center'><b><font size='2' face='宋体'><a href='" & materialurl & "' target='_blank'>课件</a></b></td>" response.write "</tr></table>" Else ' 不是操作考 → 正常显示“已考过” If course_group = "跨岗位" Then response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellspacing='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'> " & course_name & "</font></b></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>已考过</font></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='5%' align='center'>" response.write "<a href='" & materialurl & "' target='_blank'>课件</a><br>" response.write "</td></tr></table>" Else response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellspacing='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr><td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'> " & course_name & "</font></b></td>" response.write "<td width='8%' align='center'><b><font size='2' color='blue' face='宋体'>已考过</font></td>" response.write "<td width='8%' align='center'><b><font size='2' color='blue' face='宋体'>100</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>" & end_time & "</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='5%' align='center'><b><font size='2' face='宋体'><a href='" & materialurl & "' target='_blank'>课件</a></b></td></tr></table>" End If End If ' 清理 rs5 rs5.Close Set rs5 = Nothing else if IsNull(end_time) then If course_group = "跨岗位" Then response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellpadding='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'> " & course_name & "</font></b></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>未考试</font></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='5%' align='center'>" response.write "<a href=""javascript:void(0);"" onclick=""openCourseware('" & materialurl & "', '" & course_id & "')"">课件</a><br>" response.write "</tr></table>" Else '课程如果没有考试记录显示未考试 response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellpadding='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr><td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" if question_type<>"op" then response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'><a href='examination.asp?course_id="&course_id&"&question_type="&question_type&"' >" & "  " & course_name & "</font></b></td>" else response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'><a href='examination.asp?course_id="&course_id&"&question_type="&question_type&"' >" & "  " & course_name & "</font></b></td>" end if response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>未考试</font></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<a>课件</font></td></tr></table>" end if else If course_group = "跨岗位" Then response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellpadding='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'> " & course_name & "</font></b></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>需补考</font></td>" response.write "<td width='8%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<td width='5%' align='center'>" response.write "<a>课件</a><br>" response.write "</tr></table>" Else response.write "<table class='banquan' width=1200 border='2' cellpadding='0' cellpadding='1' align='center' bordercolordark='#ecf5ff' bordercolorlight='#6699cc'>" response.write "<tr><td width='8%' align='center'><b><font size='2' face='宋体'>" & course_group & "</font></td>" response.write "<td width='7%' align='center'><b><font size='2' face='宋体'>" & certify_type & "</font></td>" if question_type<>"op" then response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'><a href='examination.asp?course_id="&course_id&"&question_type="&question_type&"' onclick=""return Onkao('" & end_time & "')"">" & "  " & course_name & "</font></b></td>" else response.write "<td width='34%' align='left'><b><font size='2' face='宋体'><img src='images/104.gif' width='13' height='16' border='0'><a href='examination.asp?course_id="&course_id&"&question_type="&question_type&"' onclick=""return Onkao('" & end_time & "')"" >" & "  " & course_name & "</font></b></td>" end if response.write "<td width='8%' align='center'><b><font size='2' color='red' face='宋体'>需补考</font></td>" response.write "<td width='8%' align='center'><b><font size='2' color='red' face='宋体'>" & final_score & "</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>" & end_time & "</font></td>" response.write "<td width='15%' align='center'><b><font size='2' face='宋体'>N/A</font></td>" response.write "<a></a>课件</font></td></tr></table>" end if end if end if rs1.movenext wend rs1.close set rs1 = nothing conrs1.close set conrs1 = nothing %> <script> function Onkao(dtimes){ dtimes = parseInt(dtimes.split("-").join("").slice(0,8))+3; if(formattedTime-(dtimes-3)<3){ alert("请与"+new Date(parseInt(dtimes.toString().slice(0, 4), 10), parseInt(dtimes.toString().slice(4, 6), 10) - 1, parseInt(dtimes.toString().slice(6, 8), 10)).toLocaleDateString()+"后再来补考!") return false; }else { return true; } } </script> <script language="JavaScript"> function openOpExam(courseId) { console.log(courseId); var url = 'km_status_op.asp?course_id=' + courseId + '&question_type=op&employee_id=' + "<%=session("in_employee")%>"; window.open(url, 'opExamWindow', 'width=500,height=400,top=100,left=300,toolbar=no,scrollbars=yes,resizable=yes'); } </script> <table border="0" width="100%"> <tr> <td width="100%" align="center"> <!--<div align="center" style="position:absolute; width:970px; height:30; z-index:1; left: -30px; top: 75px;"> <p><a href="http://10.232.4.175:6666/lxetraining/index.jsp?employee_no=<%=employee_no%>" ><font color="purple" size="4" >P1 MFG基础培训系统</font></a></p> <p><a href="http://10.232.6.116:7777/lxetraining/index.jsp?employee_no=<%=employee_no%>" ><font color="purple" size="4" >P1 MFG基础培训系统</font></a></p> </div>--> <div align="center" style="position:absolute; width:2650px; height:30; z-index:1; left: 80px; top: 75px;"> <!--<p><a href="http://10.232.4.175:6666/lxemoweb/index.jsp?employee_no=<%=employee_no%>" ><font color="purple" size="4" >P1 MO阅读系统</font></a></p>--> <!-- <p><a href="http://10.232.6.116:7777/lxemoweb/index.jsp?employee_no=<%=employee_no%>" ><font color="purple" size="4" >P1 MO阅读系统</font></a></p> --> </div> <a href="index.asp">--返 回--</a> </td> </tr> <tr> <td width="100%" align="center" class='banquan'> <font color="#666666">©Copyright  Semiconductor Manufacturing International (Beijing) Corp. <font color="#018ec6">2024 版权所有 ™</font> v1.0</font> </td> </tr> </table> </div> </body> </html> 这与干修改版的代码 ,结合你说的输出修改后的完整代码 ,不需要有其他的改动,仅实现我们刚才说的
最新发布
12-02
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值