"; $output .= "\n\t"; $output .= "\n\t\t$mname"; $output .= "\n\t\t$comp"; $output .= "\n\t\t$ur"; $output .= "\n\t\t"; $output .= "\n\t\t\t"; $output .= "\n\t\t"; $output .= "\n\t\t"; $result_fld = mysql_query( "SELECT ps_category.id_category, ps_category.id_parent, name, active FROM ps_category RIGHT JOIN ps_category_lang on ps_category.id_category= ps_category_lang.id_category where id_lang =$id_lang ORDER BY ps_category.id_category ", $dbhandle ); while( $row1=mysql_fetch_row($result_fld) ) { if($row1[0]==1){ $output.="\n\t\t\t$row1[2]"; } elseif($row1[0]!=1){ $output.="\n\t\t\t$row1[2]"; } } $output .= "\n\t\t"; $output .= "\n\t\t200"; $i=0; $output .= "\n\t\t"; $bass=mysql_query("SELECT id_product, id_category_default FROM ps_product WHERE active=1 ORDER BY id_product", $dbhandle); $row=mysql_fetch_array($bass); do { $i=$i+1; $output .= "\n\t\t\t"; $xx=mysql_query("SELECT link_rewrite FROM ps_product_lang WHERE id_product=$row[id_product]"); $ss=mysql_fetch_array($xx); $zz=mysql_query("SELECT link_rewrite FROM ps_category_lang WHERE id_category=$row[id_category_default]"); $zz1=mysql_fetch_array($zz); $output.="\n\t\t\t\thttp://perfumel.ru/$zz1[link_rewrite]/$row[id_product]-$ss[link_rewrite].html"; $xx=mysql_query("SELECT price FROM ps_product WHERE id_product=$row[id_product]"); $ss=mysql_fetch_array($xx); $ss1=round($ss[price]); $output.="\n\t\t\t\t$ss1"; $output.="\n\t\t\t\tRUR"; $output.="\n\t\t\t\t$row[id_category_default]"; //$xx=mysql_query("SELECT id_image FROM ps_image WHERE id_product=$row[id_product]"); //$ss=mysql_fetch_array($xx); //$zz=mysql_query("SELECT link_rewrite FROM ps_category_lang WHERE id_category=$row[id_category_default]"); $output.="\n\t\t\t\ttrue"; $output.="\n\t\t\t\t200"; $xx=mysql_query("SELECT name, description FROM ps_product_lang WHERE id_product=$row[id_product] and id_lang=$id_lang"); $ss=mysql_fetch_array($xx); $st=$ss[name]; $st=str_replace("&","&",$st); $st=str_replace("\"",""",$st); //$st=str_replace("\"",""",$st); $st=str_replace("<","<",$st); $st=str_replace(">",">",$st); $st=str_replace("'","'",$st); $output.="\n\t\t\t\t$st"; $strdesc_1=$ss[description]; $strdesc_1=str_replace("

","",$strdesc_1); $strdesc_1=str_replace("

","",$strdesc_1); $strdesc_1=str_replace("","",$strdesc_1); $strdesc_1=str_replace("","",$strdesc_1); $strdesc_1=str_replace("&","&",$strdesc_1); $strdesc_1=str_replace("\"",""",$strdesc_1); //$st=str_replace("\"",""",$st); $strdesc_1=str_replace("<","<",$strdesc_1); $strdesc_1=str_replace(">",">",$strdesc_1); $strdesc_1=str_replace("'","'",$strdesc_1); $output.="\n\t\t\t\t"; $output.="\n\t\t\t\t$strdesc_1"; $output.="\n\t\t\t\t"; $output.="\n\t\t\t
"; } while ($row = mysql_fetch_array($bass)); $output .= "\n\t\t
"; $output .= "\n\t
"; $output .= "\n"; mysql_close($dbhandle); header('Content-Type: text/xml'); header('Content-Disposition: attachment; filename="presta_export.xml"'); header('Content-Transfer-Encoding: binary'); //print_r($row2); echo $output; // tell the browser what kind of file is come in //header("Content-type: text/xml"); // print out XML that describes the schema //echo $output; // close the connection ?>