2014-10-07 - Re: [GRASE-Hotspot] CSV from Mysql Database ??? example

Header Data

From: Timothy White <ti***8@gmail.com>
Message Hash: bed628a2419f9e8591623e0a3fb1363c9818a7de84d3e91e70bf4be9cc2584a1
Message ID: <CAESLx0LQ7QL08MK1VRw3=YVMYaXcXAtZJnLkEvR6p_WSKf8mDA@mail.gmail.com>
Reply To: <9f92baa2-d4ad-4104-826a-ee7975da07ed@grasehotspot.org>
UTC Datetime: 2014-10-07 17:58:12 UTC
Raw Date: Wed, 08 Oct 2014 10:58:12 +1000

Raw message

Hi Bart

I think you've misunderstood me. The ability to print a batch in HTML
already exists. The export to CSV is for a mailmerge or other uses. If you
click print batch, it's basically doing what your code is now doing. I
intend to make it so you can edit the CSS easily to modify the appearance.
Exporting to CSV, reimporting into MySQL and then writing a script to
process the MySQL is reimplementing the wheel. All the data started in
MySQL.

Below is a screenshot although the CSS is broken in that picture.


Each ticket is in a div already for easy styling with CSS


<div class="cutout_ticket span-6"> <span class="ticket_item_label ">
Username:</span> <span class='info_username last'>8vaaf2un</span><br/> <span
class="ticket_item_label ">Password:</span> <span class='info_password last
'>kih729meg</span><br/> </div> <div class="cutout_ticket span-6"> <span
class="ticket_item_label ">Username:</span> <span class='info_username last
'>9riih5ej</span><br/> <span class="ticket_item_label ">Password:</span>
<span class='info_password last'>jid664giw</span><br/>

Tim

On Wed, Oct 8, 2014 at 9:35 AM, bartosz <ba***z@miklaszewski.com> wrote:

> hi guys just been messing around, after Tim mention about CSS and HTML
> tickets, looks it will be very good idea :)
> tried my self. For example, in batch list, to add option to print to html,
> (and html will get batch from mysql and print in html formated with css,
> this is what i did to test it: (no CSS yet)
>
> database imported from csv to mysql:
>
>
> <https://lh4.googleusercontent.com/-nC9p9JC99Ew/VDR389hEvHI/AAAAAAAAKqU/pSxLtuCegjY/s1600/Screenshot%2Bfrom%2B2014-10-08%2B00%3A27%3A09.png>
>
> then:
>
> <?php
> $dbhost = 'localhost:3036';
> $dbuser = 'root';
> $dbpass = 'password';
> $conn = mysql_connect($dbhost, $dbuser, $dbpass);
> if(! $conn )
> {
>   die('Could not connect: ' . mysql_error());
> }
> $sql = 'SELECT username, password, expiry, type FROM barttable';
>
> mysql_select_db('bart');
> $retval = mysql_query( $sql, $conn );
> if(! $retval )
> {
>   die('Could not get data: ' . mysql_error());
> }
> while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
> {
>     echo "Username:{$row['username']}  <br> ".
>          "Password: {$row['password']} <br> ".
>          "Expiry: {$row['expiry']} <br> ".
>          "Type: {$row['type']} <br> ".
>          "--------------------------------<br>";
> }
> echo "Fetched data successfully\n";
>
> mysql_close($conn);
> ?>
>
> as a resault html file:
>
> Username:Username
> Password: Password
> Expiry: Expiry
> Type: Voucher Type
> --------------------------------
> Username:6fe6leud
> Password: tunbad333
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:un89heuf
> Password: fac898low
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:9te8novi
> Password: givhek355
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:og49buaw
> Password: bej148lil
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:as9ab2ga
> Password: daknub488
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:uf8og4ro
> Password: tuwcar795
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ek1ap2ep
> Password: ticsek284
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:5ti2keak
> Password: wacpam438
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:1lo5zoor
> Password: hac667mad
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:1coug5bu
> Password: mak684wiz
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:5riad7ob
> Password: nup595gun
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:3cu6vame
> Password: nid513nas
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:2maov6en
> Password: vajtoj659
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:1ni6cois
> Password: natgim934
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ak2un3jo
> Password: votkaf845
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:5di9hoaj
> Password: hop196nas
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:6beet2wo
> Password: roctan497
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:in8iz1up
> Password: dimpit883
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:6se6heje
> Password: lus768mom
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:uk24fooz
> Password: firroz295
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ev57wawi
> Password: mop342bih
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ej6er7pi
> Password: kam216car
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:8soer9ub
> Password: ridzev463
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ak8ol6ok
> Password: kot168cid
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ud7ir1uk
> Password: duhvol958
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ir3ol1uc
> Password: jenref625
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:an5og5nu
> Password: hippek985
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:if77gate
> Password: den211fir
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:2te1buod
> Password: salcad749
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:4dauf9fo
> Password: vic341mow
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:or67juec
> Password: jalsuh783
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:3mu9moiz
> Password: zam836fur
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:3riiv3uw
> Password: zut162sug
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:of15boad
> Password: degbok574
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:el2id8al
> Password: zim358jep
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:6mu5jait
> Password: tok513zot
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:od49situ
> Password: lan627bob
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:im6af1ew
> Password: buzzez417
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:ut79maik
> Password: topfav469
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:3keup5id
> Password: cow667muc
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:6bo4nuwu
> Password: moz751vaj
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:aj67fuih
> Password: fad159gen
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:iz71veko
> Password: cij589wek
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:4no1jewa
> Password: bis936nej
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:8vaez8ke
> Password: zofked267
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:is6ip7is
> Password: mit914sim
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:1ca5jolo
> Password: doh365tim
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:an6af8af
> Password: cobdut136
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:4puac5pu
> Password: tor527hub
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Username:5ma3pead
> Password: nuc552moc
> Expiry: Apr 7 2015 01:49:51
> Type: Ministry
> --------------------------------
> Fetched data successfully
>
>
> will try to play with css now will see what happen :)
>
> what you think ? :)
>
>
>
>
>
>
>
>
>
>
>
>  --
> This mailing list is for the Grase Hotspot Project http://grasehotspot.org
> ---
> You received this message because you are subscribed to the Google Groups
> "Grase Hotspot" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gr***e@grasehotspot.org.
> To post to this group, send email to gr***t@grasehotspot.org.
> Visit this group at
> http://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.
> To view this discussion on the web visit
> https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/9f92baa2-d4ad-4104-826a-ee7975da07ed%40grasehotspot.org
> <https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/9f92baa2-d4ad-4104-826a-ee7975da07ed%40grasehotspot.org?utm_medium=email&utm_source=footer>
> .
>

Thread