JavaScipt auxiliary development tools only

zhaozj2021-02-16  37

2003-11-12 database design </ title> <meta name = "generator" content = "Microsoft FrontPage 5.0"> <meta name = "Author" content = "> <meta name =" keywords "content ="> <meta name = "description" content = "Version = 2003-10-24> < meta http-equiv = "Content-Type" content = "text / html; charset = gb2312"> </ HEAD> <-! author: Edmund, suxiang @ 126.comhttp: //www.baron.com.cn /javascript/en/zh17.htm-->< Body Title = "In order to maintain the future program to maintain" style = "font-size: 16;"> <pre> 2003-10-27 Description: Interface is not friendly, function Use it yourself; there is bug: You can't put it under the path with spaces (such as My Document) The main purpose is to facilitate writing documents: There is no value for the program! You can write some programs, so the program is more standardized. , Save time! Anyone can modify and use 2003-11-6 to have delete functions, but also add a comment, write to object-oriented! You can think about the tolerance into XML, comb! Additional documents (free Load) You can save the function before generating 2003-11-12 To add the function of up and down movement; file type?; To write only the updated things, the special value is written. (How do I do default?) 2003-11 -30 me_all </ pre> <div id = div_edit title = "The main purpose is to facilitate writing documents: There is no value of programs without documentation, which can automatically write some programs, so that the program is more standardized, save anyone can modify and use"> <br> <style></p> <p>Table {border-width: 0; Margin: 0; Padding: 0; Border-Color: Black; Background-Color: # 666699; font-size: 12; cursor: hand;} th {background-color: # c0c0c0; text -Align: Left} .sx {background-color: # f2f2f2} #tblmain {border-width: 0 ;; Margin: 0; Padding: 0; Background-Color: # 6699cc; font-size: 12; cursor: hand; INPUT {baobao: expness (TextStyle (this))} </ stop></p> <p><Table Width = 100% ID = TBLMAIN> <TR> <TD></p> <p><Table Width = 100% Title = "metadata, please modify" ID = meta_data> <tr> <th width = 10%> Save as </ TH> <TH Width = 10%> Open </ TH> <TH Width = 10%> Table name </ th> <th width = 1%> folder </ tH> <TH width = 10%> Author </ t> <th> Function Note </ TH> <TR> <TR Class = SX> <td οnclick = "editcell (this);"> file name </ td> <td οnclick = "OpenFile (this);"> Saved file </ td> <td οnclick = "Editcell (THIS ); "> Tablename </ td> <td οnclick =" editcell (this); "> foldername </ td> <td οnclick =" Editcell (this); "> Su Xiang </ td> <td οnclick =" Editcell (this, 60); "> </ td> </ tr> </ table> <Table ID = Tedit Class = TB Border = 0 width = 100%> <Tr> <TH Title =" "Width = 8%> Field Name </ TH> <TH Title = "" Width = 8%> Chinese Description </ TH> <TH Title = "Width = 5%> Data Type </ TH> <TH Title =" "Width = 5% > Length </ TH> <TH Title = "" Width = 5%>! NULL </ TH> <TH title = "" Width = 5%> Other attributes </ th> <TH THLE = "Width = 5% > Default </ TH> <TH Title = "" Width = 5%> Display </ TH> <TH TITLE = "Verified" Width = 5%> Verification </ TH> <TH TITLE = ">> Note </ TH> <TH Title = "" Width = 5%> Insert </ TH> <TH TITLE = "" Width = 5%> Delete </ TH> </ TR> <TR> <TD Title = "field Name "οnclick =" editcell (this); "> ID </ td> <td title =" Chinese description "οnclick =" editcell (this);> ID </ t D> <</p> <p>TD Title = "Data Type" οnclick = "SelectDataType (this);"> Bigint </ TD> <TD Title = "οnclick =" editcell (this); "> </ td> <TD Title =" is Null "οnclick =" setnull (this); ">! Null </ td> <td title = other attribute: PK table master key" οnclick = "editcell (this);"> PK, i </ td> <TD Title = "Default" οnclick = "editcell (this);"> </ td> <TD title = "display: text" οnclick = "SelectFormElementType (this);"> Hidden </ TD> <TD Title = "Verification: Such as Notempty, Email, ISNumber "οnclick =" SelectValidate (this); "> </ td> <td title =" field name "οnclick =" editcell (this, 30); "> </ td> <td οnclick = insert_row (THIS.PARENTNODE)> Insert </ TD> <TD οnclick = delete_row (this.parentnode)> Delete </ TD> </ TR> </ TABLE></p> <p></ Td> </ tr> </ table> </ div> <script language = "javascript"> <! - / *********** table edit Class start *************************************************************** / var forreading = 1, ForWriting = 2; var Meta_FileName = 0, Meta_TableName = 2, Meta_FolderName = 3; var Attr_Field = 0, Attr_Description = 1, Attr_DataType = 2; var Attr_Length = 3, Attr_NotNull = 4, Attr_Attrs = 5; var Attr_Default = 6 , Attr_html = 7, attr_validate = 8;</p> <p>function getTime () {var d, s = "OF: Edmund suxiang@126.com Date:"; d = new Date (); s = d.getYear () "of" s = (d.getMonth () 1) "Month"; S = D.Getdate () "Day"; return (s); // Return date. }</p> <p>HHTML = '<html> <body> <div ID = div_edit> /n' ;string.prototype.trim = function () // by function check () {return this.replace (/ (^ / s *) | / S * $) / g, "");</p> <p>Function Editcell (Cell, Size) {mysize = 10 if (!! Size && size> 10) mysize = size; input = '<input id = "editcell" onclick = "Event.cancelbubble = true;"'; input = 'onblur = "setcell (this.parentelement, this.value" '; input =' value = "' cell.innerText '" size = "' mysize '"> "; cell.innerhtml = input; document.all. Editcell.focus (); Document.all.editcell.select ();</p> <p>function selectDataType (cell) {strSelect = '<SELECT id = editDateType ONCLICK = "event.cancelBubble = true;"'; strSelect = 'onChange = "setCell (this.parentElement, this.value)"'; strSelect = 'ONBLUR = "THIS.PARENTELEMENT, this.Value" ';</p> <p>strSelect = '<OPTION value = varchar> VARCHAR'; strSelect = '<OPTION value = tinyint> TINYINT'; strSelect = '<OPTION value = int selected> INT'; strSelect = '<OPTION value = bigint> BIGINT'; strSelect = '<Option value = real> real';</p> <p>STRSELECT = '<option value = DATE> DATE'; strsElect = '<option value = datetime> DateTime';</p> <p>strSelect = '<OPTION value = varchar> VARCHAR'; strSelect = '<OPTION value = longtext> LONGTEXT'; strSelect = '<OPTION value = char> CHAR'; strSelect = '</ SELECT>'; cell.innerHTML = strSelect ; document.all.editDateType.focus ();} // form that displays, htmlfunction selectFormElementType (cell) {strSelect = '<SELECT id = editXType ONCLICK = "event.cancelBubble = true;"'; strSelect = 'onChange = "SETCELL (this.parentelement, this.value" '; strsElect =' onbrur = "this.parentelement, this.value" '; strSelect =' <option value => no '; strsElect =' <option value = text> text '; strselect =' <option value = textarea> multi-text '; strsElect =' <option value = hidden> hidden text '; strsElect =' <option value = password> password '; strsElect =' <option value = SELECT> Downlink '; strSelect =' <option value = checkbox> multi-selection '; strSelect =' <option '; strsElect =' <option value = "" SELECTED> no '; strsElect =' < / Select>; cell.innerhtml = strselect; document.all.editXType.focus ();</p> <p>Function show (obj) {// by function selectvalidate (cell) var str = 'FOR (var i = 0; i <obj.Length; i ) {if (obj [i] .selected) Str = str.length> 0? ',' Obj [i] .Value: obj [i] .value;} IF (str .indexof ('none')> = 0) str = ""; RETURN STR;} Function SelectValidate (Cell) { // Set the verification attribute strSelect = '<select multiple id = editvalidate onclick = "Event.cancelbubble = true;" strselect =' onchange = "STRSETELECT =" SETCELL (this) "" StRSELECT = 'onblur = "show (this); setcell (this)" "'; strsElect = '<option value =" "> no'; strsElect = '<option value = Optional successd> non- empty '; strSelect =' <OPTION value = numeric> digital '; strSelect =' <OPTION value = email> Email '; strSelect =' <OPTION value = optional_x> nonempty no space '; strSelect =' <OPTION value = numeric_x > Slight Number '; strSelect =' <option value = email_x> can be email Email '; strSelect =' <option value = ""> no '; strsElect =' </ select> '; cell.innerhtml = strsElect; document. ALL.EDITVALIDATE.FOCUS ();} function setcell (cell, value) {cell.innertext = value} Function setnull (Cell) {Cell.in Nertext = cell.innertext == 'NULL'? '! null': 'null';}</p> <p>Function INSERT_ROW (ROW) {if (! check ()) Return; newrow = row.clonenode (true); row.parentnode.insertbefore (new, row); // Design default attribute row.childNodes [attr_field] .innertext = ''; row.childNodes [Attr_Description] .innerText = ''; row.childNodes [Attr_DataType] .innerText = 'varchar'; row.childNodes [Attr_Attrs] .innerText = ''; row.childNodes [Attr_Length] .innerText = ' 50 '; row.childnodes [attr_notnull] .INnertext =' null '; row.ChildNodes [attr_html] .INNNERTEXT =' text '; setBackColor ();} function delete_row (row) {if (! "You really want to delete ? ')) Return; if (row.parentnode.childnodes.Length> 2) Row.ParentNode.RemoveChild (Row); setbackcolor ()}</p> <p>/ **************** Table Editorial class end *********************************** ****************** /</p> <p>/ ******************* File operation class starts *********************************** *************************** / Function getFolderPath () {// Get the parent path var path = location.pathname if (path.indexof ('/') == 0) Path = path.substring (1, path.length) Return path.substring (0, path.lastindexof ('//'))}</p> <p>function setFileName (val) {document.all.meta_data.childNodes [0] .childNodes [1] .childNodes [0] .innerText = val;} function setOpenHidden () {document.all.meta_data.childNodes [0] .childNodes [ 1] .childnodes [1] .INNNERTEXT = '';} function save_to_file () {</p> <p>fso = new ActiveXObject ( "Scripting.FileSystemObject"); strFileName = accMetaData (Meta_FileName); if (! strFileName) {alert ( 'Enter the metadata table in the file name!'); return;} var path = getFolderPath () Tf = fso.createtextfile (Path "//" StrfileName ". doc.html", true); tf.write (hhtml document.all.div_edit.innerhtml); tf.close ();}</p> <p>Function Load_data (VAL) {if (! VAL) Return; Fso = New ActiveXObject ("scripting.filesystemObject"); var path = getFolderPath () TS = fso.opentextFile (Path '//' val ". doc.html" , Forreading; str = ts.readall ()</p> <p>Ts.close ()</p> <p>Str = str.substring ("<html> <body> <div id = div_edit>". Length, str.length) "<div>" Document.all.div_edit.innerhtml = STR;</p> <p>// accfilename (m); // setopenhidden ();} function getopenfile () {var path = getFolderPath () path = path.replace (/ [% 20] / g, ''); fso = new activXObject ("scripting .FilesystemObject ");</p> <p>f = fso.getfolder (path); fc = new enumerator (f.files); s = "<option value =>"; s = "<option value => Please select"; for (;! fc.atend) ); Fc.moveNext ()) {xxxm = " fc.Item () if (xxxm.lastindexof ('. Doc.html') == (xxxm.length - '. Doc.html'.length)) { // if (~): ~ Remove. Bak xname = xxxm.substring (xxxm.lastIndexof ("//") 1, xxxm.length-9) s = "<option value = xname >" xname;}} return s;} function openFile (cell) {strSelect = '<SELECT id = openFile ONCLICK = "event.cancelBubble = true;"'; strSelect = 'onChange = "load_data (this.value)"'; strSelect = 'onblur = "SETCELL (this.parentelement, /' / ')"';</p> <p>//strsect ='onblur="load_data(this.value "';</p> <p>STRSELECT = getopenfile (); strselect = "</ select>"; cell.innerhtml = strSelect; document.all.openfile.focus ();} / ************************** ** File operation class end ****************************************************** * // ***************** Check the complete class ********************************* ********************* / Function check () {try {msg = ""; var table = document.all.tedit; var objrows = table.childnodes [ 0] .childNodes; irows = objrows.lendth; row = objrows [rows-1]; for (var i = 0; i <row.childNodes.Length; i ) {row.childNodes [i] .INnertext = row.childNodes [i] .innertext.trim ()} if (! row.childnodes [attr_field] .INnertext) {msg = 'unknown first column "field name" cannot be empty! / n';} if (! Row.childNodes [Attr_description] .innertext) {msg = 'Not a second column "Chinese description" can not be empty! / N';} if (! Row.childnodes [attr_datatype] .INnertext) {msg = 'is not line third column " Data type "can not be empty! / N ';} if (! (Row.childnodes [attr_datatype] .INnertext.indexof (" har ") == - 1) &&! / ^ [1-9] [0-9] * [0-9] $ /. Test (row.childnodes [attr_length] .INnertext) {msg = 'Not a fourth column "Data Type Length" is not empty and can only be digital! / N';} if (!! msg) MSG = "Please delete or modify"; if (!! msg) {Alert (msg); returnaf false;} Return true;} catch (e) {Alert ("f Unification check " '/ n / r error' e)}}</p> <p>/ ****************** Check the full class end ********************************** ****************** // *********************************************************** ******************************************************************************** / Function Create_Form () {if (! Check " )) Return; strscript = ''; var strform = 'method = post action = <? = $ me_all?>> / n <input type = "hidden" name = "cmd" value = <? pv ($ cmd)? >> / n <table> / n '; var table = document.all.tedit; var objrows = table.childNodes [0] .childNodes; var stronsubmit ='; ivows = objrows.length; icols = objrows [0] .childnodes.Length; c (var i = 1; i <irows; i ) {row = objrows [i]; cells = row.childNodes; if (! Cells [attr_html] .innerText) Continue; if (Cells [attr_html] .innertext == 'hidden') strisdisplay = 'style = "Display: none;"; else strisdisplay ='; strform = '/ t <tr' strisdisplay '> / n / t / t <td>' Cells [attr_description] .INnertext '<</ td> / n / t / t <td> / n / t / t'; strValue = "value = / '<? Pv ($ fm ['" cells [attr_field]. InnerText "'])?> /'"; strvaluex = "<? pv ($ frm ['" cells [attr_field] .INNNERTEXT "])?>"; switch (cells [attr_html] .INnertext) {cas' TEXT ': CASE' TEXTAREA ': Temp = parseint (cells [attr_length] .innertext) maxlength = TEMP> 0? "Maxlength =" TEMP: ""; if (Temp> 50 || Cells [attr_html] .INnertext == 'Textarea') {strform = ' / t <textarea rows = "3" cols = "60" ' maxlength ""; strform =' name = ' </p> <p>Cells [attr_field] .INNNERTEXT '>' Strvaluex '</ textarea> / n / t / t </ td> / n / t </ tr> / n';} else strform = '/ t <input type = text Name = ' cells [attr_field] .INnertext Maxlength Strvalue > / N / T / T </ TD> / N / T </ TR> / N ";</p> <p>Break; Case 'Password': Strform = '/ T <input type = "password" name =' cells [attr_field] .INnertext maxlength strval > / n / t / t </ td> / n / t </ Tr> / n "; break; case 'checkbox': strform = '/ t <input type = checkbox name =' cells [attr_field] .INnertext "> / n / t / t </ td> / n / t < / Tr> / n "; break; case 'radio': strform = '/ t <input type = radio name =' cells [attr_field] .INNNERTEXT > / N / T / T </ td> / n / t </ Tr> / n "; Break; Case 'Hidden': Strform = '/ T <input type =" hidden "name =' cells [attr_field] .INnertext strval > / n / t / t </ td > / n / t </ tr> / n "; Break; Case 'SELECT': Strform = '/ t <select name =' cells [attr_field] .INnertext; strform ="> <option value = ''> Please Select </ SELECT> / N / T / T </ TD> / N / T </ Tr> / N "; Break;} Switch (Cells [Attr_Validate] .INnertext) {CASE ': Case Null: Break; Case 'optional': ". description = '" strOnSubmit = ". / nthis" Cells [Attr_Field] .innerText Cells [Attr_Description] .innerText "';"; strOnSubmit = ". / nthis" Cells [Attr_Field] .innerText ".OPTIONAL = true"; break; case 'numeric' : Stronsubmit = "/ nthis." Cells [attr_field] .INnertext ". Description = '" cells [attr_description] .INNNERTEXT "';"; stronsubmit = "/ nthis." </p> <p>Cells [Attr_Field] .innerText ". Numeric = true"; break; case 'email': strOnSubmit = "/ nthis." Cells [Attr_Field] .innerText ' Cells [Attr_Description] .innerText ";" description =. "' "; strOnSubmit =" / nthis " Cells [Attr_Field] .innerText " email = true.. "; break;}} strOnSubmit =" "; if (strOnSubmit) strOnSubmit = '<FORM onSubmit ="' strOnSubmit "/ nreturn Verify / "/ n"; Else Stronsubmit = '<form'; strform = '<tr> <td> <input type = "submit" value = "Submit"> / n </ td> <td> < Input type = "reset" value = "reset"> </ td> <tr> '; strform = "/ n </ table> / n </ form>"; strform = strscript stronsubmit strform return strform;} Function CreateValidate () {if (! check ()) Return; Var StrvaliDate = 'Function Validate_form {/ N / T $ STRMSG = ""; / n / t'; var table = Document.All.tedit Var objrows = table.childnodes [0] .childNodes; IROWS = ObjRows.Length; Icols = Objrows [0] .childnodes.length;</p> <p>For (var i = 1; i <irows; i ) {row = objrows [i]; cells = row.childNodes; //if (!cells[attr_field].innertext.touppercase=='id' )continue; if ( ! Cells [Attr_Validate] .innerText) continue; _Field = Cells [Attr_Field] .innerText _Name = Cells [Attr_Description] .innerText switch (Cells [Attr_Validate] .innerText) {case '': case null: break; case 'optional': Strvalate = "IF (Empty ($ frm ['" _field ")) {/ n / t / t $ strmsg. =' <li>" _ name "can not be empty, please check '; / N / T} / n / t "Break; Case 'Numeric': Strvalidate =" IF (! is_numeric ($ frm ['" _ field ")) {/ N / t / t $ strmsg. =' <li> " _Name "should be a number, please check '; / n / t} / n / t" Break; case' email ': strvalidate = "if (! ISemail ($ fm ['" _ field ")) { /N/T.Strmsg.= 'The mail format is wrong, please check'; / n / t} / n / t "Break;}} strvalidate =" if (! EMPTY) STRMSG) RETURN $ STRMSG; Else Return 0; / N} / n "Return StrvaliDate;} Function Accmetata (i, val) // by function create_ddl () {var E = Document.all.Meta_data.childNodes [0]. ChildNodes [1] .childnodes [i]; if (! VAL) Return E.INNNERTEXT; Else E.INNERTEXT = VAL; RETURN I Function Trim_COMMA (VAL) {Return Val.Substring (0, Val.lastIndexof ('))}</p> <p>function create_DDL (type) {var strCreateTableName = accMetaData (Meta_TableName); var strCreateTable = "Drop TABLE" strCreateTableName "/ n / n" strCreateTable = "CREATE TABLE" strCreateTableName "(/ n"; var strUpdate = "UPDATE" StrcreateTablename "set / n"; var strinsertbefore = "INSERT INTO" STRCREATABLENAME "(/ N"; var strinsertafter = "/ n) VALUES (/ N"; var strwhere = "/ nwhere id = $ ID"; if (! Check ()) return; if (! strcreatetablename) {alert ('Please enter a table name in the first table metadata; return} var table = document.all.tedit; var objrows = table.childNodes [0] .childnodes; irows = Objrows.Length; Icols = objrows [0] .childnodes.length;</p> <p>For (var i = 1; i <irows; i ) {row = objrows [i]; _filedname = row.childNodes [attr_field] .INNNERTEXT // get field name _Datatype = row.childes [attr_datatype] .innertext // acquired data type _DataLength = Row.childNodes [Attr_Length] .innerText // acquired data length _NotNull = Row.childNodes [Attr_NotNull] .innerText // made _Attrs = Row.childNodes [Attr_Attrs] .innerText _IsClient = !! (Row.childNodes [Attr_Html] .innertext = row.childnodes [attr_default] .INnertext; // default (write default and data default) _defaultvale = (_ defaultText.length> 0) && (! _ isclient))? _ defaultText: "" / / The client is not displayed, and it is default _default = _defaulttext.length> 0? "Default" _defaultText "": "; // alert (_default " | _ defaulttext) IF ((_ filedname! = 'id') && (_ isclient)) {// Get Update SQL Statement IF ((_ Datatype.indexof ('Char')> = 0) || (_DataType.Indexof ('Text')> = 0) || (_DataType .indexof ('area')> = 0) || (_Datatype.indexof ('Date')> = 0)) Strupdate = "/ t" _ filedname "= '$ fm [" _ filedname "], / n "; Else structure =" / t " _ filedname " = $ frm [" _ fileDname "], / n ";} if (_filedname! = 'Id') {Get Insert SQL Statement Strinsert Before = "/ t" _ filedname ", / n"; if (_ Datatype.indexof ('char')> = 0) || (_Datatype.indexof ('text')> = 0) || (_Dattype.indexof ('Area')> = 0)) // || (_Datatype.indexof ('Date')> = 0) StrinsertAfter = _ DefaultVale? "/ t / '" _ _ defaultvale "', / n": "/ t / '$ fm [" _ filedname "]'</p> <p>, / N "; Else Strinsertafter = _ defaultvale?" / t " _ defaultvale ", / n ":" / t $ fm [" _ filedname "], / n ";} switch (_Datatype) {copy 'char': Case 'varchar': strcreatetable = "/ t" _ filedname '' _Datatype "(" _ DEFAULT; strcreatetable = _ notnull.indexof ('null')> 0? "NOT NULL, / N":, / n "Continue; default: strcreatetable =" / t " _ filedname '' _Dattype _default; = 0) {strcreatetable =" primary key ";} if (_attrs.indexof) (' ')> = 0) strcreatetable = "auto_increment"; strcreateTable = _ notnull.indexof ('null')> 0? "NOT NULL, / N":, / n "Continue;}} strcreatetable = trim_comma strCreateTable); strUpdate = trim_comma (strUpdate); strInsertBefore = trim_comma (strInsertBefore); strInsertAfter = trim_comma (strInsertAfter); strUpdate = strWhere; strInsert = strInsertBefore strInsertAfter ")"; strCreateTable = "/ n)" strDDL = strCreateTable "/ n / N " STRUPDATE " / N / N " Strinsert</p> <p>IF (! type) return; if ('SERT')> 0) Return Strinsert; if (Type.indexof ('pdat')> 0) Return Strupdate;} function getvadateFunction () {Return CreateValidate () } function gerinsertFunction () {sql = crete_ddl ('insert'); SQL = SQL.Replace (// n / g, '/ n / t'); str = "Function INSERT ($ fm) / n {/ n "; STR =" / t $ sql = / "" " SQL " / "; / n" STR = "/ TDB_QUERY ($ SQL); / n} / n / n" Return Str;} function getsqlupdate () {SQL = CREATE_DDL ('update'); SQL = SQL.Replace (// n / g, '/ n / t') Return SQL;}</p> <p>Function createaddfile () {var strscriptname = acmetadata; var straddheader = "<? php / n / ** / nmain" getTime () "/ n ** // n / n"; var straddispostback = "incrude (/ "../application.php/" ";/n/nrequire_login();/n/n "; straddispostback =" if (match_refere () && isset ($ http_post_vars)) {/ n / t "; straddispostback = "$ fm = $ http_post_vars; / n / n / t"; straddispostback = "$ ErrValidate = validate_form ($ fm); / n / t"; straddispostback = "if (Empty ($ ErrValidate)) {; / n / t / t "; straddispostback =" INSERT ($ fm); / n / t / t "; straddispostback =" $ noticemsg = 'added successful'; / n / t / t // redirect ($ URL, $ Message = / " / ", $ delay = 0) {/ N / T / T"; //straddispostback ="/include (/") (@Phpdir/Header.php/" );/t "; // straddispostback = "// include (/" templates / " strscriptname " _ form.php / "); / n / t"; //straddispostback ="/include (/" full-screen ttemplatedIR/footer.php/ ") ; / n / t "; straddispostback =" die; / n / t} / n} / n / n "var straddnopostback = '' //" // incrude (/ "$ cfg-> templatedir / header.php /" ); / n "; //stradDnopostback ="/include (/" full!" $ "; STRADDNOPOSTBACK = "include (/" $ cfg-> tmpdir / form_header.php / "); / n"; straddnopostback = "include (/" templates / " strscriptname " _ form.php / "); / n"; // STRADDNOPOSTBACK = "// include (/" $ cfg-> templatedir / footer.php / "); / n"; var strfunction = "/ ** / nfunction / n ** // n / n" var strValidateFunction =</p> <p>getVadateFunction () var strInsertFunction = gerInsertFunction () strFunction = strValidateFunction strInsertFunction var strMain = strAddHeader strAddIsPostBack strAddNoPostBack var strAdd = strMain strFunction "/ n>?"; return strAdd;}</p> <p>Function createUpdatefile () {var strscriptname = Accmetadata; var strupdatemain = "<? php / n / ** / nmain" getTime () "/ n ** // n / ninclude_once (/ "/ ./. /Web.conf.php/" );/nrequire_login( );/n/n "; strupdatemain =" = "$ http_post_vars)) {/ n / t"; strupdatemain = "$ frm = $ HTTP_POST_VARS; / N / N / T "; StrupdateMain =" $ Errvalidate = Validate_form ($ fm); / n / t "; strupdatemain =" if (Empty ($ ErrValidate)) {/ n / t / t "; strUpdateMain = "Update ($ fm); / n / t / t"; strupdatemain = "$ noticemsg = 'modified success'; / n / t / t // goback / n / t / t"; strupdatemain = "Die; / N / t} / n} / n / n / t / nelse $ fm = loadingdata (); / n / n "; strupdatemain =" include (/ "$ cfg-> tmpdir / form_header.php /"); / n " Strupdatemain = "include (/" templates / " strscriptname " _ form.php / "); / n"; var strloaddatafun = "Function loadData () {/ n / t"; strloadDatafun = "global $ session; / n / T "; strloadDatafun =" $ ID = $ session ['user'] ['id']; / n / t "strloadDatafun = '$ sql =" select * from' strscriptname 'where id = ID "; / N / t '; strloadDatafun = "$ qi = db_query ($ SQL); / n / t"; strloadDatafun = "Return DBFETCHARRAY ($ QID); / n} / n / n ";</p> <p>Var strupdatefun = "Function Update ($ fm) {/ n / t"; strupdatefun = "global $ session; / n / t"; strupdatefun = "$ ID = $ session ['user'] ['id']; / n / t "; strupdatefun =" $ sql = / "" getsqlupdate () "/"; / n / t "; strupdatefun =" Return DB_QUERY ($ SQL); / n} / n / n "; var strVAlidateFun = getVadateFunction () var strUpdateFunction = "/ ** / nFUNCTION / n ** // n / n" strUpdateFunction = strValidateFun strLoadDataFun strUpdateFun var strUpdate = strUpdateMain strUpdateFunction return strUpdate ">?";}</p> <p>Function create_doc (val) {foldername = "templates" val = acmetadata (meta_tablename) if (! val) return; var curfolderpath = getFolderPath ()</p> <p>Fso = new activXObject ("scripting.filesystemObject"); folderpath = curfolderpath "//" val "_ add.php", true); tf.write (); tf.close ();</p> <p>Tf = fso.createtextfile (CurfolderPath "//" VAL "_ Update.php", true); tf.write ()); tf.close ();</p> <p>} / ****************** Generate results class end ************************ ******************* /</p> <p>// -> </ script> <input type = "button" value = "save" οnclick = save_to_file ()></p> <p><Input Type = "Button" value = "Generate" οnclick = CREATE_DOC ()></p> <p><SCRIPT LANGUAGE = "JavaScript"> function create_new () {var doc_main = document.all.tblMain var tempDoc = doc_main.childNodes [0] var newDoc = tempDoc.cloneNode (true); doc_main.insertBefore (newDoc, tempDoc);}</p> <p>Function textStyle (obj) {if (obj.type == "button" || obj.type == "submit" || Obj.Type == "reset") {Obj.Style.Fontweight = "bold"; OBJ. style.backgroundColor = "# 6699CC"; obj.style.borderTopColor = "# 66CCCC"; obj.style.borderBottomColor = "# 66FFCC"; obj.style.borderLeftColor = "# 66CCCC"; obj.style.borderRightColor = "# 66FFCC ";}} </ SCRIPT> <div id = div_save> </ div> <SCRIPT LANGUAGE =" JavaScript "defer = true> function SetBackColor () {var table = document.all.tedit; var objRows = table.childNodes [0] .childNodes; var tag = 0; for (var i = 0; i <objrows.Length; i ) {e = objrows [i] if (tag == 0) {E.Style.BackgroundColor = '# fffff7 '; Tag = 1;} else {tag = 0; E.Style.BackgroundColor =' # feput0 ';}}} setBackColor (); </ script></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-20546.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="20546" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.050</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '68HlhRaNzHEOI3zmON5sqNpmK9J4aR_2BRLfzEa49_2Brpt383AfhhfWkmD_2FPCqX1JOfcEOSmi_2F5Q_2FfaJyiz5gwC3A_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>