I have a .php file with HTML code also in it. Through this file I am calling a function in another .php file that resides in a class. The call is not working. It is simply not entering the function in the class.
Below are the codes of first and second file respectively.
<div id="sectionGrid"> <!-- Begin of Grid Section -->
<table id="tblGrid">
<tr>
<?php
require("../Lib/displaygrid.php");
displaygrid::SetGridWithValues("*","electioncategorymaster");
?>
</tr>
</table>
</div> <!-- End of Grid Section -->
Above is just a section of the first file. Below is the second file entire code:
<script type="text/javascript" src="js_cookiefunctions.js"/>
<link rel="stylesheet" href="DGStyle.css" type="text/css">
<?php
final class displaygrid
{
public static function SetGridWithValues($columnNames,$tableName)
{
echo $columnNames;
require 'obfusGrid.php';
require 'obfusGridSqlDAP.php';
require("../Config/dbconfig.php");
// Load the database adapter
$db = new MySQLAdap(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Load the datagrid class
$x = new MyDataGrid($db);
// Set the query
$x->setQuery($columnNames, $tableName);
// Add a row selector
$x->addRowSelect("SetRowInCookie(%ID%);");
echo $columnNames;
// Apply a function to a row
function returnSomething($ID)
{
return strrev($id);
}
$x->setColumnType('ID', MyDataGrid::TYPE_FUNCTION, 'returnSomething', '%id%');
// Print the table
$x->printTable();
//Show button to return to keywords entry page
echo "<br><input id='backbutton' type='button' value='Back' onclick='ReturnBack()';>";
echo "<script type='text/javascript'>alert(cookie['row_id']);</script>";
}
}
?>
I also want to know whether the links to other files are successfully implemented in the second code? I mean, the Link and Script tag on top.