Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0

    Post Need help with a Widget on my Site


    Hi,

    I am new to PHP and I have this website I'm working on. The problem is with a widget that is installed on the website which basically shows a list of people. The problem that I am facing is that it should only show a single row of people when the page is loaded and every time the page loads it should display these people randomly.

    since I cannot post a url anyone willing to help let me know and I can share the link in person

    The code that is calling this widget is given below which is a part of the index.php file

    <ul style="background-color:#FFFFFF; border: 2px solid #126DB3;">
    <? $po = 0;
    foreach($result_set as $row1){$po++;?>
    <li> <?php

    $filePath = 'admin/'.$row1['photoPath'];
    if ($filePath != "" && file_exists($filePath)) { ?>
    <a href="#tabs-<?=$po?>" title="<?=$row1['firstName'].' '.$row1['lastName']?>" style="background-color:#FFFFFF";>
    <img src="journalthemb.php?src=<?=$filePath?>&amp;f=0" border="0"></a>
    <?php } else {?><img src="journalthemb.php?src=admin/borrowerPhoto/thumbs/nophoto.jpg&amp;f=0" border="0"><br />

    <?php }?>

    </li>

    <? } ?>

    </ul>



    I'd appreciate if anyone can help me with sorting this out, also the people coming in the widget are coming from a database which gets updated on a daily basis.

    Thank you.
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    You've got a <br/> in there that may not belong, if you want just a single row. Otherwise you need to post where $result_set is coming from because that's actually where the problem is.

    Actually no, I can't say that. First you have to tell us what the problem is. You've already said what it's supposed to do so how about telling what it's actually doing?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Since I cannot paste my URL i'll try explaining. We have widget which basically is showing people in a row and once you click on them their details are displayed on the top part. Something similar to an Image Slider with Thumbnails.

    Now the Thumbnails are being generated automatically and we have 6 thumbnails in a single row. Once the number exceeds 6 the 7 thumbnail starts appearing in a 2nd row which shouldn't happen. I hope that you get my point.
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    Do you have enough space to fit seven?

    You can post URLs so long as they don't look like URLs. Like add a couple spaces to it.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Originally Posted by requinix
    Do you have enough space to fit seven?

    You can post URLs so long as they don't look like URLs. Like add a couple spaces to it.
    I could fit in more thumbnails by reducing their size but that won't serve the purpose. We are an NGO who have borrowers signing up for donations. So every time new donor comes in he/she gets displayed on the main page widget automatically.

    review akhuwatonline[dot]org[slash]test
  10. #6
  11. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    I don't understand how you expect to be able to fit seven or more of these things in there when you yourself admit there's only space to fit six. Where's the seventh supposed to go?
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Originally Posted by requinix
    I don't understand how you expect to be able to fit seven or more of these things in there when you yourself admit there's only space to fit six. Where's the seventh supposed to go?
    We only want to display six, the seventh shouldn't display at all. The idea is to just display the recent most borrowers who have signed up. I hope you understand my point.

    Thanks.
  14. #8
  15. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    In that case
    Originally Posted by requinix
    Otherwise you need to post where $result_set is coming from because that's actually where the problem is.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Originally Posted by requinix
    In that case
    For now I have set the overflow=hidden as a quickfix. I know this won't work in the long run since it would increase load time. I will look into your suggestion and see if I can find a solution.

    Thanks for the help. Cheers.
  18. #10
  19. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    All you had to do was post a bit more code, but if that's too hard I guess ignoring the problem is just as good
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Originally Posted by requinix
    All you had to do was post a bit more code, but if that's too hard I guess ignoring the problem is just as good
    Thanks for the help, here's the code of my index.php where this widget is being displayed



    PHP Code:
    <?php  
    session_start
    ();
    ob_start();

    require_once(
    "includes/db.class.php");
    require_once(
    "common/config.php");
    include_once(
    "common/header.php"); 
    include(
    "common/menu.php");

    $sid session_id();

    $query "select borrower.firstName,borrower.lastName,borrower.active,borrower.stat_us,
                      borrower.bcity,borrower.primaryActivity,borrower.thumbPath,borrower.photoPath,borrower.aboutBorrower,
                      loan.borrowerID,loan.loanAmount,loan.loanID, SUM(CASE WHEN transactiondetail.paymentType='' THEN transactiondetail.Amount ELSE 0 END) AS amount1
                      FROM borrower
                        LEFT JOIN loan ON loan.borrowerID=borrower.borrowerID                     
                        LEFT JOIN transactiondetail ON loan.loanID=transactiondetail.loanID 
                        where borrower.photoPath != '' 
                        AND borrower.active ='1'                    
                        AND borrower.thumbPath !=''                    
                        AND borrower.aboutBorrower !=''
                        AND borrower.stat_us != ''
                       GROUP BY loan.loanID                     
                       "
    ;

    //echo $query;
        
    $sql mysql_query($query);    
        
        if(isset(
    $_POST['lendnow']) && $_POST['lendnow']!='')
            {
            
    $amount $_POST['amount'];
            
    $bwrID =$_POST['bwrID'];
            
    $lID =$_POST['lID'];
                
    //echo 'borrower id====>'.$bwrID;
                //echo 'Loan id====>'.$lID;
                //exit;
            
    $sql="select * from basket WHERE borrowerID='$bwrID' and loanID='$lID' and sessionID = '$sid'";        
            
    $chkmysql_query($sql) or die(mysql_error());        
            
    $chkrow=mysql_num_rows($chk);
              if(
    $chkrow == )
               {
                
    $start mysql_query("INSERT INTO basket (loanID, sessionID, borrowerID, amount) VALUES ('$lID','$sid','$bwrID','$amount')");
                    
    header("Location: addToCart.php?loanid=".$lID);        
                }
              else if(
    $chkrow != )
                  { 
            
                  
    $query="update basket set amount='$amount' WHERE borrowerID='$bwrID'  and sessionID = '$sid'";
                 
    mysql_query($query);        
                  
    header("Location:addToCart.php?loanid=".$lID);
            
            }
            
    }

        if(isset(
    $_POST['donate']) && $_POST['donate']!='')
        
        {
        
    header('location:supportAkhuwat.php');
        }


    ?>
    <link rel="stylesheet" type="text/css" href="css/graph.css" />
    <link type="text/css" href="css/redmond/jquery-ui-1.8.2.custom.css" rel="stylesheet" />    
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
    <meta charset="UTF-8" />
    <script>
           $(function(){$('#tabs').tabs();});
    </script>    

      
        <table width="868" border="0" align="center" cellpadding="0" cellspacing="0">

          <tr>

            <td width="613" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

                  <tr>

                    <td width="6"><img src="images/header-top-left.gif" width="6" height="6" /></td>

                    <td height="6" class="bod-top-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                    <td width="6"><img src="images/header-top-right.gif" width="6" height="6" /></td>

                  </tr>

                  <tr>

                    <td class="bod-left-01">&nbsp;</td>

                    <td class="header-main"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                      <tr>

                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">

                          <tr>

                            <td class="enter-head">Entrepreneurs</td>

                            <td class="view-all"><a href="borrowers.php">View All Entrepreneurs</a></td>

                          </tr>

                        </table></td>

                      </tr>

                      <tr>

                        <td class="header-sub"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                          <tr>

                            <td width="6"><img src="images/header2-top-left.gif" width="6" height="6" /></td>

                            <td height="6" class="bod-top-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                            <td width="6"><img src="images/header2-top-right.gif" width="6" height="6" /></td>

                          </tr>

                          <tr>

                            <td class="bod-left-01">&nbsp;</td>

                            <td class="header-sub2">

                            <div id="tabs">

                               <?php

                               
    echo $message;

                               
    $po0;

                               
    $result_set=array();

                               while (
    $row mysql_fetch_array($sql))

                               {

                                       
    $result_set[]=array(

                                            
    'loanAmount' =>$row['loanAmount'],

                                            
    'amount1' => $row['amount1'],

                                            
    'loanID'=>$row['loanID'],

                                            
    'borrowerID'=>$row['borrowerID'],

                                            
    'firstName'=>$row['firstName'],

                                            
    'lastName'=>$row['lastName'],

                                            
    'photoPath'=>$row['photoPath'],
                                            
    'active'=>$row['active']);

                                   
    $po++;

                                       
    $request=$row['loanAmount'];

                                  
    $raised=$row['amount1'];

                                if(
    $request!=0)

                                    
    $bar=($raised/$request);
                                else
                                    
    $bar=0;
                               
    $bar=round (($bar*100)) ;  
                                
    $total=$request-$raised;
                                    
    $about $row['aboutBorrower']; 
                                    
    $aboutBorrower substr($row['aboutBorrower'], 060);

                               
    ?>
                
                               <div id="tabs-<?=$po?>">

                               <table width="100%" border="0" cellspacing="0" cellpadding="0">

                               <tr>

                                <td width="180" valign="top"><?php 

                 $filePath 
    'admin/'.$row['photoPath'];

                if (
    $filePath != "" && file_exists($filePath)) {  ?>

         <a  href="borrowerDetail.php?bID=<?=$row['borrowerID']?>&name=<?=$row['firstName'].' '.$row['lastName']?>&loanid=<?=$row['loanID']?>" >

                <img src="mediumthemb.php?src=<?=$filePath?>&amp;f=0" border="0" width="180" height="170"></a>

                <?php }    else {?><img src="mediumthemb.php?src=admin/borrowerPhoto/thumbs/nophoto.jpg&amp;f=0" border="0"><br />

                  <?php }?></td>

                                <td width="450" valign="top" class="header-text"><h1><?=$row['firstName']." ".$row['lastName']; ?></h1>

                                  <h2><?= $row['primaryActivity']; ?></h2>

                                  <?=$aboutBorrower."..."?>&nbsp;&nbsp;

      <a href="borrowerDetail.php?bID=<?=$row['borrowerID']?>&name=<?=$row['firstName'].' '.$row['lastName']?>&loanid=<?=$row['loanID']?>">more here</a>

                                  <? if($total!=0)
                                    {
                                  
    ?>
                                <form id="form" name="form" method="post" action="index.php" enctype="multipart/form-data">     


                                  <table width="340" border="0" cellspacing="1" cellpadding="3">
                                    <tr>
                                      <td valign="middle" colspan="2" align="left">
                                      <input type="hidden" name="bwrID" id="bwrID" value="<?=$row['borrowerID']?>" />
                                       <input type="hidden" name="lID" id="lID" value="<?=$row['loanID']?>" />
                                      <!--<input type="submit" name="donate" id="donate" value="Donate Now" class="donatenow" />-->
                                      <!--<input type="submit" name="lendnow" id="lendnow" value="Lend" class="lend" ></td>-->
                                      <input type="hidden" id="total_balance" name="total_balance" value="<?=$total?>" />
                                         <script type="text/javascript">
                                            $(function() {
                                                $("#slider-range-max<?=$row['loanID']?>").slider({
                                                    range: "max",
                                                    min: 0,
                                                    max: <?=$total?>,
                                                    value:0,
                                                    step:0.1,
                                                    animate: true,
                                                    orientation: 'horizontal',
                                                    slide: function(event, ui) {
                                                        $("#amount<?=$row['loanID']?>").val(ui.value);
                                                    }
                                                });
                                                $("#amount<?=$row['loanID']?>").val($("#slider-range-max<?=$row['loanID']?>").slider("value"));
                                            });
                                         </script>
                                     <style>
                                        #demo{width:150px;}
                                        #demo a{outline-style:none;height:9px;background-color:#DD4D48;background-image:none;border-color:#DD4D48;}
                                    </style>
                                     <div id="demo">
                                     <p>
                                        $ <input type="text" id="amount<?=$row['loanID']?>" readonly="readonly" value="" style="border:0px;" name="amount" />
                                        <div id="slider-range-max<?=$row['loanID']?>" style="height:5px;background-image:none;background-color:#B1D632;border-color:#FFFFFF;"></div>
                                      </p>
                                     </div>
                                      
                                      </td>
                                       <td width="165" valign="bottom" align="left">
                                            <input type="submit" name="lendnow" id="lendnow" value="Donate" class="lend" width="45">
                                        </td>
                                    </tr>
                              <tr>
                                  <td colspan="2" align="left">
                                    <?= $curr_type.$total;?>
                                 <br/>
                                  <div class="graph">
                                    <strong class="bar" style="width: <?=$bar.'%'?>; font-size:9px"></strong>
                                  </div>
                                    <?=$bar.'%'?> Raised
                                </td>    
                              </tr> 
                            </table>
                                </form>
                                <? }?>
                                </td>
                                  </tr>  
                           </table>

                              </div>

                                <?php ?>

                                

                               <div class="more-entr">More Entrepreneurs</div>

                            <ul style="background-color:#FFFFFF; border: 2px solid #126DB3;">
                             <?    $po 0;
                                foreach(
    $result_set as $row1){$po++;?>
                                <li> <?php 

                 $filePath 
    'admin/'.$row1['photoPath'];
                if (
    $filePath != "" && file_exists($filePath)) {  ?>
          <a  href="#tabs-<?=$po?>"  title="<?=$row1['firstName'].' '.$row1['lastName']?>" style="background-color:#FFFFFF";>
    <img src="journalthemb.php?src=<?=$filePath?>&amp;f=0" border="0"></a>
                <?php }    else {?><img src="journalthemb.php?src=admin/borrowerPhoto/thumbs/nophoto.jpg&amp;f=0" border="0"><br />

                  <?php }?>

           </li>

            <?  ?>

       </ul>    

                          </div>      

                            </td>

                            <td class="bod-right-01">&nbsp;</td>

                          </tr>

                          <tr>

                            <td><img src="images/header2-bottom-left.gif" width="6" height="6" /></td>

                            <td class="bod-bottom-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                            <td><img src="images/header2-bottom-right.gif" width="6" height="6" /></td>

                          </tr>

                        </table></td>

                      </tr>

                      <tr>

                        <td class="more-entr">More Entrepreneurs</td>

                      </tr>

                    </table></td>

                    <td class="bod-right-01">&nbsp;</td>

                  </tr>

                  <tr>

                    <td><img src="images/header-bottom-left.gif" width="6" height="6" /></td>

                    <td height="6" class="bod-bottom-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                    <td><img src="images/header-bottom-right.gif" width="6" height="6" /></td>

                  </tr>

                </table></td>

              </tr>

              <tr>

                <td class="team-main">

                <!-- change start here -->

                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                  <tr>

                    <td>

                <? 
                    $qry
    ="select * FROM team  ORDER BY  RAND()  limit 0,1";
                    
    $rs=mysql_query($qry);
                    
                    if(
    mysql_num_rows($rs)>0)
                    {
                
    ?>
                    
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

                      <tr>

                        <td width="6"><img src="images/header-top-left.gif" width="6" height="6" /></td>

                        <td height="6" class="bod-top-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                        <td width="6"><img src="images/header-top-right.gif" width="6" height="6" /></td>

                      </tr>

                      <tr>

                        <td class="bod-left-01">&nbsp;</td>

                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">

                            <tr></tr>

                            <tr>

                              <td class="team-text-main"><h1>Team </h1>

                              <table width="100%" border="0" cellspacing="0" cellpadding="0">

                

                   <tr>

                    <?                

                    $query 
    "SELECT teamID, count(team_members.teamID) as count1 FROM team_members group by team_members.teamID";

                     
    $result mysql_query($query);

                      
    $member = array();

                   while(
    $row=mysql_fetch_array($result))

                     {

                     
    $member[$row['teamID']] = $row['count1'];

                     }



                  

                      
    $count 1;
                
                   while(
    $row=mysql_fetch_array($rs))
                   { 
                       
    $tID=$row['teamID'];
                    
    ?>
                  <td width="167" valign="top"><?php 

                $filePath 
    $row['image'];

                
    // echo $filePath;

        
    if ($filePath != "" && file_exists($filePath)){  ?>

         <a  href="viewTeam.php?id=<?=$row['teamID']?>&name=<?=$row['teamName']?>" ><img src="mediumthemb.php?src=<?=$filePath?>&amp;f=0" border="0"></a>

                <?php }    else {?><img src="mediumthemb.php?src=pics/nophoto.jpg&amp;f=0" border="0"><br />

                  <?php }?></td>

                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                          <tr>

                            <td width="30%" class="team-text-01">Team:</td>

                     <td class="team-text-02"><a  href="viewTeam.php?id=<?=$row['teamID']?>&name=<?=$row['teamName']?>" ><? echo $row['teamName']; ?></a></td>

                          </tr>

                          <tr>

                            <td class="team-text-01">Location: </td>

                            <td class="team-text-02"><? echo $row['location']; ?></td>

                          </tr>                      

                          <tr>

                            <td class="team-text-01">We Loan<br />

                              Because:</td>

                            <td class="team-text-02"><? echo $row['weLoanBecause']; ?></td>

                          </tr>

                          <tr>

                            <td valign="top" class="team-text-01">Description: </td>

                            <td class="team-text-02"><? echo $row['description']; ?></td>

                          </tr>

                          <tr>

                            <td class="team-text-01">Created:</td>

                            <td class="team-text-02"><? echo date('d M Y',strtotime($row['date']))?></td>

                          </tr>

                          <tr>

                            <td class="team-text-01">Number of<br />

                              Members:</td>

                            

                            <?php  

                             
    if($member[$row[teamID]]!='')

                              { 
    ?>

                            <td valign="top" class="team-text-02"><?=$member[$row[teamID]]?></td>

                              <? }

                               else { 
    ?>

                              <td valign="top" class="team-text-02">0</td>

                               <? 

                                
    $count++;

                                 
    ?>  

                          </tr>

                          <tr>

                            <td>&nbsp;</td>

                            <td valign="top" class="team-page-link"><a href="community.php">View Team Page &gt;&gt;</a></td>

                          </tr>

                          <? ?>

                        </table></td>

                        </tr>

                    </table>

                                </td>

                            </tr>

                        </table></td>

                        <td class="bod-right-01">&nbsp;</td>

                      </tr>

                      <tr>

                        <td><img src="images/header-bottom-left.gif" width="6" height="6" /></td>

                        <td height="6" class="bod-bottom-01"><img src="images/spacer.gif" width="1" height="1" /></td>

                        <td><img src="images/header-bottom-right.gif" width="6" height="6" /></td>

                      </tr>

                    </table>
                <?
                
    }
                else
                {
                
    ?>
                       &nbsp;        
                <?
                
    }
                
    ?>


                    </td>

                  </tr>

                  <tr>

                    <td class="team-text-main">

                    <!--team -->

                    

                    </td>

                  </tr>

                </table>

                <!-- change end here -->

                </td>

              </tr>

            </table>

              </td>

            <td>&nbsp;</td>

            <td width="200" valign="top">
            <table  border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td>
                <table border="0" cellspacing="0" cellpadding="0">

                <tr>

                    <td class="sider-box-head" colspan="2">Success Stories</td>
                  </tr>

                   

                <?  

                $qry
    ="select id,title,detail,image1 from journal order by id desc limit 0,3";

                
    $resultmysql_query($qry);

                while(
    $data=mysql_fetch_array($result))

                {

                        

                
    ?>

                 <tr>

                    <td class="sider-box" width="30">

                    <?php 

                $filePath 
    'admin/'.$data['image1'];

                
    //echo $filePath;

                
    if ($filePath != "" && file_exists($filePath)) {  ?>

                <a  href="openjrnl.php?jID=<?=$data['id']?>" ><img src="journalthemb.php?src=<?=$filePath?>&amp;f=0" border="0"></a>

                <?php }    else {?><img src="journalthemb.php?src=admin/jounrlPics/nophoto.jpg&amp;f=0" border="0"><br />

                  <?php }?></td>

                  <td class="sider-box" width="150">

                  <?=substr($data['detail'],0,65).'....'?><br />

                      <p><a href="openjrnl.php?jID=<?=$data['id']?>">Read More</a></p>                             </td>
                  </tr>

                   <? }?>

                 

                 

                  <tr>

                  <td colspan="2" class="sider-box">

                  <div class="view"><a href="journalDetail.php"><img src="images/view-all.jpg" alt="View All" width="86" height="23" /></a></div>              </td>
                  </tr>

                   <tr>

                    <td colspan="2" ><img src="images/sider-box-bottom.gif" width="242" height="11" /></td>
                  </tr>
                </table>
                
                
                
                </td>
              </tr>
               <tr><td>&nbsp;</td></tr>
              <tr>
              <?php /*?>    <td align="center">
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="JVQE87RK88WFU">
    <input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
    <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
    </form>            </td><?php */
    ?> <!----Paypal Code for Direct Donations ---->
              </tr>
              

              <tr>
                <td class="sider-box-sub1">
                    <table width="90%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="sider-box-head">Fact Sheet</td>
                    </tr>
                    <tr>
                     <td class="sider-box">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                     
                        <tr>

                          <td width="50%" class="fact-sheet-text">Total Beneficiaries</td>
                          <td colspan="2" class="fact-sheet-text" style="border-right:none;" align="center">311,695</td>
                          </tr>
                   
                         <tr>
                          <td width="50%" class="fact-sheet-text">Male Entrepreneurs</td>
                          <td class="fact-sheet-text" style="border-right:none;" align="center">198,142</td>
                        </tr>

                        <tr>
                          <td width="50%" class="fact-sheet-text">Female Entrepreneurs</td>
                          <td class="fact-sheet-text" style="border-right:none;" align="center">113,553</td>
                        </tr>
                        <tr>
                          <td class="fact-sheet-text">Amount Disbursed</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">PKR 4,634,908,842</td>
                          </tr>
                        <tr>
                          <td class="fact-sheet-text">Outstanding Loans</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">PKR 1,516,966,717</td>
                        </tr>
                        <tr>
                          <td class="fact-sheet-text">Percentage Recovery</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">99.87%</td>
                        </tr>
                        <tr>
                          <td class="fact-sheet-text">Active Loans</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">154,921</td>
                        </tr>
                        <tr>
                          <td class="fact-sheet-text">Number of Branches</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">162</td>
                        </tr>
                        <tr>
                          <td class="fact-sheet-text">Cities & Towns</td>
                          <td class="fact-sheet-text" align="center" style="border-right:none;">116</td>
                        </tr>



                      </table>
                     <!-- <div class="view"><a href="#"><img src="images/view-all.jpg" alt="View All" width="86" height="23" /></a></div>--></td>
                    </tr>

                    <tr>

                      <td><img src="images/sider-box-bottom.gif" width="242" height="11" /></td>
                    </tr>

                </table></td>
              </tr>
              
              <tr>
                <td class="sider-box-sub1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  
                  <tr>
                    <td width="58%" align="center" valign="top"></td>
                    <td width="38%" align="center" valign="top"></td>
                    <td width="4%" align="left" valign="top">&nbsp;</td>
                  </tr>
                  <tr>
                    <td colspan="3" align="center" valign="top"><img src="images/spacer.gif" width="1" height="8" /></td>
                  </tr>
                  <tr>
                    <td align="center" valign="top"></td>
                    <td align="center" valign="top"></td>
                    <td align="left" valign="top">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>

            </table></td>

          </tr>

        </table>

        

        <?php include("common/footer.php"); ?>
    Last edited by requinix; July 17th, 2013 at 10:05 PM. Reason: added php tags
  22. #12
  23. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,993
    Rep Power
    9397
    PHP Code:
    $query "select borrower.firstName,borrower.lastName,borrower.active,borrower.stat_us,
    borrower.bcity,borrower.primaryActivity,borrower.thumbPath,borrower.photoPath,borrower.aboutBorrower ,
    loan.borrowerID,loan.loanAmount,loan.loanID, SUM(CASE WHEN transactiondetail.paymentType='' THEN transactiondetail.Amount ELSE 0 END) AS amount1
    FROM borrower
    LEFT JOIN loan ON loan.borrowerID=borrower.borrowerID 
    LEFT JOIN transactiondetail ON loan.loanID=transactiondetail.loanID 
    where borrower.photoPath != '' 
    AND borrower.active ='1'    
    AND borrower.thumbPath !=''    
    AND borrower.aboutBorrower !=''
    AND borrower.stat_us != ''
    GROUP BY loan.loanID 
    "

    Add a LIMIT 6 to the end of that.
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    and dont forget order by to get the 6 recent entries
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0
    Originally Posted by requinix
    PHP Code:
    $query "select borrower.firstName,borrower.lastName,borrower.active,borrower.stat_us,
    borrower.bcity,borrower.primaryActivity,borrower.thumbPath,borrower.photoPath,borrower.aboutBorrower ,
    loan.borrowerID,loan.loanAmount,loan.loanID, SUM(CASE WHEN transactiondetail.paymentType='' THEN transactiondetail.Amount ELSE 0 END) AS amount1
    FROM borrower
    LEFT JOIN loan ON loan.borrowerID=borrower.borrowerID 
    LEFT JOIN transactiondetail ON loan.loanID=transactiondetail.loanID 
    where borrower.photoPath != '' 
    AND borrower.active ='1'    
    AND borrower.thumbPath !=''    
    AND borrower.aboutBorrower !=''
    AND borrower.stat_us != ''
    GROUP BY loan.loanID 
    "

    Add a LIMIT 6 to the end of that.
    AND borrower.active='6'

    that is the status of borrower if he's active/inactive.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    that is wrong, we are trying to help you here, did you even read up what a limit is?
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo