Kodları lütfen aşağıdaki butonları kullanarak renklendirin. Örnek: <php> echo "Selam Dünya"; </php>
Yardım
karakter kaldı

yok olan key valueları.

Ciddi ve anlam veremediğim bir problemim var;

public $mesajlar'ı foreach ile sayfaya yerleştirdiğimde sorun yok ancak:
$m 'i print_r ettiğimde sonuç: (keylere isim verdim sayfanın başında ve sonunda tekrar tekrar print_r ettim ama her demem'de keyler NULL gettype da denedim sonuç NULL) ama mesaj panosu altında sayfaya yazdırabiliyorum.

sadece sayfanın altındaki foreach kod bloğu içerisinde çalışıyor. onun dışında sonuç ne şekide print olsa sonuç:

    [mesaj] => Array
        (
            [a28] => Array
                (
                    [a6] => 
                    [a5] => 
                )

            [a27] => Array
                (
                    [a4] => 
                    [a3] => 
                )

            [a26] => Array
                (
                    [a2] => 
                    [a1] => 
                    [a0] => 
                )

        )

    [hatalar] => Array
        (
            [28] => Array
                (
                    [is-349] => 
                    [is-350] => Laklı dosya laksız ödeme
                    [is-351] => 
                    [is-352] => 
                )

            [27] => Array
                (
                    [is-353] => 
                    [is-354] => 
                    [is-355] => 
                )

            [26] => Array
                (
                    [is-356] => 
                    [is-357] => Laklı seçenek laksız dosya.
                    [is-358] => Laklı seçenek laksız dosya.
                )

        )

)



Koda bir bakalım;



