Login   Register  
PHP Classes
elePHPant
Icontem

File: example/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vaclav Mares  >  ontoProdukt  >  example/index.php  >  Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: index.php
Class: ontoProdukt
Generate product feeds in XML formats
Author: By
Last change:
Date: 2010-12-29 15:54
Size: 5,395 bytes
 

Contents

Class file image Download
<?
//dodělat editaci feedu z absulutní url adresy

  /**
 * soubor index.php
 * ______________ 
 * slouží k domonstraci použití knihovny ontoprodukt. Knihovna lze 
 * využít k tvorbě a úpravě vlastního feedu zboží popř. k vzájemné 
 * přavádu mezi podoprovanými formáty (XML zbozi.cz, GoogleBase 
 * produkt a Ontoprodukt).  
 * @version        1.0
 * @author         Václav Mareš
 * country   CZ
 * {Czech Republic}  
 */
?>

 <?
require_once ('configuration.php');           //nastavení jazykové sady, adresy specifikace, textů atd...
require_once ('head.php');                    

if (
$_POST['submit'])                       //odšlo k odeslání formuláře? ANO => zobrazení formuláře
{
$generatedFormat $_POST['generatedFormat'];
$new_feed $_POST['new_feed'];
$old_feed_URL $_POST['old_feed_URL'];
$url_feed $_POST['url_feed'];

$absent_id 0;                             //$absent_id je použita v případě, že v old_feed chybí čílování produktů
require_once ('../parser.class.php');       //knihovna funkcí potřebných k parsrování feedu
require_once ('../generator.class.php');    
$NewFeed = new Generator($generatedFormat,$translation,$new_feed,$old_feed_URL,$url_feed);  
}
else {
?>
  <body> 
  <a href='http://www.phpclasses.org/browse/country/cz/'>PHP Classes</a><br>                                                                                  
      <FORM class="cmxform" ACTION="#" METHOD="post" ENCTYPE="multipart/form-data" id="commentForm" name="setFormat" >
        <div id="text">
           <br> 
            <table>            
                <tr>
                    <td><?echo $translation[NEW_FEED]?></td>
                    <td>
                      <input type="checkbox"  name="new_feed" onclick="SetVisibleUpload()" checked><br />
                    </td>
                </tr>
                 <br>
                <tr>
                    <td><?echo $translation[LOAD_FEED]?></td>
                    <td> 
                      <input type="checkbox" name="old_feed_file" onclick="SetVisibleUpload2()" value="old_feed_file" >     
                    </td>
                    <br>
                    <td>
                      <input type="file" name="file" size="30" disabled class="required" accept="xml|rss|owl">
                    </td>
                </tr>
              
                <tr>
                    <td>Zadat URL datového kanálu:</td>
                    <td> 
                      <input type="checkbox" name="old_feed_URL" onclick="SetVisibleUpload3()" value="URL" >     
                    </td>
                    <br>
                    <td> 
                      <input type="text"  name="url_feed" disabled size="25"  class="required url" value="http://">    
                    </td>  
                </tr>
           
                <br>
                <br>
                <tr>
                  <td><?echo $translation[RESULTING_FORMAT]?></td>
                  <td colspan="2">
                      <input type="radio" name="generatedFormat" value="RDF_OP" checked><?echo $translation[RDF_XML_FORMAT]?><a href="help.php" style="text-decoration: none"> [<?echo $translation[MORE]?>]</a><br />          
                   </td>
                </tr>
                <tr>
                  <td></td> 
                  <td colspan="2">
                  <!-- <input type="radio"  name="generatedFormat" value="RSS1_OP"><?echo $translation[RSS1_OP_FORMAT]?><br />
                   <input type="radio"  name="generatedFormat" value="RSS2_OP"><?echo $translation[RSS2_OP_FORMAT]?><br />
                   <input type="radio"  name="generatedFormat" value="ATOM_OP"><?echo $translation[ATOM_OP_FORMAT]?><br />  -->
                   <input type="radio"  name="generatedFormat" value="RSS2"><?echo $translation[RSS2_FORMAT]?><a href="http://www.google.com/support/merchants/bin/answer.py?answer=160589&hl=en" style="text-decoration: none"> [<?echo $translation[MORE]?>]</a><br />
                   <input type="radio"  name="generatedFormat" value="XML"><?echo $translation[XML_FORMAT]?><a href="http://help.seznam.cz/cz/specifikace-xml.html" style="text-decoration: none"> [<?echo $translation[MORE]?>]</a><br />
                   <input type="radio"  name="generatedFormat" value="Heureka_XML"><?echo $translation[HEUREKA_XML_FORMAT]?><a href="http://sluzby.heureka.cz/napoveda/import/" style="text-decoration: none"> [<?echo $translation[MORE]?>]</a><br />
                  </td>
                </tr>
                </tr>
            </table> 
            <br>
            <br>
            <div align="right">
              <input name="submit" id="submit" value="<?echo $translation[SUBMIT_LABEL]?>" type="submit">
            </div>
          </div>
        </form>
        <a href="../example/feeds/product_RDF_OP_feed.xml">Příklad RDF_OP feedu</a><br>      
        <a href="../example/feeds/product_RSS2_feed.xml">Příklad RSS feedu</a><br>
        <a href="../example/feeds/product_XML_feed.xml">Příklad XML feedu(zbozi.cz)</a><br>
        <a href="../example/feeds/productHeureka_XMLfeed.xml">Příklad XML feedu(heureka.cz)</a><br><br>
        <a href="../ontoProdukt.zip">Stažení knihovny</a><br>
      
  </body>
<?}