id; } $query = mysql_query("SELECT id FROM structure WHERE parent_id in (".implode(',',$s_ids).") and (image like '%pdf')") or die("Anfrage nicht erfolgreich"); $data = array(); while($obj = mysql_fetch_object($query)) { $sql = "select s.id, s.name, isa.item_id, files.file_name from structure s left join item_structure_assign isa on isa.structure_id=s.id left join item_files files on files.item_id=isa.item_id where files.type = 0 and s.id=".$obj->id.' limit 1'; $query2 = mysql_query($sql) or die("Anfrage nicht erfolgreich"); $image = ''; $image_path = ''; while($obj2 = mysql_fetch_object($query2)) { if ($obj2->file_name) { $image_path = "../../web/intelectra_shop/images/article/".$obj2->file_name; $targetFile = "../../web/intelectra_shop/images/structure/".$obj2->file_name; echo "$targetFile
"; copy ($image_path,$targetFile); $imaginator = new phImaginator(); $imaginator->add($targetFile); $imaginator->Resize_fitBoth(180, 180); $imaginator->save(); $sql = " UPDATE structure SET image='".$obj2->file_name."' WHERE id=".$obj2->id." "; //echo "
".$sql; mysql_query($sql); } } } ?>