<?php
include_once '_a.php'; 
class mesajlar{	
	public $isler = array();
	public $mesaj = array();
	public $hatalar = array();
	//"<div class='mesajPanosu'>";
	public function isListele($grup, $hata){
	global $vt;
	$joinhata = array();
	if($hata=1):
		$joinhata[0]="SH.cHata AS hHATA ";
		$joinhata[1]=
			"LEFT JOIN " . 
				"x_StandartHatalar AS SH " .
			"ON " .
				"I.nKodStandartHatalar = SH.nKodStandartHatalar ";
	else:
		$joinhata[0]='';
		$joinhata[1]='';
	endif;
	//ID 	bID 	sID 	kID 	tID 	fID 	dosya_yeni 	dosya_eski 	durum 	durum_baski 	aID 	konukID 	dTarihSaat 	nFatura 	nMuhasebeOnay 	nMusteriOnay 	nGrupId 	nSiparisDurum 	nKodStandartHatalar 	cAciklama 	cDosyaNick 	nGrafikerOnayi 	cDosyaGrafiker 	cDosyaJPGGrafiker 	nKodTabakalar
		$sorguIsler = 
		"SELECT ".
			"I.ID AS isID, " .
			"I.dTarihSaat AS isTime, " .
			"I.cDosyaNick AS isADI, " .
			"B.tur AS basTUR, " .
			"S.ozellikler AS secOZELLIKLER, " .
			"S.ebat AS secEBAT, " .
			"A.fiyat AS adetFIYAT, " .
			$joinhata[0] .
		"FROM " .
			"Isler AS I " .
		"LEFT JOIN " .
			"Baskilar AS B " .
		"ON " .
			"I.bID = B.ID " .
		"LEFT JOIN " .
			"Secenekler AS S " .
		"ON " .
			"I.sID = S.ID " .
		"LEFT JOIN " . 
			"AdetFiyat AS A " .
		"ON " .
			"I.aID = A.ID " .
		$joinhata[1] .
		"WHERE " .
			"I.kID='" . $_SESSION['kullaniciID'] . "' " .
			"AND " .
			"I.nGrupId='$grup'";/* .
		"ORDER BY " .
			"isGRUPID DESC ";/*"SELECT cDosyaNick,nKodStandartHatalar";*/
		$isvehatalar = $vt->get_results($sorguIsler);
		
		
		
		foreach($isvehatalar as $is):
		
		
			$this->isler[$grup]['is-'.$is->isID] =
				//"<div class='bilgiDivi'>" .
				
				$is->isTime . ' ' .
				$is->isADI . ' ' .
				$is->basTUR . ' ' . 
				$is->secOZELLIKLER . ' ' .
				$is->secEBAT . ' ' .
				$is->adetFIYAT . ' ';
				//'</div>';
				
				
			
			$this->hatalar[$grup]['is-'.$is->isID] = $is->hHATA;
		endforeach;
		
	}
	function __construct(){
		global $vt;
		$sorguMesajlar = "SELECT nKodMesajlar, nKodKullanicilar, nKodGrupID, bKodHata, cMesaj, cCevap, bCevapHakki FROM x2_mesajlar WHERE nKodKullanicilar = '" . $_SESSION['kullaniciID'] . "' ORDER BY dTarih DESC";
		
		$s = $vt->get_results($sorguMesajlar);
		$i = count($s);
		foreach( $s as $grup):
		
				$this->isListele($grup->nKodGrupID, $grup->bKodHata);
				if($grup->cCevap!=''):
					$this->mesaj['a'.$grup->nKodGrupID]['a'.$i] = '<div class=\'mesajMesaj kullaniciMesaj\'>' . $grup->cCevap . '</div>';
					$i--;
				endif;
				if($grup->cMesaj!=''):
					
					$class = ($grup->bKodHata == 1) ? 'mesajHataMesaji':'matbuuMesaj';
					$this->mesaj['a'.$grup->nKodGrupID]['a'.$i] = '<div class=\'mesajMesaj ' . $class . '\'>' . $grup->cMesaj . '</div>';
					$i--;
				endif;
				echo gettype($this->mesaj[$grup->nKodGrupID]['a'.$i]);
				 
		endforeach;

		
	
		
	}//__construct
	
	
	public function cevapla(){
		global $vt;
	}//cevapla
	
	
	
	
	
	
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Matbu | Y�kle, gelsin..</title>
<?php include_once '_jscss.php';?>
<script>

$(function(){
	$('.mesajlarGrup').find('.mesajMesaj:first').fadeIn();
	$('.mesajlarGrup').click(function(){
		$(this).find('.mesajMesaj, .bilgiDivi').slideDown()
	})
	
	})
	
</script>
</head>
<body>
<?php include_once 'ust.php'; ?>
<?php include_once '_mavibolge.php';//<div id="info" style="height:50px;width:100px;background-color:#ccf"></div>?>
<div id="ic">
<?php 
if($_SESSION['oturumKullanici']!=='acik'):
include('giris_yapiniz.php');
else: 
$m = new mesajlar;
?>




<div id='mesajlar'>
	<div id='mesajlarDiv'> 
		<div class='mesajPanosu'> 
		<pre><?php print_r($m)?></pre>
    	<?php 
		
		
			foreach((array)$m->isler as $grupID => $grup):
				echo '<div class="mesajlarGrup"><span class="mesajSiparis"> Sipariş Kodu : #' . $grupID . '</span>';
				foreach($m->mesaj['a'.$grupID] as $mesaj):
					echo $mesaj;
				endforeach;
				foreach($grup as $isID => $is):
					if($m->hatalar[$grupID][$isID]):
						$hataClass =' mesajlarHataliIs';
						$hata = ' <b>HATA : </b>'.$m->hatalar[$grupID][$isID];
					else:
						$hataClass ='';
						$hata ='';
					endif;
					echo "<div class='bilgiDivi $hataClass'>";
					echo  $is.$hata;
					echo "</div>";
				endforeach;
				/*foreach():
					
				endforeach;*/
				echo '</div>';
			endforeach;
			
		?>
		</div>
    </div>
</div>
<pre><?php print_r($m)?></pre>







<?php
endif; ?>
</div>
<?php include_once '_kutular.php'; ?>
<?php include_once '_alt.php';?>
</body>
</html>
+0
-0
Cevaba KatılıyorumKatılmıyorum
Cevap Yaz Yorum Yaz Arşivime Ekle Takip Et

Cevaplar

Hiç cevap bulunamadı. İlk cevabı siz yazın.