- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
$sql='SELECT DISTINCT id,title,img,description,adder,added,
GROUP_CONCAT(DISTINCT cid,"-",caty ) AS caty,
GROUP_CONCAT(DISTINCT oid,"-",obs,"-",face,"-",rola,"-",typ) AS obs
FROM film
LEFT JOIN f_c ON f_c.f_id = film.id
LEFT JOIN cat ON f_c.c_id = cat.cid
LEFT JOIN f_o ON f_o.f_id = film.id
LEFT JOIN obs ON f_o.o_id = obs.oid
WHERE film.id ='.$fid;
$wynik=mysql_fetch_assoc(mysql_query($sql));
if(isset($wynik['id'])){
$array = explode(',', $wynik['obs']);
$r=array();//director - 0
$s=array();//Screenwriter - 1
$ak=array();//actors - 2
$akn=array();//actors 2 plan - 3
$np=array();//From Idea By - 4
$p=array();//producers - 5
$m=array();//music - 6
foreach ($array as $item)
{
$a = explode('-', $item);
if( $a[4] == 0 ) {
$r[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 1 ) {
$s[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 2 ) {
$ak[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 3 ) {
$akn[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 4 ) {
$np[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 5 ) {
$p[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
} elseif($a[4] == 6 ) {
$m[] = $a[0].','.$a[1].','.$a[2].','.$a[3];
}
}
function dzielperson($data){
$i = 0;
$ile=count($data);
while ($i < $ile) {
$a = explode(",", $data[$i]);
$caty='<a href="/person/'.dolink($a[1]).'-'.$a[0].'" class="link1">'.$a[1].'</a>'.($i==($ile-1) ? '':', ');
$i++;
}
return $caty;
}
echo '<br>Title: '.$wynik[title];
echo '<br>Desription: '.$wynik[description];
echo '<br>directors: '.dzielperson($r);
echo '<br>screenwriters: '.dzielperson($s);
echo '<br>actors: '.dzielperson($ak);
echo '<br>actors 2 plan: '.dzielperson($akn);
echo '<br>From Idea By '.dzielperson($np);
echo '<br>Producers: '.dzielperson($p);
echo '<br>Music: '.dzielperson($m);