ARRAY

anggerisnurjaman · Nov 22, 2012
Permisi Newbie Mau Lewat .....

Yang saya mau tanyakan gimana mengganti nilai array yah ? Contoh : $distribusi[0]=1 Untuk mengganti angka '1' menjadi 'DR' gimana yah ... ? masih bingun array udah ngubek belum menemukan jawaban . Mohon Bantuannya :D
<head>

<style type="text/css">

a {text-decoration:none;}
img {border:0;}

</style>

</head>
<title>FORM REQUEST</title>
<table align="center" bgcolor="" width="96%" border="0" cellpadding="0" bordercolor="" cellspacing="0"><tr><td>

<div align="center">
<?
include 'connect.php';
$query = "SELECT request.no_urut, date_format(schd_date,'%d-%m-%Y')as schd_date, request.info_unit, customer.perusahaan, jasa.jasa, divisi.inisial FROM request, customer, jasa, divisi WHERE request.customer=customer.kode_pt AND request.tugas=jasa.kode_jasa AND request.from=divisi.kode_bag ORDER BY schd_date LIMIT 0, 10"; 
$nomor = 1;
$hasil = mysql_query($query);

	echo("<table align=\"center\" width = \"100%\" border=\"0\">\n");
	echo("<tr bgcolor=\"#000000\">\n");
	echo("<td align=\"center\" width=\"\">");
	echo("<font color=\"#FFFFFF\" size=\"1\">NO</font></td>\n");
	echo("<td align=\"center\" width=\"\">");
	echo("<font color=\"#FFFFFF\" size=\"1\">CUSTOMER</font></td>\n");
	echo("<td align=\"center\"width=\"\">");
	echo("<font color=\"#FFFFFF\" size=\"1\">TUGAS</font></td>\n");
	echo("<td align=\"center\"width=\"\">");
	echo("<font color=\"#FFFFFF\" size=\"1\">JADWAL</td>\n");
	echo("<td align=\"center\"width=\"\">");
	echo("<font color=\"#FFFFFF\" size=\"1\">UNIT KERJA</td>\n");
	echo("</tr>\n");

	
	while ($baris = mysql_fetch_array ($hasil))
	{
		$no_urut = $baris['no_urut'];
		$schd_date = $baris['schd_date'];
		$inisial = $baris['info_unit'];
		$customer = $baris['perusahaan'];
		$jasa = $baris['jasa'];
		$inisial2 = $baris['inisial'];
		

		//tentukan warna latar belakang 
		if ($nomor %2 == 1)
			$warna = "#66CCFF";
		else
			$warna = "#75b8fa";				
		

	  echo("<tr bgcolor=\"$warna\">\n"); 
	  echo("<td align=\"center\"><font size=\"1\">$nomor<font></td>\n");
	  echo("<td align=\"left\"><font size=\"1\">$customer</font></td>\n");
	  echo("<td align=\"left\"><font size=\"1\">$jasa</font></td>\n");
	  echo("<td align=\"center\"><font size=\"1\">$schd_date</font></td>\n");

		$unit_kerja = explode(",", $inisial );	
		for ($k=0;$k<9;$k++)
		
		$unit_kerja[0]; //DIREKTUR UTAMA
		$unit_kerja[1]; //CUSTOMER SERVICE
		$unit_kerja[2]; //FINANCE
		$unit_kerja[3]; //WORKSHOP
		$unit_kerja[4]; //INFORMATION TECHNOLOGY
		$unit_kerja[5]; //GA - HRD
		$unit_kerja[6]; //WAREHOUSE
		$unit_kerja[7]; //MARKET
		$unit_kerja[8]; //OPERASIONAL
		
		echo("<td align=\"center\"width=\"\">");
		echo("<font color=\"#000000\" size=\"1\">
		
		$unit_kerja[0]
		$unit_kerja[1]
		$unit_kerja[2]
		$unit_kerja[3]
		$unit_kerja[4]
		$unit_kerja[5]
		$unit_kerja[6]
		$unit_kerja[7]
		$unit_kerja[8]
			
			
		</td>\n");
	  
	  
	  $nomor++;
		
			
       ("</tr>");
	}
echo "</table>";
?>
<tr>
<td align='right'><a href='../bintang/form.php?id=show' target=_blank><font size="1">selengkapnya</font></a></td>
</tr>
 
</td></tr></table>
Silahkan login untuk menjawab!