From 44f716b5689e83226f7f694e7642e61cc8193927 Mon Sep 17 00:00:00 2001 From: Okechi Onyeje Date: Fri, 21 Jul 2017 16:17:30 -0400 Subject: [PATCH] Added Distributor and Supplier Filters: Remaing Bugs: - @Bug: With trying to select a different filter for supplier or distributor dropdown filtermenu popup closes. - @Bug: When filtering statistics, original chart appears as underlay to new filtered chart - @Bug: When logging out of the dashboard, the user is told there account was cancelled when they werent --- Pearlception/.vscode/tasks.json | 12 +++++ Pearlception/.yardoc/checksums | 6 +-- Pearlception/.yardoc/objects/root.dat | Bin 29222 -> 29861 bytes Pearlception/Gemfile | 1 + Pearlception/Gemfile.lock | 10 +++- .../app/assets/javascripts/statistics.js | 40 ++++++++++++--- .../app/controllers/sessions_controller.rb | 2 + .../app/controllers/statistics_controller.rb | 19 +++++-- Pearlception/app/models/run.rb | 3 ++ Pearlception/app/views/oysters/index.html.erb | 2 +- .../app/views/statistics/index.html.erb | 48 +++++++++++++++++- Pearlception/doc/ApplicationCable.html | 2 +- .../doc/ApplicationCable/Channel.html | 2 +- .../doc/ApplicationCable/Connection.html | 2 +- Pearlception/doc/ApplicationController.html | 2 +- Pearlception/doc/ApplicationHelper.html | 2 +- Pearlception/doc/ApplicationJob.html | 2 +- Pearlception/doc/ApplicationMailer.html | 2 +- Pearlception/doc/ApplicationRecord.html | 2 +- Pearlception/doc/CompaniesController.html | 2 +- Pearlception/doc/CompaniesHelper.html | 2 +- Pearlception/doc/Company.html | 2 +- Pearlception/doc/DashboardController.html | 2 +- Pearlception/doc/DashboardHelper.html | 2 +- Pearlception/doc/Distributor.html | 2 +- Pearlception/doc/Grade.html | 2 +- Pearlception/doc/GradesController.html | 2 +- Pearlception/doc/GradesHelper.html | 2 +- Pearlception/doc/Machine.html | 2 +- Pearlception/doc/Oyster.html | 2 +- Pearlception/doc/OystersController.html | 2 +- Pearlception/doc/OystersHelper.html | 2 +- Pearlception/doc/RegistrationsController.html | 2 +- Pearlception/doc/RegistrationsHelper.html | 2 +- Pearlception/doc/Result.html | 2 +- Pearlception/doc/Run.html | 2 +- Pearlception/doc/RunsController.html | 2 +- Pearlception/doc/RunsHelper.html | 2 +- Pearlception/doc/SessionsController.html | 30 +++++++---- Pearlception/doc/SessionsHelper.html | 2 +- Pearlception/doc/StatisticsController.html | 38 +++++++++++--- Pearlception/doc/StatisticsHelper.html | 2 +- Pearlception/doc/Subdomain.html | 2 +- Pearlception/doc/Supplier.html | 2 +- .../doc/SuppliersDistributorsController.html | 2 +- .../doc/SuppliersDistributorsHelper.html | 2 +- Pearlception/doc/User.html | 2 +- Pearlception/doc/_index.html | 2 +- Pearlception/doc/file.README.html | 2 +- Pearlception/doc/index.html | 2 +- Pearlception/doc/top-level-namespace.html | 2 +- 51 files changed, 219 insertions(+), 68 deletions(-) create mode 100644 Pearlception/.vscode/tasks.json diff --git a/Pearlception/.vscode/tasks.json b/Pearlception/.vscode/tasks.json new file mode 100644 index 0000000..ad6585c --- /dev/null +++ b/Pearlception/.vscode/tasks.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "taskName": "echo", + "command": "echo Hello", + "type": "shell" + } + ] +} \ No newline at end of file diff --git a/Pearlception/.yardoc/checksums b/Pearlception/.yardoc/checksums index 12f2e8b..9a429eb 100644 --- a/Pearlception/.yardoc/checksums +++ b/Pearlception/.yardoc/checksums @@ -1,5 +1,5 @@ lib/subdomain.rb 05d09bad9914c8468f62d18a7490bbff2a169e5b -app/models/run.rb d365dad32d163ba2cb7dd1fa3c990b4c4023aeef +app/models/run.rb 56667b48dc818963ee8e6576af6850be1388c4b9 app/models/user.rb efde248eefff583ab5d6cc0efb455d33cdf8e0f8 app/models/grade.rb 06b261d77e0f248d01783be7b756ef994287c386 app/models/oyster.rb 7e618ccfa0ed1fc599cb10c7f015d8b5ebdc7add @@ -23,10 +23,10 @@ app/controllers/runs_controller.rb cb314018e6aa86e0c9afc9d6a2fe563924000bca app/helpers/registrations_helper.rb 37b2a26d7a107fb24d0dc648ad6d739722dfec0f app/controllers/grades_controller.rb 30dc672b7759ad606bba5a9790a3c3bed7ac258d app/controllers/oysters_controller.rb eca3e0163cb4ec7f95c9f07f9991d1bd747fd52b -app/controllers/sessions_controller.rb 83c887b904faf26afafa69872dce1250e638f225 +app/controllers/sessions_controller.rb 5fe6b0a8ddd3859642258e3fbb2ce58db84efd14 app/controllers/companies_controller.rb 66866c361bc088440a0eb3a7704985171e4d96e6 app/controllers/dashboard_controller.rb f9e7b2eec29e56c58c16524dca676b087678ad02 -app/controllers/statistics_controller.rb 38331e4fe96e77828c9f2029fe35533e84679e1f +app/controllers/statistics_controller.rb bb0c96b7567285ca3c8a437ffcd8d8f95b3f1b51 app/channels/application_cable/channel.rb 54156ee2853cfdea4e3147cdb260776b8d90b646 app/controllers/application_controller.rb 7db6f6f427cff75fc496475e8f7226fc0d4deb88 app/controllers/registrations_controller.rb bcb576011beb61b83c113556afe5db1091aaf8a2 diff --git a/Pearlception/.yardoc/objects/root.dat b/Pearlception/.yardoc/objects/root.dat index 3b18c45a2519d0bb7dec2347017a6bc95f8cb015..2dcc07cba85f1afd81cb6bb4cfbd9c9022e87fc7 100644 GIT binary patch delta 2096 zcmc&#Z){Ul6z9J8)^=^#1WOoWcDL&agKao*gVD#>GoypKc7F(S!>+*F`nJBMd+)99 zmGNh=_(>8aiU$)k5=opyqb?+k-;7zZ%$SIokoZZ|#1IvYK@&ep^xPJ=*FgO0hu(M3 zIluEe=bn4d>9srL-Mi#^X|v!FeVx$Xw-Jo03fS9xj+DbIiJiIMnnySi$o1{+CW1@! z9fr4C8)r{Ton1q*NSF?$6pg0!@o`lfr+U_+SyRcFRL&^W$mo-Xr6j49k}X^m)XAfx zdRDVcnvzc_bVNbtQCS;R(rLs^Gp>vxr_-kx{FHklYg&17G$QwoGI8BuaZ`MaI9r2D zu&d_G|B?oEcv&K~O=3Xee&FDZzFjUy*rjMm)tURHRU%%>iy?K5xJBapJlw0>2(j>l z5aQJ`R#9)G-TGx>bIvEm2s2m0Lj6wf9=my-Zh}wtp7fyAkM|>P5L2+Ox!xPGgT85~ zg*V$iBq2Dkufx;7YJ%7Iy-5AM*wED>y5egbVm-@9Y%CJtdtoOpaUqy$j}kw8+J4Wg zuTV_#fGOl|Nw;{9#j7EE4l{NX%fTJFNGy0O((XCGYJwjl?R2s@2Ndl&V30x%7M$*k z!begmEO*}ZURxoV%V$x}JtriUF{)}w<)oWZxEZf-;%lL7e>v{ofqUFi8XQy8mXaAT z@!ho1F*$82d3`3UnW#9F)fg1+9#|qlm_OKG!JHl#*=NVdsbfjmQtIG~gDtaK(w+BK z$EYD^FfLyp_>l=x&G;!dijl~G5smR_JA`44^@ zb|r*OmspL$k_*~0d{BczxpLKA*9e^}z9SUvcZ63^xT6oCvO7lRAl03uOT{iI+Fh2I zOEb{uqz5ez8e$PHM;pl^d=_oN^{;3xIR}AQ4es~H>geraLKN+Uw+n;|G1G&V6~cWz zP3W%owBq_+&(=zEM%b`TqJ^TXegVR$*w;xSfDxf_XhI8+-33%SkGf<>J^NHUe62(|@; zptvR|+G~P`F1++%cw%CR4CGEsEc4FOY;uOHUTgEgajit4e7KtJ&uT8Akq`UX{)*=0 z_wZr(dv6HmX#|$Ftxg=qGZHrm_ccGSqfOr*a!A|^9}a@C-v%>`kR^sNs(5u}z z@(AJ=5qTwAi7ZR-u`WBN*~1IN@4Z#%Tq2;fo9fr z&dkL6U^KH|e9$Fp!se1DjcIZd6Q3qd7oS}EV&dYTxTx`8JDd1sO#Ch^;}YfJaKAsl z-|su$Ip6u)c3ry43I6EtwRJ7622(U1k=u*5-MTi>igijoU#vyI^L)%{Xd3c`K zVcP2!0*w%?csI~n^aX^d#(UHEhSkE-L*W3`PwvoB2dcAlKx;xi#RZT4-vuvNf#|Tn`;5 zS=bJ3gJ}%4Dyo+7HIvS~Xp{5l%sgBQe-5FMm?4uZXIgCdgF?7NxjlM=SS!s6XlfNI zHHB5EMk1sFJIB(n7K_5CV2CV6dM8wIiw%L=qe4@wRaLc~H1U(X#C*xhI`#i2Fq{Y@cl^X349me+$Bvo| zqCS&P%LbK}aFC!Ka6VopdiX6q+tbF?io6h{uN3G-J$*Gu$)aqcZBBS| zGTC1IZ$C=QQ@vJyGa;JVPWX}WW8#Our+ybs)(gbii2q`0pYYe)#Qh3KT?k7&WiGW;3>J^`XT`q@lsgc0J*@Kt@>lK-%g?F9E?Qu`*lx&YUXqw@RtIDl4tMG# zW{4I0)gb8t@#?Z- zw|{mvC!bEv$%T9%naX8EF))+N=QBBpxdpCLk}s-v5%>2)X-~ZtmJ{u&1)BvuX@l=d z4q}6ra!(tM5xFQac;e&|o+&3Dgm=m|I92AklbratYUpaaNx|D?2g!qZ&dz7jGVXQ( iJ$85t3762@&n-X5H{i=6F;_WJs!^?;?cyY6jr$i9Je9Zr diff --git a/Pearlception/Gemfile b/Pearlception/Gemfile index 07f5318..11ef0d7 100644 --- a/Pearlception/Gemfile +++ b/Pearlception/Gemfile @@ -48,6 +48,7 @@ gem 'rack-subdomain' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri + gem 'meta_request' end group :development do diff --git a/Pearlception/Gemfile.lock b/Pearlception/Gemfile.lock index 3370f70..096b51f 100644 --- a/Pearlception/Gemfile.lock +++ b/Pearlception/Gemfile.lock @@ -53,6 +53,7 @@ GEM bootstrap-popover-rails (0.1.0) builder (3.2.2) byebug (9.0.6) + callsite (0.0.11) chart-js-rails (0.1.2) railties (> 3.1) coderay (1.1.1) @@ -110,6 +111,10 @@ GEM nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + meta_request (0.4.3) + callsite (~> 0.0, >= 0.0.11) + rack-contrib (>= 1.1, < 3) + railties (>= 3.0.0, < 5.2.0) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) @@ -136,6 +141,8 @@ GEM pry (>= 0.9.11) puma (3.6.2) rack (2.0.1) + rack-contrib (1.2.0) + rack (>= 0.9.1) rack-subdomain (0.0.2) rack-test (0.6.3) rack (>= 1.0) @@ -230,6 +237,7 @@ DEPENDENCIES jquery-ui-rails kaminari listen (~> 3.0.5) + meta_request mysql2 (>= 0.3.18, < 0.5) pry-byebug pry-stack_explorer @@ -245,4 +253,4 @@ DEPENDENCIES web-console (>= 3.3.0) BUNDLED WITH - 1.13.7 + 1.14.3 diff --git a/Pearlception/app/assets/javascripts/statistics.js b/Pearlception/app/assets/javascripts/statistics.js index 1911156..507a4dc 100644 --- a/Pearlception/app/assets/javascripts/statistics.js +++ b/Pearlception/app/assets/javascripts/statistics.js @@ -7,18 +7,46 @@ $('#to_datepicker').datepicker() $('#dateFilterButton').on('click',function(){ var fromDate = $('#from_datepicker')[0].value; var toDate = $('#to_datepicker')[0].value; - var queryString = ""; + var supplier = $('#supplier').find(":selected").text(); + var distributor = $('#distributor').find(":selected").text(); + var queryString = "statistics.json"; if(fromDate != "" && toDate != ""){ - queryString = "statistics.json/?from_date="+encodeURI(fromDate)+"&to_date="+encodeURI(toDate); - } - else{ - queryString = "statistics.json" - } + queryString = queryString + "/?from_date="+encodeURI(fromDate)+"&to_date="+encodeURI(toDate); + } + if(supplier != ""){ + if(queryString.includes("/")){ + queryString = queryString + "&supplier="+encodeURI(supplier); + }else{ + queryString = queryString + "/?supplier="+encodeURI(supplier); + } + } + + if(distributor != ""){ + if(queryString.includes("/")){ + queryString = queryString + "&distributor="+encodeURI(distributor); + }else{ + queryString = queryString + "/?distributor="+encodeURI(distributor); + } + } + $.get(queryString, function(gradeData){ constructGradesGraph(gradeData); }) }); +(function($){ $(window).on("load",function(){ + $('.filter-dropdown').find('.filter-form').click(function (e) { + e.stopPropagation(); + if ($(e.target).is('[name=supplier]')) { + $($(e.target).data('target')).modal() + } + }); +}); +})(jQuery); + + + + $(document).ready( $.get("statistics.json", function(gradeData){ constructGradesGraph(gradeData); diff --git a/Pearlception/app/controllers/sessions_controller.rb b/Pearlception/app/controllers/sessions_controller.rb index a437024..e2b9c03 100644 --- a/Pearlception/app/controllers/sessions_controller.rb +++ b/Pearlception/app/controllers/sessions_controller.rb @@ -1,3 +1,5 @@ +#@FIXME: When logging out users are prompted that there accounts have been cancelled when really they +#just logged out. class SessionsController < Devise::RegistrationsController include ApplicationHelper diff --git a/Pearlception/app/controllers/statistics_controller.rb b/Pearlception/app/controllers/statistics_controller.rb index 10b2ce4..7451754 100644 --- a/Pearlception/app/controllers/statistics_controller.rb +++ b/Pearlception/app/controllers/statistics_controller.rb @@ -1,13 +1,26 @@ class StatisticsController < ApplicationController def index + @suppliers = Supplier.all + @distributors = Distributor.all + #filterUsed = false + runs = Run.all if params[:from_date] != nil && params[:to_date] != nil from_date = Date.strptime(params[:from_date], '%m/%d/%Y') to_date = Date.strptime(params[:to_date], '%m/%d/%Y') - runs = Run.where(:runDate => from_date.beginning_of_day..to_date.end_of_day) - else - runs = Run.all + #runs = Run.where(:runDate => from_date.beginning_of_day..to_date.end_of_day) + runs = runs.by_date(from_date.beginning_of_day..to_date.end_of_day) end + + if params[:supplier] != nil + runs = runs.by_supplier(params[:supplier]) + end + + if params[:distributor] != nil + runs = runs.by_distributor(params[:distributor]) + end + # runs = Run.all + #end puts runs.inspect oysterData = [] all_oysters = [] diff --git a/Pearlception/app/models/run.rb b/Pearlception/app/models/run.rb index 8b28af0..93eb518 100644 --- a/Pearlception/app/models/run.rb +++ b/Pearlception/app/models/run.rb @@ -1,3 +1,6 @@ class Run < ApplicationRecord has_many :oysters + scope :by_date, lambda { |runDate| where(:runDate => runDate)} + scope :by_supplier, lambda { |supplier| where(:supplier => supplier)} + scope :by_distributor, lambda { |distributor| where(:distributor => distributor)} end diff --git a/Pearlception/app/views/oysters/index.html.erb b/Pearlception/app/views/oysters/index.html.erb index 54ede02..31d1aa6 100644 --- a/Pearlception/app/views/oysters/index.html.erb +++ b/Pearlception/app/views/oysters/index.html.erb @@ -61,7 +61,7 @@ -->
- <%= link_to "Back", root_path( :page => params[:page_num]), :class => "btn btn-primary" %> + <%= link_to "Back", root_path( :page => params[:page_num]) + "pearlception", :class => "btn btn-primary" %>

Results of <%= Run.find(params[:result_id]).runDate %>

Processed Oysters: <%= @oysters_count %>

<% if @oysters.empty? %> diff --git a/Pearlception/app/views/statistics/index.html.erb b/Pearlception/app/views/statistics/index.html.erb index 56de615..789952e 100644 --- a/Pearlception/app/views/statistics/index.html.erb +++ b/Pearlception/app/views/statistics/index.html.erb @@ -48,7 +48,50 @@
+ +
+
+
+ +
+
+
+ + + + + +
+
diff --git a/Pearlception/doc/ApplicationCable.html b/Pearlception/doc/ApplicationCable.html index 6cbb1c2..ceb9788 100644 --- a/Pearlception/doc/ApplicationCable.html +++ b/Pearlception/doc/ApplicationCable.html @@ -107,7 +107,7 @@
diff --git a/Pearlception/doc/ApplicationCable/Channel.html b/Pearlception/doc/ApplicationCable/Channel.html index 9e9bccf..66e620d 100644 --- a/Pearlception/doc/ApplicationCable/Channel.html +++ b/Pearlception/doc/ApplicationCable/Channel.html @@ -114,7 +114,7 @@ diff --git a/Pearlception/doc/ApplicationCable/Connection.html b/Pearlception/doc/ApplicationCable/Connection.html index 490834c..5c21b53 100644 --- a/Pearlception/doc/ApplicationCable/Connection.html +++ b/Pearlception/doc/ApplicationCable/Connection.html @@ -114,7 +114,7 @@ diff --git a/Pearlception/doc/ApplicationController.html b/Pearlception/doc/ApplicationController.html index 16727b4..8f2733e 100644 --- a/Pearlception/doc/ApplicationController.html +++ b/Pearlception/doc/ApplicationController.html @@ -118,7 +118,7 @@ diff --git a/Pearlception/doc/ApplicationHelper.html b/Pearlception/doc/ApplicationHelper.html index 4802580..8ff953c 100644 --- a/Pearlception/doc/ApplicationHelper.html +++ b/Pearlception/doc/ApplicationHelper.html @@ -273,7 +273,7 @@ diff --git a/Pearlception/doc/ApplicationJob.html b/Pearlception/doc/ApplicationJob.html index 4b50a20..6abbd4a 100644 --- a/Pearlception/doc/ApplicationJob.html +++ b/Pearlception/doc/ApplicationJob.html @@ -114,7 +114,7 @@ diff --git a/Pearlception/doc/ApplicationMailer.html b/Pearlception/doc/ApplicationMailer.html index 3d7dee5..e3ef8d9 100644 --- a/Pearlception/doc/ApplicationMailer.html +++ b/Pearlception/doc/ApplicationMailer.html @@ -114,7 +114,7 @@ diff --git a/Pearlception/doc/ApplicationRecord.html b/Pearlception/doc/ApplicationRecord.html index 6658e93..5a397c8 100644 --- a/Pearlception/doc/ApplicationRecord.html +++ b/Pearlception/doc/ApplicationRecord.html @@ -118,7 +118,7 @@ diff --git a/Pearlception/doc/CompaniesController.html b/Pearlception/doc/CompaniesController.html index 0813fd2..3f94be2 100644 --- a/Pearlception/doc/CompaniesController.html +++ b/Pearlception/doc/CompaniesController.html @@ -415,7 +415,7 @@ diff --git a/Pearlception/doc/CompaniesHelper.html b/Pearlception/doc/CompaniesHelper.html index e4731d4..f50b221 100644 --- a/Pearlception/doc/CompaniesHelper.html +++ b/Pearlception/doc/CompaniesHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/Company.html b/Pearlception/doc/Company.html index ab9ae9d..2bf637f 100644 --- a/Pearlception/doc/Company.html +++ b/Pearlception/doc/Company.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/DashboardController.html b/Pearlception/doc/DashboardController.html index c7131bf..f535715 100644 --- a/Pearlception/doc/DashboardController.html +++ b/Pearlception/doc/DashboardController.html @@ -343,7 +343,7 @@ diff --git a/Pearlception/doc/DashboardHelper.html b/Pearlception/doc/DashboardHelper.html index ef0ebdb..95b7082 100644 --- a/Pearlception/doc/DashboardHelper.html +++ b/Pearlception/doc/DashboardHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/Distributor.html b/Pearlception/doc/Distributor.html index b5505b6..aa79200 100644 --- a/Pearlception/doc/Distributor.html +++ b/Pearlception/doc/Distributor.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/Grade.html b/Pearlception/doc/Grade.html index 2690563..a877f69 100644 --- a/Pearlception/doc/Grade.html +++ b/Pearlception/doc/Grade.html @@ -208,7 +208,7 @@ diff --git a/Pearlception/doc/GradesController.html b/Pearlception/doc/GradesController.html index ee06202..bd88959 100644 --- a/Pearlception/doc/GradesController.html +++ b/Pearlception/doc/GradesController.html @@ -469,7 +469,7 @@ diff --git a/Pearlception/doc/GradesHelper.html b/Pearlception/doc/GradesHelper.html index 12f73ca..4050604 100644 --- a/Pearlception/doc/GradesHelper.html +++ b/Pearlception/doc/GradesHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/Machine.html b/Pearlception/doc/Machine.html index 3805ed4..f5fd32c 100644 --- a/Pearlception/doc/Machine.html +++ b/Pearlception/doc/Machine.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/Oyster.html b/Pearlception/doc/Oyster.html index 33bfca2..67b7eac 100644 --- a/Pearlception/doc/Oyster.html +++ b/Pearlception/doc/Oyster.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/OystersController.html b/Pearlception/doc/OystersController.html index 3d20693..9a045b1 100644 --- a/Pearlception/doc/OystersController.html +++ b/Pearlception/doc/OystersController.html @@ -245,7 +245,7 @@ diff --git a/Pearlception/doc/OystersHelper.html b/Pearlception/doc/OystersHelper.html index e45a673..fb3df74 100644 --- a/Pearlception/doc/OystersHelper.html +++ b/Pearlception/doc/OystersHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/RegistrationsController.html b/Pearlception/doc/RegistrationsController.html index db2c517..bc1f649 100644 --- a/Pearlception/doc/RegistrationsController.html +++ b/Pearlception/doc/RegistrationsController.html @@ -357,7 +357,7 @@ diff --git a/Pearlception/doc/RegistrationsHelper.html b/Pearlception/doc/RegistrationsHelper.html index 23d9795..cd90296 100644 --- a/Pearlception/doc/RegistrationsHelper.html +++ b/Pearlception/doc/RegistrationsHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/Result.html b/Pearlception/doc/Result.html index 8ff4aff..81776c0 100644 --- a/Pearlception/doc/Result.html +++ b/Pearlception/doc/Result.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/Run.html b/Pearlception/doc/Run.html index 0476097..5031b02 100644 --- a/Pearlception/doc/Run.html +++ b/Pearlception/doc/Run.html @@ -122,7 +122,7 @@ diff --git a/Pearlception/doc/RunsController.html b/Pearlception/doc/RunsController.html index 6ea8db4..1130ad3 100644 --- a/Pearlception/doc/RunsController.html +++ b/Pearlception/doc/RunsController.html @@ -203,7 +203,7 @@ diff --git a/Pearlception/doc/RunsHelper.html b/Pearlception/doc/RunsHelper.html index ebd5f1f..90b1de5 100644 --- a/Pearlception/doc/RunsHelper.html +++ b/Pearlception/doc/RunsHelper.html @@ -95,7 +95,7 @@ diff --git a/Pearlception/doc/SessionsController.html b/Pearlception/doc/SessionsController.html index f9dde6e..71e03ae 100644 --- a/Pearlception/doc/SessionsController.html +++ b/Pearlception/doc/SessionsController.html @@ -106,8 +106,20 @@ +

