function startElement($parser, $name, $attrs) { global $currentRecord, $getHandler, $inMemberNationElement; if ($name != "MEMBERNATION") { return; } // keep state for the other callback handlers $inMemberNationElement = true; //create one record for each XML MEMBERNATION element $currentRecord = new EBARecord($attrs['COUNTRYCODE']); $currentRecord->add("countryCode", $attrs['COUNTRYCODE']); $currentRecord->add("flagImageLocation", $attrs['FLAGIMAGE']); }
function DisableDate($date) { $record = new EBARecord(0); $record->add("startdate", $date); $record->add("enddate", ""); $record->add("location", ""); $record->add("description", ""); $record->add("type", "disabled"); $this->add($record); }
$nodeType = 'country'; break; case "country": $nodeKeyColumn = 'District'; $nodeKey2Column = 'CountryCode'; $nodeLabelColumn = 'District'; $nodeType = 'district'; break; case "district": $nodeKeyColumn = 'ID'; $nodeLabelColumn = 'Name'; $nodeType = 'city'; break; } while ($row = mysql_fetch_array($result)) { $record = new EBARecord($row[$nodeKeyColumn]); $record->add("key", $row[$nodeKeyColumn]); $record->add("label", $row[$nodeLabelColumn]); $record->add("type", $nodeType); if ($nodeKey2Column != "") { $record->add("key2", $row[$nodeKey2Column]); } else { $record->add("key2", ''); } if ($nodeType == 'city') { $record->add("nodetype", "leaf"); $record->add("haschildren", "false"); } else { $record->add("nodetype", "node"); $record->add("haschildren", "true"); }
// ******************************************************************* $codepage = 65001; // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT CountryId, Info FROM " . $table . " WHERE Info > '" . $lastString . "' " . $whereClause; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("CountryID"); $getHandler->DefineField("Info"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("CountryID", $row["CountryID"]); $record->add("Info", $row["Info"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
$sortDirection = $_GET["SortDirection"]; } //Set up the database connection and get the recordset // Make a MySQL Connection $link = mysql_connect($server, $uid, $password) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblproductcategories order by ProductCategoryName;"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductCategoryName"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("ProductCategoryName", $row["ProductCategoryName"]); $getHandler->add($record); } $getHandler->CompleteGet(); ?>
//******************************************************************* //Let's set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("id"); $getHandler->DefineField("label"); $getHandler->DefineField("nodetype"); $getHandler->DefineField("haschildren"); //******************************************************************* //Let's loop through our data and send it to the grid //******************************************************************* while ($row = mysql_fetch_array($result)) { $record = new EBARecord($row["RegionID"]); $record->add("id", $row["RegionID"]); $record->add("label", $row["RegionName"]); $myQuery = 'SELECT COUNT(1) AS NumChildren FROM ' . $tableName . ' WHERE RegionOwner = ' . $row["RegionID"] . ';'; $countChildren = mysql_fetch_array(mysql_query($myQuery)) or die(mysql_error()); $numChildren = $countChildren["NumChildren"]; if ($numChildren > 0) { $record->add("nodetype", "node"); $record->add("haschildren", "true"); } else { $record->add("nodetype", "leaf"); $record->add("haschildren", "false"); } $getHandler->add($record); } $getHandler->CompleteGet();
$totalRows = mysql_result(mysql_query($countQuery), 0); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("OrderDate"); $getHandler->DefineField("ShippedDate"); $getHandler->DefineForeignKey("CustomerID"); $getHandler->DefineForeignKeyValue($customerID); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["OrderID"]); $record->add("OrderID", $row["OrderID"]); $record->add("ProductName", $row["ProductName"]); $record->add("OrderDate", $row["OrderDate"]); $record->add("ShippedDate", $row["ShippedDate"]); $getHandler->add($record); } $getHandler->SetTotalRowCount($totalRows); $getHandler->CompleteGet(); ?>
// If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // For the purposes of this demo we have some random icons we're using in the image column. Here they are $CustomerIcons = array("scustomerimage.gif", "scustomerimage2.gif", "scustomerimage3.gif", "scustomerimage4.gif", "scustomerimage5.gif"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("JobTitle"); $getHandler->DefineField("CompanyName"); $getHandler->DefineField("ContactImage"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactName", $row["ContactName"]); $record->add("ContactEmail", $row["ContactEmail"]); $record->add("JobTitle", $row["JobTitle"]); $record->add("CompanyName", $row["CompanyName"]); $record->add("ContactImage", $CustomerIcons[$iconIndex++ % 4]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
//field of data after its column name in the database. $getHandler->DefineField("CustomerID"); $getHandler->DefineField("CustomerName"); $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("ContactTitle"); $getHandler->DefineField("PhoneNumber"); $getHandler->DefineField("Address"); $getHandler->DefineField("Country"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["CustomerID"]); $record->add("CustomerID", $row["CustomerID"]); $record->add("CustomerName", $row["CustomerName"]); $record->add("ContactName", $row["ContactName"]); $record->add("ContactEmail", $row["ContactEmail"]); $record->add("ContactTitle", $row["ContactTitle"]); $record->add("PhoneNumber", $row["PhoneNumber"]); $record->add("Address", $row["Address"]); $record->add("Country", $row["Country"]); $getHandler->add($record); } $getHandler->SetTotalRowCount(100); $getHandler->CompleteGet(); ?>
// a date field $getHandler->DefineField("ProductIcon"); // the image for the icon on each row $getHandler->DefineField("BulkAction"); // for the checkbox $getHandler->DefineField("ProductPassword"); //for the password field $getHandler->DefineField("ButtonText"); // The label on each button // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ProductID"]); $record->add("ProductIcon", "docicon.gif"); $record->add("ButtonText", "I'm a button"); $record->add("ProductPassword", "opensesame"); $record->add("ProductLink", "http://www.chemicalproductstuff.com"); $record->add("BulkAction", "no"); $record->add("ProductName", $row["ProductName"]); $record->add("ProductCategoryName", $row["ProductCategoryName"]); $record->add("ProductSKU", "3"); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("ProductQuantityPerUnit", $row["ProductQuantityPerUnit"]); $record->add("LastUpdated", "2006-09-14"); // Just a random date value for demonstration purposes $getHandler->add($record); } $getHandler->CompleteGet();
} // ******************************************************************* // This code block just sets up the database and tries to figure out what index number // our data starts at. This code has nothing to do with the grid itself so think of it as // business logic. // ******************************************************************* // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblFileSystem WHERE FolderAbsolute LIKE '%" . $searchSubString . "%' LIMIT " . $startingRecordIndex . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("FolderAbsolute"); $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("FolderAbsolute", $row["FolderAbsolute"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
for ($i = 1 + $offset; $i <= 15 + $offset; $i++) { $getHandler->DefineField("n" . $j++); } $class_notas = new notas(); $_SESSION['aux_ramo'] = $_GET['ramo']; $asignatura = $class_notas->promedioSemestreAsignatura($_GET['ramo'], $_GET['curso'], $_GET['periodo']); $label_prom = "promedio"; $getHandler->DefineField($label_prom); //foreach ($asignatura[$_GET['ramo']]['alumnos'] AS $rut_alum => $prom_alum): // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["rut"]); $record->add("nombreCompleto", $row['apellidop'] . " " . $row['apellidom'] . " " . $row['nombres']); $record->add($label_prom, $asignatura[$_GET['ramo']]['alumnos'][$row["rut"]]); //$record->add("matricula", $row['matricula']); //$record->add("rut", $row["rut"]); $exam_aux = $_GET['periodo'] == '2S' ? 'examen2' : 'examen1'; $examen = $row[$exam_aux] > 0 ? number_format($row[$exam_aux], 1, ".", ",") : null; //$record->add("examen", $examen); $record->add("examen", $examen); if ($_GET['periodo'] == '2S' && $_SESSION['colegio']->colegio_ID == "dor") { $record->add("examen_anual", $row['examen_anual'] > 1 ? number_format($row['examen_anual'], 1, ".", ",") : null); } $j = 1; for ($i = 1 + $offset; $i <= 15 + $offset; $i++) { $notas[] = $row['n' . $i]; $record->add("nota" . $j++, $row['n' . $i] > 0 ? number_format($row['n' . $i], 1, ".", ",") : null);
// This code block just sets up the database and tries to figure out what index number // our data starts at. This code has nothing to do with the grid itself so think of it as // business logic. // ******************************************************************* // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT ContactID, CONCAT(ContactName, ' <', ContactEmail, '>') AS ContactInfo FROM tblcontacts3k WHERE ContactName LIKE '%" . $searchSubString . "%' OR ContactEmail LIKE '%" . $searchSubString . "%' LIMIT " . $startingRecordIndex . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("ContactInfo"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactInfo", $row["ContactInfo"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
$result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("Quantity"); $getHandler->DefineField("OrderDate"); $getHandler->DefineField("ShippedDate"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $record = new EBARecord($row["OrderID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("Quantity", $row["Quantity"]); $record->add("OrderDate", $row["OrderDate"]); $record->add("ShippedDate", $row["ShippedDate"]); $getHandler->add($record); } $getHandler->CompleteGet(); ?>
and w.parentwindows_id=$parentwindows_id and u.uid=$uid and w.isactive=1 and w.window_id>0 and ( gsp.validuntil = '0000-00-00' OR gsp.validuntil >= '$currentdate') */ $currentdate = date("Y-m-d", time()); $myQuery = "SELECT distinct(w.window_id) as window_id,w.window_name, w.filename, m.name as modulename,m.dirname\n from sim_groups g\n\t\tinner join sim_groups_users_link gul on g.groupid=gul.groupid\n\t\tinner join sim_users u on gul.uid=u.uid\n\t\tinner join sim_group_permission gp on gp.gperm_groupid=g.groupid\n\t\tinner join sim_modules m on gp.gperm_itemid=m.mid\n\t\tinner join sim_permission gsp on gsp.groupid=g.groupid\n\t\tinner join sim_window w on gsp.window_id=w.window_id\n\t\twhere gp.gperm_name='module_read'\n and w.parentwindows_id={$nodeId} and u.uid={$userid} and\n w.isactive=1 and w.window_id>0\n and ( gsp.validuntil = '0000-00-00' OR gsp.validuntil >= '{$currentdate}')"; $log->showLog(2, "Show parent note with sql : {$myQuery}"); $result = $xoopsDB->query($myQuery) or die(mysql_error()); //system("echo $myQuery >>log.txt"); $getHandler = new EBAGetHandler(); $getHandler->DefineField("window_id"); $getHandler->DefineField("window_name"); $getHandler->DefineField("nodetype"); $getHandler->DefineField("haschildren"); while ($row = $xoopsDB->fetchArray($result)) { $record = new EBARecord($row["window_id"]); $record->add("id", $row["window_id"]); $record->add("label", $row["window_name"]); $myQuery = 'SELECT COUNT(1) AS NumChildren FROM sim_window WHERE parentwindows_id = ' . $row['window_id'] . ';'; $countChildren = $xoopsDB->fetchArray($xoopsDB->query($myQuery)) or die(mysql_error()); $numChildren = $countChildren["NumChildren"]; if ($numChildren > 0) { $record->add("nodetype", "node"); $record->add("haschildren", "true"); } else { $record->add("nodetype", "leaf"); $record->add("haschildren", "false"); } $getHandler->add($record); } $getHandler->CompleteGet();
$result = mysql_query($myQuery) or die(mysql_error()); $countQuery = "SELECT COUNT(*) FROM tblorders where CustomerID=" . $customerID; $totalRows = mysql_query($countQuery); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("ProductQuantity"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ProductID"]); $record->add("OrderID", $row["ProductID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("ProductQuantity", $row["ProductQuantity"]); $getHandler->add($record); } $getHandler->SetTotalRowCount(50); $getHandler->CompleteGet(); ?>
$result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductCategoryName"); $getHandler->DefineField("ProductSku"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("ProductQuantityPerUnit"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $record = new EBARecord($row["ProductID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductCategoryName", $row["ProductCategoryName"]); $record->add("ProductSku", $row["ProductSku"]); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("ProductQuantityPerUnit", $row["ProductQuantityPerUnit"]); $getHandler->add($record); } $getHandler->CompleteGet(); ?>
//Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("JobTitle"); $getHandler->DefineField("CompanyName"); $getHandler->DefineField("PhoneNumber"); $getHandler->DefineField("Address"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactName", $row["ContactName"]); $record->add("ContactEmail", $row["ContactEmail"]); $record->add("JobTitle", $row["JobTitle"]); $record->add("CompanyName", $row["CompanyName"]); $record->add("PhoneNumber", $row["PhoneNumber"]); $record->add("Address", $row["Address"]); $getHandler->add($record); } $getHandler->CompleteGet(); ?>