예제 #1
0
파일: download.php 프로젝트: Ksysha/audit
<?php

include_once "config.php";
$corp = $_GET["corp"];
//$corp= $_COOKIE['corp'];
$result = mysqli_query($db, "\n\tSELECT id, NumberAudit, Corps_id, Type, TableType, Capacity, Area, Conditioner, CountSeats, Sockets\n\tFROM Auditorium\n\tWHERE Corps_id='{$corp}'\n\t");
$result2 = mysqli_query($db, "\n\tSELECT Abbr, ext_id\n\tFROM Corps\n\tWHERE id='{$corp}'\n\t");
$res2 = mysqli_fetch_array($result2);
$dom = new domDocument("1.0", "windows-1251");
// Создаём XML-документ версии 1.0 с кодировкой windows-1251
$Data_Root = $dom->appendChild($dom->createElement('Data_Root'));
$Descript = $Data_Root->appendChild($dom->createElement('Descript'));
$Descript->setAttribute("ExpSet_Code", '014');
$Descript->setAttribute("ExpSet_Name", 'Auditorium');
$Descript->appendChild($dom->createCDATASection(''));
$Data = $Data_Root->appendChild($dom->createElement('Data'));
$Collection = $Data->appendChild($dom->createElement('Collection'));
$Collection->setAttribute("caption", 'Аудитории');
$Collection->setAttribute("name", 'Data.Auditorium');
$Collection->setAttribute("child_tags", 'Object');
while ($res = mysqli_fetch_array($result)) {
    $auditor_id = $res[0];
    $num_audit = $res[1];
    $abbr_corp = $res2[0];
    $ext_id_corp = $res2[1];
    $capasity_audit = $res[5];
    $type_audit = $res[3];
    $square_audit = $res[6];
    $table_type = $res[4];
    $conditioner = $res[7];
    $result3 = mysqli_query($db, "\n\t\tSELECT Amount\n\t\tfrom Auditorium_Equipment\n\t\twhere Auditorium_id='{$auditor_id}' and Equipment_id=1\n\t");
예제 #2
0
파일: dz.php 프로젝트: echmaster/data
<?php

$document = new domDocument("1.0", "utf-8");
$domimp = new domImplementation();
$doctype = $domimp->createDocumentType('asortiment[<!ENTITY y1 "2009"> <!ENTITY y2 "2010">]');
$document->appendChild($doctype);
$asortiment = $document->createElementNS("http://mysite.ru", "asort:asortiment");
$document->appendChild($asortiment);
$telefon = $document->createElement("asort:telefon");
$asortiment->appendChild($telefon);
$attr = $document->createAttribute("number");
$attr->nodeValue = 1;
$telefon->appendChild($attr);
$cdata = $document->createCDATASection("Это контент нашего интернет магазина");
$telefon->appendChild($cdata);
$model_1 = $document->createElement("model");
$telefon->appendChild($model_1);
$name_1 = $document->createElement("name");
$model_1->appendChild($name_1);
$textN_1 = $document->createTextNode("Samsung Galaxi");
$name_1->appendChild($textN_1);
$year_1 = $document->createElement("year");
$model_1->appendChild($year_1);
$textY_1 = $document->createTextNode('2009');
$year_1->appendChild($textY_1);
$model_2 = $document->createElement("model");
$telefon->appendChild($model_2);
$name_2 = $document->createElement("name");
$model_2->appendChild($name_2);
$textN_2 = $document->createTextNode("Nokia Lumia");
$name_2->appendChild($textN_2);