GetSimple Support Forum

Full Version: Building a form + export data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I'm quite new to the world of getsimple CMS. What I need to do is to create a tiny, 3 max pages website. In one of them there should be a form with following fields:
- name,
- surname,
- email,
- contest answer
- data processing checkbox

how can I create it? One thing is important - i need a possibility of exporing all inputs to an excel file (xls would be great). Any ideas?

thanks!
are you a programmer, do you know php ?
We do not really have any great form plugins, but there are some in progress.

exporting to csv would be fairly easy for someone to write for you.

and excel can typically import xml also, so not a huge deal.
yepp, i am a programmer yet so far I was using wordpress and django. Im brand new to the getsimple Smile
I built a Facebook scraping tool a while back. Nothing special, except I exported the data in Excel XML (SpreadsheetML). It worked really well, you can find more info here: https://msdn.microsoft.com/en-us/library...e.11).aspx. You do need a local XML schema file so that Excel can properly parse it; for an example of how all of this should work: see below the JS I used to convert data to Excel XML, and in attachment the XML scheme.

Code:
    var options = {
 appName: 'FB Wall Scraper',
 docTitle: fbTimelineScraper._pageOwner + ' Facebook Posts',
 cols: [
   {header: 'Date', width: 600},
   {header: 'Text', width: 100},
   {header: 'Links', width: 40},
   {header: 'Likes', width: 40},
   {header: 'Shares', width: 70},
   {header: 'Comments', width: 90},
   {header: 'Hashtags', width: 50}
 ]
}, wnd, data = fbTimelineScraper.get(), type,
output = '<?xml version="1.0"?>'
 + '<?mso-application progid="Excel.Sheet"?>'
 + '\n<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"'
 + '\n\txmlns:o="urn:schemas-microsoft-com:office:office"'
 + '\n\txmlns:x="urn:schemas-microsoft-com:office:excel"'
 + '\n\txmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"'
 + '\n\txmlns:html="http://www.w3.org/TR/REC-html40">'
 + '\n\t<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">'
 + '\n\t\t<Title>' + options.docTitle + '</Title>'
 + '\n\t\t<Author>' + options.author + '</Author>'
 + '\n\t\t<LastAuthor>' + options.author + '</LastAuthor>'
 + '\n\t</DocumentProperties>'
 + '\n\t<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">'
 + '\n\t\t<ProtectStructure>False</ProtectStructure>'
 + '\n\t\t<ProtectWindows>False</ProtectWindows>'
 + '\n\t</ExcelWorkbook>'
 + '\n\t<Styles>'
 + '\n\t\t<Style ss:ID="xl1"><Alignment ss:WrapText="0"/></Style>'
 + '\n\t\t<Style ss:ID="xl2"><Font ss:Color="blue" ss:Underline="Single"/></Style>'
 + '\n\t\t<Style ss:ID="xl3"><Font ss:Color="black" ss:Bold="1"/></Style>'
 + '\n\t\t<Style ss:ID="xl4"><Font ss:Color="white" ss:Underline="None" ss:Size="14"/>'
 + '<Alignment ss:Vertical="Center"/><Interior ss:Pattern="Solid" ss:Color="SlateGray"/></Style>'
 + '\n\t\t<Style ss:ID="xl5"><Font ss:Color="white" ss:Underline="None" ss:Size="10"/><Alignment ss:Vertical="Top" ss:Horizontal="Center"/>'
 + '<Interior ss:Pattern="Solid" ss:Color="SlateGray"/></Style>'
 + '\n\t</Styles>'
 + '\n\t<Worksheet ss:Name="Facebook Posts">'
 + '\n\t\t<Table>'
 + '\n\t\t\t<Column ss:Width="' + options.cols[6].width + '"/>'
 + '\n\t\t\t<Column ss:StyleID="xl1" ss:Width="' + options.cols[0].width + '"/>'
 + '\n\t\t\t<Column ss:StyleID="xl2" ss:Width="' + options.cols[1].width + '"/>'
 + '\n\t\t\t<Column ss:Width="' + options.cols[2].width + '"/>'
 + '\n\t\t\t<Column ss:Width="' + options.cols[3].width + '"/>'
 + '\n\t\t\t<Column ss:Width="' + options.cols[4].width + '"/>'
 + '\n\t\t\t<Column ss:Width="' + options.cols[5].width + '"/>'
 + '\n\t\t\t<Row ss:Height="30" ss:StyleID="xl4"><Cell ss:MergeAcross="1"><Data ss:Type="String">' + options.docTitle + '</Data></Cell>'
 + '<Cell ss:MergeAcross="2"><Data ss:Type="String">' + options.appName + '</Data></Cell></Row>'
 + '\n\t\t\t<Row ss:StyleID="xl4"><Cell ss:MergeAcross="1"><Data ss:Type="String"></Data></Cell>'
 + '<Cell ss:MergeAcross="2" ss:StyleID="xl5"><Data ss:Type="String">by ' + options.author + '</Data></Cell></Row>'
 + '\n\t\t\t<Row></Row><Row>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[6].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[0].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[1].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[2].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[3].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[4].header + '</Data></Cell>'
 + '\n\t\t\t\t<Cell ss:StyleID="xl3"><Data ss:Type="String">' + options.cols[5].header + '</Data></Cell>'
 + '\n\t\t\t</Row>';

for (var i = 0; i < data.length; i++) {
 output += '\n\t\t\t<Row>';
 for (prop in data[i]) {
   type = parseInt(data[i][prop]) === data[i][prop] ? 'Number' : 'String';
   if (prop !== 'links') {
     output += '\n\t\t\t\t<Cell><Data ss:Type="' + type + '">' + data[i][prop] + '</Data></Cell>';
   } else {
     output += '\n\t\t\t\t<Cell';-
     if (data[i][prop] !== '') {
       output += ' ss:HRef="' + data[i][prop] + '"><Data ss:Type="String">' + data[i][prop];
     } else {
       output += '><Data ss:Type="String">';
     }
     output += '</Data></Cell>';
   }
 }
 output += '</Row>';
}
output += '\n\t\t</Table>\n\t</Worksheet>\n</Workbook>';

Note: I'm not sure this code was the latest version, but it should give you enough of an idea of how to make it work.
(2015-08-13, 23:51:15)colorfill Wrote: [ -> ]yepp, i am a programmer yet so far I was using wordpress and django. Im brand new to the getsimple Smile
Have you solved this issue? If not, I may be able to help.