+
+
\ No newline at end of file
diff --git a/application/views/pfreportprint.php b/application/views/pfreportprint.php
new file mode 100644
index 00000000..e1f09f64
--- /dev/null
+++ b/application/views/pfreportprint.php
@@ -0,0 +1,85 @@
+BAddress;
+ //die();
+ }
+ }
+
+
+?>
+
+
+
+
+
+
PF Letter
+
+To The Consultant,
+ For Provident Fund,
+ Chennai.
+
+
+
+ Sir/Madam,
+
+ For Your kindly information please credit employees PF of for Siddharth Indistries.
+
+
+
Employee List given Below:
+
+
+
+
+
Employee Name
+
PF Account No
+
Employee PF
+
Company Share
+
Total Amount
+
+
+
+
+
+
+
FName . " ".$data->Lname;?>
+
PFNO;?>
+
PF,2,'.','');?>
+
CompanyPF,2,'.','');?>
+
PF + $data->CompanyPF),2,'.','');?>
+
+
+
+
+
+
Total Amount:
+
Total Amount:
+
+
+
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/.gitattributes b/assets/lightswitch/lightswitch/.gitattributes
new file mode 100644
index 00000000..412eeda7
--- /dev/null
+++ b/assets/lightswitch/lightswitch/.gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/assets/lightswitch/lightswitch/.gitignore b/assets/lightswitch/lightswitch/.gitignore
new file mode 100644
index 00000000..40b878db
--- /dev/null
+++ b/assets/lightswitch/lightswitch/.gitignore
@@ -0,0 +1 @@
+node_modules/
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/.jshintrc b/assets/lightswitch/lightswitch/.jshintrc
new file mode 100644
index 00000000..992413ca
--- /dev/null
+++ b/assets/lightswitch/lightswitch/.jshintrc
@@ -0,0 +1,24 @@
+{
+ "bitwise" : true,
+ "camelcase" : true,
+ "curly" : true,
+ "eqeqeq" : true,
+ "es3" : true,
+ "eqnull" : true,
+ "forin" : true,
+ "freeze" : true,
+ "immed" : true,
+ "indent" : 2,
+ "jquery" : true,
+ "latedef" : true,
+ "newcap" : true,
+ "noarg" : true,
+ "noempty" : true,
+ "nonbsp" : true,
+ "nonew" : true,
+ "quotmark" : "single",
+ "sub" : true,
+ "trailing" : true,
+ "undef" : true,
+ "unused" : true
+}
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/.travis.yml b/assets/lightswitch/lightswitch/.travis.yml
new file mode 100644
index 00000000..992827cf
--- /dev/null
+++ b/assets/lightswitch/lightswitch/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - "0.12"
+ - "0.11"
+ - "0.10"
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/CHANGELOG.md b/assets/lightswitch/lightswitch/CHANGELOG.md
new file mode 100644
index 00000000..19573a27
--- /dev/null
+++ b/assets/lightswitch/lightswitch/CHANGELOG.md
@@ -0,0 +1,56 @@
+## 2017-07-14 - Release 0.13.0
+* Skip columns where headers are not present.
+
+## 2017-05-10 - Release 0.12.0
+* Added `extractor` option.
+
+## 2015-06-05 - Release 0.11.1
+* Fixed `colspan` & `rowspan` support for complicated tables.
+
+## 2015-02-06 - Release 0.11.0
+* Added `textExtractor` option.
+
+## 2014-11-21 - Release 0.10.0
+* Added `ignoreEmptyRows` option.
+
+## 2014-9-24 - Release 0.9.0
+* Added `includeRowId` option.
+
+## 2014-4-14 - Release 0.8.3
+* Updated to correct version number.
+
+## 2014-4-14 - Release 0.8.2
+* Updated `onlyColumns` & `ignoreColumns` to work with colspans ([demo](http://jsfiddle.net/Mottie/4E2L6/10/)).
+
+## 2014-4-13 - Release 0.8.1
+* Added basic `.gitattributes` file.
+* Updated `colspan` & `rowspan` support to work when applied to the same cell ([demo](http://jsfiddle.net/Mottie/4E2L6/9/)).
+
+## 2014-4-6 - Release 0.8.0
+* Added `colspan` & `rowspan` support.
+* Fixed missing license banner.
+* Updated Grunt plugins.
+* Added more JSHint requirements and cleaned code.
+
+## 2014-3-26 - Release 0.7.0
+* Added `allowHTML` option to preserve HTML tags from table cells.
+* Fixed Travis & Grunt tests.
+
+## 2013-07-25 - Release 0.6.0
+* Added `headings` option to define the headings of a table. When supplied, treats entire table as values.
+
+## 2013-04-23 - Release 0.5.1
+* Halved execution time.
+* Added more JSHint requirements.
+
+## 2013-04-15 - Release 0.5.0
+* **The release breaks backwards compatibility for both option names and data-* attributes.**
+* Changed option `ignoreColNum` to `ignoreColumns`.
+* Merged `data-cell-value` and `data-column-name` into a single attribute: `data-override`.
+* Added a new option `onlyColumns` to set which columns are included and ignores all others.
+
+## 2013-04-12 - Release 0.4.0
+* No longer requires the use of `th` elements - always uses the first row as column names.
+
+## 2013-02-15 - Release 0.3.0
+* Added tests and fixed many bugs.
diff --git a/assets/lightswitch/lightswitch/Gruntfile.js b/assets/lightswitch/lightswitch/Gruntfile.js
new file mode 100644
index 00000000..f0edc3e9
--- /dev/null
+++ b/assets/lightswitch/lightswitch/Gruntfile.js
@@ -0,0 +1,81 @@
+/*global module:false*/
+module.exports = function(grunt) {
+ 'use strict';
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON( 'package.json' ),
+
+ clean: {
+ build: [ 'lib' ]
+ },
+
+ concat: {
+ options: {
+ banner: '/**\n' +
+ ' * <%= pkg.name %>\n' +
+ ' * <%= pkg.description %>\n' +
+ ' *\n' +
+ ' * @author <%= pkg.author.name %>\n' +
+ ' * @copyright <%= pkg.author.name %> <%= grunt.template.today("yyyy") %>\n' +
+ ' * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>\n' +
+ ' * @link <%= pkg.homepage %>\n' +
+ ' * @module <%= pkg.name %>\n' +
+ ' * @version <%= pkg.version %>\n' +
+ ' */\n'
+ },
+ dist: {
+ src: [
+ 'src/jquery.tabletojson.js'
+ ],
+ dest : 'lib/jquery.tabletojson.js'
+ }
+ },
+ jshint: {
+ files: {
+ src: [
+ 'Gruntfile.js',
+ 'src/**/*.js',
+ 'test/specs/*.js'
+ ]
+ },
+ options: {
+ jshintrc: '.jshintrc'
+ }
+ },
+ uglify: {
+ options: {
+ banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= pkg.author.name %> */\n',
+ report: 'gzip'
+ },
+ dist: {
+ files: {
+ 'lib/jquery.tabletojson.min.js': ['','lib/jquery.tabletojson.js']
+ }
+ }
+ },
+ qunit: {
+ files: ['test/index.html']
+ },
+ watch: {
+ scripts: {
+ files: ['src/**/*.js'],
+ tasks: ['build']
+ }
+ }
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-clean' );
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+
+ // Default task.
+ grunt.registerTask('build', ['clean:build', 'concat', 'uglify']);
+ grunt.registerTask('test', ['jshint', 'qunit']);
+ grunt.registerTask('default', ['test', 'build']);
+
+};
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/MIT-LICENSE b/assets/lightswitch/lightswitch/MIT-LICENSE
new file mode 100644
index 00000000..ff2a0cd6
--- /dev/null
+++ b/assets/lightswitch/lightswitch/MIT-LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2017 Daniel White
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/assets/lightswitch/lightswitch/README.md b/assets/lightswitch/lightswitch/README.md
new file mode 100644
index 00000000..06a8f42c
--- /dev/null
+++ b/assets/lightswitch/lightswitch/README.md
@@ -0,0 +1,163 @@
+# Table To JSON
+
+[](https://travis-ci.org/lightswitch05/table-to-json)
+[](https://gitter.im/lightswitch05/table-to-json?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+
+jQuery plugin to serialize HTML tables into javascript objects.
+
+## Links
+- Demo: http://lightswitch05.github.io/table-to-json/
+- Plunker Template: http://plnkr.co/edit/iQFtcEEZkvsMJ2UqcrlW?p=preview
+
+## Features
+- Automatically finds column headings
+ - Override found column headings by using `data-override="overridden column name"`
+ - Always uses first row as column headings regardless of `th` and `td` tags
+- Override cell values column names by using `data-override="new value"`
+- Ignorable columns
+- Not confused by nested tables
+- Works with `rowspan` and `colspan`
+
+## Options
+- `ignoreColumns`
+ - Array of column indexes to ignore.
+ - Default: `[]`
+- `onlyColumns`
+ - Array of column indexes to include, all other columns are ignored. This takes presidence over `ignoreColumns` when provided.
+ - Default: `null` - all columns
+- `ignoreHiddenRows`
+ - Boolean if hidden rows should be ignored or not.
+ - Default: `true`
+- `ignoreEmptyRows`
+ - Boolean if empty rows should be ignored or not.
+ - Default: `false`
+- `headings`
+ - Array of table headings to use. When supplied, treats entire table as values including the first `
`
+ - Default: `null`
+- `allowHTML`
+ - Boolean if HTML tags in table cells should be preserved
+ - Default: `false`
+- `includeRowId`
+ - Either a `boolean` or a `string`. If `true`, the the `id` attribute on the table's `
` elements will be included in the JSON as `rowId`. To override the name `rowId`, supply a string of the name you would like to use.
+ - Default: `false`
+- `textDataOverride`
+ - String containing data-attribute which contains data which overrides the text contained within the table cell
+ - Default: 'data-override'
+- `textExtractor`
+ - alias of `extractor`
+- `extractor`
+ - Function : function that is used on all *tbody* cells to extract text from the cells; a value in `data-override` will prevent this function from being called. Example:
+
+ ```js
+ $('table').tableToJSON({
+ extractor : function(cellIndex, $cell) {
+ // get text from the span inside table cells;
+ // if empty or non-existant, get the cell text
+ return $cell.find('span').text() || $cell.text();
+ }
+ });
+ ```
+
+ ```js
+ $('table').tableToJSON({
+ extractor : function(cellIndex, $cell) {
+ return {
+ name: $cell.find('span').text(),
+ avatar: $cell.find('img').attr('src')
+ };
+ }
+ });
+ ```
+
+ - Object : object containing a zero-based cell index (this *does not* take `colspan` cells into account!) of the table; a value in `data-override` will prevent this function from being called. Example:
+
+ ```js
+ $('table').tableToJSON({
+ extractor : {
+ 0 : function(cellIndex, $cell) {
+ return $cell.find('em').text();
+ },
+ 1 : function(cellIndex, $cell) {
+ return $cell.find('span').text();
+ }
+ }
+ });
+ ```
+
+ - Default: `null`
+
+## Example
+
+```html
+
+
+
+
First Name
+
Last Name
+
Points
+
+
+
+
Jill
+
Smith
+
50
+
+
Eve
+
Jackson
+
94
+
+
John
+
Doe
+
80
+
+
Adam
+
Johnson
+
67
+
+
+
+
+```
+
+## Contributing
+
+* Install [Node.js](http://nodejs.org/).
+ * this will also the `npm` package manager.
+* run `npm install` from app root directory.
+ * This installs grunt and other dependencies See `package.json` for a full list.
+* run `npm install -g grunt-cli`.
+* run `grunt` to run tests and create a new build in `/lib`.
+* Make the changes you want.
+* Make tests for the changes.
+* Submit a pull request, please submit to the `develop` branch.
+
+### Looking for a server-side solution?
+
+[Colin Tremblay](https://github.com/tremblay) is working on a PHP implementation at [HTML-Table-To-JSON](https://github.com/tremblay/HTML-Table-to-JSON)
+
+### Special Thanks
+* [imamathwiz](https://github.com/imamathwiz) for adding `allowHTML` option and various other changes.
+* [nenads](https://github.com/nenads) for adding `headings` option.
+* [Mottie](https://github.com/Mottie) for adding `rowspan` & `colspan` support. Also adding the `textExtractor` & `dataOverride` feature!
+* [station384](https://github.com/station384) for adding `includeRowId` support.
+* [dayAlone](https://github.com/dayAlone) for adding `ignoreEmptyRows` option.
+* [danielapsmaior](https://github.com/danielapsmaior) for discovering and fixing a `rowspan` & `colspan` bug.
+* [koshuang](https://github.com/koshuang) for adding `extractor` feature!
+* [noma4i](https://github.com/noma4i) added feature "Skip columns where headers are not present"
+
diff --git a/assets/lightswitch/lightswitch/bower.json b/assets/lightswitch/lightswitch/bower.json
new file mode 100644
index 00000000..e0b1446f
--- /dev/null
+++ b/assets/lightswitch/lightswitch/bower.json
@@ -0,0 +1,27 @@
+{
+ "name": "table-to-json",
+ "version": "0.13.0",
+ "main": [
+ "./lib/jquery.tabletojson.min.js"
+ ],
+ "dependencies": {
+ "jquery": "*"
+ },
+ "homepage": "https://github.com/lightswitch05/table-to-json",
+ "authors": [
+ "Daniel White "
+ ],
+ "description": "jQuery plugin that reads an HTML table and returns a javascript object representing the values and columns of the table",
+ "license": "MIT",
+ "keywords": [
+ "table-to-json"
+ ],
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests",
+ "src"
+ ]
+}
diff --git a/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js b/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js
new file mode 100644
index 00000000..ba8442b5
--- /dev/null
+++ b/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js
@@ -0,0 +1,193 @@
+/**
+ * table-to-json
+ * jQuery plugin that reads an HTML table and returns a javascript object representing the values and columns of the table
+ *
+ * @author Daniel White
+ * @copyright Daniel White 2017
+ * @license MIT
+ * @link https://github.com/lightswitch05/table-to-json
+ * @module table-to-json
+ * @version 0.13.0
+ */
+(function( $ ) {
+ 'use strict';
+
+ $.fn.tableToJSON = function(opts) {
+
+ // Set options
+ var defaults = {
+ ignoreColumns: [],
+ onlyColumns: null,
+ ignoreHiddenRows: true,
+ ignoreEmptyRows: false,
+ headings: null,
+ allowHTML: false,
+ includeRowId: false,
+ textDataOverride: 'data-override',
+ extractor: null,
+ textExtractor: null
+ };
+ opts = $.extend(defaults, opts);
+
+ var notNull = function(value) {
+ return value !== undefined && value !== null;
+ };
+
+ var notEmpty = function(value) {
+ return value !== undefined && value.length > 0;
+ };
+
+ var ignoredColumn = function(index) {
+ if( notNull(opts.onlyColumns) ) {
+ return $.inArray(index, opts.onlyColumns) === -1;
+ }
+ return $.inArray(index, opts.ignoreColumns) !== -1;
+ };
+
+ var arraysToHash = function(keys, values) {
+ var result = {}, index = 0;
+ $.each(values, function(i, value) {
+ // when ignoring columns, the header option still starts
+ // with the first defined column
+ if ( index < keys.length && notNull(value) ) {
+ if (notEmpty(keys[index])){
+ result[ keys[index] ] = value;
+ }
+ index++;
+ }
+ });
+ return result;
+ };
+
+ var cellValues = function(cellIndex, cell, isHeader) {
+ var $cell = $(cell),
+ // extractor
+ extractor = opts.extractor || opts.textExtractor,
+ override = $cell.attr(opts.textDataOverride),
+ value;
+ // don't use extractor for header cells
+ if ( extractor === null || isHeader ) {
+ return $.trim( override || ( opts.allowHTML ? $cell.html() : cell.textContent || $cell.text() ) || '' );
+ } else {
+ // overall extractor function
+ if ( $.isFunction(extractor) ) {
+ value = override || extractor(cellIndex, $cell);
+ return typeof value === 'string' ? $.trim( value ) : value;
+ } else if ( typeof extractor === 'object' && $.isFunction( extractor[cellIndex] ) ) {
+ value = override || extractor[cellIndex](cellIndex, $cell);
+ return typeof value === 'string' ? $.trim( value ) : value;
+ }
+ }
+ // fallback
+ return $.trim( override || ( opts.allowHTML ? $cell.html() : cell.textContent || $cell.text() ) || '' );
+ };
+
+ var rowValues = function(row, isHeader) {
+ var result = [];
+ var includeRowId = opts.includeRowId;
+ var useRowId = (typeof includeRowId === 'boolean') ? includeRowId : (typeof includeRowId === 'string') ? true : false;
+ var rowIdName = (typeof includeRowId === 'string') === true ? includeRowId : 'rowId';
+ if (useRowId) {
+ if (typeof $(row).attr('id') === 'undefined') {
+ result.push(rowIdName);
+ }
+ }
+ $(row).children('td,th').each(function(cellIndex, cell) {
+ result.push( cellValues(cellIndex, cell, isHeader) );
+ });
+ return result;
+ };
+
+ var getHeadings = function(table) {
+ var firstRow = table.find('tr:first').first();
+ return notNull(opts.headings) ? opts.headings : rowValues(firstRow, true);
+ };
+
+ var construct = function(table, headings) {
+ var i, j, len, len2, txt, $row, $cell,
+ tmpArray = [], cellIndex = 0, result = [];
+ table.children('tbody,*').children('tr').each(function(rowIndex, row) {
+ if( rowIndex > 0 || notNull(opts.headings) ) {
+ var includeRowId = opts.includeRowId;
+ var useRowId = (typeof includeRowId === 'boolean') ? includeRowId : (typeof includeRowId === 'string') ? true : false;
+
+ $row = $(row);
+
+ var isEmpty = ($row.find('td').length === $row.find('td:empty').length) ? true : false;
+
+ if( ( $row.is(':visible') || !opts.ignoreHiddenRows ) && ( !isEmpty || !opts.ignoreEmptyRows ) && ( !$row.data('ignore') || $row.data('ignore') === 'false' ) ) {
+ cellIndex = 0;
+ if (!tmpArray[rowIndex]) {
+ tmpArray[rowIndex] = [];
+ }
+ if (useRowId) {
+ cellIndex = cellIndex + 1;
+ if (typeof $row.attr('id') !== 'undefined') {
+ tmpArray[rowIndex].push($row.attr('id'));
+ } else {
+ tmpArray[rowIndex].push('');
+ }
+ }
+
+ $row.children().each(function(){
+ $cell = $(this);
+ // skip column if already defined
+ while (tmpArray[rowIndex][cellIndex]) { cellIndex++; }
+
+ // process rowspans
+ if ($cell.filter('[rowspan]').length) {
+ len = parseInt( $cell.attr('rowspan'), 10) - 1;
+ txt = cellValues(cellIndex, $cell);
+ for (i = 1; i <= len; i++) {
+ if (!tmpArray[rowIndex + i]) { tmpArray[rowIndex + i] = []; }
+ tmpArray[rowIndex + i][cellIndex] = txt;
+ }
+ }
+ // process colspans
+ if ($cell.filter('[colspan]').length) {
+ len = parseInt( $cell.attr('colspan'), 10) - 1;
+ txt = cellValues(cellIndex, $cell);
+ for (i = 1; i <= len; i++) {
+ // cell has both col and row spans
+ if ($cell.filter('[rowspan]').length) {
+ len2 = parseInt( $cell.attr('rowspan'), 10);
+ for (j = 0; j < len2; j++) {
+ tmpArray[rowIndex + j][cellIndex + i] = txt;
+ }
+ } else {
+ tmpArray[rowIndex][cellIndex + i] = txt;
+ }
+ }
+ }
+
+ txt = tmpArray[rowIndex][cellIndex] || cellValues(cellIndex, $cell);
+ if (notNull(txt)) {
+ tmpArray[rowIndex][cellIndex] = txt;
+ }
+ cellIndex++;
+ });
+ }
+ }
+ });
+ $.each(tmpArray, function( i, row ){
+ if (notNull(row)) {
+ // remove ignoredColumns / add onlyColumns
+ var newRow = notNull(opts.onlyColumns) || opts.ignoreColumns.length ?
+ $.grep(row, function(v, index){ return !ignoredColumn(index); }) : row,
+
+ // remove ignoredColumns / add onlyColumns if headings is not defined
+ newHeadings = notNull(opts.headings) ? headings :
+ $.grep(headings, function(v, index){ return !ignoredColumn(index); });
+
+ txt = arraysToHash(newHeadings, newRow);
+ result[result.length] = txt;
+ }
+ });
+ return result;
+ };
+
+ // Run
+ var headings = getHeadings(this);
+ return construct(this, headings);
+ };
+})( jQuery );
diff --git a/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js b/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js
new file mode 100644
index 00000000..783585df
--- /dev/null
+++ b/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js
@@ -0,0 +1,2 @@
+/*! table-to-json - v0.13.0 - Daniel White */
+!function(a){"use strict";a.fn.tableToJSON=function(b){var c={ignoreColumns:[],onlyColumns:null,ignoreHiddenRows:!0,ignoreEmptyRows:!1,headings:null,allowHTML:!1,includeRowId:!1,textDataOverride:"data-override",extractor:null,textExtractor:null};b=a.extend(c,b);var d=function(a){return void 0!==a&&null!==a},e=function(a){return void 0!==a&&a.length>0},f=function(c){return d(b.onlyColumns)?-1===a.inArray(c,b.onlyColumns):-1!==a.inArray(c,b.ignoreColumns)},g=function(b,c){var f={},g=0;return a.each(c,function(a,c){g0||d(b.headings)){var f=b.includeRowId,g="boolean"==typeof f?f:"string"==typeof f;n=a(e);var r=n.find("td").length===n.find("td:empty").length;!n.is(":visible")&&b.ignoreHiddenRows||r&&b.ignoreEmptyRows||n.data("ignore")&&"false"!==n.data("ignore")||(q=0,p[c]||(p[c]=[]),g&&(q+=1,void 0!==n.attr("id")?p[c].push(n.attr("id")):p[c].push("")),n.children().each(function(){for(o=a(this);p[c][q];)q++;if(o.filter("[rowspan]").length)for(k=parseInt(o.attr("rowspan"),10)-1,m=h(q,o),i=1;i<=k;i++)p[c+i]||(p[c+i]=[]),p[c+i][q]=m;if(o.filter("[colspan]").length)for(k=parseInt(o.attr("colspan"),10)-1,m=h(q,o),i=1;i<=k;i++)if(o.filter("[rowspan]").length)for(l=parseInt(o.attr("rowspan"),10),j=0;j 0;
+ };
+
+ var ignoredColumn = function(index) {
+ if( notNull(opts.onlyColumns) ) {
+ return $.inArray(index, opts.onlyColumns) === -1;
+ }
+ return $.inArray(index, opts.ignoreColumns) !== -1;
+ };
+
+ var arraysToHash = function(keys, values) {
+ var result = {}, index = 0;
+ $.each(values, function(i, value) {
+ // when ignoring columns, the header option still starts
+ // with the first defined column
+ if ( index < keys.length && notNull(value) ) {
+ if (notEmpty(keys[index])){
+ result[ keys[index] ] = value;
+ }
+ index++;
+ }
+ });
+ return result;
+ };
+
+ var cellValues = function(cellIndex, cell, isHeader) {
+ var $cell = $(cell),
+ // extractor
+ extractor = opts.extractor || opts.textExtractor,
+ override = $cell.attr(opts.textDataOverride),
+ value;
+ // don't use extractor for header cells
+ if ( extractor === null || isHeader ) {
+ return $.trim( override || ( opts.allowHTML ? $cell.html() : cell.textContent || $cell.text() ) || '' );
+ } else {
+ // overall extractor function
+ if ( $.isFunction(extractor) ) {
+ value = override || extractor(cellIndex, $cell);
+ return typeof value === 'string' ? $.trim( value ) : value;
+ } else if ( typeof extractor === 'object' && $.isFunction( extractor[cellIndex] ) ) {
+ value = override || extractor[cellIndex](cellIndex, $cell);
+ return typeof value === 'string' ? $.trim( value ) : value;
+ }
+ }
+ // fallback
+ return $.trim( override || ( opts.allowHTML ? $cell.html() : cell.textContent || $cell.text() ) || '' );
+ };
+
+ var rowValues = function(row, isHeader) {
+ var result = [];
+ var includeRowId = opts.includeRowId;
+ var useRowId = (typeof includeRowId === 'boolean') ? includeRowId : (typeof includeRowId === 'string') ? true : false;
+ var rowIdName = (typeof includeRowId === 'string') === true ? includeRowId : 'rowId';
+ if (useRowId) {
+ if (typeof $(row).attr('id') === 'undefined') {
+ result.push(rowIdName);
+ }
+ }
+ $(row).children('td,th').each(function(cellIndex, cell) {
+ result.push( cellValues(cellIndex, cell, isHeader) );
+ });
+ return result;
+ };
+
+ var getHeadings = function(table) {
+ var firstRow = table.find('tr:first').first();
+ return notNull(opts.headings) ? opts.headings : rowValues(firstRow, true);
+ };
+
+ var construct = function(table, headings) {
+ var i, j, len, len2, txt, $row, $cell,
+ tmpArray = [], cellIndex = 0, result = [];
+ table.children('tbody,*').children('tr').each(function(rowIndex, row) {
+ if( rowIndex > 0 || notNull(opts.headings) ) {
+ var includeRowId = opts.includeRowId;
+ var useRowId = (typeof includeRowId === 'boolean') ? includeRowId : (typeof includeRowId === 'string') ? true : false;
+
+ $row = $(row);
+
+ var isEmpty = ($row.find('td').length === $row.find('td:empty').length) ? true : false;
+
+ if( ( $row.is(':visible') || !opts.ignoreHiddenRows ) && ( !isEmpty || !opts.ignoreEmptyRows ) && ( !$row.data('ignore') || $row.data('ignore') === 'false' ) ) {
+ cellIndex = 0;
+ if (!tmpArray[rowIndex]) {
+ tmpArray[rowIndex] = [];
+ }
+ if (useRowId) {
+ cellIndex = cellIndex + 1;
+ if (typeof $row.attr('id') !== 'undefined') {
+ tmpArray[rowIndex].push($row.attr('id'));
+ } else {
+ tmpArray[rowIndex].push('');
+ }
+ }
+
+ $row.children().each(function(){
+ $cell = $(this);
+ // skip column if already defined
+ while (tmpArray[rowIndex][cellIndex]) { cellIndex++; }
+
+ // process rowspans
+ if ($cell.filter('[rowspan]').length) {
+ len = parseInt( $cell.attr('rowspan'), 10) - 1;
+ txt = cellValues(cellIndex, $cell);
+ for (i = 1; i <= len; i++) {
+ if (!tmpArray[rowIndex + i]) { tmpArray[rowIndex + i] = []; }
+ tmpArray[rowIndex + i][cellIndex] = txt;
+ }
+ }
+ // process colspans
+ if ($cell.filter('[colspan]').length) {
+ len = parseInt( $cell.attr('colspan'), 10) - 1;
+ txt = cellValues(cellIndex, $cell);
+ for (i = 1; i <= len; i++) {
+ // cell has both col and row spans
+ if ($cell.filter('[rowspan]').length) {
+ len2 = parseInt( $cell.attr('rowspan'), 10);
+ for (j = 0; j < len2; j++) {
+ tmpArray[rowIndex + j][cellIndex + i] = txt;
+ }
+ } else {
+ tmpArray[rowIndex][cellIndex + i] = txt;
+ }
+ }
+ }
+
+ txt = tmpArray[rowIndex][cellIndex] || cellValues(cellIndex, $cell);
+ if (notNull(txt)) {
+ tmpArray[rowIndex][cellIndex] = txt;
+ }
+ cellIndex++;
+ });
+ }
+ }
+ });
+ $.each(tmpArray, function( i, row ){
+ if (notNull(row)) {
+ // remove ignoredColumns / add onlyColumns
+ var newRow = notNull(opts.onlyColumns) || opts.ignoreColumns.length ?
+ $.grep(row, function(v, index){ return !ignoredColumn(index); }) : row,
+
+ // remove ignoredColumns / add onlyColumns if headings is not defined
+ newHeadings = notNull(opts.headings) ? headings :
+ $.grep(headings, function(v, index){ return !ignoredColumn(index); });
+
+ txt = arraysToHash(newHeadings, newRow);
+ result[result.length] = txt;
+ }
+ });
+ return result;
+ };
+
+ // Run
+ var headings = getHeadings(this);
+ return construct(this, headings);
+ };
+})( jQuery );
diff --git a/assets/lightswitch/lightswitch/tabletojson.jquery.json b/assets/lightswitch/lightswitch/tabletojson.jquery.json
new file mode 100644
index 00000000..f12d44a0
--- /dev/null
+++ b/assets/lightswitch/lightswitch/tabletojson.jquery.json
@@ -0,0 +1,30 @@
+{
+ "name": "tabletojson",
+ "title": "Table To JSON",
+ "description": "jQuery plugin that reads an HTML table and returns a javascript object representing the values and columns of the table",
+ "keywords": [
+ "table",
+ "serialize",
+ "tabletojson",
+ "json"
+ ],
+ "version": "0.12.0",
+ "author": {
+ "name": "Daniel White",
+ "url": "http://www.developerdan.com"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/lightswitch05/table-to-json/blob/master/MIT-LICENSE"
+ }
+ ],
+ "bugs": "https://github.com/lightswitch05/table-to-json/issues",
+ "homepage": "https://github.com/lightswitch05/table-to-json",
+ "docs": "https://github.com/lightswitch05/table-to-json",
+ "download": "https://github.com/lightswitch05/table-to-json",
+ "demo": "http://lightswitch05.github.io/table-to-json/",
+ "dependencies": {
+ "jquery": ">=1.5"
+ }
+}
diff --git a/assets/lightswitch/lightswitch/test/index.html b/assets/lightswitch/lightswitch/test/index.html
new file mode 100644
index 00000000..00fd4162
--- /dev/null
+++ b/assets/lightswitch/lightswitch/test/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+ Table To JSON Test
+
+
+
+
+
+
MyApp Test Suite
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/lightswitch/lightswitch/test/specs/content.test.js b/assets/lightswitch/lightswitch/test/specs/content.test.js
new file mode 100644
index 00000000..41796bed
--- /dev/null
+++ b/assets/lightswitch/lightswitch/test/specs/content.test.js
@@ -0,0 +1,645 @@
+/*global module, test, expect, deepEqual */
+
+module('content');
+
+/* Ignore nested tables in cells with just td's*/
+test('ignore nested
in cells', function() {
+ $('#qunit-fixture').html(
+ '
'
+ );
+
+
+ expect(1);
+ var table = $('#test-table').tableToJSON({ignoreEmptyRows:true});
+ var expected = [{'First Name':'Jill', 'Last Name':'Smith', 'Points':'50'},
+ {'First Name':'John', 'Last Name':'Doe', 'Points':'80'}];
+ deepEqual(table, expected);
+});
+
+/* Read first row of td's as column when there are no th's*/
+test('without any
', function() {
+ $('#qunit-fixture').html(
+ '
' +
+ '
' +
+ '
First Name
' +
+ '
Last Name
' +
+ '
Points
' +
+ '
' +
+ '
' +
+ '
Jill
' +
+ '
Smith
' +
+ '
50
' +
+ '
' +
+ '
' +
+ '
Eve
' +
+ '
Jackson
' +
+ '
94
' +
+ '
' +
+ '
' +
+ '
John
' +
+ '
Doe
' +
+ '
80
' +
+ '
' +
+ '
'
+ );
+
+
+ expect(1);
+ var table = $('#test-table').tableToJSON();
+ var expected = [{'First Name':'Jill', 'Last Name':'Smith', 'Points':'50'},
+ {'First Name':'Eve', 'Last Name':'Jackson', 'Points':'94'},
+ {'First Name':'John', 'Last Name':'Doe', 'Points':'80'}];
+ deepEqual(table, expected);
+});
+
+/* Uses the onlyColumns option to only include the first column*/
+test('Ony include 1 column', function() {
+ $('#qunit-fixture').html(
+ '
'
+ );
+
+
+ expect(1);
+ var table = $('#test-table').tableToJSON({
+ onlyColumns: [1, 2],
+ headings: ['Last Name', 'Points']
+ });
+ var expected = [
+ {'Last Name':'Smith', 'Points':'50'},
+ {'Last Name':'Jackson', 'Points':'94'},
+ {'Last Name':'Doe', 'Points':'80'}
+ ];
+ deepEqual(table, expected);
+});
+
+/* allowHTML option allows HTML tags within a table to remain in the object */
+test('allowHTML option allows HTML tags within a table to remain in the object', function () {
+ $('#qunit-fixture').html(
+ '
' +
+ '
' +
+ '
First Name
' +
+ '
Last Name
' +
+ '
Points
' +
+ '
' +
+ '
' +
+ '
Jill
' +
+ '
Smith
' +
+ '
50
' +
+ '
' +
+ '
' +
+ '
Eve
' +
+ '
Jackson
' +
+ '
94
' +
+ '
' +
+ '
' +
+ '
John
' +
+ '
Doe
' +
+ '
80
' +
+ '
' +
+ '
'
+ );
+
+ expect(1);
+ var table = $('#test-table').tableToJSON({
+ allowHTML: true
+ });
+ var expected = [
+ {'First Name':'Jill', 'Last Name':'Smith', 'Points':'50'},
+ {'First Name':'Eve', 'Last Name':'Jackson', 'Points':'94'},
+ {'First Name':'John', 'Last Name':'Doe', 'Points':'80'}
+ ];
+ deepEqual(table, expected);
+});
+
+/* includeRowId option boolean type places the attribute ID from the row as a property of the row */
+test('includeRowId option boolean type places the attribute ID from the row as a property of the row', function () {
+ $('#qunit-fixture').html(
+ '
' +
+ '
' +
+ '
First Name
' +
+ '
Last Name
' +
+ '
Points
' +
+ '
' +
+ '
' +
+ '
Jill
' +
+ '
Smith
' +
+ '
50
' +
+ '
' +
+ '
' +
+ '
Eve
' +
+ '
Jackson
' +
+ '
94
' +
+ '
' +
+ '
' +
+ '
John
' +
+ '
Doe
' +
+ '
80
' +
+ '
' +
+ '
' +
+ '
No
' +
+ '
Row
' +
+ '
ID
' +
+ '
' +
+ '
'
+ );
+
+ expect(1);
+ var table = $('#test-table').tableToJSON({
+ includeRowId: true
+ });
+ var expected = [
+ {'rowId':'1', 'First Name':'Jill', 'Last Name':'Smith', 'Points':'50'},
+ {'rowId':'2', 'First Name':'Eve', 'Last Name':'Jackson', 'Points':'94'},
+ {'rowId':'3', 'First Name':'John', 'Last Name':'Doe', 'Points':'80'},
+ {'rowId':'', 'First Name':'No', 'Last Name':'Row', 'Points':'ID'}
+ ];
+ deepEqual(table, expected);
+});
+
+/* includeRowId option custom, instead of a boolean use a string, and string value will be the property name. */
+test('includeRowId option string type, instead of a boolean use a string, and string value will be the property name', function () {
+ $('#qunit-fixture').html(
+ '