Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36
  1. #21
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Quote Originally Posted by clint6998 View Post
    Looks pretty good after the css. Might need just a little more tweaking of it. I do have one concern though. When you click a letter, it does go down to it as it should, however, it removes everything above it so you can't scroll back up. ANy ideas on that?

    Thanks,

    Clint
    Remove everything? Not seeing that, but then again also on a cell phone where currently seeing only two columns and the second column is being cut off...

    Could though add a "back to top" link adjacent to each letter and the applicable link code around the list of letters. (Btw, last letter visible on my cell phone is: U in full and half of V...)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #22
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by mc12345678 View Post
    Remove everything? Not seeing that, but then again also on a cell phone where currently seeing only two columns and the second column is being cut off...

    Could though add a "back to top" link adjacent to each letter and the applicable link code around the list of letters. (Btw, last letter visible on my cell phone is: U in full and half of V...)
    That's strange that it cuts off at "U". My phone sees it all but it also cuts off the second column instead of floating left like it should. Any ideas why it would float from 3 columns to 2 but not 2 to 1?

    Also, I want to put a line "|" between each letter. I can do that but them it puts one after the last one. Can you help on how to NOT put on after the last one?

    Also, still trying to replace the numbers with a #. Could you help with the script? I cant write it but something like "if first character does not start with a letter, then show "#" and then list all numerical values under the "#"?"
    Last edited by clint6998; 10 Mar 2016 at 03:18 PM.

  3. #23
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Quote Originally Posted by clint6998 View Post
    That's strange that it cuts off at "U". My phone sees it all but it also cuts off the second column instead of floating left like it should. Any ideas why it would float from 3 columns to 2 but not 2 to 1?

    Also, I want to put a line "|" between each letter. I can do that but them it puts one after the last one. Can you help on how to NOT put on after the last one?

    Also, still trying to replace the numbers with a #. Could you help with the script? I cant write it but something like "if first character does not start with a letter, then show "#" and then list all numerical values under the "#"?"

    The issue, and not sure how/where you are adding the pipe character |, but if you wrap it in an if statement such that:
    Code:
     if ($i < (last value of applicable $i - 1)) {
    So, I've addressed three issues in one below, doesn't take care of any "float" issues, though that is likely more because of the various CSS that would probably be involved. Currently the display is linear from left to right, instead of being columnar with each column being in its own div/span or each item being in its own container like an odd/even scenario and therefore can't slide into the list to maintain alphabetic order in a single column. BTW, my second column is also cut short on my cell phone. Anyways, The below "highlighted" code is what has been changed:

    Code:
    <?php
         echo '<div id="alphanumericWrapper"><a name="attop">';
         echo 'Manufacturers ';
         echo '<a href="'. $_SERVER['REQUEST_URI'] . '#hash">#</a>';
         for ($i=65; $i<91; $i++) {
         echo '|';
         echo '<a href="'. $_SERVER['REQUEST_URI'] . '#' . chr($i).'">' . chr($i) . '</a>';
         }
         echo '</a></div>';
    
     echo '<br class="clearBoth" />';
    
    
     $manufacturers_query = "SELECT distinct manufacturers_id, manufacturers_name FROM " . TABLE_MANUFACTURERS . " ORDER BY manufacturers_name"; 
    
     $manufacturers = $db->Execute($manufacturers_query);
     $numeric_displayed = false;
    
     while (!$manufacturers->EOF) {
    
         if (!is_numeric(strtoupper(substr($manufacturers->fields['manufacturers_name'], 0, 1))) && $initial !== strtoupper(substr($manufacturers->fields['manufacturers_name'], 0, 1))) {
             $initial = strtoupper(substr($manufacturers->fields['manufacturers_name'], 0, 1));
    
             echo '<br class="clearBoth" />';
             echo '<a name="'.$initial.'" class="bold bigger defaultColor">' . $initial . '</a>';
             echo '&nbsp;<a href="'.$_SERVER['REQUEST_URI'] . '#attop">Back to Top</a>';
             echo '<br class="clearBoth" />';
         } elseif (!$numeric_displayed && is_numeric(strtoupper(substr($manufacturers->fields['manufacturers_name'], 0, 1)))) {
             $initial = strtoupper(substr($manufacturers->fields['manufacturers_name'], 0, 1));
    
             echo '<br class="clearBoth" />';
             echo '<a name="hash" class="bold bigger defaultColor">#</a>';
             echo '&nbsp;<a href="'.$_SERVER['REQUEST_URI'] . '#attop">Back to Top</a>';
             echo '<br class="clearBoth" />';
             $numeric_displayed = true;
         }
    
     echo '<div style="width: 33.3%; float: left;"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . (int) $manufacturers->fields['manufacturers_id'], $request_type) . '">' . $manufacturers->fields['manufacturers_name'] . '</a></div>';
    
    
           $manufacturers->MoveNext();
         }
    
             echo '<br class="clearBoth" />';
     ?>
    This resequenced the # symbol to the beginning (such businesses appear first), which allows the pipe symbol (|) to be inserted before the next "letter" and therefore there is never a symbol that follows another letter, it always precedes the next letter. Then it (untested) displays the # symbol one time with all of the businesses that begin with a number, then once a letter is encountered, it switches to displaying the original code with each letter being displayed followed by the manufacturers that begin with that letter until the end. Also, have added a Back to Top link that should return back to the list of characters and is displayed adjacent to each main divider character.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #24
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Fyi, just checked in on changes, looks like the numbers have been moved to the front of the pick list at top but that doesn't match any of the code provided here... Is a change since earlier post, so know that it has since been touched.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #25
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    ok so I have made a few changes to the page and css. Here is the new php and a screen shot as it seems that in a the listings are in teh following order:

    div-->manufacturers-->clearBoth-->Next alpha-->attop link. Any ideas? See image below php

    PHP Code:
    <?php 
        
    echo '<div id="alphanumericWrapper"><span class="buttonRow btn"><div style="float: left; padding: 0;margin:4,0"><a name="attop">'
        echo 
    '<a href="'$_SERVER['REQUEST_URI'] . '#hash">#</a></div>';
        for (
    $i=65$i<91$i++) {
        echo 
    '<div style="float: left; padding: 0;margin:4,0"><a href="'$_SERVER['REQUEST_URI'] . '#' chr($i).'">' chr($i) . '</a></div>'
        }
        echo 
    '</span></div>'

    echo 
    '<br class="clearBoth" /><br class="clearBoth" />'


    $manufacturers_query "SELECT distinct manufacturers_id, manufacturers_name FROM " TABLE_MANUFACTURERS " ORDER BY manufacturers_name";  

    $manufacturers $db->Execute($manufacturers_query); 
    $numeric_displayed false;

    while (!
    $manufacturers->EOF) { 

        if (!
    is_numeric(strtoupper(substr($manufacturers->fields['manufacturers_name'], 01))) && $initial !== strtoupper(substr($manufacturers->fields['manufacturers_name'], 01))) { 
            
    $initial strtoupper(substr($manufacturers->fields['manufacturers_name'], 01)); 
            echo 
    '<br class="clearBoth" /><br class="clearBoth" />'
            echo 
    '<h4 class="manufacturers" style="width: 100%"><a name="'.$initial.'" class="bold bigger defaultColor">' $initial '</a><span style="align: right;" class="btn buttonRow"><a href="'.$_SERVER['REQUEST_URI'] . '#attop">Back to Top</a></span></h4>'
           

            echo 
    '<br class="clearBoth" /><br class="clearBoth" />'
        } elseif (!
    $numeric_displayed && is_numeric(strtoupper(substr($manufacturers->fields['manufacturers_name'], 01)))) {
             
    $initial strtoupper(substr($manufacturers->fields['manufacturers_name'], 01));

             echo 
    '<br class="clearBoth" />';
             echo 
    '<h4 class="manufacturers" style="width: 100%"><a name="hash" class="bold bigger defaultColor">#</a>';
             echo 
    '&nbsp;<span style="align: right;" class="btn buttonRow"><a href="'.$_SERVER['REQUEST_URI'] . '#attop">Back to Top</a></span></h4>';
             echo 
    '<br class="clearBoth" />';
             
    $numeric_displayed true;
         }

    echo 
    '<div style="width: 33.3%; float: left; min-width:200px"><a href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' . (int) $manufacturers->fields['manufacturers_id'], $request_type) . '">' $manufacturers->fields['manufacturers_name'] . '</a></div>'


          
    $manufacturers->MoveNext(); 
        } 

            echo 
    '<br class="clearBoth" />'
    ?>
    screenshot
    Name:  manufacturers.jpg
