Brookepedia - by Daniel Brooke Peig http://www.danbp.org/p/rss.xml en Install DOW CADIX on Windows 10 http://www.danbp.org/p/node/132 <span class="field field--name-title field--type-string field--label-hidden">Install DOW CADIX on Windows 10</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Sat, 08/05/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>This article describes how to install DOW Ion Exchange Design Software, CADIX on Windows 10 (64-bits or 32 bits).</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/CadixWin10.PNG"><img src="/p/sites/default/files/styles/large/public/CadixWin10.PNG?itok=iT1HEN5e" width="750" height="499" alt="CADIX running on Windows 10 64-bit" title="CADIX running on Windows 10 64-bit" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Step by step installation</h2> <p>This tutorial was written for Windows 10 64-bits but should work for Windows 10 32-bits, Windows 8.1 and Windows 7.</p> <ol><li>Download CADIX software from the official DOW Chemical website: <a href="http://www.dow.com/en-us/water-and-process-solutions/resources/design-software/cadix-software">http://www.dow.com/en-us/water-and-process-solutions/resources/design-software/cadix-software</a><br />  </li> <li>Download the <em>Visual Basic 6.0 Runtime Plus</em> package from Sourceforge: <a href="https://sourceforge.net/projects/vb6extendedruntime">https://sourceforge.net/projects/vb6extendedruntime</a><br />  </li> <li>Install the <em>Visual Basic 6.0 Runtime Plus</em> package. Select all options available in the list.<figure role="group" class="caption caption-img align-center"><img alt="Select all options for the VB Runtime Plus installer" data-entity-type="file" data-entity-uuid="170bbcd7-9d1e-4b8e-86a4-e87257cf20be" src="/p/sites/default/files/inline-images/VB6RuntimePlus.PNG" /><figcaption>Select all options for the VB Runtime Plus installer</figcaption></figure><p> </p> </li> <li>Reboot the computer.<br />  </li> <li>Run CADIX installer. Make sure you select the option to install to all users in the computer.<figure role="group" class="caption caption-img"><img alt="CADIX for all computer users" data-entity-type="file" data-entity-uuid="a4cb4c69-61ed-4399-ac22-c196afdcaf54" src="/p/sites/default/files/inline-images/CADIXInstall.PNG" /><figcaption>CADIX for all computer users</figcaption></figure><p> </p> </li> <li>Take note of the installation directory location. We will need that later.<figure role="group" class="caption caption-img"><img alt="CADIX Destination Folder" data-entity-type="file" data-entity-uuid="4e6c51e2-4181-4ead-a545-229e6652601e" src="/p/sites/default/files/inline-images/CADIXFolder.PNG" /><figcaption>Remember the destination folder</figcaption></figure><p> </p> </li> <li>Once installed, navigate do the destination folder.<br />  </li> <li>Right click on the <em>cadix.exe</em> file and from the menu select <em>Properties</em>.<figure role="group" class="caption caption-img"><img alt="CADIX.exe properties" data-entity-type="file" data-entity-uuid="7698f694-e819-48ce-8a54-b412d04d1223" src="/p/sites/default/files/inline-images/CADIXRightClick.PNG" /><figcaption>Select properties from the cadix.exe dropdown menu</figcaption></figure><p> </p> </li> <li>Navigate to the compatibility tab and check <em>Run this Program as an Administrator</em> and then OK.<figure role="group" class="caption caption-img"><img alt="CADIX Run as Administrator" data-entity-type="file" data-entity-uuid="1b44d8ff-b365-42c6-8987-3ee51450aff5" src="/p/sites/default/files/inline-images/CADIXProperties.PNG" /><figcaption>Check the Run as Administrator option<br />  </figcaption></figure></li> <li>In the installation folder, right click again in the <em>cadix.exe</em> file and then select the option <em>Pin to Start</em>, this will create a working shortcut in the Start menu. If you prefer to have a shortcut in the Desktop, keep pressed <em>Crtl+Shift</em> while drag the <em>cadix.exe</em> to the Desktop.<figure role="group" class="caption caption-img"><img alt="CADIX Pin to Start" data-entity-type="file" data-entity-uuid="b55b3e6c-76de-445b-9a11-fb3ed8ac9576" src="/p/sites/default/files/inline-images/CADIXPinToStart.PNG" /><figcaption>Pin to Start menu to create a working shortcut</figcaption></figure><h2> </h2> </li> </ol><h2>CADIX Registration</h2> <p>CADIX will run for about one month without restrictions. After this grace period you need to ask an activation key for you DOW Technical Support engineer. The activation keys are renewed every year.</p> <p> </p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/51" hreflang="en">Ion Exchange</a></li> <li><a href="/p/taxonomy/term/26" hreflang="en">Tutorial</a></li> <li><a href="/p/taxonomy/term/37" hreflang="en">Water Treatment</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/engineering" hreflang="en">ENGINEERING</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Sun, 06 Aug 2017 01:07:55 +0000 Daniel 132 at http://www.danbp.org/p PHP - CSV Viewer for Web Browsers http://www.danbp.org/p/node/130 <span class="field field--name-title field--type-string field--label-hidden">PHP - CSV Viewer for Web Browsers</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 07/05/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>PHP script that opens and parses a CSV table file to an HTML format to be displayed in the browser.</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/csvhtmlviewer.PNG"><img src="/p/sites/default/files/styles/large/public/csvhtmlviewer.PNG?itok=XGb75R5t" width="750" height="499" alt="CSV to HTML script" title="CSV to HTML script" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Description</h2> <p>This PHP script opens and parses a CSV table file to an HTML view. It can be used together with the <a href="http://www.danbp.org/p/node/129">Internet of Things Web Logger Logger</a> script.</p> <h2>Features</h2> <ul> <li>Refresh, Download and Up/Bottom links.</li> <li>Line numbers.</li> <li>Header and footers with the column names.</li> <li>Ready for CSS customization.</li> <li>If a password is set, the GET parameter <em>?Password=yourpassword</em> will be required to read the data. Example: <em>http://www.mysite.com/csvview.php?Password=yourpassword</em>.</li> </ul> <h2>Requirements</h2> <ul> <li>Webserver with PHP 5.1.x or higher installed.</li> <li>Permissions for the script to read the CSV file.</li> </ul> <h2>Installation</h2> <p>Just edit the script configuration parameters (the CSV file name is the only required) and then put in the server and run.</p> <h2>Source code</h2> <div class="geshifilter"><pre class="php geshifilter-php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* ============================================================= / * CSV Viewer * Version 1.0 (05/07/2017) * * This application loads and parses a CSV file in the HTML format for browser viewing. * Optionally the user can set a password in the configuration and then enter it using a GET request: * Example: www.mysite.com/csvlogview.php?Password=mypassword * * Developed by Daniel Brooke Peig - daniel@danbp.org * http://www.danbp.org * Copyright 2017 - Daniel Brooke Peig * * This software is distributed under the MIT License. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * /* =============================================================*/</span> &nbsp; <span style="color: #666666; font-style: italic;">//------------------------------------------------</span> <span style="color: #666666; font-style: italic;">//Configuration</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #000088;">$fileName</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;iotcsvlog.csv&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//CSV file location</span> <span style="color: #000088;">$delimiter</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//CSV delimiter character: , ; /t</span> <span style="color: #000088;">$enclosure</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//CSV enclosure character: &quot; ' </span> <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Optional to prevent abuse. If set to [your_password] will require the &amp;Password=[your_password] GET parameter to open the file</span> <span style="color: #000088;">$ignorePreHeader</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Number of characters to ignore before the table header. Windows UTF-8 BOM has 3 characters.</span> <span style="color: #666666; font-style: italic;">//------------------------------------------------</span> &nbsp; <span style="color: #666666; font-style: italic;">//Variable initialization</span> <span style="color: #000088;">$logLines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$tableOutput</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;No data loaded&lt;/b&gt;&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Verify the password (if set)</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Password&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// File exists</span> &nbsp; <span style="color: #666666; font-style: italic;">// Reads lines of file to array</span> <span style="color: #000088;">$fileLines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #339933;">,</span> FILE_IGNORE_NEW_LINES <span style="color: #339933;">|</span> FILE_SKIP_EMPTY_LINES<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Not Empty file</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span> <span style="color: #339933;">!==</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Extract the existing header from the file</span> <span style="color: #000088;">$lineHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$logOriginalHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> str_getcsv<span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lineHeader</span><span style="color: #339933;">,</span><span style="color: #000088;">$ignorePreHeader</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$delimiter</span><span style="color: #339933;">,</span> <span style="color: #000088;">$enclosure</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Process the file only if the system could find a valid header</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Open the table tag</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;TABLE style='min-width: 50%;'&gt;&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Print the table header</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TR style='background-color: lightgray;text-align:center;'&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TD&gt;&lt;B&gt;Row&lt;/B&gt;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TD&gt;&lt;B&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$field</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/B&gt;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Add the columns</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/TR&gt;&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Get each line of the array and print the table files</span> <span style="color: #000088;">$countLines</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Remove blank lines</span> <span style="color: #000088;">$countLines</span><span style="color: #339933;">++;</span> <span style="color: #000088;">$arrayFields</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> str_getcsv<span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #339933;">,</span> <span style="color: #000088;">$delimiter</span><span style="color: #339933;">,</span> <span style="color: #000088;">$enclosure</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Convert line to array</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TR&gt;&lt;TD style='background-color: lightgray;'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$countLines</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrayFields</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TD&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$field</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Add the columns</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/TR&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Print the table footer</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TR style='background-color: lightgray;text-align:center;'&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TD&gt;&lt;B&gt;Row&lt;/B&gt;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;TD&gt;&lt;B&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$field</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/B&gt;&lt;/TD&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Add the columns</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/TR&gt;&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Close the table tag</span> <span style="color: #000088;">$tableOutput</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/TABLE&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$tableOutput</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;Invalid data format&lt;/b&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$tableOutput</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;Empty file&lt;/b&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$tableOutput</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;File not found&lt;/b&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$tableOutput</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;b&gt;Invalid password.&lt;/b&gt; Enter the password using this URL format: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?Password=&lt;b&gt;your_password&lt;/b&gt;&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;title&gt;CSV Viewer&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;CSV Viewer&lt;/h1&gt; &lt;a name=&quot;top&quot;&gt;&lt;/a&gt; &lt;hr&gt; &lt;table style=&quot;width:50%&quot;&gt; &lt;tr&gt; &lt;td&gt;&lt;a href=&quot;&quot; onClick=&quot;location.reload()&quot;&gt;Refresh&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$fileName</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Download&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;#bottom&quot;&gt;End&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;hr&gt; <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$tableOutput</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;a name=&quot;bottom&quot;&gt;&lt;/a&gt; &lt;hr&gt; &lt;table style=&quot;width:50%&quot;&gt; &lt;tr&gt; &lt;td&gt;&lt;a href=&quot;&quot; onClick=&quot;location.reload()&quot;&gt;Refresh&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$fileName</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Download&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href=&quot;#top&quot;&gt;Top&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;hr&gt; &lt;/body&gt; &lt;/html&gt;</pre></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/35" hreflang="en">PHP</a></li> <li><a href="/p/taxonomy/term/33" hreflang="en">Excel</a></li> <li><a href="/p/taxonomy/term/56" hreflang="en">Internet of Things IoT</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Wed, 05 Jul 2017 23:52:09 +0000 Daniel 130 at http://www.danbp.org/p PHP - Internet of Things Web Logger http://www.danbp.org/p/node/129 <span class="field field--name-title field--type-string field--label-hidden">PHP - Internet of Things Web Logger</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 06/30/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>Server side PHP Script that captures any HTTP GET request data and stores in a CSV spreadsheet. Can be used with Raspberry PI circuits, Arduino, IntelGalileo, IntelEdison and even with Smartwatches that can connect to the internet using Ethernet cables, Bluetooth, USB or Wifi.</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/arduino_mega_1.jpg"><img src="/p/sites/default/files/styles/large/public/arduino_mega_1.jpg?itok=Q84EmQ29" width="750" height="499" alt="Internet of Things" title="Internet of Things" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Description</h2> <p>This is a PHP script that records data from Internet of Things (IoT) devices in a CSV spreadsheet that can be opened from Excel. If you also need a web view for the log, check the <a href="http://www.danbp.org/p/node/130">CSV Viewer for Web Browsers</a>.</p> <h2>Features</h2> <ul> <li>Input is automatically decoded from the URLs by using the HTTP GET standard (see examples below).</li> <li>Records different variable sets in the same spreadsheet, each variable goes to the column it belongs.</li> <li>If a new variable is set, a column for it will be automatically created.</li> <li>No specific order required for the input data.</li> <li>Records the timestamp of the request and the IP address of the client.</li> <li>Output in the CSV format that can be directly opened in Excel.</li> <li>Output is UTF-8 compatible (at lease should be).</li> <li>If the log reaches the maximum size, older entries will be automatically purged.</li> <li>Return TRUE if the record was set and FALSE in case of problems.</li> <li>The parameter <em>?LogClear=TRUE</em> clears the table data and columns.</li> <li>Web display for the log available in <a href="http://www.danbp.org/p/node/130">CSV Viewer for Web Browsers</a>.</li> <li>If a password is set, the parameter <em>?LogPass=yourpassword</em> will be required to allow data to be inserted in the table.</li> </ul> <h2>Requirements</h2> <ul> <li>Webserver with PHP 5.1.x or higher installed.</li> <li>Permissions for the script to read, write and delete in the target CSV folder.</li> </ul> <h2>Installation</h2> <p>Just put the script in the folder and run it. There is a configuration section in the code for further adjustments.</p> <h2>Examples</h2> <ul> <li>Request 1: <em>http://www.mysite.com/iotcsvlog.php</em></li> <li>Request 2: <em>http://www.mysite.com/iotcsvlog.php?Temperature=22</em></li> <li>Request 3: <em>http://www.mysite.com/iotcsvlog.php?Temperature=22&amp;Humidity=60</em></li> <li>Request 4: <em>http://www.mysite.com/iotcsvlog.php?Humidity=80&amp;Temperature=25</em></li> <li>Request 5: <em>http://www.mysite.com/iotcsvlog.php?Pressure=1000</em></li> <li>Request 6: <em>http://www.mysite.com/iotcsvlog.php?Temperature=30&amp;Pressure=900&amp;Humidity=50</em></li> <li>Request 7 (with password set): <em>http://www.mysite.com/iotcsvlog.php?Humidity=50&LogPass=correct_password</em></li> <li>Request 8 (with password set): <em>http://www.mysite.com/iotcsvlog.php?Humidity=50&LogPass=wrong_password</em><BR><b>Wrong pass! No data logged.</b></li> <li>Request 9 (with password set): <em>http://www.mysite.com/iotcsvlog.php?Humidity=50</em><BR><b>Wrong pass! No data logged.</b></li> <li>Request 10: <em>http://www.mysite.com/iotcsvlog.php?LogClear=TRUE</em><BR><b>New empty table is created.</b></li> <li>Request 11 (with password set): <em>http://www.mysite.com/iotcsvlog.php?LogClear=TRUE&LogPass=correct_password</em><BR><b>New empty table is created.</b></li> </ul> <table align="left" border="0" cellpadding="1" cellspacing="1" height="150" width="1134"> <caption><strong>Output table from request 1, 10 and 11</strong></caption> <thead> <tr> <th scope="col">Date and Time</th> <th scope="col">IP</th> </tr> </thead> <tbody> <tr> <td>2017-06-30 10:27:45 -0300</td> <td>192.168.1.1</td> </tr> </tbody> </table> <table align="left" border="0" cellpadding="1" cellspacing="1" height="250" width="1134"> <caption> <p>&nbsp;</p> <p><strong>Output table from requests 1 and 2</strong></p> </caption> <thead> <tr> <th scope="col">Date and Time</th> <th scope="col">IP</th> <th scope="col">Temperature</th> </tr> </thead> <tbody> <tr> <td>2017-06-30 10:27:45 -0300</td> <td>192.168.1.1</td> <td>&nbsp;</td> </tr> <tr> <td>2017-06-30 10:28:48 -0300</td> <td>192.168.1.1</td> <td>22</td> </tr> </tbody> </table> <table align="left" border="0" cellpadding="1" cellspacing="1" height="500" width="1134"> <caption> <p>&nbsp;</p> <p><strong>Output table from requests 1 to 9</strong></p> </caption> <thead> <tr> <th scope="col">Date and Time</th> <th scope="col">IP</th> <th scope="col">Temperature</th> <th scope="col">Humidity</th> <th scope="col">Pressure</th> </tr> </thead> <tbody> <tr> <td>2017-06-30 10:27:45 -0300</td> <td>192.168.1.1</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>2017-06-30 10:28:48 -0300</td> <td>192.168.1.1</td> <td>22</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>2017-06-30 10:29:32 -0300</td> <td>192.168.1.1</td> <td>22</td> <td>60</td> <td>&nbsp;</td> </tr> <tr> <td>2017-06-30 10:33:20 -0300</td> <td>192.168.1.1</td> <td>25</td> <td>80</td> <td>&nbsp;</td> </tr> <tr> <td>2017-06-30 10:48:55 -0300</td> <td>192.168.1.1</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>1000</td> </tr> <tr> <td>2017-06-30 10:55:30 -0300</td> <td>192.168.1.1</td> <td>30</td> <td>50</td> <td>900</td> </tr> <tr> <td>2017-06-30 10:59:19 -0300</td> <td>192.168.1.1</td> <td>&nbsp;</td> <td>50</td> <td>&nbsp;</td> </tr> </tbody> </table> <BR> <h2>Known issues</h2> <p>The script was designed to output the CSV in the UTF-8 format so it could support a wide range of languages and character sets. Unfortunately not all systems support UTF-8 in the same way and some characters might still be displayed incorrectly. To solve this problem, configure the PHP script to output the result file in the .txt format and then open it in Excel using the Text Import function. This way you will be able to proper adjust the importation character encoding.</p> <h2>Source code</h2> <div class="geshifilter"><pre class="php geshifilter-php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* ============================================================= / * Internet of Things IoT CSV Logger * Version 1.2 (04/07/2017) * * This application logs any HTTP GET requests in a CSV file that can be directly opened by Excel. * The GET variable names will be used as column headers and the values will sorted in the rows. * The application can log completely different GET requests in the same CSV file and will automatically add the timestamp and the IP address of the client. * In case of success return TRUE, in case of errors return FALSE. * * Developed by Daniel Brooke Peig - daniel@danbp.org * http://www.danbp.org * Copyright 2017 - Daniel Brooke Peig * * This software is distributed under the MIT License. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * /* =============================================================*/</span> &nbsp; <span style="color: #666666; font-style: italic;">//------------------------------------------------</span> <span style="color: #666666; font-style: italic;">//Configurations</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #000088;">$fileName</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;iotcsvlog.csv&quot;</span><span style="color: #339933;">;</span> <span style="color: #990000;">date_default_timezone_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'America/Sao_Paulo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$delimiter</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;;&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$enclosure</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span> <span style="color: #000088;">$maxLogSize</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10000</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Most Excel versions can read only about 16000 lines</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Optional to prevent abuse. If set to [your_password] will require the &amp;LogPass=[your_password] GET parameter to allow the data to be recorded.</span> <span style="color: #666666; font-style: italic;">//------------------------------------------------</span> &nbsp; <span style="color: #666666; font-style: italic;">//Variable initialization</span> <span style="color: #000088;">$logLines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$inputLine</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$responseMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;FALSE&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;LogClear&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">&quot;TRUE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//If this is set, the source file will not be processed and will be erased after the new log entry is created</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// File exists</span> &nbsp; <span style="color: #666666; font-style: italic;">// Reads lines of file to array</span> <span style="color: #000088;">$fileLines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #339933;">,</span> FILE_IGNORE_NEW_LINES <span style="color: #339933;">|</span> FILE_SKIP_EMPTY_LINES<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Not Empty file</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span> <span style="color: #339933;">!==</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Extract the existing header from the file</span> <span style="color: #000088;">$lineHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_shift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$logOriginalHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> str_getcsv<span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$lineHeader</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$delimiter</span><span style="color: #339933;">,</span> <span style="color: #000088;">$enclosure</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Process the file only if the system could find a valid header</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Define the new header</span> <span style="color: #000088;">$logHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_combine</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span><span style="color: #339933;">,</span> <span style="color: #000088;">$logOriginalHeader</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Get each line of the array</span> <span style="color: #000088;">$linesToSkip</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$maxLogSize</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #000088;">$maxLogSize</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Trim the log size</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileLines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Remove blank lines</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$linesToSkip</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$arrayFields</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> str_getcsv<span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #339933;">,</span> <span style="color: #000088;">$delimiter</span><span style="color: #339933;">,</span> <span style="color: #000088;">$enclosure</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Convert line to array</span> <span style="color: #000088;">$logLines</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_combine</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logOriginalHeader</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arrayFields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Uses the existing headers as keys for the log lines</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$linesToSkip</span><span style="color: #339933;">--;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//Set the mandatory log headers (if they were not there during the file load)</span> <span style="color: #000088;">$logHeader</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Date and Time&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Date and Time&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$logHeader</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;IP&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;IP&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Now process the inputs</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Performs some cleaning and adjustments</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;Date and Time&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Date and Time_user&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Prevents overwriting internal data</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;IP&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;IP_user&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Prevents overwriting internal data</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[^\w\-\s\.]/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Allow only alphanumeric characters, underscore and hyphens in the header</span> <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$enclosure</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\''</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Escape the delimiter and enclosure</span> &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;LogPass&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">===</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;LogClear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Ignore the password parameter if the password is set</span> <span style="color: #000088;">$logHeader</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$key</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Adds the new header cell if needed</span> <span style="color: #000088;">$inputLine</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Defines the input array</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Set defaults to the system internal fields</span> <span style="color: #000088;">$outputLine</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Date and Time&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s O&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set the timestamp</span> <span style="color: #000088;">$outputLine</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;IP&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #000088;">$outputLine</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$inputLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$outputLine</span><span style="color: #339933;">,</span> <span style="color: #000088;">$inputLine</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$outputLine</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Put the new output into the log array</span> <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logLines</span><span style="color: #339933;">,</span> <span style="color: #000088;">$outputLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Open an output temporary file, if it does not exist create it</span> <span style="color: #000088;">$fileW</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.tmp&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;w+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//If the system was able to open the file</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;LogPass&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileW</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> &nbsp; <span style="color: #666666; font-style: italic;">//File headers</span> <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileW</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bom</span> <span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0xEF</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0xBB</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0xBF</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//BOM for Excel UTF-8</span> &nbsp; <span style="color: #666666; font-style: italic;">//Write the table header</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logHeader</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$headerKey</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$headerValue</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$finalHeader</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$enclosure</span><span style="color: #339933;">.</span><span style="color: #000088;">$headerValue</span><span style="color: #339933;">.</span><span style="color: #000088;">$enclosure</span><span style="color: #339933;">.</span><span style="color: #000088;">$delimiter</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Create the line</span> <span style="color: #000088;">$finalHeader</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$finalHeader</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Replace the last delimiter by a new line</span> <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileW</span><span style="color: #339933;">,</span><span style="color: #000088;">$finalHeader</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Write to the file</span> &nbsp; <span style="color: #666666; font-style: italic;">//Write the table lines</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logLines</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$logKey</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$logValue</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$finalLine</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$logHeader</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$headerKey</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$headerValue</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$fieldValue</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$headerKey</span><span style="color: #339933;">,</span> <span style="color: #000088;">$logValue</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$logValue</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$headerKey</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Place the content under the right header</span> <span style="color: #000088;">$finalLine</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$enclosure</span><span style="color: #339933;">.</span><span style="color: #000088;">$fieldValue</span><span style="color: #339933;">.</span><span style="color: #000088;">$enclosure</span><span style="color: #339933;">.</span><span style="color: #000088;">$delimiter</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Create the line</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$finalLine</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$finalLine</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Replace the last delimiter by a new line</span> <span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileW</span><span style="color: #339933;">,</span> <span style="color: #000088;">$finalLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Write to the file</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileW</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Close the temporary log file</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Delete the old log file since we already have the TMP file</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">rename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileName</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.tmp&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$fileName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//Rename the temporary log file to the original name</span> <span style="color: #000088;">$responseMessage</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;TRUE&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//If everything went well return TRUE</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//Output the HTTP response message</span> <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type: text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Text output for compatibility with devices that don't process HTML</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$responseMessage</span><span style="color: #339933;">;</span></pre></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/35" hreflang="en">PHP</a></li> <li><a href="/p/taxonomy/term/56" hreflang="en">Internet of Things IoT</a></li> <li><a href="/p/taxonomy/term/33" hreflang="en">Excel</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Fri, 30 Jun 2017 14:49:56 +0000 Daniel 129 at http://www.danbp.org/p Excel - Pivot tables with text values or numbers without calculations http://www.danbp.org/p/node/127 <span class="field field--name-title field--type-string field--label-hidden">Excel - Pivot tables with text values or numbers without calculations</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 06/26/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>This article demonstrates how to use the Excel Power Query tool to create pivot tables that organize and display values without calculations (count, sum, average, etc..). This can be used if the table contains text data or if you need the real values displayed in the cells.</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/pivot_title_power_query.PNG"><img src="/p/sites/default/files/styles/large/public/pivot_title_power_query.PNG?itok=TMqz0dPi" width="750" height="499" alt="Pivot Table with Text Values in Excel" title="Pivot Table with Text in Excel" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Objectives</h2> <p>Create a Pivot table that displays text data or number values that are not summarized (count, sum, etc...). This solution does not require macros or long search/replace functions, just the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39379">Microsoft Power Query</a> tool that comes with Excel 2016 or can be installed for free as an add-on in previous versions.</p> <p>This solution is far better than Formulas or VBA Macros because the categories/columns can be auto-updated according to the data source changes. It is also much simpler than typing codes and don't require any 3rd party add-on.</p> <h2>Requirements</h2> <ul><li>Windows + Excel 2016 or</li> <li>Windows + Excel 2010-2013 with the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39379">Microsoft Power Query</a> tool installed</li> <li>Mac users: Power Query is not available for this platform yet. Good luck with VBA macros :)</li> </ul><h2>Step-by-step</h2> <ol><li>Import the desired data to a blank Excel sheet.<figure role="group" class="caption caption-img align-center"><img alt="Source data" data-entity-type="file" data-entity-uuid="13a9f55e-9d53-4f2f-8474-37d8c37f9095" src="/p/sites/default/files/inline-images/01_powerquery.PNG" /><figcaption>Source data</figcaption></figure><p> </p> </li> <li>Select the data, click on <em>Data Menu - From Table/Range</em> (in Excel 2016 or higher) or in the <em>Power Query Menu - From Table/Range</em> (Excel &lt; 2016).<figure role="group" class="caption caption-img align-center"><img alt="Power Query data selection" data-entity-type="file" data-entity-uuid="629648ed-fc7e-4270-bb2f-d66d560fe018" src="/p/sites/default/files/inline-images/02_powerquery.PNG" /><figcaption>Power Query tool data selection.</figcaption></figure><p> </p> </li> <li>Confirm the selection and if it has headers.<img alt="Data range confirmation" data-entity-type="file" data-entity-uuid="41c30447-1ac5-4aa4-8681-fd53c9393bcb" src="/p/sites/default/files/inline-images/03_powerquery.PNG" class="align-center" /><p> </p> </li> <li>Power Query application will open. Convert the fields to the appropriate type, in this case, time.<figure role="group" class="caption caption-img align-center"><img alt="Adjust the data values" data-entity-type="file" data-entity-uuid="eb8828d8-c073-4b60-8dc2-8a8fdba9bd00" src="/p/sites/default/files/inline-images/04_powerquery.PNG" /><figcaption>Adjusting the data types</figcaption></figure><p> </p> </li> <li>Select the column that has the names of the new columns. In this case <em>"Action".</em></li> <li>Click on the <em>Transform Menu - Pivot Column</em>.<figure role="group" class="caption caption-img align-center"><img alt="Pivot Table creation" data-entity-type="file" data-entity-uuid="4ee77a96-28cd-4df5-a6d0-24341fc673f7" src="/p/sites/default/files/inline-images/05_powerquery.PNG" /><figcaption>Pivot Column creation</figcaption></figure></li> <li>Inside the Pivot Column dialog, select the column with the values that will populate the new columns to be created. In this case <em>"Time"</em> but could be any field type, including text.</li> <li>In the Advanced Options part, select <em>"Don´t Aggregate"</em> so the values will displayed without any modification.<figure role="group" class="caption caption-img align-center"><img alt="Select the source for the new column values" data-entity-type="file" data-entity-uuid="d200ea0c-5be2-4246-9643-6b283cb482a4" src="/p/sites/default/files/inline-images/06_powerquery.PNG" /><figcaption>Select the source for the new column values</figcaption></figure><p> </p> </li> <li>Check if the results are OK and then click on the <em>Home Menu - Close &amp; Load</em>.<figure role="group" class="caption caption-img align-center"><img alt="If everything is OK, just close." data-entity-type="file" data-entity-uuid="d34a2918-f715-4891-bb80-b62e2bf7eb25" src="/p/sites/default/files/inline-images/07_powerquery.PNG" /><figcaption>Final results, if everything is OK, click on "Close &amp; Load"</figcaption></figure><p> </p> </li> <li>The data is now on Excel in the form of Dynamic Data (a little more challenging to work with). If you just want plain data, you can copy and paste the values to another spreadsheet.<figure role="group" class="caption caption-img align-center"><img alt="Final data in Excel" data-entity-type="file" data-entity-uuid="80e1632b-3564-4190-8675-84b7ba625793" src="/p/sites/default/files/inline-images/08_powerquery.PNG" /><figcaption>Final data in Excel</figcaption></figure><p> </p> </li> </ol><h2>Another example</h2> <figure role="group" class="caption caption-img align-center"><img alt="Source data with textual values" data-entity-type="file" data-entity-uuid="d3b896c9-a622-4c8a-8081-26b6782d3d9e" src="/p/sites/default/files/inline-images/09_powerquery.PNG" /><figcaption>Source data with textual values</figcaption></figure><p> </p> <figure role="group" class="caption caption-img align-center"><img alt="Power Query configuration" data-entity-type="file" data-entity-uuid="670448b9-93bf-40f0-8e50-2516ef5bab44" src="/p/sites/default/files/inline-images/10_powerquery.PNG" /><figcaption>Power Query configuration for the column "Brand"</figcaption></figure><p> </p> <figure role="group" class="caption caption-img align-center"><img alt="Final results: Pivot Table with Text data" data-entity-type="file" data-entity-uuid="b1eb6e0a-3bea-476c-a1f0-05b7d3305d25" src="/p/sites/default/files/inline-images/11_powerquery.PNG" /><figcaption>Final results: Pivot Table with Text data</figcaption></figure><h2>Tip</h2> <p>If the Power Query is taking too long to load/calculate you probably selected all the thousand columns and lines (up to the XFD104856 cell). You must select only the exact the data range you have.</p> <p> </p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/33" hreflang="en">Excel</a></li> <li><a href="/p/taxonomy/term/26" hreflang="en">Tutorial</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Mon, 26 Jun 2017 20:28:37 +0000 Daniel 127 at http://www.danbp.org/p Drupal - Clean database cache tables automatically http://www.danbp.org/p/node/126 <span class="field field--name-title field--type-string field--label-hidden">Drupal - Clean database cache tables automatically</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Sun, 06/04/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>Script and instructions to manually or automatically clean the Drupal 8.x cache tables (cache_config, cache_container, cache_data, cache_default, cache_discovery, cache_dynamic_page_cache, cache_entity, cache_menu, cache_render and cache_toolbar).</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/drupal-logo.png"><img src="/p/sites/default/files/styles/large/public/drupal-logo.png?itok=BRAQp3TP" width="750" height="499" alt="Drupal Logo" title="Drupal Logo" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Drupal 8 has a <a href="https://www.drupal.org/node/2526150">known issue</a> that allows database cache tables grow to the infinite (hundreds of MB or even GB) this can slow or stop automated backups and in the worst scenario, take all available storage and put the site offline.</p> <p>The proposed solution is a temporary solution until Drupal team fixes this problem. I does not require the installation of any module or add-on, just a small PHP script that can be run manually, from a CRON task or from a Windows Scheduled event from the same server the page is hosted or from any other computer.</p> <p><b>Why not a Drupal module?</b> Because this can clean the cache tables even if the Drupal website went offline. It also can be executed remotely from your favorite task scheduler.</p> <h2>The PHP script to clear the cache tables</h2> <p>Edit your database access (db name, location, user and password) configuration in this code and then save with a PHP extension in any accessible folder in your server (Example: <i>http://www.mywebpage/myCleanCacheScript.php</i>). The script can run manually from the URL or be executed as an automated task (recommended).</p> <div class="geshifilter"><pre class="php geshifilter-php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* ============================================================= / * Remote Drupal Cache Cleaner * Version 1.0 (06/05/2017) * * Developed by Daniel Brooke Peig - daniel@danbp.org * http://www.danbp.org * Copyright 2017 - Daniel Brooke Peig * * This software is distributed under the MIT License. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * /* =============================================================*/</span> &nbsp; <span style="color: #000088;">$servername</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your_drupal_db_username&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your_drupal_db_password&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$dbname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your_drupal_db_name&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">// Create connection</span> <span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> mysqli<span style="color: #009900;">&#40;</span><span style="color: #000088;">$servername</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Check connection</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect_error</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Connection failed: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect_error</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;BR&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Tables to truncate</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_config&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_container&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_data&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_default&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_discovery&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_dynamic_page_cache&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_entity&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_menu&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_render&quot;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cache_toolbar&quot;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">//Run the command</span> <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TRUNCATE &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cache table &lt;i&gt;&quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/i&gt; cleaned!&lt;BR&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Error cleaning cache table &lt;i&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sqltbl</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;: &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">error</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/i&gt;&lt;BR&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> </pre></div> <h2>The CRON command</h2> <p>This command allows scheduled events to run in Linux/Unix servers. It can be run from the same server where the Drupal site is installed or from any other computer with internet access. Replace <i>mywebpage</i> with the path to the cache clear PHP script and then configure CRON to run this command every day, week or whenever you want to clear the cache tables.</p> <code>wget -O - -q -t 1 http://www.mywebpage/myCleanCacheScript.php &gt; /dev/null</code> <h2>VB Script for the Windows Task Scheduler</h2> <p>Replace the URL in the code below with the access path of your PHP script and save it as a Visual Basic Script (Example: <i>runDrupalClear.vbs</i>). Then configure Windows Task Scheduler to run this script every day, week or whenever you want to clean the cache tables.</p> <div class="geshifilter"><pre class="vbscript geshifilter-vbscript" style="font-family:monospace;"><span style="color: #8D38C9; font-weight: bold;">On Error</span> <span style="color: #8D38C9; font-weight: bold;">Resume</span> <span style="color: #8D38C9; font-weight: bold;">Next</span> &nbsp; <span style="color: #8D38C9; font-weight: bold;">Dim</span> objRequest <span style="color: #8D38C9; font-weight: bold;">Dim</span> URL &nbsp; <span style="color: #8D38C9; font-weight: bold;">Set</span> objRequest <span style="">=</span> <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;Microsoft.XMLHTTP&quot;</span>) URL <span style="">=</span> <span style="color: #800000;">&quot;http://www.mywebpage/myCleanCacheScript.php&quot;</span> &nbsp; objRequest.open <span style="color: #800000;">&quot;GET&quot;</span>, URL , <span style="color: #F660AB; font-weight: bold;">false</span> objRequest.Send <span style="color: #8D38C9; font-weight: bold;">Set</span> objRequest <span style="">=</span> <span style="color: #F660AB; font-weight: bold;">Nothing</span></pre></div> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/54" hreflang="en">Drupal</a></li> <li><a href="/p/taxonomy/term/35" hreflang="en">PHP</a></li> <li><a href="/p/taxonomy/term/26" hreflang="en">Tutorial</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Mon, 05 Jun 2017 00:16:57 +0000 Daniel 126 at http://www.danbp.org/p OpenCart orders and options Excel export tool http://www.danbp.org/p/node/125 <span class="field field--name-title field--type-string field--label-hidden">OpenCart orders and options Excel export tool</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Sun, 04/30/2017</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h3>Introduction</h3> <p>This script should work in all OpenCart 2.x and OpenCart 3.x because it extracts the data directly from the OpenCart Database and does not rely on any OpenCart directory files. No VQMod, OCMod, theme or permissions required!</p> <p>The script just dumps readable order data in an Excel file, you may later use Excel functions to auto-format the data according to your needs.</p> <h3>Inside the package</h3> <p>There are two versions of the script within the ZIP package. The first one exports the contents directly to the Excel format and should work in most of the installations if your computer/database/server uses English/Latin character sets.</p> <p>If the exported XLS appears with strange characters you should use the <em>UTF-8 TXT</em> version of the script. It allows conversion of different database charsets to UTF-8 and then exports it to a semicolon delimited <em>.TXT</em> file that can later be imported into Excel.</p> <h3>Instructions</h3> <p>1. Edit the script in any text editor. Set the configurations of your database and set an access password. The password will protect the script from outside access and should be different than the DB password.</p> <p>2. Place the modified script in any accessible (but safe) folder in your server, for example, the OpenCart <em>/admin</em> directory.</p> <p>3. Access the script by using the following URL. Remember to replace <em>YOURPASSWORD</em> with the password you set in the configuration file.</p> <p>URL: <em>https://www.yourserver.com/yourfolder/admin/order_export.php?pw=YOURPASSWORD</em></p> <p>4. If everything is OK you will be prompted to download the Excel file.</p> <p>5. Each line of the Excel file represents one order item or item option. You may group options for the same item by using the column <em>product_item</em>.</p> <p>6. In case of errors, the file will be downloaded in the PHP format. Just edit it to see what's wrong.</p> <p>7. If the characters are not displaying correctly consider the <em>UTF-8 TXT</em> version of the script. This requires an additional configuration of the source database charset.</p> <h3>Import to Excel - Convert product options to columns</h3> <p>Requirements: Excel 2016 for Windows or previous versions + <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39379">Microsoft Power Query</a> free addon.</p> <ol><li>Open the exported file (CSV or XLS).</li> <li>Select the table columns you want to use. Do not select all the 16000 available spreadsheet columns, just the ones that have data.</li> <li>In Excel 2016, go to the <em>"Data"</em> menu and then click on <em>"From Table Range"</em>. In older Excel versions with Power Query, go to the <em>"Power Query"</em> menu and click on <em>"From Table Range" </em>button.</li> <li>The query editor will open.</li> <li>Select the <em>"option_name"</em> column.</li> <li>Go to <em>"Transform"</em> menu and click on the <em>"Replace Values"</em> button.</li> <li>Replace <em>"null"</em> by any text, for example <em>"empty"</em>.</li> <li>Keep the <em>"option_name"</em> column selected.</li> <li>Back in the <em>"Transform"</em> menu, click on the  <em>"Pivot Column"</em> button.</li> <li>In the dialog box, select <em>"options_value"</em> column to the <em>"Values Column"</em> field and then, inside advanced options, select <em>"Don't aggregate"</em>.</li> <li>Now the table options should appear as columns for each order.</li> <li>Close the query editor and chose to keep/save the changes. You are back to Excel.</li> </ol><p>For more information, <a data-entity-substitution="canonical" data-entity-type="node" data-entity-uuid="1e4deab4-7a4a-4c8e-8009-9756d167323b" href="/p/node/127" title="Excel - Pivot tables with text values or numbers without calculations">check this article</a>.</p> <h3>License</h3> <p>MIT. Do whatever you want with it.</p> </div> <div class="field field--name-field-fileversion field--type-string field--label-inline"> <div class="field__label">Version</div> <div class="field__item">4.0</div> </div> <div class="field field--name-field-supported-platforms field--type-string field--label-inline"> <div class="field__label">Platforms</div> <div class="field__item">OpenCart 2.x and 3.x</div> </div> <div class="field field--name-field-download- field--type-string field--label-inline"> <div class="field__label">File size</div> <div class="field__item">8 KB</div> </div> <div class="field field--name-field-download-links field--type-link field--label-inline"> <div class="field__label">Download link</div> <div class="field__items"> <div class="field__item"><a href="http://www.danbp.org/downloads/opencart_order_xls_export_v4.zip">opencart_order_xls_export_v4.zip</a></div> </div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Screenshots</div> <div class="field field--name-field-image field--type-image field--label-above field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/2017-04/shop_banner.png"><img src="/p/sites/default/files/styles/mt_thumbnails/public/2017-04/shop_banner.png?itok=8gdD4OKS" width="230" height="153" alt="Export Tool" typeof="foaf:Image" class="image-style-mt-thumbnails" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/28" hreflang="zxx">Downloads</a></li> <li><a href="/p/taxonomy/term/35" hreflang="en">PHP</a></li> <li><a href="/p/taxonomy/term/55" hreflang="en">OpenCart</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Post Categories</h3> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title">Comments</h2> <a id="comment-92"></a> <article role="article" data-comment-user-id="0" about="/p/comment/92" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden comment__new-indicator" data-comment-timestamp="1496717581"></span> <header> </header> <footer class="comment__meta"> Submitted by <span class="comment__meta-item comment__meta-item--author"><span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Paul</span></span> </span> on <span class="comment__meta-item comment__meta-item--created">Mon, 06/05/2017 <span property="schema:dateCreated" content="2017-06-06T02:53:01+00:00" class="rdf-meta hidden"></span> </span> <span class="comment__meta-item comment__meta-item--permalink"><a href="/p/comment/92#comment-92" hreflang="en">Permalink</a></span> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/p/comment/92#comment-92" class="permalink" rel="bookmark" hreflang="en">Saved data with Question marks ((</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>Hi.</p> <p>Your script opencart2.xorderxlsexport works is fine. But my data on Russian lang. And script Saved data with Question marks.</p> <p>I search the code on stackoverflow:</p> <p>header('Content-Encoding: UTF-8');<br /> header('Content-type: text/csv; charset=UTF-8');<br /> header("Content-disposition: attachment; filename=filename.csv");<br /> header("Pragma: public");<br /> header("Expires: 0");<br /> echo "\xEF\xBB\xBF"; // UTF-8 BOM</p> <p>but this not work too.</p> <p>Please help me ;)</p> </div> </div> <nav><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=92&amp;1=default&amp;2=en&amp;3=" token="e-0hVHMaDUMQVMQcXGArf60QGHuDwa-4R-Wqb322i4c"></drupal-render-placeholder></nav> </article> <div class="indented"><a id="comment-96"></a> <article role="article" data-comment-user-id="1" about="/p/comment/96" typeof="schema:Comment" class="comment js-comment by-node-author clearfix"> <span class="hidden comment__new-indicator" data-comment-timestamp="1497216511"></span> <header> </header> <footer class="comment__meta"> Submitted by <span class="comment__meta-item comment__meta-item--author"><span rel="schema:author"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> </span> on <span class="comment__meta-item comment__meta-item--created">Tue, 06/06/2017 <span property="schema:dateCreated" content="2017-06-06T21:32:39+00:00" class="rdf-meta hidden"></span> </span> <span class="comment__meta-item comment__meta-item--permalink"><a href="/p/comment/96#comment-96" hreflang="en">Permalink</a></span> <span class="visually-hidden">In reply to <a href="/p/comment/92#comment-92" class="permalink" rel="bookmark" hreflang="en">Saved data with Question marks ((</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Paul</span></span> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/p/comment/96#comment-96" class="permalink" rel="bookmark" hreflang="en">Version 2 support for different charsets</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>Hello Paul,</p> <p>The version 2 comes with an additional script that exports the data to a UTF-8 TXT file that later can be imported into Excel.</p> <p>This version requires an additional configuration for the source database charset. Most of the databases should be UTF-8 but yours could be configured to ISO-8859-5 (Russian) so you need to check this information.</p> <p>To open it, open the TXT file from Excel and then select the option "Delimited fields" and then set the delimiter to "semicolon" (;).</p></div> </div> <nav><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=96&amp;1=default&amp;2=en&amp;3=" token="uioC_j2NrmmUdDySdm89lsoQVT5yCJBDLQ5-nwiV8ko"></drupal-render-placeholder></nav> </article> </div><a id="comment-123"></a> <article role="article" data-comment-user-id="0" about="/p/comment/123" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden comment__new-indicator" data-comment-timestamp="1501274710"></span> <header> </header> <footer class="comment__meta"> Submitted by <span class="comment__meta-item comment__meta-item--author"><span rel="schema:author"><a rel="nofollow" href="https://www.sparklingpiercings.nl" lang="" typeof="schema:Person" property="schema:name" datatype="" class="username">ThaFridge</a></span> </span> on <span class="comment__meta-item comment__meta-item--created">Fri, 07/28/2017 <span property="schema:dateCreated" content="2017-07-28T20:45:10+00:00" class="rdf-meta hidden"></span> </span> <span class="comment__meta-item comment__meta-item--permalink"><a href="/p/comment/123#comment-123" hreflang="en">Permalink</a></span> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/p/comment/123#comment-123" class="permalink" rel="bookmark" hreflang="en">Not working in MariaDB</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>Cant make it work with php7+ and MariaDB (Mysqli) any suggestions?</p> </div> </div> <nav><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=123&amp;1=default&amp;2=en&amp;3=" token="Lkj0iuFijUJ-olizimeC0BRZLjZ1IFpYnqZNpsErgJA"></drupal-render-placeholder></nav> </article> </section> Sun, 30 Apr 2017 21:45:18 +0000 Daniel 125 at http://www.danbp.org/p http://www.danbp.org/p/node/125#comments Drupal - Duplicate view results in multi language sites http://www.danbp.org/p/node/123 <span class="field field--name-title field--type-string field--label-hidden">Drupal - Duplicate view results in multi language sites</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Sat, 02/25/2017</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p>One of the problems you may face when converting your single language Drupal website to a multi-language version are the repeated / duplicated pages that appear in several views. This article explains why this happens and how to eliminate all duplicates.</p></div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/drupal-logo.png"><img src="/p/sites/default/files/styles/large/public/drupal-logo.png?itok=BRAQp3TP" width="750" height="499" alt="Drupal Logo" title="Drupal" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>This article explains how to eliminate the duplicate pages that appear in multi-language Drupal site views. The solution was tested on Drupal 8 but works well in previous versions.</p> <p>Duplicate pages normally appear in:</p> <ul><li>Banners</li> <li>Most Popular Lists</li> <li>Related Content lists</li> <li>Slideshows</li> <li>Taxonomy terms</li> <li>What's new pages</li> <li>Lists or Tables</li> <li>Views in general</li> </ul><h2>Types of duplicate pages</h2> <p>There are two types of duplicate results in multi-language website views:</p> <ul><li><strong>Content that has more than one translation language</strong>: All translations of the same content will be displayed by default in most of Drupal views. You don't need to create a view or block for each language your site display, just add some filters (see below) to display only one language.</li> <li><strong>Relationships that have more than one translation language</strong>: In this case, content that has the same translation language may appear more than once. This happens if the view has a relationship (author, for example) that has multiple translations.</li> </ul><p>The solutions below for the two types of duplicated contents can be applied individually or together to achieve the desired results.</p> <h2>How to configure a view to only display pages with the language of the user interface (filter content translations)</h2> <ol><li>Go to "Structure"-&gt;"Views" in the Drupal administration menu.</li> <li>Find the view that you want to fix and click "Edit".</li> <li>Add a new filter criteria: "Content"-&gt;"Translation Language".</li> <li>On the configuration window, select the operator "is one of" and then the language "Interface text language for the selected page".</li> <li>Apply.</li> <li>Check if there are no more duplicates with different languages. If you see the same language more than once then apply the next solution also.</li> </ol><figure role="group" class="caption caption-img"><img alt="Configuring a filter for the language" data-entity-type="file" data-entity-uuid="43fa586d-83f9-444b-9aeb-443a63f7c41a" height="315" src="/p/sites/default/files/inline-images/configure-filter-language.jpg" width="442" /><figcaption>Configuring the filter for the language in the actual view results</figcaption></figure><h2>How to eliminate pages of the same language that appear more than once (filter relationship translations)</h2> <ol><li>Go to "Structure"-"Views" in the Drupal administration mode.</li> <li>Find the view that you want to fix and click "Edit".</li> <li>On the configuration window, expand the "advanced" menu.</li> <li>Identify the existing relationships ("author", for example).</li> <li>In the "fields" group, identify the field connected to the relationships of the previous step.The relationship name is in parenthesis and the field name is at the side (example: (author) User: Name ).</li> <li>Add a new filter criteria. In the criteria list, look for for the the field name from the last step ("User" for example) and then for the "Translation language" keyword.</li> <li>On the configuration window, select the operator "is one of" and then the language "Interface text language for the selected page".</li> <li>Apply.</li> </ol><figure role="group" class="caption caption-img"><img alt="Looking for relationships" data-entity-type="file" data-entity-uuid="0cdbaf44-f1e0-477e-b140-eb13096a7b85" height="604" src="/p/sites/default/files/inline-images/relationships.jpg" width="588" /><figcaption>Identify the relationships. In this case "(author) User".</figcaption></figure><p> </p> <figure role="group" class="caption caption-img"><img alt="Looking for the author translation language filter" data-entity-type="file" data-entity-uuid="6b1297c0-3e7f-4891-9faa-5a13faedbfff" height="689" src="/p/sites/default/files/inline-images/user-translation-language.jpg" width="560" /><figcaption>Look for the user translation language filter criteria. In this case "Translation language from User".</figcaption></figure><p> </p> <figure role="group" class="caption caption-img"><img alt="Configure the filter for the relationship" data-entity-type="file" data-entity-uuid="1e5b9310-ad67-4437-bd68-6dbf3242b540" height="417" src="/p/sites/default/files/inline-images/configure-filter-relationship.jpg" width="515" /><figcaption>Configure the filter for the relationship.</figcaption></figure><p> </p> <figure role="group" class="caption caption-img"><img alt="Final filter criteria" data-entity-type="file" data-entity-uuid="8e5b71df-1284-42bb-baa4-e6e797a9dd73" src="/p/sites/default/files/inline-images/final-filter-criteria.jpg" /><figcaption>Final filters for content and for relationships.</figcaption></figure></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/54" hreflang="en">Drupal</a></li> <li><a href="/p/taxonomy/term/26" hreflang="en">Tutorial</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Sat, 25 Feb 2017 20:54:57 +0000 Daniel 123 at http://www.danbp.org/p JavaScript Test Workbench http://www.danbp.org/p/node/121 <span class="field field--name-title field--type-string field--label-hidden">JavaScript Test Workbench</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 12/20/2016</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Single file HTML 5 boilerplate for quick JavaScript applications development and testing. Comes with a built in console box and some input fields and buttons to speed up the development.</p> <p>A working sample is available <a href="http://www.danbp.org/downloads/JSTestWorkBench.html">here</a>.</p> <p>Content available under the <a href="https://opensource.org/licenses/mit">MIT license</a>.</p> </div> <div class="field field--name-field-fileversion field--type-string field--label-inline"> <div class="field__label">Version</div> <div class="field__item">1.0</div> </div> <div class="field field--name-field-supported-platforms field--type-string field--label-inline"> <div class="field__label">Platforms</div> <div class="field__item">Windows</div> </div> <div class="field field--name-field-download- field--type-string field--label-inline"> <div class="field__label">File size</div> <div class="field__item">2 KB</div> </div> <div class="field field--name-field-download-links field--type-link field--label-inline"> <div class="field__label">Download link</div> <div class="field__items"> <div class="field__item"><a href="http://www.danbp.org/downloads/jstestwb.zip">jstestwb.zip</a></div> </div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Screenshots</div> <div class="field field--name-field-image field--type-image field--label-above field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/2016-12/JSTestWorkBench.png"><img src="/p/sites/default/files/styles/mt_thumbnails/public/2016-12/JSTestWorkBench.png?itok=OfAFTZ_I" width="230" height="153" alt="JS Workbench Image" typeof="foaf:Image" class="image-style-mt-thumbnails" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/28" hreflang="zxx">Downloads</a></li> <li><a href="/p/taxonomy/term/32" hreflang="en">JavaScript</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Post Categories</h3> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title">Comments</h2> <a id="comment-129"></a> <article role="article" data-comment-user-id="0" about="/p/comment/129" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden comment__new-indicator" data-comment-timestamp="1502908112"></span> <header> </header> <footer class="comment__meta"> Submitted by <span class="comment__meta-item comment__meta-item--author"><span rel="schema:author"><a rel="nofollow" href="https://abrirempresa.ltda" lang="" typeof="schema:Person" property="schema:name" datatype="" class="username">Fernando</a></span> </span> on <span class="comment__meta-item comment__meta-item--created">Wed, 08/16/2017 <span property="schema:dateCreated" content="2017-08-16T18:28:32+00:00" class="rdf-meta hidden"></span> </span> <span class="comment__meta-item comment__meta-item--permalink"><a href="/p/comment/129#comment-129" hreflang="en">Permalink</a></span> </footer> <div class="comment__content"> <h3 property="schema:name" datatype=""><a href="/p/comment/129#comment-129" class="permalink" rel="bookmark" hreflang="en">Congratulations</a></h3> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item"><p>Great news!</p> <p>Nice post!</p> <p> </p> <p>Cya,</p> <p>Fernando<br /> Digital Marketing | <a href="https://abrirempresa.ltda">https://abrirempresa.ltda</a></p> </div> </div> <nav><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=129&amp;1=default&amp;2=en&amp;3=" token="9Oll-I4cGlD3M5E8Tx5L_YzhIM_GzH4kOxZgoGAUVjs"></drupal-render-placeholder></nav> </article> </section> Tue, 20 Dec 2016 15:07:51 +0000 Daniel 121 at http://www.danbp.org/p JavaScript Test Workbench http://www.danbp.org/p/node/120 <span class="field field--name-title field--type-string field--label-hidden">JavaScript Test Workbench</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 12/20/2016</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Simple HTML 5 boilerplate for quick JavaScript applications development and testing. Comes with a built in console box and some input fields and buttons to speed up the development.</p> <blockcode><meta charset="utf-8" /><title>JavaScript Test Workbench</title><meta name="description" content="Just a Javascript Test Tool" /><meta name="author" content="Daniel Brooke Peig" /><style> <!--/*--><![CDATA[/* ><!--*/ /* The colors of the page were adjusted to display "hidden" white objects */ body { background-color: LightGrey; } #jstwLog { vertical-align: top; width: 95%; border: 1px solid white; background-color: #1d3030; color: LightYellow; padding: 15px; } /*--><!]]>*/ </style><!-- Your style-sheets go here --><!-- End of your page style-sheets--><h1>JavaScript Test Workbench 1.0</h1> This is a simple HMTL 5 boilerplate with a built in console window designed to speedup JavaScript applications development. For more information visit: <a href="hrrp://www.danbp.org">www.danbp.org</a> <h2>Page content:</h2> <div id="jstwContent"> <!-- Your page content goes here --> Number 1 <input type="text" value="50" /><br /> Number 2 <input type="text" value="75" /><br /> Number 3 <input type="text" value="37" /><br /> Number 4 <input type="text" value="6" /><br /> Sum results <input type="text" value="0" /><br /><button type="button" onclick="RunScript()">Run</button> <!-- End of your page content --> </div> <!-- JavaScript console block--> <h2>JavaScript console echo:</h2> <button type="button" onclick="document.getElementById('jstwLog').innerHTML = ''">Clear</button> <div id="jstwLog">Script syntax error! Check browser's console window.</div> <script> <!--//--><![CDATA[// ><!-- //This script echoes the JavaScript console messages to the main HTML page (function () { if (!console) { console = {}; } var old = console.log; var logger = document.getElementById('jstwLog'); logger.innerHTML = ""; console.log = function (message) { old(message); if (typeof message == 'object') { logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />'; } else { logger.innerHTML += message + '<br />'; } } })(); //--><!]]> </script><!-- End of the JavaScript console block--><script> <!--//--><![CDATA[// ><!-- // JavaScript extra debug code part 1 //-------------------------------------------------------------------------------------------------------- "use strict"; //Prevents the use of undeclared variables console.time("MyScript"); //Start the script timer //-------------------------------------------------------------------------------------------------------- //--><!]]> </script><!-- Your JavaScript code goes here --><script> <!--//--><![CDATA[// ><!-- //Start of the sample code function RunScript(){ console.log("Action performed..."); //Indicates the script is working var inputBoxes = document.getElementsByTagName('input'); //Get the input boxes console.log("Input boxes collected: "+inputBoxes.length); var sum = Number(inputBoxes[0].value) + Number(inputBoxes[1].value) + Number(inputBoxes[2].value) + Number(inputBoxes[3].value); console.log("Sum of the values: "+sum); inputBoxes[4].value = sum; } //--><!]]> </script><!-- End of your JavaScript code --><script> <!--//--><![CDATA[// ><!-- // JavaScript extra debug code part 2 //-------------------------------------------------------------------------------------------------------- console.timeEnd("MyScript"); //Stop the script timer //-------------------------------------------------------------------------------------------------------- //--><!]]> </script></blockcode></div> <div class="field field--name-field-fileversion field--type-string field--label-inline"> <div class="field__label">Version</div> <div class="field__item">1.0</div> </div> <div class="field field--name-field-supported-platforms field--type-string field--label-inline"> <div class="field__label">Platforms</div> <div class="field__item">Windows</div> </div> <div class="field field--name-field-download- field--type-string field--label-inline"> <div class="field__label">File size</div> <div class="field__item">2 KB</div> </div> <div class="field field--name-field-download-links field--type-link field--label-inline"> <div class="field__label">Download link</div> <div class="field__items"> <div class="field__item"><a href="http://www.danbp.org/downloads/jstestwb.zip">jstestwb.zip</a></div> </div> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/28" hreflang="zxx">Downloads</a></li> <li><a href="/p/taxonomy/term/32" hreflang="en">JavaScript</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Post Categories</h3> <ul class='links field__items'> <li><a href="/p/it" hreflang="en">INFORMATION TECHNOLOGY</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Tue, 20 Dec 2016 14:59:21 +0000 Daniel 120 at http://www.danbp.org/p Plutocalc Water - Cálculos para tratamento de água e efluentes http://www.danbp.org/p/pt-br/plutocalc <span class="field field--name-title field--type-string field--label-hidden">Plutocalc Water - Instant calculations for environmental professionals</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/p/user/1" lang="" about="/p/user/1" typeof="schema:Person" property="schema:name" datatype="" class="username">Daniel</a></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 11/14/2016</span> <div class="clearfix text-formatted field field--name-field-mt-subheader-body field--type-text-with-summary field--label-hidden field__item"><p><img alt="Plutocalc Water" data-entity-type="file" data-entity-uuid="8796ab35-68e8-44fe-b158-32407e8f5b1b" src="/p/sites/default/files/inline-images/Plutocalc-120.png" class="align-right" /></p> <p><b>Plutocalc</b> is a free problem solver suite for water treatment, wastewater, hydraulics, environmental chemistry and unit conversions. Plutocalc calculations were carefully tuned to require minimal inputs and provide accurate results based on the latest advances in science and engineering.</p> </div> <div class="field field--name-field-image field--type-image field--label-hidden field__items"> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field__item"> <a class="image-popup overlayed" href="http://www.danbp.org/p/sites/default/files/FeatureImage-1024x500.png"><img src="/p/sites/default/files/styles/large/public/FeatureImage-1024x500.png?itok=Wlljx2jJ" width="750" height="499" alt="Plutocalc Water" title="Plutocalc Water" typeof="foaf:Image" class="image-style-large" /> <span class="overlay"><i class="fa fa-plus"></i></span></a> </div> </div> </div> </div> </div> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><strong>Please visit the official <a href="http://www.plutocalc.com" style="color:Maroon;">Plutocalc Water</a> website for more information and downloads.</strong></p> <p><strong><a href="http://www.plutocalc.com" style="color:Maroon;">http://www.plutocalc.com</a></strong></p> <p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--entity-reference-target-type-taxonomy-term clearfix"> <h3 class="field__label">Tags</h3> <ul class='links field__items'> <li><a href="/p/taxonomy/term/37" hreflang="en">Water Treatment</a></li> <li><a href="/p/taxonomy/term/40" hreflang="en">Membranes</a></li> <li><a href="/p/taxonomy/term/28" hreflang="zxx">Downloads</a></li> <li><a href="/p/taxonomy/term/50" hreflang="en">Wastewater Treatment</a></li> </ul> </div><div class="field field--name-field-mt-post-categories field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix"> <ul class='links field__items'> <li><a href="/p/engineering" hreflang="en">ENGINEERING</a></li> </ul> </div><section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> </section> Sat, 12 Nov 2016 21:57:31 +0000 Daniel 86 at http://www.danbp.org/p