Overview

+
+ +

@FIXME: When logging out users are prompted that there accounts have been +cancelled when really they just logged out.

+
+
+
+ + +
+ @@ -201,8 +213,6 @@
 
 
-8
-9
 10
 11
 12
@@ -215,10 +225,12 @@
 19
 20
 21
-22
+22 +23 +24 -
# File 'app/controllers/sessions_controller.rb', line 8
+      
# File 'app/controllers/sessions_controller.rb', line 10
 
 def create
   params = 
@@ -255,12 +267,12 @@
       
 
 
-4
-5
-6
+6 +7 +8
-
# File 'app/controllers/sessions_controller.rb', line 4
+      
# File 'app/controllers/sessions_controller.rb', line 6
 
 def new
   super
@@ -275,7 +287,7 @@
 
 
       
diff --git a/Pearlception/doc/SessionsHelper.html b/Pearlception/doc/SessionsHelper.html
index f86087d..8857199 100644
--- a/Pearlception/doc/SessionsHelper.html
+++ b/Pearlception/doc/SessionsHelper.html
@@ -95,7 +95,7 @@
 
 
       
diff --git a/Pearlception/doc/StatisticsController.html b/Pearlception/doc/StatisticsController.html
index 5e90c03..cae2f29 100644
--- a/Pearlception/doc/StatisticsController.html
+++ b/Pearlception/doc/StatisticsController.html
@@ -192,20 +192,46 @@
 21
 22
 23
-24
+24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37
# File 'app/controllers/statistics_controller.rb', line 3
 
 def index
+    @suppliers = Supplier.all 
+    @distributors = Distributor.all
+    #filterUsed = false
+    runs = Run.all
     if params[:from_date] != nil && params[:to_date] != nil
         from_date = Date.strptime(params[:from_date], '%m/%d/%Y')
         to_date = Date.strptime(params[:to_date], '%m/%d/%Y')
-        runs = Run.where(:runDate => from_date.beginning_of_day..to_date.end_of_day)
-    else
-        runs = Run.all
+        #runs = Run.where(:runDate => from_date.beginning_of_day..to_date.end_of_day)
+        runs = runs.by_date(from_date.beginning_of_day..to_date.end_of_day)
     end
-    puts runs.inspect
+
+    if params[:supplier] != nil
+        runs = runs.by_supplier(params[:supplier])
+    end
+
+    if params[:distributor] != nil
+        runs = runs.by_distributor(params[:distributor])
+    end
+    #    runs = Run.all
+    #end
+    puts runs.inspect
     oysterData = []
     all_oysters = []
     runs.each do |run|
@@ -229,7 +255,7 @@
 
 
       
diff --git a/Pearlception/doc/StatisticsHelper.html b/Pearlception/doc/StatisticsHelper.html
index 75cc8c8..b724ae0 100644
--- a/Pearlception/doc/StatisticsHelper.html
+++ b/Pearlception/doc/StatisticsHelper.html
@@ -95,7 +95,7 @@
 
 
       
diff --git a/Pearlception/doc/Subdomain.html b/Pearlception/doc/Subdomain.html
index 6eb9591..d0b9fc0 100644
--- a/Pearlception/doc/Subdomain.html
+++ b/Pearlception/doc/Subdomain.html
@@ -202,7 +202,7 @@
 
 
       
diff --git a/Pearlception/doc/Supplier.html b/Pearlception/doc/Supplier.html
index 455b3e7..a89ba67 100644
--- a/Pearlception/doc/Supplier.html
+++ b/Pearlception/doc/Supplier.html
@@ -122,7 +122,7 @@
 
 
       
diff --git a/Pearlception/doc/SuppliersDistributorsController.html b/Pearlception/doc/SuppliersDistributorsController.html
index 360231d..b2dbe3c 100644
--- a/Pearlception/doc/SuppliersDistributorsController.html
+++ b/Pearlception/doc/SuppliersDistributorsController.html
@@ -677,7 +677,7 @@
 
 
       
diff --git a/Pearlception/doc/SuppliersDistributorsHelper.html b/Pearlception/doc/SuppliersDistributorsHelper.html
index c86c158..f134acf 100644
--- a/Pearlception/doc/SuppliersDistributorsHelper.html
+++ b/Pearlception/doc/SuppliersDistributorsHelper.html
@@ -95,7 +95,7 @@
 
 
       
diff --git a/Pearlception/doc/User.html b/Pearlception/doc/User.html
index c7b8aae..0b96eef 100644
--- a/Pearlception/doc/User.html
+++ b/Pearlception/doc/User.html
@@ -199,7 +199,7 @@
 
 
       
diff --git a/Pearlception/doc/_index.html b/Pearlception/doc/_index.html
index 46dfa41..883b277 100644
--- a/Pearlception/doc/_index.html
+++ b/Pearlception/doc/_index.html
@@ -343,7 +343,7 @@
 
 
       
diff --git a/Pearlception/doc/file.README.html b/Pearlception/doc/file.README.html
index 6d9576b..52ff165 100644
--- a/Pearlception/doc/file.README.html
+++ b/Pearlception/doc/file.README.html
@@ -86,7 +86,7 @@ application up and running.

diff --git a/Pearlception/doc/index.html b/Pearlception/doc/index.html index 36ef6fa..b81fa98 100644 --- a/Pearlception/doc/index.html +++ b/Pearlception/doc/index.html @@ -86,7 +86,7 @@ application up and running.

diff --git a/Pearlception/doc/top-level-namespace.html b/Pearlception/doc/top-level-namespace.html index 19f6c0d..079de3b 100644 --- a/Pearlception/doc/top-level-namespace.html +++ b/Pearlception/doc/top-level-namespace.html @@ -102,7 +102,7 @@