Jump to content

Recommended Posts

Okay, here's my code:

    if (($_GET['page']=='dedi') && $_GET['plan']=='10tb') {
        echo '<table style="-moz-border-radius:10px;"><thead><tr><td class="Features">Features</td>';
        for ($i=0; $i<$Cols; $i++) {
            echo '<td>'.$Products[$i]['Name'].'</td>';
        }

            echo '</tr></thead>';
                    $titlesded100 = array('CPU','HDD','RAM','IP\'s','Bandwidth','Uplink Port','OS');
            $count = count($titlesded100);
            foreach ($titlesded100 as $value) {
                echo '<tr><td class="Features">'.$titlesded100[$t].'</td>';
                         $plan = explode('<br/>', $Features[0]); 
                            foreach($features as $feature) {
                                    echo '<td>' . $feature[$t] . '</td>';
                            }              
                         $t++;
                echo '</tr>';      
            }
    }

    echo '</tr><tr><td></td>';
    for ($i=0; $i<$Cols; $i++) {
        if ($Products[$i]['Price']=='free')
            echo '<td><span class="PlanPrice">Free</span><br/><a href="http://test.fibrenetworks.org/clients/cart.php?a=add&pid='.$Products[$i]['Id'].'"><img src="/images/ordernow.png" /></a></td>';
        else
            echo '<td><span class="PlanPrice">€'.$Products[$i]['Price'].'</span>/month<br/><a href="http://test.fibrenetworks.org/clients/cart.php?a=add&pid='.$Products[$i]['Id'].'"><img src="/images/ordernow.png" /></a></td>';
    }
    echo '</tr></table>';

 

This works fine, it outputs the appropriate packages in the table.

 

However, the list is 13 (horizontally) and that's too wide for the page, I've been tried to split it to show 6 results, per table. Then it will do another table. However, I can't get my head around it, I won't show what I've tried as they've turned out to be useless, this is fully working as a standalone.

 

Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/206797-whmcs-integration-problem/
Share on other sites

That's the basic concept I tried, but I couldn't get my head around it. Not with the layout of my code anyway.

 

I am quite sure if you understand the basics of that you should have no problem applying it to your own code. Try doing it on a new page and doing a simple mysql fetch and integrating that code.. then go on to use it in your code up there..

Excuse me? Try talking to people with a bit of damn courtesy. I'm simply asking for help, not asking for anyone to write it for me. If you knew a thing about me, you'd notice I post here frequently and I've helped a lot of people. Don't turn this into a flame fest.

Drop the <table> and use a <div> instead. Float all child <div>'s, they'll auto cut-off on 6 elements.

 

<div id="main">
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
  <div class="box"> </div>
</div>

 

#main { width: 720px; }
.box { float: left; margin-left: 20px; width: 100px; }

Excuse me? Try talking to people with a bit of damn courtesy. I'm simply asking for help, not asking for anyone to write it for me. If you knew a thing about me, you'd notice I post here frequently and I've helped a lot of people. Don't turn this into a flame fest.

 

Please don't get offended or anything, I didn't mean to come off like that. You asked for help and I simply directed you to a page where there is a perfectly CLEAR example of what you need to know. Spend some time practicing it and you'll eventually get the hang of it, then you can try it again on your own code. You could have posted the attempt you made also and we coulda have helped you based on that..

 

Again pardon me if I came off like a jerk.

The problem I'm facing is the first part does the headings for all of the products it finds, in this case there's 11.

 

Then it displays the information for each of the 11 headings.

 

so:

 

heading1 heading2 heading3

 

then it shows

 

content1 content2 content3

 

These are two separate foreach's, so creating this to end the <tr> and the <table> then create a new table underneath the first lot of headings and content is pretty annoying. If it was all displaying together, it would be far easier. But it doesn't.

Looks to me that I need to recode

    if (($_GET['page']=='dedi') && $_GET['plan']=='10tb') {
        echo '<table style="-moz-border-radius:10px;"><thead><tr><td class="Features">Features</td>';
        for ($i=0; $i<$Cols; $i++) {
            echo '<td>'.$Products[$i]['Name'].'</td>';
        }

            echo '</tr></thead>';
                    $titlesded100 = array('CPU','HDD','RAM','IP\'s','Bandwidth','Uplink Port','OS');
            $count = count($titlesded100);
            foreach ($titlesded100 as $value) {
                echo '<tr><td class="Features">'.$titlesded100[$t].'</td>';
                         $plan = explode('<br/>', $Features[0]); 
                            foreach($features as $feature) {
                                    echo '<td>' . $feature[$t] . '</td>';
                            }              
                         $t++;
                echo '</tr>';      
            }
    }

 

That in order to get it to work, I can't think of any work around to it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.