Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ajouter_prd2.php
Package: Generateur_v13.rar [view]
Upload User: feiyaoda
Upload Date: 2016-11-21
Package Size: 9556k
Code Size: 3k
Category:
WEB Mail
Development Platform:
PHP
- //script ajouter_prd2
- <?
- include("page_haut.inc");
- include ("configuration.php");
- require ("xml_domit_parser.php");
- require ("xml_domit_utilities.php");
- require ("xml_domit_nodemaps.php");
- $prd=& new DOMIT_Document();
- $success=$prd->loadXML("./modules/administration/produits.xml");
- $num = count($prd->documentElement->childNodes);
- if($num==0)
- {
- $nb=0;
- }
- else{ $currentprd =& $prd->documentElement->childNodes[$num-1];
- $prdid=$currentprd->childNodes[0]->firstChild->nodeValue;
- $nb=$prdid+1;
- }
- $newnode=$prd->createElement("produit");
- $prd->documentElement->appendChild($newnode);
- $newchild=& $prd->documentElement->lastChild;
- $newchild->appendChild($prd->createElement("id"));
- $newchild->appendChild($prd->createElement("nom"));
- $newchild->appendChild($prd->createElement("prix"));
- $newchild->appendChild($prd->createElement("articleStock"));
- $newchild->appendChild($prd->createElement("promo"));
- $newchild->appendChild($prd->createElement("anciePrix"));
- $newchild->appendChild($prd->createElement("frais"));
- $newchild->appendChild($prd->createElement("description"));
- $newchild->appendChild($prd->createElement("photo"));
- $newchild->appendChild($prd->createElement("categorie"));
- $newchild->appendChild($prd->createElement("souscategorie"));
- $newtextnodee=& $prd->createTextNode($nb);
- $newtextnode=& $prd->createTextNode($name);
- $newtextnode1=& $prd->createTextNode($prix);
- $newtextnode2=& $prd->createTextNode($stock);
- $newtextnode3=& $prd->createTextNode($promo);
- $newtextnode4=& $prd->createTextNode($ancienprix);
- $newtextnode5=& $prd->createTextNode($frais);
- $newtextnode6=& $prd->createTextNode($spec);
- $newtextnode7=& $prd->createTextNode("../$photos/prd_image$nb.gif");
- $newtextnode8=& $prd->createTextNode($group);
- $newtextnode9=& $prd->createTextNode($subgroup);
- $new=& $prd->documentElement->lastChild;
- $idnew=& $new->firstChild;
- $namenew=& $idnew->nextSibling;
- $prixnew=& $namenew->nextSibling;
- $stocknew=& $prixnew->nextSibling;
- $promonew=& $stocknew->nextSibling;
- $ancienprixnew=& $promonew->nextSibling;
- $fraisnew=& $ancienprixnew->nextSibling;
- $specnew=& $fraisnew->nextSibling;
- $photonew=& $specnew->nextSibling;
- $groupnew=& $photonew->nextSibling;
- $subgroupnew=& $groupnew->nextSibling;
- $idnew->appendChild($newtextnodee);
- $namenew->appendChild($newtextnode);
- $prixnew->appendChild($newtextnode1);
- $stocknew->appendChild($newtextnode2);
- $promonew->appendChild($newtextnode3);
- $ancienprixnew->appendChild($newtextnode4);
- $fraisnew->appendChild($newtextnode5);
- $specnew->appendChild($newtextnode6);
- $photonew->appendChild($newtextnode7);
- $groupnew->appendChild($newtextnode8);
- $subgroupnew->appendChild($newtextnode9);
- $succes=& $prd->saveXML("./modules/administration/produits.xml");
- $fichier = "./modules/administration/produits.xml";
- $id_fichier = fopen($fichier, "rb");
- $contenu = fread($id_fichier, filesize ($fichier));
- @fclose($fichier);
- @unlink ("./modules/administration/produits.xml");
- $f=fopen("./modules/administration/produits.xml","w");
- fputs($f,"<?xml version='1.0' encoding='ISO-8859-1' ?>r");
- fputs($f,$contenu);
- if(is_uploaded_file($_FILES['image']['tmp_name']))
- {
- copy($_FILES['image']['tmp_name'],"../$photos/prd_image$nb.gif");
- }
- ?>
- <script>
- document.location='?m=administration&a=ajouter_prd';
- </script>