NYCPHP Meetup

NYPHP.org

[nycphp-talk] Linking Excel to PHP/MySQL (older versions)

jon baer jonbaer at jonbaer.net
Thu Jan 8 15:41:32 EST 2004


well ... it works pretty smoothly ... in fact I didn't really need that
class, just needed to refresh up on COM functions in PHP ...

http://us3.php.net/com

@ the bottom there is a nice Excel example ... so natively on Linux using
COM would probably have to be complex + deal with WINE i suppose, something
my ISP most likely wont allow me to install.

- jon

----- Original Message -----
From: "jon baer" <jonbaer at jonbaer.net>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Thursday, January 08, 2004 3:13 PM
Subject: Re: [nycphp-talk] Linking Excel to PHP/MySQL (older versions)


> Merci!
>
> :-)
>
> ----- Original Message -----
> From: "Kerem Tuzemen" <keremtuzemen at hotmail.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Thursday, January 08, 2004 12:49 PM
> Subject: Re: [nycphp-talk] Linking Excel to PHP/MySQL (older versions)
>
>
> > Jon, here are some clues:
> >
> > Fichier = File
> > Feuille = Sheet
> > Cellule = Cell
> > Connexion = Connection
> > Classeur = Folder
> > Valeur = Value
> > Enregistrer = Save
> > Fermer = Close
> > OuvreLeFichier=OpenFile
> > EcritDansCellule=WriteInCell
> > NouvelleValeur = NewValue
> > RecupereValeurCellule=ReadCellValue
> > EcritDansCellule=WriteInCell
> >
> > Hope this helps.
> >
> > O. Kerem Tuzemen
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "jon baer" <jonbaer at jonbaer.net>
> > To: "NYPHP Talk" <talk at lists.nyphp.org>
> > Sent: Thursday, January 08, 2004 11:56 AM
> > Subject: Re: [nycphp-talk] Linking Excel to PHP/MySQL (older versions)
> >
> >
> > > >
> > > > Isn't this the page about ExcelRead (which is in English)?
> > > > http://www.andykhan.com/excelread/index.html
> > > >
> > >
> > > http://www.phpclasses.org/browse.html/package/1069.html
> > >
> > > maybe someone can translate the code below into English? not even sure
> if
> > it
> > > works ...
> > >
> > > - jon
> > >
> > > <?php
> > > class ExcelRead_FR{
> > >
> > > // Les variables :
> > > var $Fichier; // Le Fichier excel à lire !
> > > var $Feuille; // La Feuille a Récupérer !
> > > var $Cellule; // La Cellule a lire
> > > var $IdConnexion;
> > > var $Classeur;
> > >
> > > function OuvreLeFichier($LeDocument){
> > >  /* Cette fonction Ouvre le document Excel
> > >  * Elle est a appelé aprés avoir renseigner la variable
> > >  * Fichier.
> > >  * Elle renseigne les variables IdConnexion et Classeur
> > >  */
> > >  $this->IdConnexion = new com("Excel.Application")or die("Erreur lors
de
> > la
> > > connexion au fichier excel : $Fichier");
> > >  $Rep = getcwd();
> > >  $$LeDocument=$Rep."\\".$$LeDocument;
> > >  $this->Classeur = $this->IdConnexion->WorkBooks->Open($LeDocument) or
> > > die("Erreur impossible d'ouvrir le classeur");
> > > }
> > >
> > > function RecupereValeurCellule($feuil, $cell){
> > >  if (!isset($this->Classeur)){
> > >   if (!isset($this->Fichier)){
> > >    return False;
> > >   }else{
> > >    $this->OuvreLeFichier($this->Fichier);
> > >   }
> > >  }
> > >  $Classeur = $this->Classeur;
> > >  $Feuille = $this->Classeur->Sheets($feuil);
> > >  $SelectedFeuille = $Feuille->Select;
> > >  $Cellule = $Feuille->Range($cell);
> > >  $ValeurCellule = $Cellule->Value;
> > >  return $ValeurCellule;
> > > }
> > >
> > >
> > > function EcritDansCellule($feuil, $cell, $NouvelleValeur){
> > >  if (!isset($this->Classeur)){
> > >   if (!isset($this->Fichier)){
> > >    return False;
> > >   }else{
> > >    $this->OuvreLeFichier($this->Fichier);
> > >   }
> > >  }
> > >  $Classeur = $this->Classeur;
> > >  $Feuille = $this->Classeur->Sheets($feuil);
> > >  $SelectedFeuille = $Feuille->Select;
> > >  $Cellule = $Feuille->Range($cell);
> > >  $Cellule->Value = $NouvelleValeur;
> > > }
> > > function CellIsEmpty($cell){
> > >  $Classeur = $this->Classeur;
> > >  $Feuille = $this->Classeur->Sheets($this->Feuille);
> > >  $SelectedFeuille = $Feuille->Select;
> > >  $Cellule = $Feuille->Range($cell);
> > >  if ($Cellule->Value == ""){
> > >   return true;
> > >  }else{
> > >   return False;
> > >  }
> > > }
> > >
> > > function CellIsMerged($cell){
> > >
> > >  $Classeur = $this->Classeur;
> > >  $Feuille = $this->Classeur->Sheets($this->Feuille);
> > >  $SelectedFeuille = $Feuille->Select;
> > >  $Cellule = $Feuille->Range($cell);
> > >  if ($y = $Cellule->MergeCells){
> > >   return true;
> > >  }else{
> > >   return False;
> > >  }
> > >
> > > }
> > >
> > > function Enregistrer(){
> > >  $this->Classeur->Save();
> > > }
> > > function Fermer(){
> > >  //com_release($this->IdConnexion);
> > >  $this->IdConnexion->Quit();
> > >  $this->IdConnexion = null;
> > > }
> > > function RecupereDerniereLigne(){
> > >
> > > }
> > > }
> > >
> > >
> > > ?>
> > >
> > >
> > >
> > > _______________________________________________
> > > talk mailing list
> > > talk at lists.nyphp.org
> > > http://lists.nyphp.org/mailman/listinfo/talk
> > >
> > _______________________________________________
> > talk mailing list
> > talk at lists.nyphp.org
> > http://lists.nyphp.org/mailman/listinfo/talk
> >
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>




More information about the talk mailing list