Views: 114
Size:  76.9 KB

  6. #26
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Missing a matching close for the attop a tag.
    Code:
    <?php 
        echo '<div id="alphanumericWrapper"><span class="buttonRow btn"><div style="float: left; padding: 0;margin:4,0"><a name="attop">'; 
        echo '<a href="'. $_SERVER['REQUEST_URI'] . '#hash">#</a></div>';
        for ($i=65; $i<91; $i++) {
        echo '<div style="float: left; padding: 0;margin:4,0"><a href="'. $_SERVER['REQUEST_URI'] . '#' . chr($i).'">' . chr($i) . '</a></div>'; 
        }
        echo '</a></span></div>';
    Weird, I posted the code. Last line modified.
    Last edited by mc12345678; 10 Mar 2016 at 08:14 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #27
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by mc12345678 View Post
    Missing a matching close for the attop a tag.
    Code:
    <?php 
        echo '<div id="alphanumericWrapper"><span class="buttonRow btn"><div style="float: left; padding: 0;margin:4,0"><a name="attop">'; 
        echo '<a href="'. $_SERVER['REQUEST_URI'] . '#hash">#</a></div>';
        for ($i=65; $i<91; $i++) {
        echo '<div style="float: left; padding: 0;margin:4,0"><a href="'. $_SERVER['REQUEST_URI'] . '#' . chr($i).'">' . chr($i) . '</a></div>'; 
        }
        echo '</a></span></div>';
    Weird, I posted the code. Last line modified.
    I must have deleted by accident when making style changes and rearranging to put the hash tag in the front. No matter what I do with the css I cannot seem to get a margin between the alpha and manufacturers above it...

    Great work getting me where I am!!! Thank you all so much!!

  8. #28
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Three things I see. One, adaptive tactical appears twice, not sure what the background is for the entered information, but it became obvious when it went single column.
    Two, the back to top clickable link I would suggest having adjacent the letter rather than below it. It takes up a lot of screen space.
    Three, the letter row doesn't wrap and is now truncated at T.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #29
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Need help with a query

    Quote Originally Posted by clint6998 View Post
    I must have deleted by accident when making style changes and rearranging to put the hash tag in the front. No matter what I do with the css I cannot seem to get a margin between the alpha and manufacturers above it...

    Great work getting me where I am!!! Thank you all so much!!
    These days I'm rarely in a position to evaluate the css, because my phone though powerful doesn't offer that type of review. But, hopefully you are "testing" the css by use of tools like firebug for firefox (ie pressing f12) and or clearing your cache, though that doesn't always immediately fix the loaded page as css can be cached in the internet and take a bit to get displayed... Maybe as much as a day. But if you use a local tool like rbarbour did, you can see how it ought to be.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #30
    Join Date
    Aug 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Need help with a query

    Quote Originally Posted by mc12345678 View Post
    These days I'm rarely in a position to evaluate the css, because my phone though powerful doesn't offer that type of review. But, hopefully you are "testing" the css by use of tools like firebug for firefox (ie pressing f12) and or clearing your cache, though that doesn't always immediately fix the loaded page as css can be cached in the internet and take a bit to get displayed... Maybe as much as a day. But if you use a local tool like rbarbour did, you can see how it ought to be.
    Yeah this redesign is being more of a pain in the a$$ than I had expected. Didnt realize how much languages have evolved over the last 4 years. Having trouble getting the back to top button moved to the right side instead of under...All in good time I guess.

    Thanks for also pointing out the duplicate manufacturer. never even noticed that.

    I used firefox and chromes dev tools to inspect and clear cache quite often. nothing sucks more than making the change the does work and you just cant see it bcz of cache. talk about driving you crazy.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  2. Need help creating SQL query...
    By DigitalShadow in forum General Questions
    Replies: 2
    Last Post: 22 Jun 2011, 02:05 PM
  3. Need help with a mySQL Query
    By jeffmic in forum General Questions
    Replies: 3
    Last Post: 19 Dec 2010, 02:21 PM
  4. Need help with SQL query. Want to make membership that expires.
    By TecBrat in forum Managing Customers and Orders
    Replies: 1
    Last Post: 18 Jun 2010, 03:43 PM
  5. Need help w/ SQL query in phpMyAdmin
    By audradh in forum General Questions
    Replies: 17
    Last Post: 16 Nov 2009, 01:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg