66session_start ();
77$ bg =2 ;
88$ step =20 ;
9- $ version ="3.16.3 " ;
9+ $ version ="3.16.5 " ;
1010$ bbs =['False ' ,'True ' ];
1111$ deny =['sqlite_sequence ' ];
1212$ js =(file_exists ('jquery.js ' )?"/jquery.js " :"https://code.jquery.com/jquery-1.12.4.min.js " );
@@ -272,7 +272,7 @@ public function pg_number($pg,$totalpg) {
272272 elseif ($ this ->sg [0 ]==5 ) $ link =$ this ->path ."5/ " .$ this ->sg [1 ];
273273 $ pgs ='' ;$ k =1 ;
274274 while ($ k <=$ totalpg ) {
275- $ pgs .="<option " .(($ k ==$ pg ) ? "selected='selected' > " :"value=' $ link/ $ k'> " )."$ k</option> " ;
275+ $ pgs .="<option " .(($ k ==$ pg ) ? "selected> " :"value=' $ link/ $ k'> " )."$ k</option> " ;
276276 ++$ k ;
277277 }
278278 $ lft =($ pg >1 ?"<a href=' $ link/1'>First</a><a href=' $ link/ " .($ pg -1 )."'>Prev</a> " :"" );
@@ -400,11 +400,11 @@ public function tb_structure($tb,$fopt,$tab='') {
400400 public function getTables ($ db ) {
401401 $ tbs =[];$ vws =[];
402402 $ dbx =new DBT ($ this ->dir .$ db .$ this ->ext );
403- if ($ this ->post ('tables ' )=='' && $ this ->post ('dbs ' )!='' ) {
403+ if ($ this ->post ('tbs ' )=='' && $ this ->post ('dbs ' )!='' ) {
404404 $ tabs =$ dbx ->query ("SELECT name FROM sqlite_master WHERE type IN ('table','view') " )->fetch (1 );
405405 $ tabs =empty ($ tabs ) ? []:call_user_func_array ('array_merge ' ,$ tabs );
406406 } else {
407- $ tabs =$ this ->post ('tables ' );
407+ $ tabs =$ this ->post ('tbs ' );
408408 }
409409 foreach ($ tabs as $ tb ) {
410410 $ q_st =$ dbx ->query ("SELECT name,type FROM sqlite_master WHERE name=' $ tb' " )->fetch (2 );
@@ -1341,8 +1341,8 @@ public function getTables($db) {
13411341 if (empty ($ ed ->sg [1 ])) {
13421342 $ ed ->check ();
13431343 echo $ ed ->menu (1 ,'' ,2 ).$ ed ->form ("32 " ).$ div ."<h3>Select database(s)</h3>
1344- <p><input type='checkbox' onclick ='selectall(this, \"dbs \")'/> All/None</p>
1345- <select id='dbs' name='dbs[]' multiple='multiple'> " ;
1344+ <p><input type='checkbox' onchange ='selectall(this, \"dbs \");dbx( )'/> All/None</p>
1345+ <select id='dbs' name='dbs[]' multiple='multiple' onchange='dbx()' > " ;
13461346 foreach ($ ed ->listdb () as $ db ) {
13471347 echo "<option value=' $ db'> $ db</option> " ;
13481348 }
@@ -1363,25 +1363,25 @@ public function getTables($db) {
13631363 $ ed ->redir ("5/ $ db " ,["err " =>"No export empty DB " ]);
13641364 }
13651365 echo $ ed ->menu ($ db ,'' ,2 ).$ ed ->form ("32/ $ db " ).$ div ."<h3>Select table(s)</h3>
1366- <p><input type='checkbox' onclick ='selectall(this, \"tables \")' /> All/None</p>
1367- <select id='tables ' name='tables []' multiple='multiple'> " ;
1366+ <p><input type='checkbox' onchange ='selectall(this, \"tbs \" );dbx( \" tbs \")' /> All/None</p>
1367+ <select id='tbs ' name='tbs []' multiple='multiple' onchange='dbx( \" tbs \" ) '> " ;
13681368 foreach ($ r_tts as $ tts ) {
13691369 echo "<option value=' $ tts'> $ tts</option> " ;
13701370 }
13711371 }
1372- echo "</select><h3><input type='checkbox' onclick ='toggle(this, \"fopt[] \")' /> Options</h3> " ;
1372+ echo "</select><h3><input type='checkbox' onchange ='toggle(this, \"fopt[] \")' /> Options</h3> " ;
13731373 $ opts =['structure ' =>'Structure ' ,'data ' =>'Data ' ,'drop ' =>'Drop if exist ' ,'ifnot ' =>'If not exist ' ,'trigger ' =>'Triggers ' ];
13741374 foreach ($ opts as $ k => $ opt ) {
13751375 echo "<p><input type='checkbox' name='fopt[]' value=' $ k' " .($ k =='structure ' ? ' checked ' :'' )." /> $ opt</p> " ;
13761376 }
13771377 echo "<h3>File format</h3> " ;
1378- $ ffo =['sql ' =>'SQL ' ,'sqlite ' =>'SQLite ' ];
1379- if (!empty ($ ed ->sg [1 ])) $ ffo =array_merge ($ ffo ,['json ' =>'JSON ' ,'csv1 ' =>'CSV, ' ,'csv2 ' =>'CSV; ' , ' xls ' => ' Excel Spreadsheet ' , ' doc ' => ' Word 2000 ' , ' xml ' => ' XML ' ]);
1378+ $ ffo =['sql ' =>'SQL ' ,'sqlite ' =>'SQLite ' , ' xls ' => ' Spreadsheet ' , ' xml ' => ' XML ' , ' doc ' => ' Word ' ];
1379+ if (!empty ($ ed ->sg [1 ])) $ ffo =array_merge ($ ffo ,['json ' =>'JSON ' ,'csv1 ' =>'CSV, ' ,'csv2 ' =>'CSV; ' ]);
13801380 foreach ($ ffo as $ k => $ ff ) {
1381- echo "<p><input type='radio' name='ffmt[]' onclick='opt ()' value=' $ k' " .($ k =='sql ' ? ' checked ' :'' )." /> $ ff</p> " ;
1381+ echo "<p><input type='radio' name='ffmt[]' onchange='fmt ()' value=' $ k' " .($ k =='sql ' ? ' checked ' :'' )." /> $ ff</p> " ;
13821382 }
13831383 echo "<h3>File compression</h3><p><select name='ftype'> " ;
1384- $ fty =['plain ' =>'None ' ,'gzip ' =>'GZ ' ,'zip ' =>'Zip ' ];
1384+ $ fty =['plain ' =>'None ' ,'zip ' =>'Zip ' ,'gzip ' =>'GZ ' ];
13851385 foreach ($ fty as $ k => $ ft ) {
13861386 echo "<option value=' $ k'> $ ft</option> " ;
13871387 }
@@ -1393,7 +1393,7 @@ public function getTables($db) {
13931393 $ ftype =$ ed ->post ('ftype ' ); $ ffmt =$ ed ->post ('ffmt ' );
13941394 $ dbs =(empty ($ ed ->sg [1 ])?($ ed ->post ('dbs ' )?$ ed ->post ('dbs ' ):[]):[$ ed ->sg [1 ]]);
13951395 if ($ ffmt [0 ]!='sqlite ' ) {
1396- if (!empty ($ ed ->sg [1 ]) && $ ed ->post ('tables ' )=='' ) {
1396+ if (!empty ($ ed ->sg [1 ]) && $ ed ->post ('tbs ' )=='' ) {
13971397 $ ed ->redir ("31/ " .$ ed ->sg [1 ],['err ' =>"You didn't selected any table " ]);
13981398 }
13991399 if ($ ed ->post ('fopt ' )=='' && in_array ($ ffmt [0 ],['sql ' ,'doc ' ,'xml ' ])) {//export options
@@ -1403,21 +1403,21 @@ public function getTables($db) {
14031403 }
14041404 }
14051405 if (empty ($ ed ->sg [1 ]) && $ ed ->post ('dbs ' )=='' ) $ ed ->redir ("31 " ,['err ' =>"You didn't selected any DB " ]);
1406- if (! in_array ($ ffmt [0 ],['sql ' ,'sqlite ' ])) {
1406+ if (in_array ($ ffmt [0 ],['json ' ,'csv1 ' , ' csv2 ' ])) {
14071407 $ db =$ dbs [0 ];
14081408 $ ed ->con =new DBT ($ ed ->dir .$ db .$ ed ->ext );
14091409 list ($ tbs ,$ vws )=$ ed ->getTables ($ db );
14101410 }
14111411 if ($ ffmt [0 ]=='sql ' ) {//data sql
14121412 $ ffty ="text/plain " ; $ ffext =".sql " ; $ fname =(count ($ dbs )>1 ? 'all ' :$ dbs [0 ]).$ ffext ;
1413- $ sql ="-- EdLiteAdmin $ version SQL Dump \n" ;
14141413 foreach ($ dbs as $ db ) {
1414+ $ sq ="-- EdLiteAdmin $ version SQL Dump \n" ;
14151415 $ ed ->con =new DBT ($ ed ->dir .$ db .$ ed ->ext );
14161416 list ($ tbs ,$ vws )=$ ed ->getTables ($ db );
1417- $ sql .="\n-- Database: $ db \n\n" ;
1417+ $ sq .="\n-- Database: $ db \n\n" ;
14181418 if (!empty ($ fopt )) {
14191419 foreach ($ tbs as $ tb ) {
1420- if (in_array ('structure ' ,$ fopt )) $ sql .=$ ed ->tb_structure ($ tb ,$ fopt );//begin structure
1420+ if (in_array ('structure ' ,$ fopt )) $ sq .=$ ed ->tb_structure ($ tb ,$ fopt );//structure
14211421 $ val ='' ;
14221422 if (in_array ('data ' ,$ fopt )) {//option data
14231423 $ res2 =$ ed ->con ->query ("SELECT * FROM " .$ tb );
@@ -1432,40 +1432,42 @@ public function getTables($db) {
14321432 }
14331433 $ val .=substr ($ ro ,0 ,-1 )."); \n" ;
14341434 }
1435- $ sql .=$ val ."\n" ;
1435+ $ sq .=$ val ."\n" ;
14361436 }
14371437 }
14381438 if ($ vws !='' && in_array ('structure ' ,$ fopt )) {//export views
14391439 foreach ($ vws as $ vw ) {
14401440 $ q_rw =$ ed ->con ->query ("SELECT sql FROM sqlite_master WHERE name=' $ vw' AND type='view' " ,true )->fetch ();
14411441 if ($ q_rw ) {
14421442 if (in_array ('drop ' ,$ fopt )) {//option drop
1443- $ sql .="DROP VIEW IF EXISTS $ vw; \n" ;
1443+ $ sq .="DROP VIEW IF EXISTS $ vw; \n" ;
14441444 }
14451445 if (in_array ('ifnot ' ,$ fopt )) {//option if not
1446- $ sql .=preg_replace ('~(CREATE\sVIEW\s)(.*)~i ' ,'${1}IF NOT EXISTS ${2} ' ,$ q_rw );
1446+ $ sq .=preg_replace ('~(CREATE\sVIEW\s)(.*)~i ' ,'${1}IF NOT EXISTS ${2} ' ,$ q_rw );
14471447 } else {
1448- $ sql .=$ q_rw ;
1448+ $ sq .=$ q_rw ;
14491449 }
1450- $ sql .="; \n\n" ;
1450+ $ sq .="; \n\n" ;
14511451 }
14521452 }
14531453 }
14541454 if (in_array ('trigger ' ,$ fopt )) {//option data
14551455 $ q_ttgr =$ ed ->con ->query ("SELECT name,sql FROM sqlite_master WHERE type='trigger' " )->fetch (1 );
14561456 foreach ($ q_ttgr as $ r_ttgr ) {
14571457 if (in_array ('drop ' ,$ fopt )) {//option drop
1458- $ sql .="DROP TRIGGER IF EXISTS " .$ r_ttgr [0 ]."; \n" ;
1458+ $ sq .="DROP TRIGGER IF EXISTS " .$ r_ttgr [0 ]."; \n" ;
14591459 }
14601460 if (in_array ('ifnot ' ,$ fopt )) {//option if not
1461- $ sql .=preg_replace ('~(CREATE\sTRIGGER\s)(.*)~i ' ,'${1}IF NOT EXISTS ${2} ' ,$ r_ttgr [1 ]);
1461+ $ sq .=preg_replace ('~(CREATE\sTRIGGER\s)(.*)~i ' ,'${1}IF NOT EXISTS ${2} ' ,$ r_ttgr [1 ]);
14621462 } else {
1463- $ sql .=$ r_ttgr [1 ];
1463+ $ sq .=$ r_ttgr [1 ];
14641464 }
1465- $ sql .="; \n" ;
1465+ $ sq .="; \n" ;
14661466 }
14671467 }
14681468 }
1469+ if ($ ftype !="plain " ) $ sql [$ db .$ ffext ]=$ sq ;
1470+ else $ sql =$ sq ;
14691471 }
14701472 } elseif ($ ffmt [0 ]=='csv1 ' || $ ffmt [0 ]=='csv2 ' ) {//csv
14711473 $ ffty ="text/csv " ; $ ffext =".csv " ; $ fname =$ db .$ ffext ;
@@ -1522,8 +1524,11 @@ public function getTables($db) {
15221524 }
15231525 if (count ($ tbs )==1 || $ ftype =="plain " ) $ sql =$ sql [$ fname ];
15241526 } elseif ($ ffmt [0 ]=='doc ' ) {//doc
1525- $ ffty ="application/msword " ; $ ffext =".doc " ; $ fname =$ db .$ ffext ;
1526- $ sql ='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html;charset=utf-8"></head><body> ' ;
1527+ $ ffty ="application/msword " ; $ ffext =".doc " ; $ fname =(count ($ dbs )>1 ? 'all ' :$ dbs [0 ]).$ ffext ;
1528+ foreach ($ dbs as $ db ) {
1529+ $ ed ->con =new DBT ($ ed ->dir .$ db .$ ed ->ext );
1530+ list ($ tbs )=$ ed ->getTables ($ db );
1531+ $ sq ='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html;charset=utf-8"></head><body> ' ;
15271532 foreach ($ tbs as $ tb ) {
15281533 $ q_doc =$ ed ->con ->query ("PRAGMA table_info( $ tb) " )->fetch (2 );
15291534 if (in_array ('structure ' ,$ fopt )) {
@@ -1549,12 +1554,18 @@ public function getTables($db) {
15491554 }
15501555 $ wb .='</table><br> ' ;
15511556 }
1552- $ sql .=$ wh .$ wb ;
1557+ $ sq .=$ wh .$ wb ;
1558+ }
1559+ $ sq .='</body></html> ' ;
1560+ if ($ ftype !="plain " ) $ sql [$ db .$ ffext ]=$ sq ;
1561+ else $ sql =$ sq ;
15531562 }
1554- $ sql .='</body></html> ' ;
15551563 } elseif ($ ffmt [0 ]=='xls ' ) {//xls
1556- $ ffty ="application/excel " ; $ ffext =".xls " ; $ fname =$ db .$ ffext ;
1557- $ sql ='<?xml version="1.0"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> ' ;
1564+ $ ffty ="application/excel " ; $ ffext =".xls " ; $ fname =(count ($ dbs )>1 ? 'all ' :$ dbs [0 ]).$ ffext ;
1565+ foreach ($ dbs as $ db ) {
1566+ $ ed ->con =new DBT ($ ed ->dir .$ db .$ ed ->ext );
1567+ list ($ tbs )=$ ed ->getTables ($ db );
1568+ $ sq ='<?xml version="1.0"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> ' ;
15581569 foreach ($ tbs as $ tb ) {
15591570 $ xh ='<Worksheet ss:Name=" ' .$ tb .'"><Table><Row> ' ;
15601571 $ q_xl1 =$ ed ->con ->query ("PRAGMA table_info( $ tb) " )->fetch (2 );
@@ -1568,51 +1579,57 @@ public function getTables($db) {
15681579 foreach ($ r_xl2 as $ r_x2 ) $ xh .='<Cell><Data ss:Type=" ' .(is_numeric ($ r_x2 )?'Number ' :'String ' ).'"> ' .htmlentities ($ r_x2 ).'</Data></Cell> ' ;
15691580 $ xh .='</Row> ' ;
15701581 }
1571- $ sql .=$ xh .'</Table></Worksheet> ' ;
1582+ $ sq .=$ xh .'</Table></Worksheet> ' ;
1583+ }
1584+ $ sq .='</Workbook> ' ;
1585+ if ($ ftype !="plain " ) $ sql [$ db .$ ffext ]=$ sq ;
1586+ else $ sql =$ sq ;
15721587 }
1573- $ sql .='</Workbook> ' ;
15741588 } elseif ($ ffmt [0 ]=='xml ' ) {//xml
1575- $ ffty ="application/xml " ; $ ffext =".xml " ; $ fname =$ db .$ ffext ;
1576- $ sql ='<?xml version="1.0" encoding="utf-8"?> ' ;
1577- $ sql .="\n<!-- EdLiteAdmin $ version XML Dump --> \n" ;
1578- $ sql .="<export version= \"1.0 \" xmlns:ed= \"https://github.com/edmondsql \"> " ;
1589+ $ ffty ="application/xml " ; $ ffext =".xml " ; $ fname =(count ($ dbs )>1 ? 'all ' :$ dbs [0 ]).$ ffext ;
1590+ foreach ($ dbs as $ db ) {
1591+ $ ed ->con =new DBT ($ ed ->dir .$ db .$ ed ->ext );
1592+ list ($ tbs )=$ ed ->getTables ($ db );
1593+ $ sq ='<?xml version="1.0" encoding="utf-8"?> ' ;
1594+ $ sq .="\n<!-- EdLiteAdmin $ version XML Dump --> \n" ;
1595+ $ sq .="<export version= \"1.0 \" xmlns:ed= \"https://github.com/edmondsql \"> " ;
15791596 if (in_array ('structure ' ,$ fopt )) {
1580- $ sql .="\n\t<ed:structure_schemas> " ;
1581- $ sql .="\n\t\t<ed:database name= \"$ db \"> " ;
1597+ $ sq .="\n\t<ed:structure_schemas> " ;
1598+ $ sq .="\n\t\t<ed:database name= \"$ db \"> " ;
15821599 foreach ($ tbs as $ tb ) {
1583- $ sql .="\n\t\t\t<ed:table name= \"$ tb \"> \n" ;
1584- $ sql .= $ ed ->tb_structure ($ tb ,$ fopt ,"\t\t\t" );
1585- $ sql .="\t\t\t</ed:table> " ;
1600+ $ sq .="\n\t\t\t<ed:table name= \"$ tb \"> \n" ;
1601+ $ sq .= $ ed ->tb_structure ($ tb ,$ fopt ,"\t\t\t" );
1602+ $ sq .="\t\t\t</ed:table> " ;
15861603 }
1587- $ sql .="\n\t\t</ed:database> \n\t</ed:structure_schemas> " ;
1604+ $ sq .="\n\t\t</ed:database> \n\t</ed:structure_schemas> " ;
15881605 }
15891606 if (in_array ('data ' ,$ fopt )) {
1590- $ sq ="\n\t<database name= \"$ db \"> " ;
1607+ $ sq2 ="\n\t<database name= \"$ db \"> " ;
15911608 foreach ($ tbs as $ tb ) {
15921609 $ q_xm1 =$ ed ->con ->query ("PRAGMA table_info( $ tb) " )->fetch (1 );
15931610 $ q_xm2 =$ ed ->con ->query ("SELECT * FROM $ tb " )->fetch (1 );
15941611 foreach ($ q_xm2 as $ r_ =>$ r_xm2 ) {
1595- $ sq .="\n\t\t<table name= \"$ tb \"> " ;
1612+ $ sq2 .="\n\t\t<table name= \"$ tb \"> " ;
15961613 $ x =0 ;
15971614 foreach ($ r_xm2 as $ r_x2 ) {
1598- $ sq .="\n\t\t\t<column name= \"" .$ q_xm1 [$ x ][1 ]."\"> " .addslashes (htmlspecialchars ($ r_x2 ))."</column> " ;
1615+ $ sq2 .="\n\t\t\t<column name= \"" .$ q_xm1 [$ x ][1 ]."\"> " .addslashes (htmlspecialchars ($ r_x2 ))."</column> " ;
15991616 ++$ x ;
16001617 }
1601- $ sq .="\n\t\t</table> " ;
1618+ $ sq2 .="\n\t\t</table> " ;
1619+ }
16021620 }
1621+ $ sq2 .="\n\t</database> " ;
16031622 }
1604- $ sq .="\n\t</database> " ;
1623+ $ sq .=(empty ($ tbs )?'' :$ sq2 )."\n</export> " ;
1624+ if ($ ftype !="plain " ) $ sql [$ db .$ ffext ]=$ sq ;
1625+ else $ sql =$ sq ;
16051626 }
1606- $ sql .=(empty ($ tbs )?'' :$ sq )."\n</export> " ;
16071627 } elseif ($ ffmt [0 ]=='sqlite ' ) {//sqlite
16081628 $ ffty ="application/octet-stream " ; $ ffext =$ ed ->ext ; $ fname =(count ($ dbs )>1 ? 'all ' :$ dbs [0 ]).$ ffext ;
16091629 $ sql =[];
16101630 foreach ($ dbs as $ db ) {
16111631 $ sql [$ db .$ ed ->ext ]=file_get_contents ($ ed ->dir .$ db .$ ed ->ext );
1612- }
1613- if ($ ftype =="plain " || count ($ dbs )==1 ) {
1614- $ sql =$ sql [$ dbs [0 ].$ ed ->ext ];
1615- $ fname =$ dbs [0 ].$ ffext ;
1632+ if ($ ftype =="plain " ) $ sql =$ sql [$ db .$ ed ->ext ];
16161633 }
16171634 }
16181635
@@ -1849,9 +1866,7 @@ public function getTables($db) {
18491866break ;
18501867}
18511868$ ed ->con =null ;
1852- unset($ _POST );
1853- unset($ _SESSION ["ok " ]);
1854- unset($ _SESSION ["err " ]);
1869+ unset($ _POST ,$ _SESSION ["ok " ],$ _SESSION ["err " ]);
18551870?> </div></div><div class="l1 ce"><a href="http://edmondsql.github.io">edmondsql</a></div>
18561871<script src="<?= $ js?> "></script>
18571872<script>
@@ -1916,11 +1931,11 @@ function selectall(cb,lb){
19161931function toggle(cb,el){
19171932var cbox=document.getElementsByName(el);
19181933for(var i=0;i<cbox.length;i++) cbox[i].checked=cb.checked;
1919- if(el="fopt[]") opt();
19201934}
1921- function opt(){
1922- var opt=document.getElementsByName("fopt[]"),ft=document.getElementsByName("ffmt[]"),from=2,to=opt.length,ch="";
1923- for(var j=0;ft[j];++j){if(ft[j].checked) ch=ft[j].value;}
1935+ function fmt(){
1936+ var opt=document.getElementsByName("fopt[]"),ff=document.getElementsByName("ffmt[]"),from=2,to=opt.length,ch="",ft=document.getElementsByName("ftype")[0];
1937+ for(var j=0;ff[j];++j){if(ff[j].checked) ch=ff[j].value;}
1938+ if(document.getElementById('tbs'))dbx('tbs');
19241939if(ch=="sql"){
19251940for(var k=0;k<to;k++) opt[k].parentElement.style.display="block";
19261941}else if(ch=="doc" || ch=="xml"){
@@ -1930,5 +1945,18 @@ function opt(){
19301945for(var i=0;i<to;i++) opt[i].parentElement.style.display="none";
19311946}
19321947}
1948+ function dbx(el='dbs'){
1949+ var ch="",ft=document.getElementsByName("ftype")[0],ff=document.getElementsByName("ffmt[]"),db=document.querySelectorAll("#"+el+" option:checked").length,dbs=document.getElementById('dbs'),arr=["json","csv1","csv2"];
1950+ for(var j=0;ff[j];++j){if(ff[j].checked) ch=ff[j].value;}
1951+ if(ft[0].value!="plain"){
1952+ if((db<2 && (dbs||arr.indexOf(ch)>-1))||(db>1 && (dbs||arr.indexOf(ch)==-1))){
1953+ var op=document.createElement("option");
1954+ op.value="plain";op.text="None";
1955+ ft.options.add(op,0);
1956+ ft.options[0].selected=true;
1957+ }
1958+ }
1959+ if(db>1 && ft[0].value=="plain" && (dbs||arr.indexOf(ch)>-1))ft[0].remove();
1960+ }
19331961</script>
19341962</body></html>
0 commit comments