<script>
function openDialog(id,tool,assembly) {
  $("#addBtn").html("<div style='position: absolute;width: 600px;height: 300px;top: calc(50% - 150px); left: calc(50% - 300px);background-color:white; border:2px solid blue'><form align=center action=log.php method=get><h3>Title</h3><input type=hidden name=act value=close /> <input name=id type=hidden readonly value='"+id+"' /> <input name=tool type=hidden readonly value='"+tool+"' required /> <input name=assembly type=hidden readonly value='"+assembly+"' required /> <button class='btn btn-primary' type=submit>submit</button> <button class='btn btn-secondary' onclick='closeDialog()'>cancel</button></form></div>");
  }
function closeDialog() {$("#addBtn").html("");}
</script>
<a href='#' onclick=\"openDialog({$value['id']},'{$value['Tool']}','{$value['Assembly']}')\"  title='Click here to close the Issue'>Close Issue</a>
<div id="addBtn"></div>

if (strstr($_SERVER['HTTP_USER_AGENT'],"Chrome")) {$smsg="<br>Please Use IE";}
$_REQUEST['Log'] = str_replace(PHP_EOL, "<br>", $_REQUEST['Log']);
$oldDetail='/<span style="padding:4px;background:[a-zA-Z;]{3,12}">'.$v.'<\/span>/';
$newDetail='<span style="padding:4px;background:Red">'.$v.'</span>';
if ($red) { $detail=preg_replace($oldDetail,$newDetail,$detail); }    

UPDATE tool SET Symptom= REPLACE(Symptom,'a','b')
UPDATE log SET Status='Red' WHERE Status='Yellow' and (julianday('now')-julianday(Time))>14

折腾了几个小时才发现。python3执行sqlite需要commit,否则修改不生效。
下文csv导入sqlite并把英文日期转为数字

conn= sqlite3.connect("C:\\xx\\s0-data.db")
conn.execute('CREATE TABLE "sessions" ( "Course Code" TEXT, "sdate" DATETIME)')
df = pandas.read_csv("C:\\xxFile.csv")
df.to_sql('sessions', conn, if_exists='append', index=False)
conn.execute('UPDATE sessions set sdate=substr("colname",8)||"-"||substr("colname",4,3)||"-"||substr("colname",1,2)')
conn.execute('UPDATE sessions set sdate=REPLACE(sdate,"JAN","01")')
conn.commit()
conn.close()

from openpyxl import Workbook, load_workbook
wb=load_workbook("C:\\xx\\ISWPR_REP3_NOV04.xlsx")
ws=wb.active
ws.row_dimensions.group(1,22, hidden=True)
for i in range(24,98) :
    if '-TR' not in ws['d'+str(i)].value :
        ws.row_dimensions.group(i, hidden=True)
wb.save("C:\\xx\\xx.xlsx")