• 08-08-2014, 16:11:33
    #1
    Üyeliği durduruldu
    Merhaba arkadaşlar while ile müşterilerimin faturalarını listeliyorum her sayfada 10 kayıt şeklinde göstermek istiyorum nasıl yapabilirim 1 - 2 -3 gibi sayfa numarası vermek istiyorum kullandığım kod:

    <?php
    	$sql=mysql_query("SELECT * FROM faturalar where musterino= '$musterino' ORDER BY id ASC");
    	while($row=mysql_fetch_assoc($sql)){
    ?>
    				<tr>
    					<th><span class="glyphicon glyphicon-chevron-right"></span></th>
    					<th><?=$row['faturano']?></th>
    					<th><?=$row['donem']?></th>
    					<th><?=$row['sonodeme']?></th>
    					<th><?=$row['geneltoplam']?></th>
    					<th><? if($row['durumu']=="1")
    							{
    							echo "<font color='green'>Ödendi</font>";
    							} else {
    							 echo "<font color='red'>Ödenmedi</font>"; } ?> 	<? if($row['durumu']=="0")
    							{
    							echo "<a href='fatura-ode.php?faturano=$row[faturano]'>Hemen Öde</a>";
    							} ?></th>
    				</tr>
    					<?php
    	}
    ?>
  • 08-08-2014, 16:14:56
    #2
    Binet adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar while ile müşterilerimin faturalarını listeliyorum her sayfada 10 kayıt şeklinde göstermek istiyorum nasıl yapabilirim 1 - 2 -3 gibi sayfa numarası vermek istiyorum kullandığım kod:

    <?php
    	$sql=mysql_query("SELECT * FROM faturalar where musterino= '$musterino' ORDER BY id ASC");
    	while($row=mysql_fetch_assoc($sql)){
    ?>
    				<tr>
    					<th><span class="glyphicon glyphicon-chevron-right"></span></th>
    					<th><?=$row['faturano']?></th>
    					<th><?=$row['donem']?></th>
    					<th><?=$row['sonodeme']?></th>
    					<th><?=$row['geneltoplam']?></th>
    					<th><? if($row['durumu']=="1")
    							{
    							echo "<font color='green'>Ödendi</font>";
    							} else {
    							 echo "<font color='red'>Ödenmedi</font>"; } ?> 	<? if($row['durumu']=="0")
    							{
    							echo "<a href='fatura-ode.php?faturano=$row[faturano]'>Hemen Öde</a>";
    							} ?></th>
    				</tr>
    					<?php
    	}
    ?>
    SELECT * FROM `student` LIMIT 20, 10

    şeklinde bir döngü 20'den başlayıp 10 tane gösterecektir.
  • 08-08-2014, 16:21:26
    #3
    Üyeliği durduruldu
    yapmak istediğim işlem resimdeki rakam ve sağ sol butonlarının çalışmasını sağlamak tabi 10 kayıttan sonra görünecekler

  • 08-08-2014, 16:39:23
    #4
    Binet adlı üyeden alıntı: mesajı görüntüle
    yapmak istediğim işlem resimdeki rakam ve sağ sol butonlarının çalışmasını sağlamak tabi 10 kayıttan sonra görünecekler

    O zaman while dışında bir $i tanımlayıp her seferinde bunu bir arttırabilir ve eğer 10 veya katıysa bunu göstermesini sağlayabilirsiniz.

    <?php 
        $i =0;
        $sql=mysql_query("SELECT * FROM faturalar where musterino= '$musterino' ORDER BY id ASC"); 
        while($row=mysql_fetch_assoc($sql)){ 
           $i++;
           if(($i%10 == 0) && ($i!=0))
    {
    ?>
    butonlar
    <?php 
    }
    else {
    ?> 
                    <tr> 
                        <th><span class="glyphicon glyphicon-chevron-right"></span></th> 
                        <th><?=$row['faturano']?></th> 
                        <th><?=$row['donem']?></th> 
                        <th><?=$row['sonodeme']?></th> 
                        <th><?=$row['geneltoplam']?></th> 
                        <th><? if($row['durumu']=="1") 
                                { 
                                echo "<font color='green'>Ödendi</font>"; 
                                } else { 
                                 echo "<font color='red'>Ödenmedi</font>"; } ?>     <? if($row['durumu']=="0") 
                                { 
                                echo "<a href='fatura-ode.php?faturano=$row[faturano]'>Hemen Öde</a>"; 
                                } ?></th> 
                    </tr> 
                        <?php 
        } 
    }
    ?>