Exemplo n.º 1
0
function doExport(&$dbHandler, $filename)
{
    $tables = tlObjectWithDB::getDBTables(array('custom_fields', 'cfield_node_types'));
    $adodbXML = new ADODB_XML("1.0", "ISO-8859-1");
    $sql = " SELECT name,label,type,possible_values,default_value,valid_regexp, " . " length_min,length_max,show_on_design,enable_on_design,show_on_execution," . " enable_on_execution,show_on_testplan_design,enable_on_testplan_design, " . " node_type_id,required " . " FROM {$tables['custom_fields']} CF,{$tables['cfield_node_types']} " . " WHERE CF.id=field_id ";
    $adodbXML->setRootTagName('custom_fields');
    $adodbXML->setRowTagName('custom_field');
    $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql);
    downloadContentsToFile($content, $filename);
    exit;
}
function doExport(&$db, $filename, $testproject_id)
{
    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    $tables = tlObjectWithDB::getDBTables(array('platforms'));
    $adodbXML = new ADODB_XML("1.0", "UTF-8");
    $sql = "/* {$debugMsg} */ SELECT name,notes " . " FROM {$tables['platforms']} PLAT " . " WHERE PLAT.testproject_id=" . intval($testproject_id);
    $adodbXML->setRootTagName('platforms');
    $adodbXML->setRowTagName('platform');
    $content = $adodbXML->ConvertToXMLString($db->db, $sql);
    downloadContentsToFile($content, $filename);
    exit;
}
function doExport(&$dbHandler, $filename)
{
    $adodbXML = new ADODB_XML("1.0", "ISO-8859-1");
    $adodbXML->setRootTagName('users');
    $adodbXML->setRowTagName('user');
    $tables = tlObjectWithDB::getDBTables(array('users'));
    $fieldSet = 'id,login,role_id,email,first,last,locale,default_testproject_id,active';
    $sql = " SELECT {$fieldSet} FROM {$tables['users']} ";
    $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql);
    downloadContentsToFile($content, $filename);
    exit;
}
Exemplo n.º 4
0
<?php

require_once 'connection.php';
require_once 'class.ADODB_XML.php';
/*
This example saves the data of the consultation in an file XML
*/
$adodbXML = new ADODB_XML("1.0", "ISO-8859-1");
$adodbXML->ConvertToXML(&$objConnection, "SELECT * FROM user", "usersxml.xml");
Exemplo n.º 5
0
<?php

require_once 'connection.php';
require_once 'class.ADODB_XML.php';
/*
This example saves the content of file XML in the table "users" of the Data base.  
Tags of the XML corresponds to the fields of the table.
*/
$adodbXML = new ADODB_XML("1.0", "ISO-8859-1");
$adodbXML->InsertIntoDB(&$objConnection, "usersxml.xml", "user");