Add couchdb-lucene
Add couchdb-lucene

[submodule "sag"] [submodule "sag"]
path = sag path = sag
url = git://github.com/sbisbee/sag.git url = https://github.com/sbisbee/sag.git
  [submodule "couchdb/couchdb-lucene"]
  path = couchdb/couchdb-lucene
  url = https://github.com/rnewson/couchdb-lucene.git
   
directory:b/couchdb/couchdb-lucene (new)
 
  <?php
 
  include_once("./lib/common.inc.php");
  setlocale(LC_CTYPE, 'C');
  // source: http://stackoverflow.com/questions/81934/easy-way-to-export-a-sql-table-without-access-to-the-server-or-phpmyadmin#81951
 
  $unspsc = Array();
  $unspscresult = $conn->prepare('select * from "UNSPSCcategories" where "UNSPSC"::text like \'%00000\';');
  $unspscresult->execute();
  foreach ($unspscresult->fetchAll() as $row) {
  $unspsc[$row['UNSPSC']] = $row['Title'];
  }
 
  $query = $conn->prepare('
  SELECT "CNID",contractnotice."agencyName",agency_nametoabn.abn as "agencyABN",
  EXTRACT(EPOCH FROM "publishDate") as "publishDate",
  EXTRACT(EPOCH FROM "contractStart") as "contractStart",
  EXTRACT(EPOCH FROM "contractEnd") as "contractEnd",
  value,description,category,
  "supplierName",(case when "supplierABN" != 0 THEN "supplierABN"::text ELSE "supplierName" END) as supplierID,
  (\'https://www.tenders.gov.au/?event=public.advancedsearch.keyword&keyword=CN\'::text || "CNID"::text) as sourceURL
  FROM contractnotice join agency_nametoabn on contractnotice."agencyName"=agency_nametoabn."agencyName"
  where "childCN" is null'
  , array(PDO::ATTR_CURSOR => PDO::FETCH_ORI_NEXT));
  $query->execute();
  $errors = $conn->errorInfo();
  if ($errors[2] != "") {
  die("Export terminated, db error" . print_r($errors, true));
  }
 
  $num_fields = $query->columnCount();
  $headers = Array();
  for ($i = 0; $i < $num_fields; $i++) { // for each column in query, make a CSV header
  $meta = $query->getColumnMeta($i);
  $headers[] = $meta['name'];
  }
  $fp = fopen('php://output', 'w');
  if ($fp && $query) {
  header('Content-Type: text/csv');
  header('Content-Disposition: attachment; filename="export.' . date("c") . '.csv"');
  header('Pragma: no-cache');
  header('Expires: 0');
  fputcsv($fp, $headers);
  while ($row = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {
  foreach ($row as $key => &$colvalue) {
 
  $colvalue = preg_replace('/[^[:print:]]/', '', utf8_encode($colvalue));
  if ($headers[$key] == "publishDate" || $headers[$key] == "contractStart"
  || $headers[$key] == "contractEnd") {
  $colvalue = date("Y-m-d", $colvalue);
  }
  /* if ($headers[$key] == "CNID") {
  $colvalue = str_replace("A","", $colvalue);
  }*/
  if ($headers[$key] == "cat1" || $headers[$key] == "cat2"
  || $headers[$key] == "cat3") {
  $colvalue = $unspsc[$colvalue];
  }
  }
  fputcsv($fp, array_values($row));
  }
  die;
  }
  ?>
 
file:b/foundation.html (new)
  <!DOCTYPE html>
 
  <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
  <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
  <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
  <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
  <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
  <head>
  <meta charset="utf-8" />
 
  <!-- Set the viewport width to device width for mobile -->
  <meta name="viewport" content="width=device-width" />
 
  <title>Welcome to Foundation</title>
 
  <!-- Included CSS Files -->
  <link rel="stylesheet" href="stylesheets/foundation.css">
  <link rel="stylesheet" href="stylesheets/app.css">
 
  <!--[if lt IE 9]>
  <link rel="stylesheet" href="stylesheets/ie.css">
  <![endif]-->
 
 
  <!-- IE Fix for HTML5 Tags -->
  <!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
 
  </head>
  <body>
 
  <!-- container -->
  <div class="container">
 
  <div class="row">
  <div class="twelve columns">
  <h2>Welcome to Foundation</h2>
  <p>This is version 2.1.4 released on December 19, 2011</p>
  <hr />
  </div>
  </div>
 
  <div class="row">
  <div class="eight columns">
  <h3>The Grid</h3>
 
  <!-- Grid Example -->
  <div class="row">
  <div class="twelve columns">
  <div class="panel">
  <p>This is a twelve column section in a row. Each of these includes a div.panel element so you can see where the columns are - it's not required at all for the grid.</p>
  </div>
  </div>
  </div>
  <div class="row">
  <div class="six columns">
  <div class="panel">
  <p>Six columns</p>
  </div>
  </div>
  <div class="six columns">
  <div class="panel">
  <p>Six columns</p>
  </div>
  </div>
  </div>
  <div class="row">
  <div class="four columns">
  <div class="panel">
  <p>Four columns</p>
  </div>
  </div>
  <div class="four columns">
  <div class="panel">
  <p>Four columns</p>
  </div>
  </div>
  <div class="four columns">
  <div class="panel">
  <p>Four columns</p>
  </div>
  </div>
  </div>
 
  <h3>Tabs</h3>
  <dl class="tabs">
  <dd><a href="#simple1" class="active">Simple Tab 1</a></dd>
  <dd><a href="#simple2">Simple Tab 2</a></dd>
  <dd><a href="#simple3">Simple Tab 3</a></dd>
  </dl>
 
  <ul class="tabs-content">
  <li class="active" id="simple1Tab">This is simple tab 1's content. Pretty neat, huh?</li>
  <li id="simple2Tab">This is simple tab 2's content. Now you see it!</li>
  <li id="simple3Tab">This is simple tab 3's content. It's, you know...okay.</li>
  </ul>
 
  <h3>Buttons</h3>
 
  <p><a href="#" class="small blue button">Small Blue Button</a></p>
  <p><a href="#" class="blue button">Medium Blue Button</a></p>
  <p><a href="#" class="large blue button">Large Blue Button</a></p>
 
  <p><a href="#" class="nice radius small blue button">Nice Blue Button</a></p>
  <p><a href="#" class="nice radius blue button">Nice Blue Button</a></p>
  <p><a href="#" class="nice radius large blue button">Nice Blue Button</a></p>
 
  </div>
 
  <div class="four columns">
  <h4>Getting Started</h4>
  <p>We're stoked you want to try Foundation! To get going, this file (index.html) includes some basic styles you can modify, play around with, or totally destroy to get going.</p>
 
  <h4>Other Resources</h4>
  <p>Once you've exhausted the fun in this document, you should check out:</p>
  <ul class="disc">
  <li><a href="http://foundation.zurb.com/docs">Foundation Documentation</a><br />Everything you need to know about using the framework.</li>
  <li><a href="http://github.com/zurb/foundation">Foundation on Github</a><br />Latest code, issue reports, feature requests and more.</li>
  <li><a href="http://twitter.com/foundationzurb">@foundationzurb</a><br />Ping us on Twitter if you have questions. If you build something with this we'd love to see it (and send you a totally boss sticker).</li>
  </ul>
  </div>
  </div>
 
  </div>
  <!-- container -->
 
 
 
 
  <!-- Included JS Files -->
  <script src="javascripts/foundation.js"></script>
  <script src="javascripts/app.js"></script>
 
  </body>
  </html>
 
file:b/humans.txt (new)
  /* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */
  /* zurb.com */
  /* humanstxt.org */
 
  /* SITE */
  Standards: HTML5, CSS3
  Components: jQuery, Orbit, Reveal
  Software: Coda, Textmate, Git
 Binary files /dev/null and b/images/misc/button-gloss.png differ
 Binary files /dev/null and b/images/misc/button-overlay.png differ
 Binary files /dev/null and b/images/misc/custom-form-sprites.png differ
 Binary files /dev/null and b/images/misc/input-bg.png differ
 Binary files /dev/null and b/images/misc/modal-gloss.png differ
 Binary files /dev/null and b/images/misc/table-sorter.png differ
 Binary files /dev/null and b/images/orbit/bullets.jpg differ
 Binary files /dev/null and b/images/orbit/left-arrow.png differ
 Binary files /dev/null and b/images/orbit/loading.gif differ
 Binary files /dev/null and b/images/orbit/mask-black.png differ
 Binary files /dev/null and b/images/orbit/pause-black.png differ
 Binary files /dev/null and b/images/orbit/right-arrow.png differ
 Binary files /dev/null and b/images/orbit/rotator-black.png differ
 Binary files /dev/null and b/images/orbit/timer-black.png differ
  /* Foundation v2.1.4 http://foundation.zurb.com */
  $(document).ready(function () {
 
  /* Use this js doc for all application specific JS */
 
  /* TABS --------------------------------- */
  /* Remove if you don't need :) */
 
  function activateTab($tab) {
  var $activeTab = $tab.closest('dl').find('a.active'),
  contentLocation = $tab.attr("href") + 'Tab';
 
  //Make Tab Active
  $activeTab.removeClass('active');
  $tab.addClass('active');
 
  //Show Tab Content
  $(contentLocation).closest('.tabs-content').children('li').hide();
  $(contentLocation).show();
  }
 
  $('dl.tabs').each(function () {
  //Get all tabs
  var tabs = $(this).children('dd').children('a');
  tabs.click(function (e) {
  activateTab($(this));
  });
  });
 
  if (window.location.hash) {
  activateTab($('a[href="' + window.location.hash + '"]'));
  }
 
  /* ALERT BOXES ------------ */
  $(".alert-box").delegate("a.close", "click", function(event) {
  event.preventDefault();
  $(this).closest(".alert-box").fadeOut(function(event){
  $(this).remove();
  });
  });
 
 
  /* PLACEHOLDER FOR FORMS ------------- */
  /* Remove this and jquery.placeholder.min.js if you don't need :) */
 
  $('input, textarea').placeholder();
 
 
 
  /* UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE6/7/8 SUPPORT AND ARE USING .block-grids */
  // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'left'});
  // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'left'});
  // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'left'});
  // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'left'});
 
 
 
  /* DROPDOWN NAV ------------- */
 
  var currentFoundationDropdown = null;
  $('.nav-bar li a, .nav-bar li a:after').each(function() {
  $(this).data('clicks', 0);
  });
  $('.nav-bar li a, .nav-bar li a:after').live('click', function(e) {
  e.preventDefault();
  if (currentFoundationDropdown !== $(this).index() || currentFoundationDropdown === null) {
  $(this).data('clicks', 0);
  currentFoundationDropdown = $(this).index();
  }
  $(this).data('clicks', ($(this).data('clicks') + 1));
  var f = $(this).siblings('.flyout');
  if (!f.is(':visible') && $(this).parent('.has-flyout').length > 1) {
  $('.nav-bar li .flyout').hide();
  f.show();
  } else if (($(this).data('clicks') > 1) || ($(this).parent('.has-flyout').length < 1)) {
  window.location = $(this).attr('href');
  }
  });
  $('.nav-bar').live('click', function(e) {
  e.stopPropagation();
  if ($(e.target).parents().is('.flyout') || $(e.target).is('.flyout')) {
  e.preventDefault();
  }
  });
  // $('body').bind('touchend', function(e) {
  // if (!$(e.target).parents().is('.nav-bar') || !$(e.target).is('.nav-bar')) {
  // $('.nav-bar li .flyout').is(':visible').hide();
  // }
  // });