Skip to content

Instantly share code, notes, and snippets.

Created October 31, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/406973d20099206a3362 to your computer and use it in GitHub Desktop.
Save anonymous/406973d20099206a3362 to your computer and use it in GitHub Desktop.
<?php include "../includes/session_start.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Overall</title>
<link rel="stylesheet" href="style/content.css" type="text/css" media="screen" />
<link rel= "stylesheet" type="text/css" href= "Styles/userscss.css" />
<link rel= "stylesheet" type="text/css" href= "Styles/sidebars.css" />
<link rel= "stylesheet" type="text/css" href= "Styles/content.css" />
</head>
<body>
<div align="center" id="pwrapper" name="pwrapper">
<?php include 'sidebar.php' ?>
<div id = "content-main">
<div name = "content-main">
<?php include "../includes/welcome_admin.php"; ?>
<div id="record-list">
<div name="record-list">
<div style = "color:green"><?php if($msg!="") { echo $msg; } ?></div> <br>
<form action ="customer_info_edit.php" method ="post">
<table width="35%" border="0" cellspacing="2" cellpadding="10">
<th colspan = "4"><h3>Search<h3></th>
<tr><td>Name:</td><td>
<center><label></label><input type = "text" name="search" placeholder="" ></center></td>
<td>ID:</td><td>
<center><label></label><input type = "text" name="search" placeholder="Type valid ID here!"></center></td></tr>
<!--<tr><td>Type:</td><td>
<center><label></label><input type = "text" name="" placeholder=""></center></td>
<td>Group:</td><td>
<center><label></label><input type = "text" name="" placeholder=""></center></td></tr>-->
<tr><td colspan = "4"><center> <button type = "submit" name="submit">Search</button></center></td></tr>
</table>
</form>
</div>
</div><!--content main-->
</div><!--content main-->
</div>
</div>
</div>
<?php include "../nakama_database/connect_to_mysql.php"; ?>
<?php
$msg = "";
/////////////////////////////////// ROD EDITED HERE!
if(isset($_POST["submit"])){
if(isset($_POST["search"]))
{
//header("Location: admin_overall.php");
}
$query = "SELECT * FROM investment "; // I DONT KNOW THE TABLE NAME AND FIELDS
$query .= "WHERE id OR name = " . $_POST['search'] . "";
$result = mysql_query($query);
if(!$result)
{
$msg = "<p style='color:red'>Error! Please Try Again!</p>";
exit();
}
else
{
// display data in table
//echo "<a href='viewdelete.php?page=1'><p>Edit Comment</p></a>";
echo "<br><br><table width='100%' border='0' cellspacing='3' cellpadding='10' style='text-align:center'>";
echo "<tr><th colspan='7'>Investment</th></tr>";
echo "<tr><th>ID</th><th>Name</th><th>No</th> <th>Type</th> <th>Date</th> <th>Amount</th> <th>Group</th></tr>";
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array($result )) {
// echo out the contents of each row into a table
echo "<tr>";
echo '<td><a href="#">' . $row['id'] . '</a></td>';
echo '<td><a href="#">' . $row['name'] . '</a></td>';
echo '<td>' . $row['no'] . '</td>';
echo '<td>' . $row['transaction_contents'] . '</td>';
echo '<td>' . $row['date'] . '</td>';
echo '<td>' . $row['deposit'] . '</td>';
echo '<td>' . $row['group'] . '</td>';
echo "</tr>";
}
}
// close table>
echo "</table>";
}
?>
<?php /* ////// HISTORY ITO!!
// get results from database
$result = mysql_query("SELECT * FROM history WHERE id = " . $_POST['search'] . "") //where id = $id
or die(mysql_error());
// display data in table
//echo "<a href='viewdelete.php?page=1'><p>Edit Comment</p></a>";
echo "<br><br><table width='100%' border='0' cellspacing='3' cellpadding='10' style='text-align:center'>";
echo "<tr><th colspan='7'>HISTORY</th></tr>";
echo "<tr><th>ID</th><th>Name</th><th>Date</th> <th>Withdrawals</th> <th>Deposit</th> <th>Transaction Contents</th></tr>";
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array( $result )) {
// echo out the contents of each row into a table
echo "<tr>";
echo '<td><a href="#">' . $row['id'] . '</a></td>';
echo '<td><a href="#">' . $row['name'] . '</a></td>';
echo '<td>' . $row['date'] . '</td>';
echo '<td>' . $row['withdrawals'] . '</td>';
echo '<td>' . $row['deposit'] . '</td>';
echo '<td>' . $row['transaction_contents'] . '</td>';
echo "</tr>";
}
// close table>
echo "</table>"; */
?>
<br />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment