Merge branch 'master' of ssh://apples.lambdacomplex.org/git/scannr
Merge branch 'master' of ssh://apples.lambdacomplex.org/git/scannr

Conflicts:
.idea/workspace.xml
generateHourlys.php

  <?xml version="1.0" encoding="UTF-8"?>
  <project version="4">
  <component name="SqlDialectMappings">
  <file url="file://$PROJECT_DIR$/db.sql" dialect="PostgreSQL" />
  </component>
  </project>
 
 
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/js/flotr2" vcs="Git" />  
<mapping directory="$PROJECT_DIR$/pynma" vcs="Git" /> <mapping directory="$PROJECT_DIR$/pynma" vcs="Git" />
</component> </component>
</project> </project>
   
   
file:a/.idea/workspace.xml (deleted)
<?xml version="1.0" encoding="UTF-8"?>  
<project version="4">  
<component name="ChangeListManager">  
<list default="true" id="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" name="Default" comment="">  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/Chart.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/Chart.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/Color.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/Color.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/Flotr.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/Flotr.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/Graph.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/Graph.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/lib/base64.js" afterPath="$PROJECT_DIR$/js/flotr2/lib/base64.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/basic.json" afterPath="$PROJECT_DIR$/js/flotr2/make/basic.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/build.json" afterPath="$PROJECT_DIR$/js/flotr2/make/build.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/examples.js" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/examples.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/examples.json" afterPath="$PROJECT_DIR$/js/flotr2/make/examples.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/extending-flotr.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/extending-flotr.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/flotr2.json" afterPath="$PROJECT_DIR$/js/flotr2/make/flotr2.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/js/flotr2.stable.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/js/flotr2.stable.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/lib/codemirror/lib/util/formatting.js" afterPath="$PROJECT_DIR$/js/flotr2/examples/lib/codemirror/lib/util/formatting.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/generateHourlys.php" afterPath="$PROJECT_DIR$/generateHourlys.php" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/ie.json" afterPath="$PROJECT_DIR$/js/flotr2/make/ie.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/index.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/index.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/index.html" afterPath="$PROJECT_DIR$/js/flotr2/spec/index.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine-html.js" afterPath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine-html.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine.css" afterPath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine.css" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine.js" afterPath="$PROJECT_DIR$/js/flotr2/lib/jasmine/jasmine.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json-data.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json-data.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json-real-data.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json-real-data.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json.txt" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/json.txt" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/make/lib.json" afterPath="$PROJECT_DIR$/js/flotr2/make/lib.json" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/logarithmic-scale.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/logarithmic-scale.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/mouse-zoom-preview.html" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/mouse-zoom-preview.html" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/lib/prototype.js" afterPath="$PROJECT_DIR$/js/flotr2/lib/prototype.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/examples/old_examples/style.css" afterPath="$PROJECT_DIR$/js/flotr2/examples/old_examples/style.css" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/js/test-background.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/js/test-background.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/js/test-boundaries.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/js/test-boundaries.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/flotr2/spec/js/test-mountain-nulls.js" afterPath="$PROJECT_DIR$/js/flotr2/spec/js/test-mountain-nulls.js" />  
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />  
</list>  
<ignored path="scannr.iws" />  
<ignored path=".idea/workspace.xml" />  
<file path="/Dummy.txt" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1358585886245" ignored="false" />  
<file path="/calllog.php" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356153807482" ignored="false" />  
<file path="/scannr.py" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356154551131" ignored="false" />  
<file path="/start_script.py" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356155203132" ignored="false" />  
<file path="/a.java" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356155211924" ignored="false" />  
<file path="/a.php" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356155216083" ignored="false" />  
<file path="/calls.json.php" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356155700744" ignored="false" />  
<file path="/generateHourlys.php" changelist="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" time="1356960167594" ignored="false" />  
<option name="TRACKING_ENABLED" value="true" />  
<option name="SHOW_DIALOG" value="false" />  
<option name="HIGHLIGHT_CONFLICTS" value="true" />  
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />  
<option name="LAST_RESOLUTION" value="IGNORE" />  
</component>  
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />  
<component name="CreatePatchCommitExecutor">  
<option name="PATCH_PATH" value="" />  
</component>  
<component name="DaemonCodeAnalyzer">  
<disable_hints />  
</component>  
<component name="DebuggerManager">  
<breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">  
<breakpoint>  
<option name="NOTIFY_CAUGHT" value="true" />  
<option name="NOTIFY_UNCAUGHT" value="true" />  
<option name="ENABLED" value="false" />  
<option name="LOG_ENABLED" value="false" />  
<option name="LOG_EXPRESSION_ENABLED" value="false" />  
<option name="SUSPEND_POLICY" value="SuspendAll" />  
<option name="SUSPEND" value="true" />  
<option name="COUNT_FILTER_ENABLED" value="false" />  
<option name="COUNT_FILTER" value="0" />  
<option name="CONDITION_ENABLED" value="true" />  
<option name="CLASS_FILTERS_ENABLED" value="false" />  
<option name="INSTANCE_FILTERS_ENABLED" value="false" />  
<option name="CONDITION" value="" />  
<option name="LOG_MESSAGE" value="" />  
</breakpoint>  
<breakpoint>  
<option name="NOTIFY_CAUGHT" value="true" />  
<option name="NOTIFY_UNCAUGHT" value="true" />  
<option name="ENABLED" value="false" />  
<option name="LOG_ENABLED" value="false" />  
<option name="LOG_EXPRESSION_ENABLED" value="false" />  
<option name="SUSPEND_POLICY" value="SuspendAll" />  
<option name="SUSPEND" value="true" />  
<option name="COUNT_FILTER_ENABLED" value="false" />  
<option name="COUNT_FILTER" value="0" />  
<option name="CONDITION_ENABLED" value="true" />  
<option name="CLASS_FILTERS_ENABLED" value="false" />  
<option name="INSTANCE_FILTERS_ENABLED" value="false" />  
<option name="CONDITION" value="" />  
<option name="LOG_MESSAGE" value="" />  
</breakpoint>  
</breakpoint_any>  
<ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />  
<breakpoint_rules />  
<ui_properties />  
</component>  
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />  
<component name="FavoritesManager">  
<favorites_list name="scannr" />  
</component>  
<component name="FileEditorManager">  
<leaf>  
<file leaf-file-name="calllog.php" pinned="false" current="false" current-in-tab="false">  
<entry file="file://$PROJECT_DIR$/calllog.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="2" column="0" selection-start="34" selection-end="226" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
</file>  
<file leaf-file-name="calls.json.php" pinned="false" current="false" current-in-tab="false">  
<entry file="file://$PROJECT_DIR$/calls.json.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="13" column="53" selection-start="499" selection-end="499" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
</file>  
<file leaf-file-name="generateConvos.php" pinned="false" current="false" current-in-tab="false">  
<entry file="file://$PROJECT_DIR$/generateConvos.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
</file>  
<file leaf-file-name="generateHourlys.php" pinned="false" current="true" current-in-tab="true">  
<entry file="file://$PROJECT_DIR$/generateHourlys.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="31" column="170" selection-start="1499" selection-end="1499" vertical-scroll-proportion="0.58762884">  
<folding />  
</state>  
</provider>  
</entry>  
</file>  
<file leaf-file-name="getfile.php" pinned="false" current="false" current-in-tab="false">  
<entry file="file://$PROJECT_DIR$/getfile.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="11" column="13" selection-start="471" selection-end="539" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
</file>  
</leaf>  
</component>  
<component name="FindManager">  
<FindUsagesManager>  
<setting name="OPEN_NEW_TAB" value="false" />  
</FindUsagesManager>  
</component>  
<component name="Git.Settings">  
<option name="SYNC_SETTING" value="DONT" />  
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />  
</component>  
<component name="GitLogSettings">  
<option name="myDateState">  
<MyDateState />  
</option>  
</component>  
<component name="IdeDocumentHistory">  
<option name="changedFiles">  
<list>  
<option value="$PROJECT_DIR$/common.inc.php" />  
<option value="$PROJECT_DIR$/viewcalls.php" />  
<option value="$PROJECT_DIR$/calllog.php" />  
<option value="$PROJECT_DIR$/scannr.py" />  
<option value="$PROJECT_DIR$/calls.json.php" />  
<option value="$PROJECT_DIR$/generateHourlys.php" />  
</list>  
</option>  
</component>  
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP" />  
<component name="ProjectFrameBounds">  
<option name="y" value="22" />  
<option name="width" value="1680" />  
<option name="height" value="936" />  
</component>  
<component name="ProjectLevelVcsManager" settingsEditedManually="true">  
<OptionsSetting value="true" id="Add" />  
<OptionsSetting value="true" id="Remove" />  
<OptionsSetting value="true" id="Checkout" />  
<OptionsSetting value="true" id="Update" />  
<OptionsSetting value="true" id="Status" />  
<OptionsSetting value="true" id="Edit" />  
<ConfirmationsSetting value="0" id="Add" />  
<ConfirmationsSetting value="0" id="Remove" />  
</component>  
<component name="ProjectReloadState">  
<option name="STATE" value="0" />  
</component>  
<component name="ProjectView">  
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">  
<flattenPackages />  
<showMembers />  
<showModules />  
<showLibraryContents ProjectPane="true" />  
<hideEmptyPackages />  
<abbreviatePackageNames />  
<autoscrollToSource />  
<autoscrollFromSource />  
<sortByType />  
</navigator>  
<panes>  
<pane id="Scope" />  
<pane id="PackagesPane" />  
<pane id="ProjectPane">  
<subPane>  
<PATH>  
<PATH_ELEMENT>  
<option name="myItemId" value="scannr" />  
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />  
</PATH_ELEMENT>  
</PATH>  
<PATH>  
<PATH_ELEMENT>  
<option name="myItemId" value="scannr" />  
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />  
</PATH_ELEMENT>  
<PATH_ELEMENT>  
<option name="myItemId" value="scannr" />  
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />  
</PATH_ELEMENT>  
</PATH>  
</subPane>  
</pane>  
</panes>  
</component>  
<component name="PropertiesComponent">  
<property name="options.splitter.main.proportions" value="0.3" />  
<property name="WebServerToolWindowFactoryState" value="false" />  
<property name="options.lastSelected" value="tasks" />  
<property name="last_opened_file_path" value="$PROJECT_DIR$/../disclosr" />  
<property name="FullScreen" value="false" />  
<property name="options.splitter.details.proportions" value="0.2" />  
<property name="options.searchVisible" value="true" />  
</component>  
<component name="PyConsoleOptionsProvider">  
<option name="myPythonConsoleState">  
<PyConsoleSettings />  
</option>  
<option name="myDjangoConsoleState">  
<PyConsoleSettings />  
</option>  
</component>  
<component name="RecentsManager">  
<key name="CopyFile.RECENT_KEYS">  
<recent name="$PROJECT_DIR$" />  
</key>  
</component>  
<component name="RunManager">  
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">  
<TestRunner />  
<method />  
</configuration>  
<configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">  
<method />  
</configuration>  
<configuration default="true" type="tests" factoryName="Doctests">  
<option name="INTERPRETER_OPTIONS" value="" />  
<option name="PARENT_ENVS" value="true" />  
<envs />  
<option name="SDK_HOME" value="" />  
<option name="WORKING_DIRECTORY" value="" />  
<option name="IS_MODULE_SDK" value="false" />  
<module name="scannr" />  
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />  
<option name="SCRIPT_NAME" value="" />  
<option name="CLASS_NAME" value="" />  
<option name="METHOD_NAME" value="" />  
<option name="FOLDER_NAME" value="" />  
<option name="TEST_TYPE" value="TEST_SCRIPT" />  
<option name="PATTERN" value="" />  
<option name="USE_PATTERN" value="false" />  
<method />  
</configuration>  
<configuration default="true" type="JavascriptDebugSession" factoryName="Local" singleton="true">  
<JSDebuggerConfigurationSettings>  
<option name="engineId" value="embedded" />  
<option name="fileUrl" />  
</JSDebuggerConfigurationSettings>  
<method />  
</configuration>  
<list size="0" />  
</component>  
<component name="ShelveChangesManager" show_recycled="false" />  
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">  
<option name="USER" value="" />  
<option name="PASSWORD" value="" />  
<option name="mySSHConnectionTimeout" value="30000" />  
<option name="mySSHReadTimeout" value="30000" />  
<option name="LAST_MERGED_REVISION" />  
<option name="MERGE_DRY_RUN" value="false" />  
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />  
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />  
<option name="IGNORE_SPACES_IN_MERGE" value="false" />  
<option name="DETECT_NESTED_COPIES" value="true" />  
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />  
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />  
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />  
<option name="FORCE_UPDATE" value="false" />  
<option name="IGNORE_EXTERNALS" value="false" />  
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>  
</component>  
<component name="TaskManager">  
<task active="true" id="Default" summary="Default task">  
<changelist id="f90ee5b5-97e4-47ec-9b14-d4f4e896f100" name="Default" comment="" />  
<created>1350026709905</created>  
<updated>1350026709905</updated>  
</task>  
<servers />  
</component>  
<component name="ToolWindowManager">  
<frame x="0" y="22" width="1680" height="936" extended-state="6" />  
<editor active="false" />  
<layout>  
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />  
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />  
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />  
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />  
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32762837" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />  
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />  
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />  
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />  
<window_info id="Structure" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19645043" sideWeight="0.36797065" order="1" side_tool="true" content_ui="tabs" />  
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />  
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />  
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19645043" sideWeight="0.2958435" order="0" side_tool="false" content_ui="combo" />  
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />  
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />  
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />  
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />  
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />  
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />  
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />  
</layout>  
</component>  
<component name="VcsContentAnnotationSettings">  
<option name="myLimit" value="2678400000" />  
</component>  
<component name="VcsManagerConfiguration">  
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />  
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />  
<option name="CHECK_NEW_TODO" value="true" />  
<option name="myTodoPanelSettings">  
<value>  
<are-packages-shown value="false" />  
<are-modules-shown value="false" />  
<flatten-packages value="false" />  
<is-autoscroll-to-source value="false" />  
</value>  
</option>  
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />  
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />  
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />  
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />  
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />  
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />  
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />  
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />  
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />  
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />  
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />  
<option name="SHORT_DIFF_HORISONTALLY" value="true" />  
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />  
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />  
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />  
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />  
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />  
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />  
<option name="SHOW_DIRTY_RECURSIVELY" value="false" />  
<option name="LIMIT_HISTORY" value="true" />  
<option name="MAXIMUM_HISTORY_ROWS" value="1000" />  
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />  
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />  
<option name="LAST_COMMIT_MESSAGE" />  
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />  
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />  
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />  
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />  
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />  
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />  
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />  
<option name="ACTIVE_VCS_NAME" />  
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />  
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />  
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />  
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />  
</component>  
<component name="XDebuggerManager">  
<breakpoint-manager />  
</component>  
<component name="antWorkspaceConfiguration">  
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />  
<option name="FILTER_TARGETS" value="false" />  
</component>  
<component name="editorHistoryManager">  
<entry file="file://$PROJECT_DIR$/viewcalls.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="2" column="13" selection-start="46" selection-end="46" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/common.inc.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="34" column="0" selection-start="1179" selection-end="1179" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/calls.json.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="2" column="9" selection-start="42" selection-end="42" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/trunklog.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/../disclosr/include/template.inc.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="72" column="93" selection-start="2545" selection-end="2635" vertical-scroll-proportion="0.43404254" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/../disclosr/include/common.inc.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/../busui/myway/myway_timeliness.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="27" column="5" selection-start="1003" selection-end="1018" vertical-scroll-proportion="26.346153" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/snd.py">  
<provider selected="true" editor-type-id="text-editor">  
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/common.inc.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="60" column="117" selection-start="2262" selection-end="2262" vertical-scroll-proportion="-39.23077" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/viewcalls.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="41" column="69" selection-start="1388" selection-end="1388" vertical-scroll-proportion="1.2659575" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/scannr.py">  
<provider selected="true" editor-type-id="text-editor">  
<state line="80" column="64" selection-start="2271" selection-end="2271" vertical-scroll-proportion="0.0" />  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/calllog.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="2" column="0" selection-start="34" selection-end="226" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/calls.json.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="13" column="53" selection-start="499" selection-end="499" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/generateConvos.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/getfile.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="11" column="13" selection-start="471" selection-end="539" vertical-scroll-proportion="0.0">  
<folding />  
</state>  
</provider>  
</entry>  
<entry file="file://$PROJECT_DIR$/generateHourlys.php">  
<provider selected="true" editor-type-id="text-editor">  
<state line="31" column="170" selection-start="1499" selection-end="1499" vertical-scroll-proportion="0.58762884">  
<folding />  
</state>  
</provider>  
</entry>  
</component>  
</project>  
 
 
file:a/README.md (deleted)
# [HTML5 Boilerplate](http://html5boilerplate.com)  
 
HTML5 Boilerplate is a professional front-end template for building fast,  
robust, and adaptable web apps or sites.  
 
This project is the product of many years of iterative development and combined  
community knowledge. It does not impose a specific development philosophy or  
framework, so you're free to architect your code in the way that you want.  
 
* Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate)  
* Homepage: [http://html5boilerplate.com](http://html5boilerplate.com)  
* Twitter: [@h5bp](http://twitter.com/h5bp)  
 
 
## Quick start  
 
Choose one of the following options:  
 
1. Download the latest stable release from  
[html5boilerplate.com](http://html5boilerplate.com/) or a custom build from  
[Initializr](http://www.initializr.com).  
2. Clone the git repo — `git clone  
https://github.com/h5bp/html5-boilerplate.git` - and checkout the tagged  
release you'd like to use.  
 
 
## Features  
 
* HTML5 ready. Use the new elements with confidence.  
* Cross-browser compatible (Chrome, Opera, Safari, Firefox 3.6+, IE6+).  
* Designed with progressive enhancement in mind.  
* Includes [Normalize.css](http://necolas.github.com/normalize.css/) for CSS  
normalizations and common bug fixes.  
* The latest [jQuery](http://jquery.com/) via CDN, with a local fallback.  
* The latest [Modernizr](http://modernizr.com/) build for feature detection.  
* IE-specific classes for easier cross-browser control.  
* Placeholder CSS Media Queries.  
* Useful CSS helpers.  
* Default print CSS, performance optimized.  
* Protection against any stray `console.log` causing JavaScript errors in  
IE6/7.  
* An optimized Google Analytics snippet.  
* Apache server caching, compression, and other configuration defaults for  
Grade-A performance.  
* Cross-domain Ajax and Flash.  
* "Delete-key friendly." Easy to strip out parts you don't need.  
* Extensive inline and accompanying documentation.  
 
 
## Documentation  
 
Take a look at the [documentation table of  
contents](/h5bp/html5-boilerplate/blob/master/doc/README.md). This  
documentation is bundled with the project, which makes it readily available for  
offline reading and provides a useful starting point for any documentation  
you want to write about your project.  
 
 
## Contributing  
 
Anyone and everyone is welcome to  
[contribute](/h5bp/html5-boilerplate/blob/master/doc/contribute.md). Hundreds  
of developers have helped make the HTML5 Boilerplate what it is today.  
 
file:a/README.txt (deleted)
ffmpeg from http://ffmpeg.zeranoe.com/builds/  
<?php <?php
date_default_timezone_set("Australia/Sydney"); date_default_timezone_set("Australia/Sydney");
try { try {
$conn = new PDO("pgsql:dbname=scannr;user=postgres;password=snmc;host=localhost"); $conn = new PDO("pgsql:dbname=scannr;user=postgres;password=snmc;host=localhost");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) { } catch (PDOException $e) {
die('Unable to connect to database server.'); die('Unable to connect to database server.');
} }
catch (Exception $e) { catch (Exception $e) {
die('Unknown error in ' . __FILE__ . '.'); die('Unknown error in ' . __FILE__ . '.');
} }
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
$basePath = ""; $basePath = "";
$DATA_DIR = "./data"; $DATA_DIR = "./data";
   
/** Returns the offset from the origin timezone to the remote timezone, in seconds. /** Returns the offset from the origin timezone to the remote timezone, in seconds.
* @param $remote_tz; * @param $remote_tz;
* @param $origin_tz; If null the servers current timezone is used as the origin. * @param $origin_tz; If null the servers current timezone is used as the origin.
* @return int; * @return int;
*/ */
function get_timezone_offset($remote_tz, $origin_tz = null) function get_timezone_offset($remote_tz, $origin_tz = null)
{ {
if ($origin_tz === null) { if ($origin_tz === null) {
if (!is_string($origin_tz = date_default_timezone_get())) { if (!is_string($origin_tz = date_default_timezone_get())) {
return false; // A UTC timestamp was returned -- bail out! return false; // A UTC timestamp was returned -- bail out!
} }
} }
$origin_dtz = new DateTimeZone($origin_tz); $origin_dtz = new DateTimeZone($origin_tz);
$remote_dtz = new DateTimeZone($remote_tz); $remote_dtz = new DateTimeZone($remote_tz);
$origin_dt = new DateTime("now", $origin_dtz); $origin_dt = new DateTime("now", $origin_dtz);
$remote_dt = new DateTime("now", $remote_dtz); $remote_dt = new DateTime("now", $remote_dtz);
$offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt); $offset = $origin_dtz->getOffset($origin_dt) - $remote_dtz->getOffset($remote_dt);
return $offset; return $offset;
} }
   
   
function include_header($title) function include_header($title)
{ {
global $basePath; global $basePath;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]--> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]--> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title> <title></title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
   
<!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
   
<link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
   
  <link href="css/daterangepicker.css" rel="stylesheet">
<script src="js/vendor/modernizr-2.6.1.min.js"></script> <script src="js/vendor/modernizr-2.6.1.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<!--<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script>--> <!--<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script>-->
<script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script> <script type="text/javascript" src="<?php echo $basePath ?>js/flotr2/flotr2.js"></script>
<script src="js/plugins.js"></script> <script src="js/plugins.js"></script>
<script src="js/main.js"></script> <script src="js/main.js"></script>
  <!-- xcharts includes -->
  <script src="//cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.js"></script>
   
  <!-- The daterange picker bootstrap plugin -->
  <script src="js/sugar.min.js"></script>
  <script src="js/daterangepicker.js"></script>
</head> </head>
<body> <body>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser
today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to
better experience this site.</p> better experience this site.</p>
<![endif]--> <![endif]-->
   
<!-- Add your site or application content here --> <!-- Add your site or application content here -->
<?php <?php
} }
   
function include_footer() function include_footer()
{ {
global $basePath; global $basePath;
?> ?>
   
   
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script> <script>
var _gaq = [ var _gaq = [
['_setAccount', 'UA-XXXXX-X'], ['_setAccount', 'UA-XXXXX-X'],
['_trackPageview'] ['_trackPageview']
]; ];
(function (d, t) { (function (d, t) {
var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js'; g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s) s.parentNode.insertBefore(g, s)
}(document, 'script')); }(document, 'script'));
</script> </script>
</body> </body>
</html> </html>
   
<?php <?php
   
} }
   
   
file:a/cron.php (deleted)
<?php  
/*- scheduled tasks  
- combine recordings into conversations  
- using ffmpeg  
- conversations and recordings_to_conversations tables  
- remove all other wav files  
- delete old uninteresting conversations*/  
?>  
 
  .daterangepicker.dropdown-menu {
  max-width: none;
  }
 
  .daterangepicker.opensleft .ranges, .daterangepicker.opensleft .calendar {
  float: left;
  margin: 4px;
  }
 
  .daterangepicker.opensright .ranges, .daterangepicker.opensright .calendar {
  float: right;
  margin: 4px;
  }
 
  .daterangepicker .ranges {
  width: 160px;
  text-align: left;
  }
 
  .daterangepicker .ranges .range_inputs>div {
  float: left;
  }
 
  .daterangepicker .ranges .range_inputs>div:nth-child(2) {
  padding-left: 11px;
  }
 
  .daterangepicker .calendar {
  display: none;
  max-width: 230px;
  }
 
  .daterangepicker .calendar th, .daterangepicker .calendar td {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  white-space: nowrap;
  text-align: center;
  }
 
  .daterangepicker .ranges label {
  color: #333;
  font-size: 11px;
  margin-bottom: 2px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #fff;
  }
 
  .daterangepicker .ranges input {
  font-size: 11px;
  }
 
  .daterangepicker .ranges ul {
  list-style: none;
  margin: 0;
  padding: 0;
  }
 
  .daterangepicker .ranges li {
  font-size: 13px;
  background: #f5f5f5;
  border: 1px solid #f5f5f5;
  color: #08c;
  padding: 3px 12px;
  margin-bottom: 8px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  cursor: pointer;
  }
 
  .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
  background: #08c;
  border: 1px solid #08c;
  color: #fff;
  }
 
  .daterangepicker .calendar {
  border: 1px solid #ddd;
  padding: 4px;
  border-radius: 4px;
  background: #fff;
  }
 
  .daterangepicker {
  position: absolute;
  background: #fff;
  top: 100px;
  left: 20px;
  padding: 4px;
  margin-top: 1px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  }
 
  .daterangepicker.opensleft:before {
  position: absolute;
  top: -7px;
  right: 9px;
  display: inline-block;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ccc;
  border-left: 7px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  content: '';
  }
 
  .daterangepicker.opensleft:after {
  position: absolute;
  top: -6px;
  right: 10px;
  display: inline-block;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  border-left: 6px solid transparent;
  content: '';
  }
 
  .daterangepicker.opensright:before {
  position: absolute;
  top: -7px;
  left: 9px;
  display: inline-block;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ccc;
  border-left: 7px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  content: '';
  }
 
  .daterangepicker.opensright:after {
  position: absolute;
  top: -6px;
  left: 10px;
  display: inline-block;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
  border-left: 6px solid transparent;
  content: '';
  }
 
  .daterangepicker table {
  width: 100%;
  margin: 0;
  }
 
  .daterangepicker td, .daterangepicker th {
  text-align: center;
  width: 20px;
  height: 20px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  }
 
  .daterangepicker td.off {
  color: #999;
  }
  .daterangepicker td.disabled {
  color: #999;
  }
 
  .daterangepicker td.available:hover, .daterangepicker th.available:hover {
  background: #eee;
  }
 
  .daterangepicker td.in-range {
  background: #ebf4f8;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  }
 
  .daterangepicker td.active, .daterangepicker td.active:hover {
  background-color: #006dcc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(top, #0088cc, #0044cc);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  }
 
  .daterangepicker td.week, .daterangepicker th.week {
  font-size: 80%;
  color: #ccc;
  }
 
file:b/datepicker.php (new)
  bri<!DOCTYPE html>
  <html>
  <head>
  <meta charset="utf-8" />
 
  <title>Pretty Charts with jQuery and AJAX | Tutorialzine Demo</title>
  <!-- Include bootstrap css -->
  <link href="css/daterangepicker.css" rel="stylesheet">
 
  </head>
  <body>
  <div id="content">
 
  <form class="form-horizontal">
  <fieldset>
  <div class="input-prepend">
  <span class="add-on"><i class="icon-calendar"></i></span><input type="text" name="range" id="range" />
  </div>
  </fieldset>
  </form>
 
  <div id="placeholder">
  <figure id="chart"></figure>
  </div>
 
  </div>
 
  <footer>
  <h2><i>Tutorial:</i> Pretty Charts with jQuery and AJAX</h2>
  <a class="tzine" href="http://tutorialzine.com/2013/01/charts-jquery-ajax/">Head on to <i>Tutorial<b>zine</b></i> to read and download</a>
  </footer>
 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
 
  <!-- xcharts includes -->
  <script src="//cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.js"></script>
 
  <!-- The daterange picker bootstrap plugin -->
  <script src="js/sugar.min.js"></script>
  <script src="js/daterangepicker.js"></script>
 
  <!-- Our main script file -->
  <script src="js/script.js"></script>
  </body>
  </html>
 
file:a/db.sql -> file:b/db.sql
-- /usr/pgsql-9.1/bin/pg_dump --schema-only scannr -- /usr/pgsql-9.1/bin/pg_dump --schema-only scannr
-- --
-- PostgreSQL database dump -- PostgreSQL database dump
-- --
   
SET statement_timeout = 0; SET statement_timeout = 0;
SET client_encoding = 'UTF8'; SET client_encoding = 'UTF8';
SET standard_conforming_strings = on; SET standard_conforming_strings = on;
SET check_function_bodies = false; SET check_function_bodies = false;
SET client_min_messages = warning; SET client_min_messages = warning;
   
-- --
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
-- --
   
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
   
   
-- --
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
-- --
   
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
   
   
SET search_path = public, pg_catalog; SET search_path = public, pg_catalog;
   
SET default_tablespace = ''; SET default_tablespace = '';
   
SET default_with_oids = false; SET default_with_oids = false;
   
-- --
-- Name: recordings; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- Name: recordings; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
-- --
   
CREATE TABLE recordings ( CREATE TABLE recordings (
filename text NOT NULL, filename text NOT NULL,
tgid text, tgid text,
tgname text, tgname text,
sitename text, sitename text,
call_timestamp timestamp with time zone DEFAULT now(), call_timestamp timestamp with time zone DEFAULT now(),
length integer length integer
); );
   
   
ALTER TABLE public.recordings OWNER TO postgres; ALTER TABLE public.recordings OWNER TO postgres;
   
-- --
-- Name: tgids; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- Name: tgids; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
-- --
   
CREATE TABLE tgids ( CREATE TABLE tgids (
tgid text NOT NULL, tgid text NOT NULL,
subfleet smallint, subfleet smallint,
alpha_tag text NOT NULL, alpha_tag text NOT NULL,
mode character(1) DEFAULT 'D'::bpchar NOT NULL, mode character(1) DEFAULT 'D'::bpchar NOT NULL,
description text, description text,
service_tag text, service_tag text,
category text category text
); );
   
   
ALTER TABLE public.tgids OWNER TO postgres; ALTER TABLE public.tgids OWNER TO postgres;
   
-- --
-- Name: recordings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- Name: recordings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
-- --
   
ALTER TABLE ONLY recordings ALTER TABLE ONLY recordings
ADD CONSTRAINT recordings_pkey PRIMARY KEY (filename); ADD CONSTRAINT recordings_pkey PRIMARY KEY (filename);
   
   
-- --
-- Name: tgids_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- Name: tgids_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
-- --
   
ALTER TABLE ONLY tgids ALTER TABLE ONLY tgids
ADD CONSTRAINT tgids_pkey PRIMARY KEY (tgid); ADD CONSTRAINT tgids_pkey PRIMARY KEY (tgid);
   
   
-- --
-- Name: public; Type: ACL; Schema: -; Owner: postgres -- Name: public; Type: ACL; Schema: -; Owner: postgres
-- --
   
REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres; REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC; GRANT ALL ON SCHEMA public TO PUBLIC;
   
   
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --
   
  CREATE TABLE "compilation" (
  "filename" text NOT NULL,
  "files" text ARRAY NOT NULL,
  "datetime" timestamp NOT NULL
  );
   
  CREATE TABLE "trunk_log" (
  "id" text NOT NULL,
  "datetime" integer NOT NULL,
  "site" integer NOT NULL,
  "action" text NOT NULL,
  "sourcetype" character(1) NOT NULL,
  "sourceid" smallint NOT NULL,
  "targettype" character(1) NOT NULL,
  "targetid" smallint NOT NULL,
  "channel" smallint NOT NULL,
  "calltype" text NOT NULL
  );
   
file:a/generateConvos.php (deleted)
<?php  
//select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename), ' ') from recordings group by tgid, ahour, aday order by aday, ahour, tgid  
include('common.inc.php');  
$sth = $conn->prepare('select * from recordings limit 100;');  
 
$sth->execute();  
$recordings = $sth->fetchAll();  
$convos = Array();  
$convo = Array();  
foreach ($recordings as $i => $recording) {  
 
if (count($convo) > 0) {  
echo "<br> " . strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp']);  
if (abs(strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp'])) > 2) {  
echo " " . $convos[count($convos) - 1][0]['call_timestamp'] . " " . $recording['call_timestamp'];  
}  
if (strcasecmp($convos[count($convos) - 1][0]['tgid'], $recording['tgid']) != 0) {  
$convos[] = $convo;  
$convo = Array();  
}  
}  
;  
//print_r($recording);  
$convo[] = $recording;  
//print_r($convo);  
//echo "<br>\n";  
}  
foreach ($convos as $i => $convo) {  
foreach ($convo as $recording) {  
echo $recording['filename'] . " , ";  
}  
echo "<br><hr>\n";  
}  
?>  
 
 
<?php <?php
include('common.inc.php'); include('common.inc.php');
function processHourly($hourly) { function processHourly($hourly) {
$filename = str_replace(' ',"_",$hourly['tgid']).'-'.str_replace(' 00:00:00+1','',$hourly['aday']).'-'.$hourly['ahour'].'.3gp'; $filename = str_replace(' ',"_",$hourly['tgid']).'-'.str_replace(' 00:00:00+1','',$hourly['aday']).'-'.$hourly['ahour'].'.3gp';
   
if(!file_exists("hourly/".$filename)) { $hfilename = $hourly['tgid'] . '-' . str_replace(' 00:00:00+10', '', $hourly['aday']) . '-' . $hourly['ahour'] . '.3gp';
   
$filenames = explode(",",$hourly['filenames']); if (!file_exists("hourly/" . $hfilename)) {
$cmd = "/usr/local/bin/ffmpeg -filter_complex concat=n=".count($filenames).":v=0:a=1 -i data/".implode(" -i data/",$filenames)." -ar 8000 -ab 4.75k -ac 1 hourly/".$filename . ' 2>&1';  
  $filenames = explode(",", $hourly['filenames']);
  $cmd = "/usr/local/bin/ffmpeg -filter_complex concat=n=" . count($filenames) . ":v=0:a=1 -i data/" . implode(" -i data/", $filenames) . " -ar 8000 -ab 4.75k -ac 1 hourly/" . $hfilename . ' 2>&1';
//print_r($hourly); //print_r($hourly);
exec ( $cmd,$output,$returncode ); exec($cmd, $output, $returncode);
echo $cmd."<br>\n"; echo $cmd . "<br>\n";
if ($returncode != 10) { if ($returncode != 10) {
//print_r($output); print_r($output);
//die(); //die();
  } else {
  $q = " insert into compilations (filename files datetime) ('" . $hfilename . "',{'" . implode("', '", $filenames) . "'},'" . strtottime($hourly['aday'] . ' +' . $hourly['ahour'] . " hours')") . "' ";
   
  foreach ($filenames as $filename) {
  $q = "UPDATE recordings SET archived = '$hfilename' WHERE filename = '$filename' ";
  }
} }
   
} }
} }
/*$sth = $conn->prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, /*$sth = $conn->prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday,
count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;"); count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;");
   
  $sth = $conn->prepare("SELECT tgid, EXTRACT(HOUR FROM call_timestamp) ahour, date_trunc('day', call_timestamp) aday, COUNT(filename), array_to_string(array_agg(filename ORDER BY call_timestamp), ',') filenames FROM recordings GROUP BY tgid, ahour, aday ORDER BY aday DESC, ahour, tgid;");
  // TODO use tgid categories instead, tgid too specific
$sth->execute(); $sth->execute();
$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach($hourlies as $hourly) { foreach ($hourlies as $hourly) {
processHourly($hourly); processHourly($hourly);
} }
$sth = $conn->prepare("select 'hour' as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, $sth = $conn->prepare("select 'hour' as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday,
count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by ahour, aday order by aday DESC, ahour;"); count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by ahour, aday order by aday DESC, ahour;");
   
$sth->execute(); $sth->execute();
$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach($hourlies as $hourly) { foreach ($hourlies as $hourly) {
processHourly($hourly); processHourly($hourly);
} }
*/  
$sth = $conn->prepare("select coalesce(category,'unknown') as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, $sth = $conn->prepare("select coalesce(category,'unknown') as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday,
count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames
from recordings inner join tgids on recordings.tgid = tgids.tgid group by category, ahour, aday order by aday DESC, ahour, category;"); from recordings inner join tgids on recordings.tgid = tgids.tgid group by category, ahour, aday order by aday DESC, ahour, category;");
   
$sth->execute(); $sth->execute();
$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach($hourlies as $hourly) { foreach($hourlies as $hourly) {
processHourly($hourly); processHourly($hourly);
} }
   
   
  /**
  * @version: 1.0.1
  * @author: Dan Grossman http://www.dangrossman.info/
  * @date: 2012-08-20
  * @copyright: Copyright (c) 2012 Dan Grossman. All rights reserved.
  * @license: Licensed under Apache License v2.0. See http://www.apache.org/licenses/LICENSE-2.0
  * @website: http://www.improvely.com/
  */
  !function ($) {
 
  var DateRangePicker = function (element, options, cb) {
  var hasOptions = typeof options == 'object'
  var localeObject;
 
  //state
  this.startDate = Date.create('today');
  this.endDate = Date.create('today');
  this.minDate = false;
  this.maxDate = false;
  this.changed = false;
  this.cleared = false;
  this.ranges = {};
  this.opens = 'right';
  this.cb = function () { };
  this.format = '{MM}/{dd}/{yyyy}';
  this.separator = ' - ';
  this.showWeekNumbers = false;
  this.buttonClasses = ['btn-success'];
  this.locale = {
  applyLabel: 'Apply',
  clearLabel:"Clear",
  fromLabel: 'From',
  toLabel: 'To',
  weekLabel: 'W',
  customRangeLabel: 'Custom Range',
  daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
  monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  firstDay: 0
  };
 
  localeObject = this.locale;
 
  this.leftCalendar = {
  month: Date.create('today').set({ day: 1, month: this.startDate.getMonth(), year: this.startDate.getFullYear() }),
  calendar: Array()
  };
 
  this.rightCalendar = {
  month: Date.create('today').set({ day: 1, month: this.endDate.getMonth(), year: this.endDate.getFullYear() }),
  calendar: Array()
  };
 
  //element that triggered the date range picker
  this.element = $(element);
 
  if (this.element.hasClass('pull-right'))
  this.opens = 'left';
 
  if (this.element.is('input')) {
  this.element.on({
  click: $.proxy(this.show, this),
  focus: $.proxy(this.show, this)
  });
  } else {
  this.element.on('click', $.proxy(this.show, this));
  }
 
  if (hasOptions) {
  if(typeof options.locale == 'object') {
  $.each(localeObject, function (property, value) {
  localeObject[property] = options.locale[property] || value;
  });
  }
  }
 
  var DRPTemplate = '<div class="daterangepicker dropdown-menu">' +
  '<div class="calendar left"></div>' +
  '<div class="calendar right"></div>' +
  '<div class="ranges">' +
  '<div class="range_inputs">' +
  '<div class="daterangepicker_start_input" style="float: left">' +
  '<label for="daterangepicker_start">' + this.locale.fromLabel + '</label>' +
  '<input class="input-mini" type="text" name="daterangepicker_start" value="" disabled="disabled" />' +
  '</div>' +
  '<div class="daterangepicker_end_input" style="float: left; padding-left: 11px">' +
  '<label for="daterangepicker_end">' + this.locale.toLabel + '</label>' +
  '<input class="input-mini" type="text" name="daterangepicker_end" value="" disabled="disabled" />' +
  '</div>' +
  '<button class="btn btn-small btn-success applyBtn" disabled="disabled">' + this.locale.applyLabel + '</button>&nbsp;' +
  '<button class="btn btn-small clearBtn">' + this.locale.clearLabel + '</button>' +
  '</div>' +
  '</div>' +
  '</div>';
 
  this.container = $(DRPTemplate).appendTo('body');
 
  if (hasOptions) {
 
  if (typeof options.format == 'string')
  this.format = options.format;
 
  if (typeof options.separator == 'string')
  this.separator = options.separator;
 
  if (typeof options.startDate == 'string')
  this.startDate = Date.create(options.startDate);
 
  if (typeof options.endDate == 'string')
  this.endDate = Date.create(options.endDate);
 
  if (typeof options.minDate == 'string')
  this.minDate = Date.create(options.minDate);
 
  if (typeof options.maxDate == 'string')
  this.maxDate = Date.create(options.maxDate);
 
 
  if (typeof options.startDate == 'object')
  this.startDate = options.startDate;
 
  if (typeof options.endDate == 'object')
  this.endDate = options.endDate;
 
  if (typeof options.minDate == 'object')
  this.minDate = options.minDate;
 
  if (typeof options.maxDate == 'object')
  this.maxDate = options.maxDate;
 
  if (typeof options.ranges == 'object') {
  for (var range in options.ranges) {
 
  var start = options.ranges[range][0];
  var end = options.ranges[range][1];
 
  if (typeof start == 'string')
  start = Date.create(start);
 
  if (typeof end == 'string')
  end = Date.create(end);
 
  // If we have a min/max date set, bound this range
  // to it, but only if it would otherwise fall
  // outside of the min/max.
  if (this.minDate && start < this.minDate)
  start = this.minDate;
 
  if (this.maxDate && end > this.maxDate)
  end = this.maxDate;
 
  // If the end of the range is before the minimum (if min is set) OR
  // the start of the range is after the max (also if set) don't display this
  // range option.
  if ((this.minDate && end < this.minDate) || (this.maxDate && start > this.maxDate))
  {
  continue;
  }
 
  this.ranges[range] = [start, end];
  }
 
  var list = '<ul>';
  for (var range in this.ranges) {
  list += '<li>' + range + '</li>';
  }
  list += '<li>' + this.locale.customRangeLabel + '</li>';
  list += '</ul>';
  this.container.find('.ranges').prepend(list);
  }
 
  // update day names order to firstDay
  if (typeof options.locale == 'object') {
  if (typeof options.locale.firstDay == 'number') {
  this.locale.firstDay = options.locale.firstDay;
  var iterator = options.locale.firstDay;
  while (iterator > 0) {
  this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
  iterator--;
  }
  }
  }
 
  if (typeof options.opens == 'string')
  this.opens = options.opens;
 
  if (typeof options.showWeekNumbers == 'boolean') {
  this.showWeekNumbers = options.showWeekNumbers;
  }
 
  if (typeof options.buttonClasses == 'string') {
  this.buttonClasses = [options.buttonClasses];
  }
 
  if (typeof options.buttonClasses == 'object') {
  this.buttonClasses = options.buttonClasses;
  }
 
  }
 
  //apply CSS classes to buttons
  var c = this.container;
  $.each(this.buttonClasses, function (idx, val) {
  c.find('button').addClass(val);
  });
 
  if (this.opens == 'right') {
  //swap calendar positions
  var left = this.container.find('.calendar.left');
  var right = this.container.find('.calendar.right');
  left.removeClass('left').addClass('right');
  right.removeClass('right').addClass('left');
  }
 
  if (typeof options == 'undefined' || typeof options.ranges == 'undefined')
  this.container.find('.calendar').show();
 
  if (typeof cb == 'function')
  this.cb = cb;
 
  this.container.addClass('opens' + this.opens);
 
  //event listeners
  this.container.on('mousedown', $.proxy(this.mousedown, this));
  this.container.find('.calendar').on('click', '.prev', $.proxy(this.clickPrev, this));
  this.container.find('.calendar').on('click', '.next', $.proxy(this.clickNext, this));
  this.container.find('.ranges').on('click', 'button.applyBtn', $.proxy(this.clickApply, this));
  this.container.find('.ranges').on('click', 'button.clearBtn', $.proxy(this.clickClear, this));
 
  this.container.find('.calendar').on('click', 'td.available', $.proxy(this.clickDate, this));
  this.container.find('.calendar').on('mouseenter', 'td.available', $.proxy(this.enterDate, this));
  this.container.find('.calendar').on('mouseleave', 'td.available', $.proxy(this.updateView, this));
 
  this.container.find('.ranges').on('click', 'li', $.proxy(this.clickRange, this));
  this.container.find('.ranges').on('mouseenter', 'li', $.proxy(this.enterRange, this));
  this.container.find('.ranges').on('mouseleave', 'li', $.proxy(this.updateView, this));
 
  this.element.on('keyup', $.proxy(this.updateFromControl, this));
 
  this.updateView();
  this.updateCalendars();
 
  };
 
  DateRangePicker.prototype = {
 
  constructor: DateRangePicker,
 
  mousedown: function (e) {
  e.stopPropagation();
  e.preventDefault();
  },
 
  updateView: function () {
  this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
  this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
 
  this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.format));
  this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.format));
 
  if (this.startDate.is(this.endDate) || this.startDate.isBefore(this.endDate)) {
  this.container.find('button.applyBtn').removeAttr('disabled');
  } else {
  this.container.find('button.applyBtn').attr('disabled', 'disabled');
  }
  },
 
  updateFromControl: function () {
  if (!this.element.is('input')) return;
 
  var dateString = this.element.val().split(this.separator);
  var start = Date.create(dateString[0]);
  var end = Date.create(dateString[1]);
 
  if (start == null || end == null) return;
  if (end.isBefore(start)) return;
 
  this.startDate = start;
  this.endDate = end;
 
  this.updateView();
  this.cb(this.startDate, this.endDate);
  this.updateCalendars();
  },
 
  notify: function () {
  if (!this.cleared) {
  this.updateView();
  }
 
  if (this.element.is('input')) {
  this.element.val(this.cleared ? '' : this.startDate.format(this.format) + this.separator + this.endDate.format(this.format));
  }
  var arg1 = (this.cleared ? null : this.startDate),
  arg2 = (this.cleared ? null : this.endDate);
  this.cleared = false;
  this.cb(arg1,arg2);
  },
 
  move: function () {
  if (this.opens == 'left') {
  this.container.css({
  top: this.element.offset().top + this.element.outerHeight(),
  right: $(window).width() - this.element.offset().left - this.element.outerWidth(),
  left: 'auto'
  });
  } else {
  this.container.css({
  top: this.element.offset().top + this.element.outerHeight(),
  left: this.element.offset().left,
  right: 'auto'
  });
  }
  },
 
  show: function (e) {
  this.container.show();
  this.move();
 
  if (e) {
  e.stopPropagation();
  e.preventDefault();
  }
 
  this.changed = false;
 
  this.element.trigger('shown',{target:e.target,picker:this});
 
  $(document).on('mousedown', $.proxy(this.hide, this));
  },
 
  hide: function (e) {
  this.container.hide();
  $(document).off('mousedown', this.hide);
 
  if (this.changed) {
  this.changed = false;
  this.notify();
  }
  },
 
  enterRange: function (e) {
  var label = e.target.innerHTML;
  if (label == this.locale.customRangeLabel) {
  this.updateView();
  } else {
  var dates = this.ranges[label];
  this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.format));
  this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.format));
  }
  },
 
  clickRange: function (e) {
  var label = e.target.innerHTML;
  if (label == this.locale.customRangeLabel) {
  this.container.find('.calendar').show();
  } else {
  var dates = this.ranges[label];
 
  this.startDate = dates[0];
  this.endDate = dates[1];
 
  this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
  this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
  this.updateCalendars();
 
  this.changed = true;
 
  this.container.find('.calendar').hide();
  this.hide();
  }
  },
 
  clickPrev: function (e) {
  var cal = $(e.target).parents('.calendar');
  if (cal.hasClass('left')) {
  this.leftCalendar.month.addMonths(-1);
  } else {
  this.rightCalendar.month.addMonths(-1);
  }
  this.updateCalendars();
  },
 
  clickNext: function (e) {
  var cal = $(e.target).parents('.calendar');
  if (cal.hasClass('left')) {
  this.leftCalendar.month.addMonths(1);
  } else {
  this.rightCalendar.month.addMonths(1);
  }
  this.updateCalendars();
  },
 
  enterDate: function (e) {
 
  var title = $(e.target).attr('title');
  var row = title.substr(1, 1);
  var col = title.substr(3, 1);
  var cal = $(e.target).parents('.calendar');
 
  if (cal.hasClass('left')) {
  this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].format(this.format));
  } else {
  this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].format(this.format));
  }
 
  },
 
  clickDate: function (e) {
  var title = $(e.target).attr('title');
  var row = title.substr(1, 1);
  var col = title.substr(3, 1);
  var cal = $(e.target).parents('.calendar');
 
  if (cal.hasClass('left')) {
  startDate = this.leftCalendar.calendar[row][col];
  endDate = this.endDate;
  this.element.trigger('clicked',{
  dir: 'left',
  picker: this
  });
  } else {
  startDate = this.startDate;
  endDate = this.rightCalendar.calendar[row][col];
  this.element.trigger('clicked',{
  dir: 'right',
  picker: this
  });
  }
 
  cal.find('td').removeClass('active');
 
  if (startDate.is(endDate) || startDate.isBefore(endDate)) {
  $(e.target).addClass('active');
  if (!startDate.is(this.startDate) || !endDate.is(this.endDate))
  this.changed = true;
  this.startDate = startDate;
  this.endDate = endDate;
  }
  else if (startDate.isAfter(endDate)) {
  $(e.target).addClass('active');
  this.changed = true;
  this.startDate = startDate;
  this.endDate = startDate.clone().addDays(1);
  }
 
  this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
  this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
  this.updateCalendars();
  },
 
  clickApply: function (e) {
  this.hide();
  },
 
  clickClear: function (e) {
  this.changed = true;
  this.cleared = true;
  this.hide();
  },
 
  updateCalendars: function () {
  this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.getMonth(), this.leftCalendar.month.getFullYear());
  this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.getMonth(), this.rightCalendar.month.getFullYear());
  this.container.find('.calendar.left').html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate));
  this.container.find('.calendar.right').html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.startDate, this.maxDate));
  this.element.trigger('updated',this);
  },
 
  buildCalendar: function (month, year) {
 
  var firstDay = Date.create('today').set({ day: 1, month: month, year: year });
  var lastMonth = firstDay.clone().addDays(-1).getMonth();
  var lastYear = firstDay.clone().addDays(-1).getFullYear();
 
  var daysInMonth = this.getDaysInMonth(year, month);
  var daysInLastMonth = this.getDaysInMonth(lastYear, lastMonth);
 
  var dayOfWeek = firstDay.getDay();
 
  //initialize a 6 rows x 7 columns array for the calendar
  var calendar = Array();
  for (var i = 0; i < 6; i++) {
  calendar[i] = Array();
  }
 
  //populate the calendar with date objects
  var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
  if (startDay > daysInLastMonth)
  startDay -= 7;
 
  if (dayOfWeek == this.locale.firstDay)
  startDay = daysInLastMonth - 6;
 
  var curDate = Date.create('today').set({ day: startDay, month: lastMonth, year: lastYear });
  for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = curDate.clone().addDays(1)) {
  if (i > 0 && col % 7 == 0) {
  col = 0;
  row++;
  }
  calendar[row][col] = curDate;
  }
 
  return calendar;
 
  },
 
  renderCalendar: function (calendar, selected, minDate, maxDate) {
  var html = '<table class="table-condensed">';
  html += '<thead>';
  html += '<tr>';
 
  // add empty cell for week number
  if (this.showWeekNumbers)
  html += '<th></th>';
 
  if (!minDate || minDate < calendar[1][1])
  {
  html += '<th class="prev available"><i class="icon-arrow-left"></i></th>';
  }
  else
  {
  html += '<th></th>';
  }
  html += '<th colspan="5" style="width: auto">' + this.locale.monthNames[calendar[1][1].getMonth()] + calendar[1][1].format(' {yyyy}') + '</th>';
  if (!maxDate || maxDate > calendar[1][1])
  {
  html += '<th class="next available"><i class="icon-arrow-right"></i></th>';
  }
  else
  {
  html += '<th></th>';
  }
 
  html += '</tr>';
  html += '<tr>';
 
  // add week number label
  if (this.showWeekNumbers)
  html += '<th class="week">' + this.locale.weekLabel + '</th>';
 
  $.each(this.locale.daysOfWeek, function (index, dayOfWeek) {
  html += '<th>' + dayOfWeek + '</th>';
  });
 
  html += '</tr>';
  html += '</thead>';
  html += '<tbody>';
 
  for (var row = 0; row < 6; row++) {
  html += '<tr>';
 
  // add week number
  if (this.showWeekNumbers)
  html += '<td class="week">' + calendar[row][0].getWeek() + '</td>';
 
  for (var col = 0; col < 7; col++) {
  var cname = 'available ';
  cname += (calendar[row][col].getMonth() == calendar[1][1].getMonth()) ? '' : 'off';
 
  // Normalise the time so the comparison won't fail
  selected.setHours(0,0,0,0);
 
  if ( (minDate && calendar[row][col] < minDate) || (maxDate && calendar[row][col] > maxDate))
  {
  cname = ' off disabled ';
  }
  else if (calendar[row][col].is(selected))
  {
  cname += ' active ';
  if (calendar[row][col].is(this.startDate)) { cname += ' start-date '; }
  if (calendar[row][col].is(this.endDate)) { cname += ' end-date '; }
  }
  else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate)
  {
  cname += ' in-range ';
  if (calendar[row][col].is(this.startDate)) { cname += ' start-date '; }
  if (calendar[row][col].is(this.endDate)) { cname += ' end-date '; }
  }
 
  var title = 'r' + row + 'c' + col;
  html += '<td class="' + cname.replace(/\s+/g,' ').replace(/^\s?(.*?)\s?$/,'$1') + '" title="' + title + '">' + calendar[row][col].getDate() + '</td>';
  }
  html += '</tr>';
  }
 
  html += '</tbody>';
  html += '</table>';
 
  return html;
 
  },
 
  getDaysInMonth: function (y, m) {
  return /8|3|5|10/.test(--m)?30:m==1?(!(y%4)&&y%100)||!(y%400)?29:28:31;
  }
 
  };
 
  $.fn.daterangepicker = function (options, cb) {
  this.each(function() {
  var el = $(this);
  if (!el.data('daterangepicker'))
  el.data('daterangepicker', new DateRangePicker(el, options, cb));
  });
  return this;
  };
 
  } (window.jQuery);
 
file:b/js/script.js~ (new)
  $(function() {
 
  // Set the default dates
  var startDate = Date.create().addDays(-6), // 7 days ago
  endDate = Date.create(); // today
 
  var range = $('#range');
 
  // Show the dates in the range input
  range.val(startDate.format('{MM}/{dd}/{yyyy}') + ' - ' + endDate.format('{MM}/{dd}/{yyyy}'));
 
  // Load chart
  ajaxLoadChart(startDate,endDate);
 
  range.daterangepicker({
 
  startDate: startDate,
  endDate: endDate,
 
  ranges: {
  'Today': ['today', 'today'],
  'Yesterday': ['yesterday', 'yesterday'],
  'Last 7 Days': [Date.create().addDays(-6), 'today'],
  'Last 30 Days': [Date.create().addDays(-29), 'today']
  }
  },function(start, end){
 
  ajaxLoadChart(start, end);
 
  });
 
  // The tooltip shown over the chart
  var tt = $('<div class="ex-tooltip">').appendTo('body'),
  topOffset = -32;
 
  var data = {
  "xScale" : "time",
  "yScale" : "linear",
  "main" : [{
  className : ".stats",
  "data" : []
  }]
  };
 
  var opts = {
  paddingLeft : 50,
  paddingTop : 20,
  paddingRight : 10,
  axisPaddingLeft : 25,
  tickHintX: 9, // How many ticks to show horizontally
 
  dataFormatX : function(x) {
 
  // This turns converts the timestamps coming from
  // ajax.php into a proper JavaScript Date object
 
  return Date.create(x);
  },
 
  tickFormatX : function(x) {
 
  // Provide formatting for the x-axis tick labels.
  // This uses sugar's format method of the date object.
 
  return x.format('{MM}/{dd}');
  },
 
  "mouseover": function (d, i) {
  var pos = $(this).offset();
 
  tt.text(d.x.format('{Month} {ord}') + ': ' + d.y).css({
 
  top: topOffset + pos.top,
  left: pos.left
 
  }).show();
  },
 
  "mouseout": function (x) {
  tt.hide();
  }
  };
 
  // Create a new xChart instance, passing the type
  // of chart a data set and the options object
 
  var chart = new xChart('line-dotted', data, '#chart' , opts);
 
  // Function for loading data via AJAX and showing it on the chart
  function ajaxLoadChart(startDate,endDate) {
 
  // If no data is passed (the chart was cleared)
 
  if(!startDate || !endDate){
  chart.setData({
  "xScale" : "time",
  "yScale" : "linear",
  "main" : [{
  className : ".stats",
  data : []
  }]
  });
 
  return;
  }
 
  // Otherwise, issue an AJAX request
 
  $.getJSON('ajax.php', {
 
  start: startDate.format('{yyyy}-{MM}-{dd}'),
  end: endDate.format('{yyyy}-{MM}-{dd}')
 
  }, function(data) {
 
  var set = [];
  $.each(data, function() {
  set.push({
  x : this.label,
  y : parseInt(this.value, 10)
  });
  });
 
  chart.setData({
  "xScale" : "time",
  "yScale" : "linear",
  "main" : [{
  className : ".stats",
  data : set
  }]
  });
 
  });
  }
  });
 
file:b/js/sugar.min.js (new)
  /*
  * Sugar Library v1.3.7
  *
  * Freely distributable and licensed under the MIT-style license.
  * Copyright (c) 2012 Andrew Plummer
  * http://sugarjs.com/
  *
  * ---------------------------- */
  (function(){var k=true,l=null,n=false;function aa(a){return function(){return a}}var p=Object,q=Array,r=RegExp,s=Date,t=String,u=Number,v=Math,ba=typeof global!=="undefined"?global:this,ca=p.defineProperty&&p.defineProperties,x="Array,Boolean,Date,Function,Number,String,RegExp".split(","),da=y(x[0]),ea=y(x[1]),fa=y(x[2]),A=y(x[3]),B=y(x[4]),C=y(x[5]),D=y(x[6]);function y(a){return function(b){return p.prototype.toString.call(b)==="[object "+a+"]"}}
  function ga(a){if(!a.SugarMethods){ha(a,"SugarMethods",{});E(a,n,n,{restore:function(){var b=arguments.length===0,c=F(arguments);G(a.SugarMethods,function(d,e){if(b||c.indexOf(d)>-1)ha(e.wa?a.prototype:a,d,e.method)})},extend:function(b,c,d){E(a,d!==n,c,b)}})}}function E(a,b,c,d){var e=b?a.prototype:a,f;ga(a);G(d,function(h,i){f=e[h];if(typeof c==="function")i=ia(e[h],i,c);if(c!==n||!e[h])ha(e,h,i);a.SugarMethods[h]={wa:b,method:i,Da:f}})}
  function H(a,b,c,d,e){var f={};d=C(d)?d.split(","):d;d.forEach(function(h,i){e(f,h,i)});E(a,b,c,f)}function ia(a,b,c){return function(){return a&&(c===k||!c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}function ha(a,b,c){if(ca)p.defineProperty(a,b,{value:c,configurable:k,enumerable:n,writable:k});else a[b]=c}function F(a,b){var c=[],d;for(d=0;d<a.length;d++){c.push(a[d]);b&&b.call(a,a[d],d)}return c}
  function ja(a,b,c){F(q.prototype.concat.apply([],q.prototype.slice.call(a,c||0)),b)}function ka(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}function I(a){return a!==void 0}function K(a){return a===void 0}function la(a){return a&&typeof a==="object"}function ma(a){return!!a&&p.prototype.toString.call(a)==="[object Object]"&&"hasOwnProperty"in a}function L(a,b){return p.hasOwnProperty.call(a,b)}function G(a,b){for(var c in a)if(L(a,c))if(b.call(a,c,a[c],a)===n)break}
  function na(a,b){G(b,function(c){a[c]=b[c]});return a}function oa(a){na(this,a)}oa.prototype.constructor=p;function pa(a,b,c,d){var e=[];a=parseInt(a);for(var f=d<0;!f&&a<=b||f&&a>=b;){e.push(a);c&&c.call(this,a);a+=d||1}return e}function N(a,b,c){c=v[c||"round"];var d=v.pow(10,v.abs(b||0));if(b<0)d=1/d;return c(a*d)/d}function qa(a,b){return N(a,b,"floor")}function O(a,b,c,d){d=v.abs(a).toString(d||10);d=ra(b-d.replace(/\.\d+/,"").length,"0")+d;if(c||a<0)d=(a<0?"-":"+")+d;return d}
  function sa(a){if(a>=11&&a<=13)return"th";else switch(a%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}function ta(){return"\t\n\u000b\u000c\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff"}function ra(a,b){return q(v.max(0,I(a)?a:1)+1).join(b||"")}function ua(a,b){var c=a.toString().match(/[^/]*$/)[0];if(b)c=(c+b).split("").sort().join("").replace(/([gimy])\1+/g,"$1");return c}
  function P(a){C(a)||(a=t(a));return a.replace(/([\\/'*+?|()\[\]{}.^$])/g,"\\$1")}function va(a,b){var c=typeof a,d,e,f,h,i,j;if(c==="string")return a;f=p.prototype.toString.call(a);d=ma(a);e=f==="[object Array]";if(a!=l&&d||e){b||(b=[]);if(b.length>1)for(j=b.length;j--;)if(b[j]===a)return"CYC";b.push(a);d=t(a.constructor);h=e?a:p.keys(a).sort();for(j=0;j<h.length;j++){i=e?j:h[j];d+=i+va(a[i],b)}b.pop()}else d=1/a===-Infinity?"-0":t(a&&a.valueOf?a.valueOf():a);return c+f+d}
  function wa(a){var b=p.prototype.toString.call(a);return b==="[object Date]"||b==="[object Array]"||b==="[object String]"||b==="[object Number]"||b==="[object RegExp]"||b==="[object Boolean]"||b==="[object Arguments]"||ma(a)}function xa(a,b,c){var d=[],e=a.length,f=b[b.length-1]!==n,h;F(b,function(i){if(ea(i))return n;if(f){i%=e;if(i<0)i=e+i}h=c?a.charAt(i)||"":a[i];d.push(h)});return d.length<2?d[0]:d}
  function ya(a,b){H(b,k,n,a,function(c,d){c[d+(d==="equal"?"s":"")]=function(){return p[d].apply(l,[this].concat(F(arguments)))}})}ga(p);G(x,function(a,b){ga(ba[b])});
  E(p,n,n,{keys:function(a){var b=[];if(!la(a)&&!D(a)&&!A(a))throw new TypeError("Object required");G(a,function(c){b.push(c)});return b}});
  function za(a,b,c,d){var e=a.length,f=d==-1,h=f?e-1:0;c=isNaN(c)?h:parseInt(c>>0);if(c<0)c=e+c;if(!f&&c<0||f&&c>=e)c=h;for(;f&&c>=0||!f&&c<e;){if(a[c]===b)return c;c+=d}return-1}function Aa(a,b,c,d){var e=a.length,f=0,h=I(c);ka(b);if(e==0&&!h)throw new TypeError("Reduce called on empty array with no initial value");else if(h)c=c;else{c=a[d?e-1:f];f++}for(;f<e;){h=d?e-f-1:f;if(h in a)c=b(c,a[h],h,a);f++}return c}
  function Ba(a){if(a.length===0)throw new TypeError("First argument must be defined");}E(q,n,n,{isArray:function(a){return da(a)}});
  E(q,k,n,{every:function(a,b){var c=this.length,d=0;for(Ba(arguments);d<c;){if(d in this&&!a.call(b,this[d],d,this))return n;d++}return k},some:function(a,b){var c=this.length,d=0;for(Ba(arguments);d<c;){if(d in this&&a.call(b,this[d],d,this))return k;d++}return n},map:function(a,b){var c=this.length,d=0,e=Array(c);for(Ba(arguments);d<c;){if(d in this)e[d]=a.call(b,this[d],d,this);d++}return e},filter:function(a,b){var c=this.length,d=0,e=[];for(Ba(arguments);d<c;){d in this&&a.call(b,this[d],d,this)&&
  e.push(this[d]);d++}return e},indexOf:function(a,b){if(C(this))return this.indexOf(a,b);return za(this,a,b,1)},lastIndexOf:function(a,b){if(C(this))return this.lastIndexOf(a,b);return za(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(ka(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return Aa(this,a,b)},reduceRight:function(a,b){return Aa(this,a,b,k)}});
  E(Function,k,n,{bind:function(a){var b=this,c=F(arguments).slice(1),d;if(!A(this))throw new TypeError("Function.prototype.bind called on a non-function");d=function(){return b.apply(b.prototype&&this instanceof b?this:a,c.concat(F(arguments)))};d.prototype=this.prototype;return d}});E(s,n,n,{now:function(){return(new s).getTime()}});
  (function(){var a=ta().match(/^\s+$/);try{t.prototype.trim.call([1])}catch(b){a=n}E(t,k,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(r("^["+ta()+"]+"),"")},trimRight:function(){return this.replace(r("["+ta()+"]+$"),"")}})})();
  (function(){var a=new s(s.UTC(1999,11,31));a=a.toISOString&&a.toISOString()==="1999-12-31T00:00:00.000Z";H(s,k,!a,"toISOString,toJSON",function(b,c){b[c]=function(){return O(this.getUTCFullYear(),4)+"-"+O(this.getUTCMonth()+1,2)+"-"+O(this.getUTCDate(),2)+"T"+O(this.getUTCHours(),2)+":"+O(this.getUTCMinutes(),2)+":"+O(this.getUTCSeconds(),2)+"."+O(this.getUTCMilliseconds(),3)+"Z"}})})();
  function Ca(a,b,c,d){var e=k;if(a===b)return k;else if(D(b)&&C(a))return r(b).test(a);else if(A(b))return b.apply(c,d);else if(ma(b)&&la(a)){G(b,function(f){Ca(a[f],b[f],c,[a[f],a])||(e=n)});return e}else return wa(a)&&wa(b)?va(a)===va(b):a===b}function R(a,b,c,d){return K(b)?a:A(b)?b.apply(c,d||[]):A(a[b])?a[b].call(a):a[b]}
  function S(a,b,c,d){var e,f;if(c<0)c=a.length+c;f=isNaN(c)?0:c;for(c=d===k?a.length+f:a.length;f<c;){e=f%a.length;if(e in a){if(b.call(a,a[e],e,a)===n)break}else return Ea(a,b,f,d);f++}}function Ea(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(parseInt(e));d.sort().each(function(f){return b.call(a,a[f],f,a)});return a}function Fa(a,b,c,d,e){var f,h;S(a,function(i,j,g){if(Ca(i,b,g,[i,j,g])){f=i;h=j;return n}},c,d);return e?h:f}
  function Ga(a,b){var c=[],d={},e;S(a,function(f,h){e=b?R(f,b,a,[f,h,a]):f;Ha(d,e)||c.push(f)});return c}function Ia(a,b,c){var d=[],e={};b.each(function(f){Ha(e,f)});a.each(function(f){var h=va(f),i=!wa(f);if(Ja(e,h,f,i)!=c){var j=0;if(i)for(h=e[h];j<h.length;)if(h[j]===f)h.splice(j,1);else j+=1;else delete e[h];d.push(f)}});return d}function Ka(a,b,c){b=b||Infinity;c=c||0;var d=[];S(a,function(e){if(da(e)&&c<b)d=d.concat(Ka(e,b,c+1));else d.push(e)});return d}
  function La(a){var b=[];F(a,function(c){b=b.concat(c)});return b}function Ja(a,b,c,d){var e=b in a;if(d){a[b]||(a[b]=[]);e=a[b].indexOf(c)!==-1}return e}function Ha(a,b){var c=va(b),d=!wa(b),e=Ja(a,c,b,d);if(d)a[c].push(b);else a[c]=b;return e}
  function Ma(a,b,c,d){var e,f=[],h=c==="max",i=c==="min",j=Array.isArray(a);G(a,function(g){var m=a[g];g=R(m,b,a,j?[m,parseInt(g),a]:[]);if(K(g))throw new TypeError("Cannot compare with undefined");if(g===e)f.push(m);else if(K(e)||h&&g>e||i&&g<e){f=[m];e=g}});j||(f=Ka(f,1));return d?f:f[0]}function Na(a){if(q[Oa])a=a.toLowerCase();return a.replace(q[Pa],"")}function Qa(a,b){var c=a.charAt(b);return(q[Ra]||{})[c]||c}function Sa(a){var b=q[Ta];return a?b.indexOf(a):l}
  var Ta="AlphanumericSortOrder",Pa="AlphanumericSortIgnore",Oa="AlphanumericSortIgnoreCase",Ra="AlphanumericSortEquivalents";E(q,n,n,{create:function(){var a=[],b;F(arguments,function(c){if(la(c))try{b=q.prototype.slice.call(c,0);if(b.length>0)c=b}catch(d){}a=a.concat(c)});return a}});
  E(q,k,n,{find:function(a,b,c){return Fa(this,a,b,c)},findAll:function(a,b,c){var d=[];S(this,function(e,f,h){Ca(e,a,h,[e,f,h])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=Fa(this,a,b,c,k);return K(a)?-1:a},count:function(a){if(K(a))return this.length;return this.findAll(a).length},removeAt:function(a,b){if(K(a))return this;if(K(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return q.prototype.remove.apply(this.clone(),
  arguments)},clone:function(){return na([],this)},unique:function(a){return Ga(this,a)},flatten:function(a){return Ka(this,a)},union:function(){return Ga(this.concat(La(arguments)))},intersect:function(){return Ia(this,La(arguments),n)},subtract:function(){return Ia(this,La(arguments),k)},at:function(){return xa(this,arguments)},first:function(a){if(K(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(K(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-
  a)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},min:function(a,b){return Ma(this,a,"min",b)},max:function(a,b){return Ma(this,a,"max",b)},least:function(a,b){return Ma(this.groupBy.apply(this,[a]),"length","min",b)},most:function(a,b){return Ma(this.groupBy.apply(this,[a]),"length","max",b)},sum:function(a){a=a?this.map(a):this;return a.length>0?a.reduce(function(b,c){return b+c}):0},average:function(a){a=a?this.map(a):this;return a.length>0?
  a.sum()/a.length:0},inGroups:function(a,b){var c=arguments.length>1,d=this,e=[],f=N(this.length/a,void 0,"ceil");pa(0,a-1,function(h){h=h*f;var i=d.slice(h,h+f);c&&i.length<f&&pa(1,f-i.length,function(){i=i.add(b)});e.push(i)});return e},inGroupsOf:function(a,b){var c=[],d=this.length,e=this,f;if(d===0||a===0)return e;if(K(a))a=1;if(K(b))b=l;pa(0,N(d/a,void 0,"ceil")-1,function(h){for(f=e.slice(a*h,a*h+a);f.length<a;)f.push(b);c.push(f)});return c},isEmpty:function(){return this.compact().length==
  0},sortBy:function(a,b){var c=this.clone();c.sort(function(d,e){var f,h;f=R(d,a,c,[d]);h=R(e,a,c,[e]);if(C(f)&&C(h)){f=f;h=h;var i,j,g,m,o=0,w=0;f=Na(f);h=Na(h);do{g=Qa(f,o);m=Qa(h,o);i=Sa(g);j=Sa(m);if(i===-1||j===-1){i=f.charCodeAt(o)||l;j=h.charCodeAt(o)||l}g=g!==f.charAt(o);m=m!==h.charAt(o);if(g!==m&&w===0)w=g-m;o+=1}while(i!=l&&j!=l&&i===j);f=i===j?w:i<j?-1:1}else f=f<h?-1:f>h?1:0;return f*(b?-1:1)});return c},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(v.random()*
  d),c=a[--d],a[d]=a[b],a[b]=c);return a},zip:function(){var a=F(arguments);return this.map(function(b,c){return[b].concat(a.map(function(d){return c in d?d[c]:l}))})},sample:function(a){var b=this.randomize();return arguments.length>0?b.slice(0,a):b[0]},each:function(a,b,c){S(this,a,b,c);return this},add:function(a,b){if(!B(u(b))||isNaN(b))b=this.length;q.prototype.splice.apply(this,[b,0].concat(a));return this},remove:function(){var a,b=this;F(arguments,function(c){for(a=0;a<b.length;)if(Ca(b[a],
  c,b,[b[a],a,b]))b.splice(a,1);else a++});return b},compact:function(a){var b=[];S(this,function(c){if(da(c))b.push(c.compact());else if(a&&c)b.push(c);else!a&&c!=l&&c.valueOf()===c.valueOf()&&b.push(c)});return b},groupBy:function(a,b){var c=this,d={},e;S(c,function(f,h){e=R(f,a,c,[f,h,c]);d[e]||(d[e]=[]);d[e].push(f)});b&&G(d,b);return d},none:function(){return!this.any.apply(this,arguments)}});E(q,k,n,{all:q.prototype.every,any:q.prototype.some,insert:q.prototype.add});
  function Ua(a){if(a&&a.valueOf)a=a.valueOf();return p.keys(a)}function Va(a,b){H(p,n,n,a,function(c,d){c[d]=function(e,f,h){var i=Ua(e);h=q.prototype[d].call(i,function(j){return b?R(e[j],f,e,[j,e[j],e]):Ca(e[j],f,e,[j,e[j],e])},h);if(da(h))h=h.reduce(function(j,g){j[g]=e[g];return j},{});return h}});ya(a,oa)}
  E(p,n,n,{map:function(a,b){return Ua(a).reduce(function(c,d){c[d]=R(a[d],b,a,[d,a[d],a]);return c},{})},reduce:function(a){var b=Ua(a).map(function(c){return a[c]});return b.reduce.apply(b,F(arguments).slice(1))},each:function(a,b){ka(b);G(a,b);return a},size:function(a){return Ua(a).length}});var Wa="any,all,none,count,find,findAll,isEmpty".split(","),Xa="sum,average,min,max,least,most".split(","),Ya="map,reduce,size".split(","),Za=Wa.concat(Xa).concat(Ya);
  (function(){H(q,k,function(){var a=arguments;return a.length>0&&!A(a[0])},"map,every,all,some,any,none,filter",function(a,b){a[b]=function(c){return this[b](function(d,e){return b==="map"?R(d,c,this,[d,e,this]):Ca(d,c,this,[d,e,this])})}})})();
  (function(){q[Ta]="A\u00c1\u00c0\u00c2\u00c3\u0104BC\u0106\u010c\u00c7D\u010e\u00d0E\u00c9\u00c8\u011a\u00ca\u00cb\u0118FG\u011eH\u0131I\u00cd\u00cc\u0130\u00ce\u00cfJKL\u0141MN\u0143\u0147\u00d1O\u00d3\u00d2\u00d4PQR\u0158S\u015a\u0160\u015eT\u0164U\u00da\u00d9\u016e\u00db\u00dcVWXY\u00ddZ\u0179\u017b\u017d\u00de\u00c6\u0152\u00d8\u00d5\u00c5\u00c4\u00d6".split("").map(function(b){return b+b.toLowerCase()}).join("");var a={};S("A\u00c1\u00c0\u00c2\u00c3\u00c4,C\u00c7,E\u00c9\u00c8\u00ca\u00cb,I\u00cd\u00cc\u0130\u00ce\u00cf,O\u00d3\u00d2\u00d4\u00d5\u00d6,S\u00df,U\u00da\u00d9\u00db\u00dc".split(","),
  function(b){var c=b.charAt(0);S(b.slice(1).split(""),function(d){a[d]=c;a[d.toLowerCase()]=c.toLowerCase()})});q[Oa]=k;q[Ra]=a})();Va(Wa);Va(Xa,k);ya(Ya,oa);
  var T,$a,ab=["ampm","hour","minute","second","ampm","utc","offset_sign","offset_hours","offset_minutes","ampm"],bb="({t})?\\s*(\\d{1,2}(?:[,.]\\d+)?)(?:{h}([0-5]\\d(?:[,.]\\d+)?)?{m}(?::?([0-5]\\d(?:[,.]\\d+)?){s})?\\s*(?:({t})|(Z)|(?:([+-])(\\d{2,2})(?::?(\\d{2,2}))?)?)?|\\s*({t}))",cb={},db,eb,fb,gb=[],hb=[{ba:"f{1,4}|ms|milliseconds",format:function(a){return V(a,"Milliseconds")}},{ba:"ss?|seconds",format:function(a){return V(a,"Seconds")}},{ba:"mm?|minutes",format:function(a){return V(a,"Minutes")}},
  {ba:"hh?|hours|12hr",format:function(a){a=V(a,"Hours");return a===0?12:a-qa(a/13)*12}},{ba:"HH?|24hr",format:function(a){return V(a,"Hours")}},{ba:"dd?|date|day",format:function(a){return V(a,"Date")}},{ba:"dow|weekday",la:k,format:function(a,b,c){a=V(a,"Day");return b.weekdays[a+(c-1)*7]}},{ba:"MM?",format:function(a){return V(a,"Month")+1}},{ba:"mon|month",la:k,format:function(a,b,c){a=V(a,"Month");return b.months[a+(c-1)*12]}},{ba:"y{2,4}|year",format:function(a){return V(a,"FullYear")}},{ba:"[Tt]{1,2}",
  format:function(a,b,c,d){if(b.ampm.length==0)return"";a=V(a,"Hours");b=b.ampm[qa(a/12)];if(d.length===1)b=b.slice(0,1);if(d.slice(0,1)==="T")b=b.toUpperCase();return b}},{ba:"z{1,4}|tz|timezone",text:k,format:function(a,b,c,d){a=a.getUTCOffset();if(d=="z"||d=="zz")a=a.replace(/(\d{2})(\d{2})/,function(e,f){return O(f,d.length)});return a}},{ba:"iso(tz|timezone)",format:function(a){return a.getUTCOffset(k)}},{ba:"ord",format:function(a){a=V(a,"Date");return a+sa(a)}}],ib=[{$:"year",method:"FullYear",
  ja:k,da:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{$:"month",method:"Month",ja:k,da:function(a,b){var c=30.4375,d;if(a){d=a.daysInMonth();if(b<=d.days())c=d}return c*24*60*60*1E3},error:0.919},{$:"week",method:"Week",da:aa(6048E5)},{$:"day",method:"Date",ja:k,da:aa(864E5)},{$:"hour",method:"Hours",da:aa(36E5)},{$:"minute",method:"Minutes",da:aa(6E4)},{$:"second",method:"Seconds",da:aa(1E3)},{$:"millisecond",method:"Milliseconds",da:aa(1)}],jb={};
  function kb(a){na(this,a);this.ga=gb.concat()}
  kb.prototype={getMonth:function(a){return B(a)?a-1:this.months.indexOf(a)%12},getWeekday:function(a){return this.weekdays.indexOf(a)%7},oa:function(a){var b;return B(a)?a:a&&(b=this.numbers.indexOf(a))!==-1?(b+1)%10:1},ta:function(a){var b=this;return a.replace(r(this.num,"g"),function(c){return b.oa(c)||""})},ra:function(a){return T.units[this.units.indexOf(a)%8]},ua:function(a){return this.na(a,a[2]>0?"future":"past")},qa:function(a){return this.na(lb(a),"duration")},va:function(a){a=a||this.code;
  return a==="en"||a==="en-US"?k:this.variant},ya:function(a){return a===this.ampm[0]},za:function(a){return a&&a===this.ampm[1]},na:function(a,b){var c,d,e=a[0],f=a[1],h=a[2],i=this[b]||this.relative;if(A(i))return i.call(this,e,f,h,b);d=this.units[(this.plural&&e>1?1:0)*8+f]||this.units[f];if(this.capitalizeUnit)d=mb(d);c=this.modifiers.filter(function(j){return j.name=="sign"&&j.value==(h>0?1:-1)})[0];return i.replace(/\{(.*?)\}/g,function(j,g){switch(g){case "num":return e;case "unit":return d;
  case "sign":return c.src}})},sa:function(){return this.ma?[this.ma].concat(this.ga):this.ga},addFormat:function(a,b,c,d,e){var f=c||[],h=this,i;a=a.replace(/\s+/g,"[-,. ]*");a=a.replace(/\{([^,]+?)\}/g,function(j,g){var m,o,w,z=g.match(/\?$/);w=g.match(/^(\d+)\??$/);var J=g.match(/(\d)(?:-(\d))?/),M=g.replace(/[^a-z]+$/,"");if(w)m=h.tokens[w[1]];else if(h[M])m=h[M];else if(h[M+"s"]){m=h[M+"s"];if(J){o=[];m.forEach(function(Q,Da){var U=Da%(h.units?8:m.length);if(U>=J[1]&&U<=(J[2]||J[1]))o.push(Q)});
  m=o}m=nb(m)}if(w)w="(?:"+m+")";else{c||f.push(M);w="("+m+")"}if(z)w+="?";return w});if(b){b=ob(bb,h,e);e=["t","[\\s\\u3000]"].concat(h.timeMarker);i=a.match(/\\d\{\d,\d\}\)+\??$/);pb(h,"(?:"+b+")[,\\s\\u3000]+?"+a,ab.concat(f),d);pb(h,a+"(?:[,\\s]*(?:"+e.join("|")+(i?"+":"*")+")"+b+")?",f.concat(ab),d)}else pb(h,a,f,d)}};function qb(a,b){var c;C(a)||(a="");c=jb[a]||jb[a.slice(0,2)];if(b===n&&!c)throw Error("Invalid locale.");return c||$a}
  function rb(a,b){function c(g){var m=i[g];if(C(m))i[g]=m.split(",");else m||(i[g]=[])}function d(g,m){g=g.split("+").map(function(o){return o.replace(/(.+):(.+)$/,function(w,z,J){return J.split("|").map(function(M){return z+M}).join("|")})}).join("|");return g.split("|").forEach(m)}function e(g,m,o){var w=[];i[g].forEach(function(z,J){if(m)z+="+"+z.slice(0,3);d(z,function(M,Q){w[Q*o+J]=M.toLowerCase()})});i[g]=w}function f(g,m,o){g="\\d{"+g+","+m+"}";if(o)g+="|(?:"+nb(i.numbers)+")+";return g}function h(g,
  m){i[g]=i[g]||m}var i,j;i=new kb(b);c("modifiers");"months,weekdays,units,numbers,articles,tokens,timeMarker,ampm,timeSuffixes,dateParse,timeParse".split(",").forEach(c);j=!i.monthSuffix;e("months",j,12);e("weekdays",j,7);e("units",n,8);e("numbers",n,10);h("code",a);h("date",f(1,2,i.digitDate));h("year","'\\d{2}|"+f(4,4));h("num",function(){var g=["\\d+"].concat(i.articles);if(i.numbers)g=g.concat(i.numbers);return nb(g)}());(function(){var g=[];i.ha={};i.modifiers.forEach(function(m){var o=m.name;
  d(m.src,function(w){var z=i[o];i.ha[w]=m;g.push({name:o,src:w,value:m.value});i[o]=z?z+"|"+w:w})});i.day+="|"+nb(i.weekdays);i.modifiers=g})();if(i.monthSuffix){i.month=f(1,2);i.months=pa(1,12).map(function(g){return g+i.monthSuffix})}i.full_month=f(1,2)+"|"+nb(i.months);i.timeSuffixes.length>0&&i.addFormat(ob(bb,i),n,ab);i.addFormat("{day}",k);i.addFormat("{month}"+(i.monthSuffix||""));i.addFormat("{year}"+(i.yearSuffix||""));i.timeParse.forEach(function(g){i.addFormat(g,k)});i.dateParse.forEach(function(g){i.addFormat(g)});
  return jb[a]=i}function pb(a,b,c,d){a.ga.unshift({Ba:d,xa:a,Aa:r("^"+b+"$","i"),to:c})}function mb(a){return a.slice(0,1).toUpperCase()+a.slice(1)}function nb(a){return a.filter(function(b){return!!b}).join("|")}function sb(a,b){var c;if(ma(a[0]))return a;else if(B(a[0])&&!B(a[1]))return[a[0]];else if(C(a[0])&&b)return[tb(a[0]),a[1]];c={};eb.forEach(function(d,e){c[d.$]=a[e]});return[c]}
  function tb(a,b){var c={};if(match=a.match(/^(\d+)?\s?(\w+?)s?$/i)){if(K(b))b=parseInt(match[1])||1;c[match[2].toLowerCase()]=b}return c}function ub(a,b){var c={},d,e;b.forEach(function(f,h){d=a[h+1];if(!(K(d)||d==="")){if(f==="year")c.Ca=d.replace(/'/,"");e=parseFloat(d.replace(/'/,"").replace(/,/,"."));c[f]=!isNaN(e)?e:d.toLowerCase()}});return c}function vb(a){a=a.trim().replace(/^(just )?now|\.+$/i,"");return wb(a)}
  function wb(a){return a.replace(db,function(b,c,d){var e=0,f=1,h,i;if(c)return b;d.split("").reverse().forEach(function(j){j=cb[j];var g=j>9;if(g){if(h)e+=f;f*=j/(i||1);i=j}else{if(h===n)f*=10;e+=f*j}h=g});if(h)e+=f;return e})}
  function xb(a,b,c,d){var e=new s,f=n,h,i,j,g,m,o,w,z,J;e.utc(d);if(fa(a))e.utc(a.isUTC()).setTime(a.getTime());else if(B(a))e.setTime(a);else if(ma(a)){e.set(a,k);g=a}else if(C(a)){h=qb(b);a=vb(a);h&&G(h.sa(),function(M,Q){var Da=a.match(Q.Aa);if(Da){j=Q;i=j.xa;g=ub(Da,j.to,i);g.utc&&e.utc();i.ma=j;if(g.timestamp){g=g.timestamp;return n}if(j.Ba&&!C(g.month)&&(C(g.date)||h.va(b))){z=g.month;g.month=g.date;g.date=z}if(g.year&&g.Ca.length===2)g.year=N(V(new s,"FullYear")/100)*100-N(g.year/100)*100+g.year;
  if(g.month){g.month=i.getMonth(g.month);if(g.shift&&!g.unit)g.unit=i.units[7]}if(g.weekday&&g.date)delete g.weekday;else if(g.weekday){g.weekday=i.getWeekday(g.weekday);if(g.shift&&!g.unit)g.unit=i.units[5]}if(g.day&&(z=i.ha[g.day])){g.day=z.value;e.reset();f=k}else if(g.day&&(o=i.getWeekday(g.day))>-1){delete g.day;if(g.num&&g.month){J=function(){var U=e.getWeekday();e.setWeekday(7*(g.num-1)+(U>o?o+7:o))};g.day=1}else g.weekday=o}if(g.date&&!B(g.date))g.date=i.ta(g.date);if(i.za(g.ampm)&&g.hour<
  12)g.hour+=12;else if(i.ya(g.ampm)&&g.hour===12)g.hour=0;if("offset_hours"in g||"offset_minutes"in g){e.utc();g.offset_minutes=g.offset_minutes||0;g.offset_minutes+=g.offset_hours*60;if(g.offset_sign==="-")g.offset_minutes*=-1;g.minute-=g.offset_minutes}if(g.unit){f=k;w=i.oa(g.num);m=i.ra(g.unit);if(g.shift||g.edge){w*=(z=i.ha[g.shift])?z.value:0;if(m==="month"&&I(g.date)){e.set({day:g.date},k);delete g.date}if(m==="year"&&I(g.month)){e.set({month:g.month,day:g.date},k);delete g.month;delete g.date}}if(g.sign&&
  (z=i.ha[g.sign]))w*=z.value;if(I(g.weekday)){e.set({weekday:g.weekday},k);delete g.weekday}g[m]=(g[m]||0)+w}if(g.year_sign==="-")g.year*=-1;fb.slice(1,4).forEach(function(U,$b){var Eb=g[U.$],Fb=Eb%1;if(Fb){g[fb[$b].$]=N(Fb*(U.$==="second"?1E3:60));g[U.$]=qa(Eb)}});return n}});if(j)if(f)e.advance(g);else{e._utc&&e.reset();yb(e,g,k,n,c)}else{e=a?new s(a):new s;d&&e.addMinutes(e.getTimezoneOffset())}if(g&&g.edge){z=i.ha[g.edge];G(fb.slice(4),function(M,Q){if(I(g[Q.$])){m=Q.$;return n}});if(m==="year")g.fa=
  "month";else if(m==="month"||m==="week")g.fa="day";e[(z.value<0?"endOf":"beginningOf")+mb(m)]();z.value===-2&&e.reset()}J&&J();e.utc(n)}return{ea:e,set:g}}function lb(a){var b,c=v.abs(a),d=c,e=0;fb.slice(1).forEach(function(f,h){b=qa(N(c/f.da()*10)/10);if(b>=1){d=b;e=h+1}});return[d,e,a]}
  function zb(a,b,c,d){var e,f=qb(d),h=r(/^[A-Z]/);if(a.isValid())if(Date[b])b=Date[b];else{if(A(b)){e=lb(a.millisecondsFromNow());b=b.apply(a,e.concat(f))}}else return"Invalid Date";if(!b&&c){e=e||lb(a.millisecondsFromNow());if(e[1]===0){e[1]=1;e[0]=1}return f.ua(e)}b=b||"long";b=f[b]||b;hb.forEach(function(i){b=b.replace(r("\\{("+i.ba+")(\\d)?\\}",i.la?"i":""),function(j,g,m){j=i.format(a,f,m||1,g);m=g.length;var o=g.match(/^(.)\1+$/);if(i.la){if(m===3)j=j.slice(0,3);if(o||g.match(h))j=mb(j)}else if(o&&
  !i.text)j=(B(j)?O(j,m):j.toString()).slice(-m);return j})});return b}
  function Ab(a,b,c,d){var e,f,h,i=0,j=0,g=0;e=xb(b,l,l,d);if(c>0){j=g=c;f=k}if(!e.ea.isValid())return n;if(e.set&&e.set.fa){ib.forEach(function(m){if(m.$===e.set.fa)i=m.da(e.ea,a-e.ea)-1});b=mb(e.set.fa);if(e.set.edge||e.set.shift)e.ea["beginningOf"+b]();if(e.set.fa==="month")h=e.ea.clone()["endOf"+b]().getTime();if(!f&&e.set.sign&&e.set.fa!="millisecond"){j=50;g=-50}}f=a.getTime();b=e.ea.getTime();h=h||b+i;h=Bb(a,b,h);return f>=b-j&&f<=h+g}
  function Bb(a,b,c){b=new Date(b);a=(new Date(c)).utc(a.isUTC());if(V(a,"Hours")!==23){b=b.getTimezoneOffset();a=a.getTimezoneOffset();if(b!==a)c+=(a-b).minutes()}return c}
  function yb(a,b,c,d,e){function f(g){return I(b[g])?b[g]:b[g+"s"]}function h(g){return I(f(g))}var i,j;if(B(b)&&d)b={milliseconds:b};else if(B(b)){a.setTime(b);return a}if(I(b.date))b.day=b.date;G(fb,function(g,m){var o=m.$==="day";if(h(m.$)||o&&h("weekday")){b.fa=m.$;j=+g;return n}else if(c&&m.$!=="week"&&(!o||!h("week")))W(a,m.method,o?1:0)});ib.forEach(function(g){var m=g.$;g=g.method;var o;o=f(m);if(!K(o)){if(d){if(m==="week"){o=(b.day||0)+o*7;g="Date"}o=o*d+V(a,g)}else m==="month"&&h("day")&&
  W(a,"Date",15);W(a,g,o);if(d&&m==="month"){m=o;if(m<0)m=m%12+12;m%12!=V(a,"Month")&&W(a,"Date",0)}}});if(!d&&!h("day")&&h("weekday")){i=f("weekday");a.setWeekday(i)}(function(){var g=new s;return e===-1&&a>g||e===1&&a<g})()&&G(fb.slice(j+1),function(g,m){if((m.ja||m.$==="week"&&h("weekday"))&&!(h(m.$)||m.$==="day"&&h("weekday"))){a[m.ia](e);return n}});return a}function V(a,b){return a["get"+(a._utc?"UTC":"")+b]()}function W(a,b,c){return a["set"+(a._utc?"UTC":"")+b](c)}
  function ob(a,b,c){var d={h:0,m:1,s:2},e;b=b||T;return a.replace(/{([a-z])}/g,function(f,h){var i=[],j=h==="h",g=j&&!c;if(h==="t")return b.ampm.join("|");else{j&&i.push(":");if(e=b.timeSuffixes[d[h]])i.push(e+"\\s*");return i.length===0?"":"(?:"+i.join("|")+")"+(g?"":"?")}})}function X(a,b,c){var d,e;if(B(a[1]))d=sb(a)[0];else{d=a[0];e=a[1]}return xb(d,e,b,c).ea}
  s.extend({create:function(){return X(arguments)},past:function(){return X(arguments,-1)},future:function(){return X(arguments,1)},addLocale:function(a,b){return rb(a,b)},setLocale:function(a){var b=qb(a,n);$a=b;if(a&&a!=b.code)b.code=a;return b},getLocale:function(a){return!a?$a:qb(a,n)},addFormat:function(a,b,c){pb(qb(c),a,b)}},n,n);
  s.extend({set:function(){var a=sb(arguments);return yb(this,a[0],a[1])},setWeekday:function(a){if(!K(a))return W(this,"Date",V(this,"Date")+a-V(this,"Day"))},setWeek:function(a){if(!K(a)){V(this,"Date");W(this,"Month",0);W(this,"Date",a*7+1);return this.getTime()}},getWeek:function(){var a=this;a=a.clone();var b=V(a,"Day")||7;a.addDays(4-b).reset();return 1+qa(a.daysSince(a.clone().beginningOfYear())/7)},getUTCOffset:function(a){var b=this._utc?0:this.getTimezoneOffset(),c=a===k?":":"";if(!b&&a)return"Z";
  return O(N(-b/60),2,k)+c+O(b%60,2)},utc:function(a){ha(this,"_utc",a===k||arguments.length===0);return this},isUTC:function(){return!!this._utc||this.getTimezoneOffset()===0},advance:function(){var a=sb(arguments,k);return yb(this,a[0],a[1],1)},rewind:function(){var a=sb(arguments,k);return yb(this,a[0],a[1],-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,b){return this.getTime()>s.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<s.create(a).getTime()+
  (b||0)},isBetween:function(a,b,c){var d=this.getTime();a=s.create(a).getTime();var e=s.create(b).getTime();b=v.min(a,e);a=v.max(a,e);c=c||0;return b-c<d&&a+c>d},isLeapYear:function(){var a=V(this,"FullYear");return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-V(new s(V(this,"FullYear"),V(this,"Month"),32),"Date")},format:function(a,b){return zb(this,a,n,b)},relative:function(a,b){if(C(a)){b=a;a=l}return zb(this,a,k,b)},is:function(a,b,c){var d,e;if(this.isValid()){if(C(a)){a=a.trim().toLowerCase();
  e=this.clone().utc(c);switch(k){case a==="future":return this.getTime()>(new s).getTime();case a==="past":return this.getTime()<(new s).getTime();case a==="weekday":return V(e,"Day")>0&&V(e,"Day")<6;case a==="weekend":return V(e,"Day")===0||V(e,"Day")===6;case (d=T.weekdays.indexOf(a)%7)>-1:return V(e,"Day")===d;case (d=T.months.indexOf(a)%12)>-1:return V(e,"Month")===d}}return Ab(this,a,b,c)}},reset:function(a){var b={},c;a=a||"hours";if(a==="date")a="days";c=ib.some(function(d){return a===d.$||
  a===d.$+"s"});b[a]=a.match(/^days?/)?1:0;return c?this.set(b,k):this},clone:function(){var a=new s(this.getTime());a.utc(this.isUTC());return a}});s.extend({iso:function(){return this.toISOString()},getWeekday:s.prototype.getDay,getUTCWeekday:s.prototype.getUTCDay});
  function Cb(a,b){function c(){return N(this*b)}function d(){return X(arguments)[a.ia](this)}function e(){return X(arguments)[a.ia](-this)}var f=a.$,h={};h[f]=c;h[f+"s"]=c;h[f+"Before"]=e;h[f+"sBefore"]=e;h[f+"Ago"]=e;h[f+"sAgo"]=e;h[f+"After"]=d;h[f+"sAfter"]=d;h[f+"FromNow"]=d;h[f+"sFromNow"]=d;u.extend(h)}u.extend({duration:function(a){return qb(a).qa(this)}});
  T=$a=s.addLocale("en",{plural:k,timeMarker:"at",ampm:"am,pm",months:"January,February,March,April,May,June,July,August,September,October,November,December",weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",units:"millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s",numbers:"one,two,three,four,five,six,seven,eight,nine,ten",articles:"a,an,the",tokens:"the,st|nd|rd|th,of","short":"{Month} {d}, {yyyy}","long":"{Month} {d}, {yyyy} {h}:{mm}{tt}",full:"{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}",
  past:"{num} {unit} {sign}",future:"{num} {unit} {sign}",duration:"{num} {unit}",modifiers:[{name:"day",src:"yesterday",value:-1},{name:"day",src:"today",value:0},{name:"day",src:"tomorrow",value:1},{name:"sign",src:"ago|before",value:-1},{name:"sign",src:"from now|after|from|in|later",value:1},{name:"edge",src:"last day",value:-2},{name:"edge",src:"end",value:-1},{name:"edge",src:"first day|beginning",value:1},{name:"shift",src:"last",value:-1},{name:"shift",src:"the|this",value:0},{name:"shift",
  src:"next",value:1}],dateParse:["{num} {unit} {sign}","{sign} {num} {unit}","{month} {year}","{shift} {unit=5-7}","{0?} {date}{1}","{0?} {edge} of {shift?} {unit=4-7?}{month?}{year?}"],timeParse:["{0} {num}{1} {day} of {month} {year?}","{weekday?} {month} {date}{1?} {year?}","{date} {month} {year}","{date} {month}","{shift} {weekday}","{shift} week {weekday}","{weekday} {2?} {shift} week","{num} {unit=4-5} {sign} {day}","{0?} {date}{1} of {month}","{0?}{month?} {date?}{1?} of {shift} {unit=6-7}"]});
  fb=ib.concat().reverse();eb=ib.concat();eb.splice(2,1);
  H(s,k,n,ib,function(a,b,c){function d(g){g=g/h;var m=g%1,o=b.error||0.999;if(m&&v.abs(m%1)>o)g=N(g);return parseInt(g)}var e=b.$,f=mb(e),h=b.da(),i,j;b.ia="add"+f+"s";i=function(g,m){return d(this.getTime()-s.create(g,m).getTime())};j=function(g,m){return d(s.create(g,m).getTime()-this.getTime())};a[e+"sAgo"]=j;a[e+"sUntil"]=j;a[e+"sSince"]=i;a[e+"sFromNow"]=i;a[b.ia]=function(g,m){var o={};o[e]=g;return this.advance(o,m)};Cb(b,h);c<3&&["Last","This","Next"].forEach(function(g){a["is"+g+f]=function(){return this.is(g+
  " "+e)}});if(c<4){a["beginningOf"+f]=function(){var g={};switch(e){case "year":g.year=V(this,"FullYear");break;case "month":g.month=V(this,"Month");break;case "day":g.day=V(this,"Date");break;case "week":g.weekday=0}return this.set(g,k)};a["endOf"+f]=function(){var g={hours:23,minutes:59,seconds:59,milliseconds:999};switch(e){case "year":g.month=11;g.day=31;break;case "month":g.day=this.daysInMonth();break;case "week":g.weekday=6}return this.set(g,k)}}});
  T.addFormat("([+-])?(\\d{4,4})[-.]?{full_month}[-.]?(\\d{1,2})?",k,["year_sign","year","month","date"],n,k);T.addFormat("(\\d{1,2})[-.\\/]{full_month}(?:[-.\\/](\\d{2,4}))?",k,["date","month","year"],k);T.addFormat("{full_month}[-.](\\d{4,4})",n,["month","year"]);T.addFormat("\\/Date\\((\\d+(?:\\+\\d{4,4})?)\\)\\/",n,["timestamp"]);T.addFormat(ob(bb,T),n,ab);gb=T.ga.slice(0,7).reverse();T.ga=T.ga.slice(7).concat(gb);H(s,k,n,"short,long,full",function(a,b){a[b]=function(c){return zb(this,b,n,c)}});
  "\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07".split("").forEach(function(a,b){if(b>9)b=v.pow(10,b-9);cb[a]=b});"\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19".split("").forEach(function(a,b){cb[a]=b});db=r("([\u671f\u9031\u5468])?([\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19]+)(?!\u6628)","g");
  (function(){var a="today,yesterday,tomorrow,weekday,weekend,future,past".split(","),b=T.weekdays.slice(0,7),c=T.months.slice(0,12);H(s,k,n,a.concat(b).concat(c),function(d,e){d["is"+mb(e)]=function(f){return this.is(e,0,f)}})})();(function(){s.extend({utc:{create:function(){return X(arguments,0,k)},past:function(){return X(arguments,-1,k)},future:function(){return X(arguments,1,k)}}},n,n)})();
  s.extend({RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}"},n,n);
  DateRange=function(a,b){this.start=s.create(a);this.end=s.create(b)};DateRange.prototype.toString=function(){return this.isValid()?this.start.full()+".."+this.end.full():"Invalid DateRange"};
  E(DateRange,k,n,{isValid:function(){return this.start<this.end},duration:function(){return this.isValid()?this.end.getTime()-this.start.getTime():NaN},contains:function(a){var b=this;return(a.start&&a.end?[a.start,a.end]:[a]).every(function(c){return c>=b.start&&c<=b.end})},every:function(a,b){var c=this.start.clone(),d=[],e=0,f,h;if(C(a)){c.advance(tb(a,0),k);f=tb(a);h=a.toLowerCase()==="day"}else f={milliseconds:a};for(;c<=this.end;){d.push(c);b&&b(c,e);if(h&&V(c,"Hours")===23){c=c.clone();W(c,
  "Hours",48)}else c=c.clone().advance(f,k);e++}return d},union:function(a){return new DateRange(this.start<a.start?this.start:a.start,this.end>a.end?this.end:a.end)},intersect:function(a){return new DateRange(this.start>a.start?this.start:a.start,this.end<a.end?this.end:a.end)},clone:function(){return new DateRange(this.start,this.end)}});H(DateRange,k,n,"Millisecond,Second,Minute,Hour,Day,Week,Month,Year",function(a,b){a["each"+b]=function(c){return this.every(b,c)}});
  E(s,n,n,{range:function(a,b){return new DateRange(a,b)}});
  function Db(a,b,c,d,e){var f;if(!a.timers)a.timers=[];B(b)||(b=0);a.timers.push(setTimeout(function(){a.timers.splice(f,1);c.apply(d,e||[])},b));f=a.timers.length}
  E(Function,k,n,{lazy:function(a,b){function c(){if(!(f&&e.length>b-2)){e.push([this,arguments]);h()}}var d=this,e=[],f=n,h,i,j;a=a||1;b=b||Infinity;i=N(a,void 0,"ceil");j=N(i/a);h=function(){if(!(f||e.length==0)){for(var g=v.max(e.length-j,0);e.length>g;)Function.prototype.apply.apply(d,e.shift());Db(c,i,function(){f=n;h()});f=k}};return c},delay:function(a){var b=F(arguments).slice(1);Db(this,a,this,this,b);return this},throttle:function(a){return this.lazy(a,1)},debounce:function(a){function b(){b.cancel();
  Db(b,a,c,this,arguments)}var c=this;return b},cancel:function(){if(da(this.timers))for(;this.timers.length>0;)clearTimeout(this.timers.shift());return this},after:function(a){var b=this,c=0,d=[];if(B(a)){if(a===0){b.call();return b}}else a=1;return function(){var e;d.push(F(arguments));c++;if(c==a){e=b.call(this,d);c=0;d=[];return e}}},once:function(){var a=this;return function(){return L(a,"memo")?a.memo:a.memo=a.apply(this,arguments)}},fill:function(){var a=this,b=F(arguments);return function(){var c=
  F(arguments);b.forEach(function(d,e){if(d!=l||e>=c.length)c.splice(e,0,d)});return a.apply(this,c)}}});
  function Gb(a,b,c,d,e,f){var h=a.toFixed(20),i=h.search(/\./);h=h.search(/[1-9]/);i=i-h;if(i>0)i-=1;e=v.max(v.min((i/3).floor(),e===n?c.length:e),-d);d=c.charAt(e+d-1);if(i<-9){e=-3;b=i.abs()-9;d=c.slice(0,1)}return(a/(f?(2).pow(10*e):(10).pow(e*3))).round(b||0).format()+d.trim()}
  E(u,n,n,{random:function(a,b){var c,d;if(arguments.length==1){b=a;a=0}c=v.min(a||0,K(b)?1:b);d=v.max(a||0,K(b)?1:b)+1;return qa(v.random()*(d-c)+c)}});
  E(u,k,n,{log:function(a){return v.log(this)/(a?v.log(a):1)},abbr:function(a){return Gb(this,a,"kmbt",0,4)},metric:function(a,b){return Gb(this,a,"n\u03bcm kMGTPE",4,K(b)?1:b)},bytes:function(a,b){return Gb(this,a,"kMGTPE",0,K(b)?4:b,k)+"B"},isInteger:function(){return this%1==0},isOdd:function(){return!isNaN(this)&&!this.isMultipleOf(2)},isEven:function(){return this.isMultipleOf(2)},isMultipleOf:function(a){return this%a===0},format:function(a,b,c){var d,e,f,h="";if(K(b))b=",";if(K(c))c=".";d=(B(a)?
  N(this,a||0).toFixed(v.max(a,0)):this.toString()).replace(/^-/,"").split(".");e=d[0];f=d[1];for(d=e.length;d>0;d-=3){if(d<e.length)h=b+h;h=e.slice(v.max(0,d-3),d)+h}if(f)h+=c+ra((a||0)-f.length,"0")+f;return(this<0?"-":"")+h},hex:function(a){return this.pad(a||1,n,16)},upto:function(a,b,c){return pa(this,a,b,c||1)},downto:function(a,b,c){return pa(this,a,b,-(c||1))},times:function(a){if(a)for(var b=0;b<this;b++)a.call(this,b);return this.toNumber()},chr:function(){return t.fromCharCode(this)},pad:function(a,
  b,c){return O(this,a,b,c)},ordinalize:function(){var a=this.abs();a=parseInt(a.toString().slice(-2));return this+sa(a)},toNumber:function(){return parseFloat(this,10)}});H(u,k,n,"round,floor,ceil",function(a,b){a[b]=function(c){return N(this,c,b)}});H(u,k,n,"abs,pow,sin,asin,cos,acos,tan,atan,exp,pow,sqrt",function(a,b){a[b]=function(c,d){return v[b](this,c,d)}});
  var Hb="isObject,isNaN".split(","),Ib="keys,values,select,reject,each,merge,clone,equal,watch,tap,has".split(",");
  function Jb(a,b,c,d){var e=/^(.+?)(\[.*\])$/,f,h,i;if(d!==n&&(h=b.match(e))){i=h[1];b=h[2].replace(/^\[|\]$/g,"").split("][");b.forEach(function(j){f=!j||j.match(/^\d+$/);if(!i&&da(a))i=a.length;L(a,i)||(a[i]=f?[]:{});a=a[i];i=j});if(!i&&f)i=a.length.toString();Jb(a,i,c)}else a[b]=c.match(/^[+-]?\d+(\.\d+)?$/)?parseFloat(c):c==="true"?k:c==="false"?n:c}function Kb(a,b,c){var d={},e;G(a,function(f,h){e=n;ja(b,function(i){if(D(i)?i.test(f):la(i)?L(i,f):f===t(i))e=k},1);if(e===c)d[f]=h});return d}
  E(p,n,k,{watch:function(a,b,c){if(ca){var d=a[b];p.defineProperty(a,b,{enumerable:k,configurable:k,get:function(){return d},set:function(e){d=c.call(a,b,d,e)}})}}});E(p,n,function(a,b){return A(b)},{keys:function(a,b){var c=p.keys(a);c.forEach(function(d){b.call(a,d,a[d])});return c}});
  E(p,n,n,{isObject:function(a){return ma(a)},isNaN:function(a){return B(a)&&a.valueOf()!==a.valueOf()},equal:function(a,b){return wa(a)&&wa(b)?va(a)===va(b):a===b},extended:function(a){return new oa(a)},merge:function(a,b,c,d){var e,f;if(a&&typeof b!="string")for(e in b)if(L(b,e)&&a){f=b[e];if(I(a[e])){if(d===n)continue;if(A(d))f=d.call(b,e,a[e],b[e])}if(c===k&&f&&la(f))if(fa(f))f=new s(f.getTime());else if(D(f))f=new r(f.source,ua(f));else{a[e]||(a[e]=q.isArray(f)?[]:{});p.merge(a[e],b[e],c,d);continue}a[e]=
  f}return a},values:function(a,b){var c=[];G(a,function(d,e){c.push(e);b&&b.call(a,e)});return c},clone:function(a,b){var c;if(!la(a))return a;c=a instanceof oa?new oa:new a.constructor;return p.merge(c,a,b)},fromQueryString:function(a,b){var c=p.extended();a=a&&a.toString?a.toString():"";a.replace(/^.*?\?/,"").split("&").forEach(function(d){d=d.split("=");d.length===2&&Jb(c,d[0],decodeURIComponent(d[1]),b)});return c},tap:function(a,b){var c=b;A(b)||(c=function(){b&&a[b]()});c.call(a,a);return a},
  has:function(a,b){return L(a,b)},select:function(a){return Kb(a,arguments,k)},reject:function(a){return Kb(a,arguments,n)}});H(p,n,n,x,function(a,b){var c="is"+b;Hb.push(c);a[c]=function(d){return p.prototype.toString.call(d)==="[object "+b+"]"}});(function(){E(p,n,function(){return arguments.length===0},{extend:function(){var a=Hb.concat(Ib);if(typeof Za!=="undefined")a=a.concat(Za);ya(a,p)}})})();ya(Ib,oa);
  E(r,n,n,{escape:function(a){return P(a)}});
  E(r,k,n,{getFlags:function(){return ua(this)},setFlags:function(a){return r(this.source,a)},addFlag:function(a){return this.setFlags(ua(this,a))},removeFlag:function(a){return this.setFlags(ua(this).replace(a,""))}});
  var Lb,Mb;
  E(t,k,function(a){return D(a)||arguments.length>2},{startsWith:function(a,b,c){var d=this;if(b)d=d.slice(b);if(K(c))c=k;a=D(a)?a.source.replace("^",""):P(a);return r("^"+a,c?"":"i").test(d)},endsWith:function(a,b,c){var d=this;if(I(b))d=d.slice(0,b);if(K(c))c=k;a=D(a)?a.source.replace("$",""):P(a);return r(a+"$",c?"":"i").test(d)}});
  E(t,k,n,{escapeRegExp:function(){return P(this)},escapeURL:function(a){return a?encodeURIComponent(this):encodeURI(this)},unescapeURL:function(a){return a?decodeURI(this):decodeURIComponent(this)},escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2f;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,
  "'").replace(/&#x2f;/g,"/")},encodeBase64:function(){return Lb(this)},decodeBase64:function(){return Mb(this)},each:function(a,b){var c,d;if(A(a)){b=a;a=/[\s\S]/g}else if(a)if(C(a))a=r(P(a),"gi");else{if(D(a))a=r(a.source,ua(a,"g"))}else a=/[\s\S]/g;c=this.match(a)||[];if(b)for(d=0;d<c.length;d++)c[d]=b.call(this,c[d],d,c)||c[d];return c},shift:function(a){var b="";a=a||0;this.codes(function(c){b+=t.fromCharCode(c+a)});return b},codes:function(a){for(var b=[],c=0;c<this.length;c++){var d=this.charCodeAt(c);
  b.push(d);a&&a.call(this,d,c)}return b},chars:function(a){return this.each(a)},words:function(a){return this.trim().each(/\S+/g,a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},isBlank:function(){return this.trim().length===0},has:function(a){return this.search(D(a)?a:P(a))!==-1},add:function(a,b){b=K(b)?this.length:b;return this.slice(0,b)+a+this.slice(b)},remove:function(a){return this.replace(a,
  "")},reverse:function(){return this.split("").reverse().join("")},compact:function(){return this.trim().replace(/([\r\n\s\u3000])+/g,function(a,b){return b==="\u3000"?b:" "})},at:function(){return xa(this,arguments,k)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},dasherize:function(){return this.underscore().replace(/_/g,"-")},underscore:function(){return this.replace(/[-\s]+/g,"_").replace(t.Inflector&&t.Inflector.acronymRegExp,function(a,b){return(b>
  0?"_":"")+a.toLowerCase()}).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()},camelize:function(a){return this.underscore().replace(/(^|_)([^_]+)/g,function(b,c,d,e){b=d;b=(c=t.Inflector)&&c.acronyms[b];b=C(b)?b:void 0;e=a!==n||e>0;if(b)return e?b:b.toLowerCase();return e?d.capitalize():d})},spacify:function(){return this.underscore().replace(/_/g," ")},stripTags:function(){var a=this;ja(arguments.length>0?arguments:[""],function(b){a=a.replace(r("</?"+
  P(b)+"[^<>]*>","gi"),"")});return a},removeTags:function(){var a=this;ja(arguments.length>0?arguments:["\\S+"],function(b){b=r("<("+b+")[^<>]*(?:\\/>|>.*?<\\/\\1>)","gi");a=a.replace(b,"")});return a},truncate:function(a,b,c,d){var e="",f="",h=this.toString(),i="["+ta()+"]+",j="[^"+ta()+"]*",g=r(i+j+"$");d=K(d)?"...":t(d);if(h.length<=a)return h;switch(c){case "left":a=h.length-a;e=d;h=h.slice(a);g=r("^"+j+i);break;case "middle":a=qa(a/2);f=d+h.slice(h.length-a).trimLeft();h=h.slice(0,a);break;default:a=
  a;f=d;h=h.slice(0,a)}if(b===n&&this.slice(a,a+1).match(/\S/))h=h.remove(g);return e+h+f},pad:function(a,b){return ra(b,a)+this+ra(b,a)},padLeft:function(a,b){return ra(b,a)+this},padRight:function(a,b){return this+ra(b,a)},first:function(a){if(K(a))a=1;return this.substr(0,a)},last:function(a){if(K(a))a=1;return this.substr(this.length-a<0?0:this.length-a)},repeat:function(a){var b="",c=this;if(!B(a)||a<1)return"";for(;a;){if(a&1)b+=c;if(a>>=1)c+=c}return b},toNumber:function(a){var b=this.replace(/,/g,
  "");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},capitalize:function(a){var b;return this.toLowerCase().replace(a?/[\s\S]/g:/^\S/,function(c){var d=c.toUpperCase(),e;e=b?c:d;b=d!==c;return e})},assign:function(){var a={};F(arguments,function(b,c){if(ma(b))na(a,b);else a[c+1]=b});return this.replace(/\{([^{]+?)\}/g,function(b,c){return L(a,c)?a[c]:b})},namespace:function(a){a=a||ba;G(this.split("."),function(b,c){return!!(a=a[c])});return a}});E(t,k,n,{insert:t.prototype.add});
  (function(a){if(this.btoa){Lb=this.btoa;Mb=this.atob}else{var b=/[^A-Za-z0-9\+\/\=]/g;Lb=function(c){var d="",e,f,h,i,j,g,m=0;do{e=c.charCodeAt(m++);f=c.charCodeAt(m++);h=c.charCodeAt(m++);i=e>>2;e=(e&3)<<4|f>>4;j=(f&15)<<2|h>>6;g=h&63;if(isNaN(f))j=g=64;else if(isNaN(h))g=64;d=d+a.charAt(i)+a.charAt(e)+a.charAt(j)+a.charAt(g)}while(m<c.length);return d};Mb=function(c){var d="",e,f,h,i,j,g=0;if(c.match(b))throw Error("String contains invalid base64 characters");c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");
  do{e=a.indexOf(c.charAt(g++));f=a.indexOf(c.charAt(g++));i=a.indexOf(c.charAt(g++));j=a.indexOf(c.charAt(g++));e=e<<2|f>>4;f=(f&15)<<4|i>>2;h=(i&3)<<6|j;d+=t.fromCharCode(e);if(i!=64)d+=t.fromCharCode(f);if(j!=64)d+=t.fromCharCode(h)}while(g<c.length);return d}}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");})();
file:b/purgeArchived.php (new)
  <?php
  include('common.inc.php');
  // delete archived calls
  $sth = $conn->prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;");
  // TODO use tgid categories instead, tgid too specific
  $sth->execute();
  $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC);
  foreach($hourlies as $hourly) {
  processHourly($hourly);
  }
 
  // delete uninteresting compilations
 
file:a/run.bat (deleted)
python scannr.py > output.txt  
pause  
<?php <?php
include('common.inc.php'); include('common.inc.php');
$tgid = 44028; $tgid = 44028;
$from = (isset($_REQUEST['from']) ? $_REQUEST['from'] : strtotime("2012-09-12")); $from = (isset($_REQUEST['from']) ? $_REQUEST['from'] : strtotime("2012-09-12"));
$to = (isset($_REQUEST['to']) ? $_REQUEST['to'] : strtotime("2012-12-12")); $to = (isset($_REQUEST['to']) ? $_REQUEST['to'] : strtotime("2012-12-12"));
include_header("fdds"); include_header("fdds");
$sth = $conn->prepare('select distinct date_trunc(\'day\', call_timestamp) as rdate from recordings order by rdate'); $sth = $conn->prepare('select distinct date_trunc(\'day\', call_timestamp) as rdate from recordings order by rdate');
   
$sth->execute(); $sth->execute();
foreach ($sth->fetchAll() as $row) { foreach ($sth->fetchAll() as $row) {
echo '<a href="?from=' . strtotime($row['rdate']) . '&amp;to=' . strtotime($row['rdate'] . ' +1 day') . '">' . $row['rdate'] . '</a> <br>'; echo '<a href="?from=' . strtotime($row['rdate']) . '&amp;to=' . strtotime($row['rdate'] . ' +1 day') . '">' . $row['rdate'] . '</a> <br>';
} }
   
?> ?>
  <form class="form-horizontal">
  <fieldset>
  <div class="input-prepend">
  <span class="add-on"><i class="icon-calendar"></i></span><input type="text" name="range" id="range" />
  </div>
  </fieldset>
  </form>
<div class="span12"> <div class="span12">
   
<table width="100%" height="775px"> <table width="100%" height="775px">
<tr> <tr>
<td valign="middle"><span class="arrow-w" style="font-size:2em;">&lt;</span></td> <td valign="middle"><span class="arrow-w" style="font-size:2em;">&lt;</span></td>
<td width="95%"> <td width="95%">
<div id="placeholder" style="width:100%;height:575px;"></div> <div id="placeholder" style="width:100%;height:575px;"></div>
</td> </td>
<td valign="middle"><span class="arrow-e" style="font-size:2em;">&gt;</span></td> <td valign="middle"><span class="arrow-e" style="font-size:2em;">&gt;</span></td>
</tr> </tr>
</table> </table>
<script> <script>
var data = []; var data = [];
var plot; var plot;
var options = { var options = {
lines: { show: true }, lines: { show: true },
points: { show: true }, points: { show: true },
xaxis: { xaxis: {
mode: 'time', mode: 'time',
labelsAngle: 45 labelsAngle: 45
}, },
selection: { mode: 'x', fps: 30 }, selection: { mode: 'x', fps: 30 },
series: { series: {
lines: { show: true }, lines: { show: true },
points: { show: true } points: { show: true }
}, },
mouse: { mouse: {
track: true, track: true,
relative: true relative: true
} }
}; };
$(function () { $(function () {
// graph // graph
   
   
var placeholder = document.getElementById("placeholder"); var placeholder = document.getElementById("placeholder");
   
drawGraph(options); drawGraph(options);
   
// Hook into the 'flotr:select' event. // Hook into the 'flotr:select' event.
Flotr.EventAdapter.observe(placeholder, 'flotr:select', function (area) { Flotr.EventAdapter.observe(placeholder, 'flotr:select', function (area) {
   
// Draw graph with new area // Draw graph with new area
graph = drawGraph({ graph = drawGraph({
xaxis: {min: area.x1, max: area.x2, mode: 'time', labelsAngle: 45}, xaxis: {min: area.x1, max: area.x2, mode: 'time', labelsAngle: 45},
yaxis: {min: area.y1, max: area.y2} yaxis: {min: area.y1, max: area.y2}
}); });
}); });
   
// When graph is clicked, draw the graph with default area. // When graph is clicked, draw the graph with default area.
Flotr.EventAdapter.observe(placeholder, 'flotr:click', function () { Flotr.EventAdapter.observe(placeholder, 'flotr:click', function () {
drawGraph(); drawGraph();
}); });
   
   
  // Set the default dates
  var startDate = Date.create().addDays(-6), // 7 days ago
  endDate = Date.create(); // today
   
  var range = $('#range');
   
  // Show the dates in the range input
  range.val(startDate.format('{MM}/{dd}/{yyyy}') + ' - ' + endDate.format('{MM}/{dd}/{yyyy}'));
   
  range.daterangepicker({
   
  startDate: startDate,
  endDate: endDate,
   
  ranges: {
  'Today': ['today', 'today'],
  'Yesterday': ['yesterday', 'yesterday'],
  'Last 7 Days': [Date.create().addDays(-6), 'today'],
  'Last 30 Days': [Date.create().addDays(-29), 'today']
  }
  },function(start, end){
   
  ajaxLoadChart(start, end);
   
  });
  function ajaxLoadChart(startDate,endDate) {
   
  // If no data is passed (the chart was cleared)
   
  if(!startDate || !endDate){
  chart.setData({
  "xScale" : "time",
  "yScale" : "linear",
  "main" : [{
  className : ".stats",
  data : []
  }]
  });
   
  return;
  }
   
  // Otherwise, issue an AJAX request
   
  $.getJSON('ajax.php', {
   
  start: startDate.format('{yyyy}-{MM}-{dd}'),
  end: endDate.format('{yyyy}-{MM}-{dd}')
   
  }, function(data) {
   
  var set = [];
  $.each(data, function() {
  set.push({
  x : this.label,
  y : parseInt(this.value, 10)
  });
  });
   
  chart.setData({
  "xScale" : "time",
  "yScale" : "linear",
  "main" : [{
  className : ".stats",
  data : set
  }]
  });
   
  });
  }
getData('<?php echo $tgid; ?>', '<?php echo $from ?>', '<?php echo $to ?>'); getData('<?php echo $tgid; ?>', '<?php echo $from ?>', '<?php echo $to ?>');
   
}); });
   
// Draw graph with default options, overwriting with passed options // Draw graph with default options, overwriting with passed options
function drawGraph(opts) { function drawGraph(opts) {
   
// Clone the options, so the 'options' variable always keeps intact. // Clone the options, so the 'options' variable always keeps intact.
var o = Flotr._.extend(Flotr._.clone(options), opts || {}); var o = Flotr._.extend(Flotr._.clone(options), opts || {});
   
// Return a new graph. // Return a new graph.
return Flotr.draw( return Flotr.draw(
placeholder, placeholder,
data, data,
o o
); );
} }
   
   
function onDataReceived(series) { function onDataReceived(series) {
data = [] data = []
for (var key in series.data) { for (var key in series.data) {
data[data.length] = {label: key, data: series.data[key]}; data[data.length] = {label: key, data: series.data[key]};
} }
drawGraph(options); drawGraph(options);
} }
function getData(sensorID, from, to) { function getData(sensorID, from, to) {
$.ajax({ $.ajax({
url: "<?php echo $basePath; ?>calls.json.php?action=graphcount&tgid=" + sensorID + "&from=" + from + "&to=" + to, url: "<?php echo $basePath; ?>calls.json.php?action=graphcount&tgid=" + sensorID + "&from=" + from + "&to=" + to,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: onDataReceived success: onDataReceived
}); });
} }
   
   
</script> </script>
</div> </div>
<?php <?php
include_footer(); include_footer();
?> ?>