<?php include "header.php"; ?>
<?php 
$page_protect = new Access_user;
// $page_protect->login_page = "login.php"; // change this only if your login is on another page
$page_protect->access_page(); // only set this this method to protect your page
$page_protect->get_user_info();
$hello_name = ($page_protect->user_full_name != "") ? $page_protect->user_full_name : $page_protect->user;
 ?><td valign="top" colspan="2" height="20"><p align="top"><font size="3">Welcome <?php echo $_SESSION['user']; ?></font>&nbsp;<a href="<?PHP $_SERVER['PHP_SELF'];?>?action=log_out">Log Out</a><p align="right"><a target="_blank" href="http://www.electronicstestlab.com/laptop.htm"><img border="0" src="winnert.gif" width="400" height="90"></p>
		</td>
		<td height="390"></td>
		
	</tr>
	<tr>
		<td>
					<?php ################### DO NOT TOUCH THIS CODE AREA ################################
			// change these to match your mySQL host's settings
			include "config.php";
			
			if($_SESSION['user']=="jimoh21")
			  { //ADMIN AREA
			// require the class
			require "class.datagrid.php";
			
			// this is the query that will be displayed
			// remember: no ORDER BY and no LIMIT!
			$query = "SELECT * FROM users where login!='jimoh21'";
			
			// instantiate the class and pass the query string to it
			$grid = new dataGrid($query);
			
			// show all the columns
			$grid->showColumn("id");
			$grid->showColumn("login");
			$grid->showColumn("pw");
			$grid->showColumn("real_name");
			$grid->showColumn("email");
			$grid->showColumn("extra_info");
					
			// sort the data by the "title" column
			$grid->setDefaultSortColumn("login");
			
			// create the function that will change a unix timestamp to an user-readable date
			function convert_unixtimestamp($timestamp)
			{
				return date("M-d-Y H:i", $timestamp);
			}
			
			// bound this function to the "created" and "modified" column's fields
			$grid->setCallbackFunction("created", "convert_unixtimestamp");
			$grid->setCallbackFunction("modified", "convert_unixtimestamp");
			
			// create a function that will set a javascript action for when clicking on the rows
			// you could use this to redirect the page
					
			// we add a custom column
			$grid->showCustomColumn("operations");
			
			// we add content to it by using a callback function
			// first create the function
			function custom_content($value)
			{
				return "[<a href=\"javascript:if(confirm('Are you sure?')){}else{}\">delete</a>]";
			}
			// bound this function to the "operations" column's fields
			$grid->setCallbackFunction("operations", "custom_content");
			// disable sorting on it
			$grid->disableSorting("operations");
			// unset for this column the action function set before
			$grid->unsetActionFunction("operations");
			
			// add a "selector" column
			$grid->showSelectorColumn("&nbsp;", "check", "id");
			
			// make the "title" column the widest
			$grid->setTitleHTMLProperties("login", "style='width:100%'");
			// make the "title" column's fields left aligned
			$grid->setFieldHTMLProperties("login", "style='text-align:left'");
			
			// make the "created", "modified" and "operations" column's fields 'nowrap'-ed and be centered
			$grid->setFieldHTMLProperties("created", "align='center' nowrap='nowrap'");
			$grid->setFieldHTMLProperties("modified", "align='center' nowrap='nowrap'");
			$grid->setFieldHTMLProperties("operations", "align='center' nowrap='nowrap'");
			
			// add a title to the table
			$grid->setHeaderHTML("<h1>www.hotonlinejob.com</h1>");
			
			// and also add a footer
			// you could use this button to dynamically change the form's action and submit the checked values...
			$grid->setFooterHTML("<br /><input type='submit' value='Submit'>");
			
			// witness magic!
			$grid->render();
			}//ADMIN AREA END
			?>
						
		</td>
	</tr>	
	</tr>	
	<tr>
		<td valign="top" width="813"><!-- MSCellType="empty" -->&nbsp;</td>
		<td height="66" width="1"></td>
	</tr>
</table>
</body>
</html>

