Demand:
1. Get all files uploaded by VTA, usually pictures and txt files, PDF files.
2. Get the file teller to VTM end push PDF,VTM client not confirm the PDF file name is not changed before the customer confirmed that the file name becomes _signature.pdf, when the customer confirmed the PDF, after the confirmation of the _signature.pdf PDF Overwrite the original PDF without confirmation.
Code:
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <title></title> <Scriptsrc= "Jquery.js"CharSet= "Utf-8"></Script> <Scripttype= "Text/javascript"> $(function() { $("#btncc"). Click (function() { varData= [ "610121_idcheck.jpg", "Customer Declaration for VTM a.pdf", "Customer Declaration for VTM a_signature.pdf", "ebanking.pdf", "ebanking_signature.pdf", "ebankingggg.pdf", "hfe.pdf", "Hfesupplementinffffffffffffffffffffffffffdddddddddddddddddddddddddddddddddddddddddddddddddddddffffffffffffffffffffffo Rmation.pdf", "hfesupplementinfffffffffffffffffffffffffffffffffffffffffffffffformation.pdf", "hfesupplementinformation.pdf", "hfesupplementinformation_signature.pdf", "hfe_signature.pdf", "ebankingggg_signature.pdf" ] varHTML=[], arr1=[], arr2=[], ARR3=[], ARR4=[], ARR5=[], LinkArray= []; ARR1=Data.filter (function(item) {returnItem.lastindexof ('. pdf') == -1; }); ARR2=Data.filter (function(item) {returnItem.lastindexof ('. pdf') != -1 &&Item.lastindexof ('_signature.pdf') == -1; }); ARR3=Data.filter (function(item) {returnItem.lastindexof ('_signature.pdf') != -1; }); Arr3.map (function(valsignature) {Arr2.map (function(Valpdf, inx) {if(Valsignature.substring (0, Valsignature.length- -) ==valpdf.substring (0, Valpdf.length- 4) {arr2.splice (Inx,1); } }); }); ARR4=Arr1.concat (ARR2); ARR5=Arr4.concat (ARR3); Arr5.map (function(Val, inx) {Html.push ("<tr><td><a class= ' file-link file-visited ' href= ' xxxx ' title= '" +Val+ "' target= ' _blank ' >" +Val+ "</a></td></tr>"); }); $("#check-list-table"). Empty (). Append (Html.join ()); }); }); </Script></Head><Body> <Buttontype= "button"name= "button"ID= "BTNCC">Dot me.</Button> <Divclass= "Dialog-content"> <TableID= "Check-list-table"> </Table> </Div></Body></HTML>
:
Remove data with similar file names in the array