	<?php	
	include ("../koneksi.php");
	include ("../functions/clear_data.php");
	$sql = "select *, year(tanggal) as tahun, month(tanggal) as bulan from content, menus_head where kategori=id order by idContent ";
	echo $sql;
	$no = 0;
	
	if ($hasil = mysql_query($sql)) {
		while ($data = mysql_fetch_array($hasil)) {
			echo "<br>No ".$no++;
			$idContent = $data["idContent"]; 
			$kategori = $data["kategori"];
			$tahun = $data["tahun"];
			$bulan = $data["bulan"];
			$title = $data["title"];
			//echo clear_data2($title);
			$gambar1 = $data["gambar1"];
			$nama_menu = $data["namaMenu"];

			include ("../functions/getUrl.php");
			include ("../functions/createUrl.php");
			
			$query="update content set targetPage='$targetPage' where idContent='".$idContent."' ";		
			mysql_query($query);
			//echo "<br>".$query;
			
			if ($gambar1) {
				$file = $basicUrl;
				$current_url = explode(" ",$nama_menu);
				foreach ($current_url as $url) {
					$file .= strtolower($url);
				}
				//$file .= "/".$tahun."/".$data["idContent"]."/".$gambar1;
				$file .= $imageUrl.$gambar1;
				
				$newfile = $imageUrl.$gambar1;
				
				if (!copy($file, $newfile)) {
					echo "failed to copy $file...".$file."\n";
				}			
			}
		}
	}
	?>
	<br>
	.. it is done ..