Moose Loose Data Management System Creator
Variables and Fields Used to Create this DBMS
Copy and Paste somewhere so you can recreate this if needed.
Database: {{ database }} = {{ database }}
Host: {{ host }} = {{ host }}
Database Username: {{ username }} = {{ username }}
Database Password: {{ password }} = {{ password }}
Table: {{ table }} = {{ table }}
DBMS User: {{ dbmsUser }} = {{ dbmsUser }}
DBMS Password: {{ dbmsPassword }} = {{ dbmsPassword }}
DBMS made for: {{ csv }} = {{ csv }}
Import File: {{ filename }} = {{ filename }}
Field: {{ field01 }} = {{ field01 }}
Field: {{ field02 }} = {{ field02 }}
Field: {{ field03 }} = {{ field03 }}
Field: {{ field04 }} = {{ field04 }}
Field: {{ field05 }} = {{ field05 }}
Field: {{ field06 }} = {{ field06 }}
Field: {{ field07 }} = {{ field07 }}
Field: {{ field08 }} = {{ field08 }}
Field: {{ field09 }} = {{ field09 }}
Field: {{ field10 }} = {{ field10 }}
Field: {{ field11 }} = {{ field11 }}
Field: {{ field12 }} = {{ field12 }}
Field: {{ field13 }} = {{ field13 }}
Field: {{ field14 }} = {{ field14 }}
Field: {{ field15 }} = {{ field15 }}
Field: {{ field16 }} = {{ field16 }}
Field: {{ field17 }} = {{ field17 }}
Field: {{ field18 }} = {{ field18 }}
Field: {{ field19 }} = {{ field19 }}
Field: {{ field20 }} = {{ field20 }}
Dynamic Drop
Form Fields
Drop From Text
Drop Options
Recapcha
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;
}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ filename }}" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ filename }}?a=logout">Logout</a>
<?php
$connect = mysql_connect("{{ host }}","{{ username }}","{{ password }}");
mysql_select_db("{{ database }}",$connect);
if ($_FILES[csv][size] > 0) {
$file = $_FILES[csv][tmp_name];
$handle = fopen($file,"r");
do {
if ($data[0]) {
$todae=date ("Y/m/d-G:i");
mysql_query("INSERT INTO {{ table }} (
{{ field01 }}
,{{ field02 }}
,{{ field03 }}
,{{ field04 }}
,{{ field05 }}
,{{ field06 }}
,{{ field07 }}
,{{ field08 }}
,{{ field09 }}
,{{ field10 }}
,{{ field11 }}
,{{ field12 }}
,{{ field13 }}
,{{ field14 }}
,{{ field15 }}
,{{ field16 }}
,{{ field17 }}
,{{ field18 }}
,{{ field19 }}
,{{ field20 }}
,todae
)
VALUES (
'".addslashes($data[0])."'
,'".addslashes($data[1])."'
,'".addslashes($data[2])."'
,'".addslashes($data[3])."'
,'".addslashes($data[4])."'
,'".addslashes($data[5])."'
,'".addslashes($data[6])."'
,'".addslashes($data[7])."'
,'".addslashes($data[8])."'
,'".addslashes($data[9])."'
,'".addslashes($data[10])."'
,'".addslashes($data[11])."'
,'".addslashes($data[12])."'
,'".addslashes($data[3])."'
,'".addslashes($data[14])."'
,'".addslashes($data[15])."'
,'".addslashes($data[16])."'
,'".addslashes($data[17])."'
,'".addslashes($data[18])."'
,'".addslashes($data[19])."'
,'".addslashes($todae)."'
)
");
}
} while ($data = fgetcsv($handle,1000,",","'"));
header('Location: {{ filename }}?success=1'); die;
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Import a CSV File with PHP & MySQL</title>
<style type="text/css">
*{font-family:sans-serif;}
.Fear{
text-align: right;
white-space: nowrap;
}
.moosetext {
background-color : #eee;
border: 1px solid #ddd;
width: 230px;
}
.moosebutt {
background-color: #369;
padding-left:6px;
padding-right:6px;
padding-top:3px;
padding-bottom:3px;
color: #ffffff;
border:1px solid #003;
background-image: url(images/button_bg.jpg);
}
.moosebutt:hover {
background-color: #000000;
border:1px solid #000000;
background-image: url(images/button_bg_over.jpg);
}
</style>
</head>
<body>
<h3>Use this form to Upload Data From {{ csv }}</h3>
<?php if (!empty($_GET[success])) { echo "<b>Your file has been imported.</b><br><br>"; } //generic success notice ?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
Choose your file: <br />
<input class="moosebutt" name="csv" type="file" id="csv" />
<input class="moosebutt" type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
</td></tr> </table>
<?php
$con=mysqli_connect("{{ host }}","{{ username }}","{{ password }}","{{ database }}");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} $sql="
CREATE TABLE `{{ table }}` (
`{{ field01; }}` varchar(250) NULL DEFAULT NULL,
`{{ field02; }}` varchar(250) NULL DEFAULT NULL,
`{{ field03; }}` varchar(250) NULL DEFAULT NULL,
`{{ field04; }}` varchar(250) NULL DEFAULT NULL,
`{{ field05; }}` varchar(250) NULL DEFAULT NULL,
`{{ field06; }}` varchar(250) NULL DEFAULT NULL,
`{{ field07; }}` varchar(250) NULL DEFAULT NULL,
`{{ field08; }}` varchar(250) NULL DEFAULT NULL,
`{{ field09; }}` varchar(250) NULL DEFAULT NULL,
`{{ field10; }}` varchar(250) NULL DEFAULT NULL,
`{{ field11; }}` varchar(250) NULL DEFAULT NULL,
`{{ field12; }}` varchar(250) NULL DEFAULT NULL,
`{{ field13; }}` varchar(250) NULL DEFAULT NULL,
`{{ field14; }}` varchar(250) NULL DEFAULT NULL,
`{{ field15; }}` varchar(250) NULL DEFAULT NULL,
`{{ field16; }}` varchar(250) NULL DEFAULT NULL,
`{{ field17; }}` varchar(250) NULL DEFAULT NULL,
`{{ field18; }}` varchar(250) NULL DEFAULT NULL,
`{{ field19; }}` varchar(250) NULL DEFAULT NULL,
`{{ field20; }}` varchar(250) NULL DEFAULT NULL,
`todae` varchar(250) NULL DEFAULT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
)";
if (mysqli_query($con,$sql))
{
echo "<Center> Your table, {{ table }}, was created in the database {{ database }} !";
}
else
{
echo "Error creating table: " . mysqli_error($con);
}
?>
<?php
$con=mysqli_connect("{{ host }}","{{ username }}","{{ password }}","{{ database }}");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} $sql="
CREATE TABLE `{{ table}}_Users` (
`id` int(11) NOT NULL auto_increment,
`First` varchar(250) NULL DEFAULT NULL,
`Last` varchar(250) NULL DEFAULT NULL,
`Username` varchar(250) NULL DEFAULT NULL,
`Password` varchar(250) NULL DEFAULT NULL,
`Email` varchar(250) NULL DEFAULT NULL,
`ip` varchar(250) NULL DEFAULT NULL,
`todae` varchar(250) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)";
if (mysqli_query($con,$sql))
{
echo "<Center> Your table, {{table}}_Users, was created in the database {{ databse }}!<br><br>";
}
else
{
echo "Error creating table: " . mysqli_error($con);
}
?>
<?php
$con=mysqli_connect("{{ host }}","{{ username }}","{{ password }}","{{ database }}");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}$sql="
INSERT INTO {{table}}_Users (Username,Password,First) VALUES ('{{ dbmsUser }}','{{ dbmsPassword }}','Fill In Data')
";
if (mysqli_query($con,$sql))
{
echo "<Center><span style=\"color:red;\"> {{table}}_Users now has the username as {{ dbmsUser }} and the password as {{ dbmsPassword }}. Write this down now!</span><br><br> ";
}
else
{
echo "Error creating table: " . mysqli_error($con);
}
?>
<?php session_start("{{ table }}");
if (isset($_GET["order"])) $order = @$_GET["order"];
if (isset($_GET["type"])) $ordtype = @$_GET["type"];
if (isset($_POST["filter"])) $filter = @$_POST["filter"];
if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"];
$wholeonly = false;
if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"];
if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"];
if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"];
if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"];
if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"];
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off'); ?>
<html>
<head>
<title></title>
<link rel="SHORTCUT ICON" href="http://mooseloose.com/moose.ico">
<meta name="generator" http-equiv="content-type" content="text/html">
<style type="text/css">
a:link { color: #000000; text-decoration: none}
a:vlink { color: #000000; text-decoration: none}
a:hover { color:Red; text-decoration: underline}
a:active { color: 000000; text-decoration: none; }
a { color: #000000; text-decoration: none; }
body {background: #F7F6F1}
body,html{padding:0px;margin:0px}
CITE { font-size: 14px; color: #ff0000; text-decoration: none}
/*background color behind buttons and links*/
.bd {
background-color: #FDFDDE;
color: #000000;
font-family: Arial;
font-size: 12px;
text-align:left;
}
td{color: #1D507D; font-family: Arial; font-size: 18px;}
/*Table Border around the information*/
.tbl {
border-left: 1px solid #ffffff;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #dddddd;
border-right: 1px solid #dddddd;
background-color: #F7F6F1;
}
/*Footer background and TH*/
.hr {
background-color: #EAF3FA;
color: #1D507D;
font-family: Arial;
font-size: 14px;
}
/*Links in the TH*/
.hr a:link{
background-color: transparent;
color: #1D507D;
font-family: Arial;
font-size: 14px;
}
/*Header*/
.th01{
background-image:url(http://mooseloose.com/header.png);
height:107px;
background-color: #F7F6F1;
background-repeat:no-repeat;
border: 0px solid black;
}
/*Links in th main page*/
a.hr:link {
color: #1D507D;
font-family: Arial;
font-size: 12px;
}
a.hr:visited {
color: #1D507D;
}
a.hr:hover {
color: #0000ff;
}
a.hr:active {
color: #ff0000;
}
/*odd and bg of record details*/
.dr {
background-color: #F7F6F1;
color: #000000;
font-family: Arial;
font-size: 12px;
}
/*even*/
.sr {
background-color: #FDFDDE;
color: #000000;
font-family: Arial;
font-size: 12px;
}
.detaillabels{width:100px;
text-align:right;
font-family: Arial;
font-size: 14px;
background-color: #EAF3FA;
}
.op02
a {
font-family: Arial;
font-size: 12px;
color: #EAF3FA;
text-decoration: none;
float: left;
background-image: url(butaX.jpg);
background-color: #21759B;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: white #C7C7C7 #C7C7C7 white;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
-khtml-border-radius: 50px;
border-radius: 50px; }
.op02
a:hover {
color: #ffffff;
text-decoration: none;
float: left;
background-image: url(butbX.jpg);
background-color: #073447;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: #C7C7C7 white white #C7C7C7;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible }
table{width:960px;}
.search{width:500px}
.success{ font-family: Arial;
font-size: 14px;
}
</style> </head>
<body>
<center><table border=0><tr><td valign=top class="th01"></table>
<table>
<tr>
<td valign=top valign="top">
<?php
if (!login()) exit;
?><div style="float: right"><span class="op02 "><a href="{{ table }}ML.php?a=logout">Logout</a></span></div>
<div style="float: right"><span class="op02 "><a href="{{ table }}excel.php?a=logout">Excel</a></span></div>
<br>
<?php
$conn = connect();
$showrecs = 20;
$pagerange = 10;
$a = @$_GET["a"];
$recid = @$_GET["recid"];
$page = @$_GET["page"];
if (!isset($page)) $page = 1;
$sql = @$_POST["sql"];
switch ($sql) {
case "insert":
sql_insert();
break;
case "update":
sql_update();
break;
case "delete":
sql_delete();
break;
}
switch ($a) {
case "add":
addrec();
break;
case "view":
viewrec($recid);
break;
case "edit":
editrec($recid);
break;
case "del":
deleterec($recid);
break;
default:
select();
break;
}
if (isset($order)) $_SESSION["order"] = $order;
if (isset($ordtype)) $_SESSION["type"] = $ordtype;
if (isset($filter)) $_SESSION["filter"] = $filter;
if (isset($filterfield)) $_SESSION["filter_field"] = $filterfield;
if (isset($wholeonly)) $_SESSION["wholeonly"] = $wholeonly;
mysql_close($conn);
?>
</td></tr></table>
<table ><tr><td valign=top class="hr">
</td></tr></table>
</body>
</html>
<?php function select()
{
global $a;
global $showrecs;
global $page;
global $filter;
global $filterfield;
global $wholeonly;
global $order;
global $ordtype;
if ($a == "reset") {
$filter = "";
$filterfield = "";
$wholeonly = "";
$order = "";
$ordtype = "";
}
$checkstr = "";
if ($wholeonly) $checkstr = " checked";
if ($ordtype == "asc") { $ordtypestr = "desc"; } else { $ordtypestr = "asc"; }
$res = sql_select();
$count = sql_getrecordcount();
if ($count % $showrecs != 0) {
$pagecount = intval($count / $showrecs) + 1;
}
else {
$pagecount = intval($count / $showrecs);
}
$startrec = $showrecs * ($page - 1);
if ($startrec < $count) {mysql_data_seek($res, $startrec);}
$reccount = min($showrecs * $page, $count);
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>Records shown <?php echo $startrec + 1 ?> - <?php echo $reccount ?> of <?php echo $count ?></td></tr>
</table>
<form name="{{ table }}" action="{{ table }}ML.php" method="post">
<table class="search" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><b>Find</b> </td>
<td><input type="text" name="filter" value="<?php echo $filter ?>"></td>
<td>
<select name="filter_field">
<option value="">All Fields</option>
<option value="<?php echo "Id" ?>"<?php if ($filterfield == "Id") { echo "selected"; } ?>><?php echo htmlspecialchars("Id") ?></option>
<option value="<?php echo "{{ field01 }}" ?>"<?php if ($filterfield == "{{ field01 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field01 }}") ?></option>
<option value="<?php echo "{{ field02 }}" ?>"<?php if ($filterfield == "{{ field02 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field02 }}") ?></option>
<option value="<?php echo "{{ field03 }}" ?>"<?php if ($filterfield == "{{ field03 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field03 }}") ?></option>
<option value="<?php echo "{{ field04 }}" ?>"<?php if ($filterfield == "{{ field04 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field04 }}") ?></option>
<option value="<?php echo "{{ field05 }}" ?>"<?php if ($filterfield == "{{ field05 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field05 }}") ?></option>
<option value="<?php echo "{{ field06 }}" ?>"<?php if ($filterfield == "{{ field06 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field06 }}") ?></option>
<option value="<?php echo "{{ field07 }}" ?>"<?php if ($filterfield == "{{ field07 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field07 }}") ?></option>
<option value="<?php echo "{{ field08 }}" ?>"<?php if ($filterfield == "{{ field08 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field08 }}") ?></option>
<option value="<?php echo "{{ field09 }}" ?>"<?php if ($filterfield == "{{ field09 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field09 }}") ?></option>
<option value="<?php echo "{{ field10 }}" ?>"<?php if ($filterfield == "{{ field10 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field10 }}") ?></option>
<option value="<?php echo "{{ field11 }}" ?>"<?php if ($filterfield == "{{ field11 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field11 }}") ?></option>
<option value="<?php echo "{{ field12 }}" ?>"<?php if ($filterfield == "{{ field12 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field12 }}") ?></option>
<option value="<?php echo "{{ field13 }}" ?>"<?php if ($filterfield == "{{ field13 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field13 }}") ?></option>
<option value="<?php echo "{{ field14 }}" ?>"<?php if ($filterfield == "{{ field14 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field14 }}") ?></option>
<option value="<?php echo "{{ field15 }}" ?>"<?php if ($filterfield == "{{ field15 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field15 }}") ?></option>
<option value="<?php echo "{{ field16 }}" ?>"<?php if ($filterfield == "{{ field16 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field16 }}") ?></option>
<option value="<?php echo "{{ field17 }}" ?>"<?php if ($filterfield == "{{ field17 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field17 }}") ?></option>
<option value="<?php echo "{{ field18 }}" ?>"<?php if ($filterfield == "{{ field18 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field18 }}") ?></option>
<option value="<?php echo "{{ field19 }}" ?>"<?php if ($filterfield == "{{ field19 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field191 }}") ?></option>
<option value="<?php echo "{{ field20 }}" ?>"<?php if ($filterfield == "{{ field20 }}") { echo "selected"; } ?>><?php echo htmlspecialchars("{{ field20 }}") ?></option>
</select>
</td>
<td><nobr><input type="checkbox" name="wholeonly"<?php echo $checkstr ?>>Whole words only</td>
</td>
<td> </td>
<td><input type="submit" name="action" value="Search Now"></td>
<td></td>
</tr>
</table>
</form>
<?php showpagenav($page, $pagecount); ?>
<br>
<!--------------------------------------------------------------------------view all table--------------------------------------------------->
<table class="tbl" border="0" cellspacing="1" cellpadding="5">
<tr>
<td valign=top class="hr"> </td>
<td valign=top class="hr"> </td>
<td valign=top class="hr"> </td>
<td valign=top class="hr"><a class="hr" href="{{ table }}ML.php?order=<?php echo "Id" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Id") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field01 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field01 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field02 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field02 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field03 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field03 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field04 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field04 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field05 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field05 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field06 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field06 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field07 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field07 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field08 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field08 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field09 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field09 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field10 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field10 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field11 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field11 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field12 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field12 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field13 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field13 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field14 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field14 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field15 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field15 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field16 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field16 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field17 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field17 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field18 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field18 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field19 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field19 }}") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}ML.php?order=<?php echo "{{ field20 }}" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("{{ field20 }}") ?></a></td>
</tr>
<?php
for ($i = $startrec; $i < $reccount; $i++)
{
$row = mysql_fetch_assoc($res);
$style = "dr";
if ($i % 2 != 0) {
$style = "sr";
}
?>
<tr>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}ML.php?a=view&recid=<?php echo $i ?>"><img src="http://mooseloose.com/view.png" border=0 width=20 height=20></a></td>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}ML.php?a=edit&recid=<?php echo $i ?>"><img src="http://mooseloose.com/edit.png" border=0 width=20 height=20></a></td>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}ML.php?a=del&recid=<?php echo $i ?>"><img src="http://mooseloose.com/delete.png" border=0 width=20 height=20></a></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Id"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field01 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field02 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field03 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field04 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field05 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field06 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field07 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field08 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field09 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field10 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field11 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field12 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field13 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field14 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field15 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field16 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field17 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field18 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field19 }}"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["{{ field20 }}"]) ?></td>
</tr>
<?php
}
mysql_free_result($res);
?>
</table>
<br>
<?php showpagenav($page, $pagecount); ?>
<?php } ?>
<!-- Login Function Begin -->
<?php function login()
{
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;
}
else {
?>
<!-- Login Function End -->
<p><b><font color="-1">Sorry, the login/password combination you've entered is invalid</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name={{ table }} action="{{ table }}ML.php" method="post">
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td>Username</td>
<td><input type="text" name="login" value="<?php echo $login ?>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" value="<?php echo $password ?>"></td>
</tr>
<tr>
<td><input type="submit" name="action" value="Login"></td>
</tr>
</table>
</form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
} ?>
<?php function showrow($row, $recid)
{
?>
<!--------------------------------------------------------------------------View Record Detail------------------>
<table class="tbl" border="0" cellspacing="1" cellpadding="5">
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Id")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Id"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field01 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field01 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field02 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field02 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field03 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field03 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field04 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field04 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field05 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field05 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field06 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field06 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field07 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field07 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field08 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field08 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field09 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field09 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field10 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field10 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field11 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field11 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field12 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field12 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field13 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field13 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field14 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field14 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field15 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field15 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field16 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field16 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field17 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field17 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field18 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field18 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field19 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field19 }}"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field20 }}")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["{{ field20 }}"]) ?></td>
</tr>
</tr>
</table>
<?php } ?>
<?php function showroweditor($row, $iseditmode)
{
global $conn;
?>
<!--------------------------------------------Add and Edit Page------------------------------------------------------------->
<table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
<input type="hidden" name="Id" size="55" value="<?php echo str_replace('"', '"', trim($row["Id"])) ?>">
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field01 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field01 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field01 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field02 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field02 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field02 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field03 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field03 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field03 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field04 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field04 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field04 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field05 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field05 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field05 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field06 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field06 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field06 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field07 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field07 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field07 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field08 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field08 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field08 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field09 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field09 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field09 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field10 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field10 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field10 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field11 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field11 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field11 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field12 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field12 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field12 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field13 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field13 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field13 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field14 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field14 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field14 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field15 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field15 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field15 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field16 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field16 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field16 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field17 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field17 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field17 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field18 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field18 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field18 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field19 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field19 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field19 }}"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field20 }}")." " ?></td>
<td valign=top class="dr"><input type="text" name="{{ field20 }}" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["{{ field20 }}"])) ?>"></td>
</table>
<?php } ?>
<?php function showpagenav($page, $pagecount)
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}ML.php?a=add">Add Record</a> <span class="op02"><a href="{{ table }}ML.php?a=reset">List All Records</a></span></td>
<?php if ($page > 1) { ?>
<td><a href="{{ table }}ML.php?page=<?php echo $page - 1 ?>"><< Prev</a> </td>
<?php } ?>
<?php
global $pagerange;
if ($pagecount > 1) {
if ($pagecount % $pagerange != 0) {
$rangecount = intval($pagecount / $pagerange) + 1;
}
else {
$rangecount = intval($pagecount / $pagerange);
}
for ($i = 1; $i < $rangecount + 1; $i++) {
$startpage = (($i - 1) * $pagerange) + 1;
$count = min($i * $pagerange, $pagecount);
if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) {
for ($j = $startpage; $j < $count + 1; $j++) {
if ($j == $page) {
?>
<td><b><?php echo $j ?></b></td>
<?php } else { ?>
<td><a href="{{ table }}ML.php?page=<?php echo $j ?>"><?php echo $j ?></a></td>
<?php } } } else { ?>
<td><a href="{{ table }}ML.php?page=<?php echo $startpage ?>"><?php echo $startpage ."..." .$count ?></a></td>
<?php } } } ?>
<?php if ($page < $pagecount) { ?>
<td> <a href="{{ table }}ML.php?page=<?php echo $page + 1 ?>">Next >></a> </td>
<?php } ?>
</tr>
</table>
<?php } ?>
<?php function showrecnav($a, $recid, $count)
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}ML.php">Index Page</a>
<?php if ($recid > 0) { ?>
<span class="op02 "><a href="{{ table }}ML.php?a=<?php echo $a ?>&recid=<?php echo $recid - 1 ?>">Prior Record</a>
<?php } if ($recid < $count - 1) { ?>
<span class="op02 "><a href="{{ table }}ML.php?a=<?php echo $a ?>&recid=<?php echo $recid + 1 ?>">Next Record</a></td>
<?php } ?>
</tr>
</table>
<?php } ?>
<?php function addrec()
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}ML.php">Index Page</a></td>
</tr>
</table>
<form name="{{ table }}" enctype="multipart/form-data" action="{{ table }}ML.php" method="post">
<p><input type="hidden" name="sql" value="insert"></p>
<?php
$row = array(
"Id" => "",
"{{ field01 }}" => ""
, "{{ field02 }}" => ""
, "{{ field03 }}" => ""
, "{{ field04 }}" => ""
, "{{ field05 }}" => ""
, "{{ field06 }}" => ""
, "{{ field07 }}" => ""
, "{{ field08 }}" => ""
, "{{ field09 }}" => ""
, "{{ field10 }}" => ""
, "{{ field11 }}" => ""
, "{{ field12 }}" => ""
, "{{ field13 }}" => ""
, "{{ field14 }}" => ""
, "{{ field15 }}" => ""
, "{{ field16 }}" => ""
, "{{ field17 }}" => ""
, "{{ field18 }}" => ""
, "{{ field19 }}" => ""
, "{{ field20 }}" => ""
);
showroweditor($row, false);
?>
<p><input type="submit" name="action" value="Post"></p>
</form>
<?php } ?>
<?php function viewrec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("view", $recid, $count);
?>
<br>
<?php showrow($row, $recid) ?>
<br>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}ML.php?a=add">Add Record</a>
<span class="op02 "><a href="{{ table }}ML.php?a=edit&recid=<?php echo $recid ?>">Edit Record</a></td>
<td><span class="op02 "><a href="{{ table }}ML.php?a=del&recid=<?php echo $recid ?>">Delete Record</a></td>
</tr>
</table>
<?php
mysql_free_result($res);
} ?>
<?php function editrec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("edit", $recid, $count);
?>
<br>
<form name="{{ table }}" enctype="multipart/form-data" action="{{ table }}ML.php" method="post">
<input type="hidden" name="sql" value="update">
<input type="hidden" name="xId" value="<?php echo $row["Id"] ?>">
<?php showroweditor($row, true); ?>
<p><input type="submit" name="action" value="Post"></p>
</form>
<?php
mysql_free_result($res);
} ?>
<?php function deleterec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("del", $recid, $count);
?>
<br>
<form name="{{ table }}" action="{{ table }}ML.php" method="post">
<input type="hidden" name="sql" value="delete">
<input type="hidden" name="xId" value="<?php echo $row["Id"] ?>">
<?php showrow($row, $recid) ?>
<p><input type="submit" name="action" value="Confirm"></p>
</form>
<?php
mysql_free_result($res);
} ?>
<?php function connect()
{
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
return $conn;
}
function sqlvalue($val, $quote)
{
if ($quote)
$tmp = sqlstr($val);
else
$tmp = $val;
if ($tmp == "")
$tmp = "NULL";
elseif ($quote)
$tmp = "'".$tmp."'";
return $tmp;
}
function sqlstr($val)
{
return str_replace("'", "'", $val);
}
function sql_select()
{
global $conn;
global $order;
global $ordtype;
global $filter;
global $filterfield;
global $wholeonly;
$filterstr = sqlstr($filter);
if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
$sql = "SELECT `Id`,
`{{ field01 }}`
, `{{ field02 }}`
, `{{ field03 }}`
, `{{ field04 }}`
, `{{ field05 }}`
, `{{ field06 }}`
, `{{ field07 }}`
, `{{ field08 }}`
, `{{ field09 }}`
, `{{ field10 }}`
, `{{ field11 }}`
, `{{ field12 }}`
, `{{ field13 }}`
, `{{ field14 }}`
, `{{ field15 }}`
, `{{ field16 }}`
, `{{ field17 }}`
, `{{ field18 }}`
, `{{ field19 }}`
, `{{ field20 }}`
FROM `{{ table }}`";
if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
$sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
} elseif (isset($filterstr) && $filterstr!='') {
$sql .= " where
(`Id` like '" .$filterstr ."') or
(`{{ field01 }}` like '" .$filterstr ."')
or (`{{ field02 }}` like '" .$filterstr ."')
or (`{{ field03 }}` like '" .$filterstr ."')
or (`{{ field04 }}` like '" .$filterstr ."')
or (`{{ field05 }}` like '" .$filterstr ."')
or (`{{ field06 }}` like '" .$filterstr ."')
or (`{{ field07 }}` like '" .$filterstr ."')
or (`{{ field08 }}` like '" .$filterstr ."')
or (`{{ field09 }}` like '" .$filterstr ."')
or (`{{ field10 }}` like '" .$filterstr ."')
or (`{{ field11 }}` like '" .$filterstr ."')
or (`{{ field12 }}` like '" .$filterstr ."')
or (`{{ field13 }}` like '" .$filterstr ."')
or (`{{ field14 }}` like '" .$filterstr ."')
or (`{{ field15 }}` like '" .$filterstr ."')
or (`{{ field16 }}` like '" .$filterstr ."')
or (`{{ field17 }}` like '" .$filterstr ."')
or (`{{ field18 }}` like '" .$filterstr ."')
or (`{{ field19 }}` like '" .$filterstr ."')
or (`{{ field20 }}` like '" .$filterstr ."')
";
}
if (isset($order) && $order!='') $sql .= " order by `" .sqlstr($order) ."`";
if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype);
$res = mysql_query($sql, $conn) or die(mysql_error());
return $res;
}
function sql_getrecordcount()
{
global $conn;
global $order;
global $ordtype;
global $filter;
global $filterfield;
global $wholeonly;
$filterstr = sqlstr($filter);
if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
$sql = "SELECT COUNT(*) FROM `{{ table }}`";
if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
$sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
} elseif (isset($filterstr) && $filterstr!='') {
$sql .= " where
(`Id` like '" .$filterstr ."') or
(`{{ field01 }}` like '" .$filterstr ."')
or (`{{ field02 }}` like '" .$filterstr ."')
or (`{{ field03 }}` like '" .$filterstr ."')
or (`{{ field04 }}` like '" .$filterstr ."')
or (`{{ field05 }}` like '" .$filterstr ."')
or (`{{ field06 }}` like '" .$filterstr ."')
or (`{{ field07 }}` like '" .$filterstr ."')
or (`{{ field08 }}` like '" .$filterstr ."')
or (`{{ field09 }}` like '" .$filterstr ."')
or (`{{ field10 }}` like '" .$filterstr ."')
or (`{{ field11 }}` like '" .$filterstr ."')
or (`{{ field12 }}` like '" .$filterstr ."')
or (`{{ field13 }}` like '" .$filterstr ."')
or (`{{ field14 }}` like '" .$filterstr ."')
or (`{{ field15 }}` like '" .$filterstr ."')
or (`{{ field16 }}` like '" .$filterstr ."')
or (`{{ field17 }}` like '" .$filterstr ."')
or (`{{ field18 }}` like '" .$filterstr ."')
or (`{{ field19 }}` like '" .$filterstr ."')
or (`{{ field20 }}` like '" .$filterstr ."')
";
}
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res);
reset($row);
return current($row);
}
function sql_insert()
{
global $conn;
global $_POST;
$sql = "insert into `{{ table }}`
(`Id`,
`{{ field01 }}`
, `{{ field02 }}`
, `{{ field03 }}`
, `{{ field04 }}`
, `{{ field05 }}`
, `{{ field06 }}`
, `{{ field07 }}`
, `{{ field08 }}`
, `{{ field09 }}`
, `{{ field10 }}`
, `{{ field11 }}`
, `{{ field12 }}`
, `{{ field13 }}`
, `{{ field14 }}`
, `{{ field15 }}`
, `{{ field16 }}`
, `{{ field17 }}`
, `{{ field18 }}`
, `{{ field19 }}`
, `{{ field20 }}`
) values (
" .sqlvalue(@$_POST["Id"], false).",
" .sqlvalue(@$_POST["{{ field01 }}"], true)."
, " .sqlvalue(@$_POST["{{ field02 }}"], true)."
, " .sqlvalue(@$_POST["{{ field03 }}"], true)."
, " .sqlvalue(@$_POST["{{ field04 }}"], true)."
, " .sqlvalue(@$_POST["{{ field05 }}"], true)."
, " .sqlvalue(@$_POST["{{ field06 }}"], true)."
, " .sqlvalue(@$_POST["{{ field07 }}"], true)."
, " .sqlvalue(@$_POST["{{ field08 }}"], true)."
, " .sqlvalue(@$_POST["{{ field09 }}"], true)."
, " .sqlvalue(@$_POST["{{ field10 }}"], true)."
, " .sqlvalue(@$_POST["{{ field11 }}"], true)."
, " .sqlvalue(@$_POST["{{ field13 }}"], true)."
, " .sqlvalue(@$_POST["{{ field14 }}"], true)."
, " .sqlvalue(@$_POST["{{ field15 }}"], true)."
, " .sqlvalue(@$_POST["{{ field16 }}"], true)."
, " .sqlvalue(@$_POST["{{ field17 }}"], true)."
, " .sqlvalue(@$_POST["{{ field18 }}"], true)."
, " .sqlvalue(@$_POST["{{ field19 }}"], true)."
, " .sqlvalue(@$_POST["{{ field20 }}"], true)."
)";
mysql_query($sql, $conn) or die(mysql_error());
}
function sql_update()
{
global $conn;
global $_POST;
$sql = "update `{{ table }}` set
`Id`=" .sqlvalue(@$_POST["Id"], false).",
`{{ field01 }}`=" .sqlvalue(@$_POST["{{ field01 }}"], true)."
, `{{ field02 }}`=" .sqlvalue(@$_POST["{{ field02 }}"], true)."
, `{{ field03 }}`=" .sqlvalue(@$_POST["{{ field03 }}"], true)."
, `{{ field04 }}`=" .sqlvalue(@$_POST["{{ field04 }}"], true)."
, `{{ field05 }}`=" .sqlvalue(@$_POST["{{ field05 }}"], true)."
, `{{ field06 }}`=" .sqlvalue(@$_POST["{{ field06 }}"], true)."
, `{{ field07 }}`=" .sqlvalue(@$_POST["{{ field07 }}"], true)."
, `{{ field08 }}`=" .sqlvalue(@$_POST["{{ field08 }}"], true)."
, `{{ field09 }}`=" .sqlvalue(@$_POST["{{ field09 }}"], true)."
, `{{ field10 }}`=" .sqlvalue(@$_POST["{{ field10 }}"], true)."
, `{{ field11 }}`=" .sqlvalue(@$_POST["{{ field11 }}"], true)."
, `{{ field12 }}`=" .sqlvalue(@$_POST["{{ field12 }}"], true)."
, `{{ field13 }}`=" .sqlvalue(@$_POST["{{ field13 }}"], true)."
, `{{ field14 }}`=" .sqlvalue(@$_POST["{{ field14 }}"], true)."
, `{{ field15 }}`=" .sqlvalue(@$_POST["{{ field15 }}"], true)."
, `{{ field16 }}`=" .sqlvalue(@$_POST["{{ field16 }}"], true)."
, `{{ field17 }}`=" .sqlvalue(@$_POST["{{ field17 }}"], true)."
, `{{ field18 }}`=" .sqlvalue(@$_POST["{{ field18 }}"], true)."
, `{{ field19 }}`=" .sqlvalue(@$_POST["{{ field19 }}"], true)."
, `{{ field20 }}`=" .sqlvalue(@$_POST["{{ field20 }}"], true)."
where " .primarykeycondition();
mysql_query($sql, $conn) or die(mysql_error());
}
function sql_delete()
{
global $conn;
$sql = "delete from `{{ table }}` where " .primarykeycondition();
mysql_query($sql, $conn) or die(mysql_error());
}
function primarykeycondition()
{
global $_POST;
$pk = "";
$pk .= "(`Id`";
if (@$_POST["xId"] == "") {
$pk .= " IS NULL";
}else{
$pk .= " = " .sqlvalue(@$_POST["xId"], false);
};
$pk .= ")";
return $pk;
}
?>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center>
<script src='https://www.google.com/recaptcha/api.js'></script>
<b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}new.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ table }}new.php?a=logout">Logout</a>
<style>
.moosebutt {
background-color: #369;
padding-left:6px;
padding-right:6px;
padding-top:3px;
padding-bottom:3px;
color: #ffffff;
border:1px solid #eee;
background-image: url(images/button_bg.jpg);
}
.moosebutt:hover {
background-color: #000000;
border:1px solid #000000;
background-image: url(images/button_bg_over.jpg);
}
.moosetext {
font-family:sans-serif;
background-color : #eee;
border: 1px solid #ccc ;
width: 230px;
font-size:12pt;
}
.moosetext:hover {
background-color : #eee;
border: 1px solid #f00 ;
}
.moosetextarea {
width:230px;
height:60px;
background-color:#99FFCC;
border:1px solid #008800;
font-size:12pt;
}
td{font-family:sans-serif;}
.alignleft{text-align:left;}
.alignright{text-align:right;}
</style>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" >
<?php
${{ field01 }} = $_POST['{{ field01 }}'];
${{ field02 }} = $_POST['{{ field02 }}'];
${{ field03 }} = $_POST['{{ field03 }}'];
${{ field04 }} = $_POST['{{ field04 }}'];
${{ field05 }} = $_POST['{{ field05 }}'];
${{ field06 }} = $_POST['{{ field06 }}'];
${{ field07 }} = $_POST['{{ field07 }}'];
${{ field08 }} = $_POST['{{ field08 }}'];
${{ field09 }} = $_POST['{{ field09 }}'];
${{ field10 }} = $_POST['{{ field10 }}'];
${{ field11 }} = $_POST['{{ field11 }}'];
${{ field12 }} = $_POST['{{ field12 }}'];
${{ field13 }} = $_POST['{{ field13 }}'];
${{ field14 }} = $_POST['{{ field14 }}'];
${{ field15 }} = $_POST['{{ field15 }}'];
${{ field16 }} = $_POST['{{ field16 }}'];
${{ field17 }} = $_POST['{{ field17 }}'];
${{ field18 }} = $_POST['{{ field18 }}'];
${{ field19 }} = $_POST['{{ field19 }}'];
${{ field20 }} = $_POST['{{ field20 }}'];
?>
<table>
<tr><td class="alignright">{{ field01 }}:</td><td><input class="moosetext" type="text" name="{{ field01 }}" value="<?php echo ${{ field01 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field02 }}:</td><td><input class="moosetext" type="text" name="{{ field02 }}" value="<?php echo ${{ field02 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field03 }}:</td><td><input class="moosetext" type="text" name="{{ field03 }}" value="<?php echo ${{ field03 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field04 }}:</td><td><input class="moosetext" type="text" name="{{ field04 }}" value="<?php echo ${{ field04 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field05 }}:</td><td><input class="moosetext" type="text" name="{{ field05 }}" value="<?php echo ${{ field05 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field06 }}:</td><td><input class="moosetext" type="text" name="{{ field06 }}" value="<?php echo ${{ field06 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field07 }}:</td><td><input class="moosetext" type="text" name="{{ field07 }}" value="<?php echo ${{ field07 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field08 }}:</td><td><input class="moosetext" type="text" name="{{ field08 }}" value="<?php echo ${{ field08 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field09 }}:</td><td><input class="moosetext" type="text" name="{{ field09 }}" value="<?php echo ${{ field09 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field10 }}:</td><td><input class="moosetext" type="text" name="{{ field10 }}" value="<?php echo ${{ field10 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field11 }}:</td><td><input class="moosetext" type="text" name="{{ field11 }}" value="<?php echo ${{ field11 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field12 }}:</td><td><input class="moosetext" type="text" name="{{ field12 }}" value="<?php echo ${{ field12 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field13 }}:</td><td><input class="moosetext" type="text" name="{{ field13 }}" value="<?php echo ${{ field13 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field14 }}:</td><td><input class="moosetext" type="text" name="{{ field14 }}" value="<?php echo ${{ field14 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field15 }}:</td><td><input class="moosetext" type="text" name="{{ field15 }}" value="<?php echo ${{ field15 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field16 }}:</td><td><input class="moosetext" type="text" name="{{ field16 }}" value="<?php echo ${{ field16 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field17 }}:</td><td><input class="moosetext" type="text" name="{{ field17 }}" value="<?php echo ${{ field17 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field18 }}:</td><td><input class="moosetext" type="text" name="{{ field18 }}" value="<?php echo ${{ field18 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field19 }}:</td><td><input class="moosetext" type="text" name="{{ field19 }}" value="<?php echo ${{ field19 }}; ?>"></td></tr>
<tr><td class="alignright">{{ field20 }}:</td><td><input class="moosetext" type="text" name="{{ field20 }}" value="<?php echo ${{ field20 }}; ?>"></td></tr>
<tr><td><td><input class="moosebutt" type="submit" value="Submit"><td>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (
!$_POST['{{ field01 }}'] || $_POST['{{ field01 }}'] == " " || strlen($_POST['{{ field01 }}'])>255
|| !$_POST['{{ field02 }}'] || $_POST['{{ field02 }}'] == " " || strlen($_POST['{{ field02 }}'])>255
|| !$_POST['{{ field03 }}'] || $_POST['{{ field03 }}'] == " " || strlen($_POST['{{ field03 }}'])>255
|| !$_POST['{{ field04 }}'] || $_POST['{{ field04 }}'] == " " || strlen($_POST['{{ field04 }}'])>255
|| !$_POST['{{ field05 }}'] || $_POST['{{ field05 }}'] == " " || strlen($_POST['{{ field05 }}'])>255
|| !$_POST['{{ field06 }}'] || $_POST['{{ field06 }}'] == " " || strlen($_POST['{{ field06 }}'])>255
|| !$_POST['{{ field07 }}'] || $_POST['{{ field07 }}'] == " " || strlen($_POST['{{ field07 }}'])>255
|| !$_POST['{{ field08 }}'] || $_POST['{{ field08 }}'] == " " || strlen($_POST['{{ field08 }}'])>255
|| !$_POST['{{ field09 }}'] || $_POST['{{ field09 }}'] == " " || strlen($_POST['{{ field09 }}'])>255
|| !$_POST['{{ field10 }}'] || $_POST['{{ field10 }}'] == " " || strlen($_POST['{{ field10 }}'])>255
|| !$_POST['{{ field11 }}'] || $_POST['{{ field11 }}'] == " " || strlen($_POST['{{ field11 }}'])>255
|| !$_POST['{{ field12 }}'] || $_POST['{{ field12 }}'] == " " || strlen($_POST['{{ field12 }}'])>255
|| !$_POST['{{ field13 }}'] || $_POST['{{ field13 }}'] == " " || strlen($_POST['{{ field13 }}'])>255
|| !$_POST['{{ field14 }}'] || $_POST['{{ field14 }}'] == " " || strlen($_POST['{{ field14 }}'])>255
|| !$_POST['{{ field15 }}'] || $_POST['{{ field15 }}'] == " " || strlen($_POST['{{ field15 }}'])>255
|| !$_POST['{{ field16 }}'] || $_POST['{{ field16 }}'] == " " || strlen($_POST['{{ field16 }}'])>255
|| !$_POST['{{ field17 }}'] || $_POST['{{ field17 }}'] == " " || strlen($_POST['{{ field17 }}'])>255
|| !$_POST['{{ field18 }}'] || $_POST['{{ field18 }}'] == " " || strlen($_POST['{{ field18 }}'])>255
|| !$_POST['{{ field19 }}'] || $_POST['{{ field19 }}'] == " " || strlen($_POST['{{ field19 }}'])>255
|| !$_POST['{{ field20 }}'] || $_POST['{{ field20 }}'] == " " || strlen($_POST['{{ field20 }}'])>255
)
{
${{ field01 }} = $_REQUEST['${{ field01 }}'];if (empty(${{ field01 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field02 }} = $_REQUEST['${{ field02 }}'];if (empty(${{ field02 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field03 }} = $_REQUEST['${{ field03 }}'];if (empty(${{ field03 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field04 }} = $_REQUEST['${{ field04 }}'];if (empty(${{ field04 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field05 }} = $_REQUEST['${{ field05 }}'];if (empty(${{ field05 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field06 }} = $_REQUEST['${{ field06 }}'];if (empty(${{ field06 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field07 }} = $_REQUEST['${{ field07 }}'];if (empty(${{ field07 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field08 }} = $_REQUEST['${{ field08 }}'];if (empty(${{ field08 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field09 }} = $_REQUEST['${{ field09 }}'];if (empty(${{ field09 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field10 }} = $_REQUEST['${{ field10 }}'];if (empty(${{ field10 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field11 }} = $_REQUEST['${{ field11 }}'];if (empty(${{ field11 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field12 }} = $_REQUEST['${{ field12 }}'];if (empty(${{ field12 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field13 }} = $_REQUEST['${{ field13 }}'];if (empty(${{ field13 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field14 }} = $_REQUEST['${{ field14 }}'];if (empty(${{ field14 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field15 }} = $_REQUEST['${{ field15 }}'];if (empty(${{ field15 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field16 }} = $_REQUEST['${{ field16 }}'];if (empty(${{ field16 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field17 }} = $_REQUEST['${{ field17 }}'];if (empty(${{ field17 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field18 }} = $_REQUEST['${{ field18 }}'];if (empty(${{ field18 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field19 }} = $_REQUEST['${{ field19 }}'];if (empty(${{ field19 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
${{ field20 }} = $_REQUEST['${{ field20 }}'];if (empty(${{ field20 }})) {echo "<tr><td><td style=\"padding:6px;background-color:red;color:#fff;text-align:center;\">Incomplete";exit;}
}
$conn = mysql_connect( "{{ host }}", "{{ username }}", "{{ password }}" );
$result= mysql_select_db("{{ database }}",$conn);
$query = "insert into {{ table }}(
{{ field01 }} ,{{ field02 }} ,{{ field03 }} ,{{ field04 }} ,{{ field05 }} ,{{ field06 }} ,{{ field07 }} ,{{ field08 }} ,{{ field09 }} ,{{ field10 }} ,{{ field11 }} ,{{ field12 }} ,{{ field13 }} ,{{ field14 }} ,{{ field15 }} ,{{ field16 }} ,{{ field17 }} ,{{ field18 }} ,{{ field19 }} ,{{ field20 }}
) values (
'${{ field01 }}' ,'${{ field02 }}' ,'${{ field03 }}' ,'${{ field04 }}' ,'${{ field05 }}' ,'${{ field06 }}' ,'${{ field07 }}' ,'${{ field08 }}' ,'${{ field09 }}' ,'${{ field10 }}' ,'${{ field11 }}' ,'${{ field12 }}' ,'${{ field13 }}' ,'${{ field14 }}' ,'${{ field15 }}' ,'${{ field16 }}' ,'${{ field17 }}' ,'${{ field18 }}' ,'${{ field19 }}' ,'${{ field20 }}'
)" ;
$result1 = mysql_query($query, $conn);
echo "<p class=\".success\"><tr><td><td style=\"padding:6px;background-color:green;color:#fff;text-align:center;\">Successfully Submitted!</p>";
}
?>
</form>
</table>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}excel.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<?php
$host = '{{ host }}';
$user = '{{ username }}';
$pass = '{{ password }}';
$db = '{{ database }}';
$table = '{{ table }}';
$file = '{{ table }}';
$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
mysql_select_db($db) or die("Can not connect.");
$result = mysql_query("SHOW COLUMNS FROM ".$table."");
$i = 0;
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$csv_output .= $row['Field'].", ";
$i++;
}
}
$csv_output .= "\n";
$values = mysql_query("SELECT * FROM ".$table."");
while ($rowr = mysql_fetch_row($values)) {
for ($j=0;$j<$i;$j++) {
$csv_output .= $rowr[$j].", ";
}
$csv_output .= "\n";
}
$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
?>
<INPUT TYPE="Radio" NAME="{{ bield }}" VALUE="AAAAAAAAAAAA>AAAAAAAAAAAA
<br>
<INPUT TYPE="Radio" NAME="{{ bield }}" VALUE="BBBBBBBBBBBB">BBBBBBBBBBBB
<br>
<INPUT TYPE="Radio" NAME="{{ bield }}" VALUE="CCCCCCCCCCC">CCCCCCCCCCC
-----------------Selection---------------------------------------
<SELECT class="moosetext" NAME="{{ bield }}">
<OPTION value="AAAAAAAAAAAA">AAAAAAAAAAAA</OPTION>
<OPTION value="BBBBBBBBBBBB">BBBBBBBBBBBB</OPTION>
</SELECT>
OOOOOOOOOORRRRRRRRRRRR
<SELECT class="moosetext" NAME="{{ bield }}">
<OPTION value="<?php echo htmlspecialchars(${{ bield }}) ?>"><?php echo htmlspecialchars(${{ bield }}) ?></OPTION>
<OPTION value="Approved">Approved</OPTION>
<OPTION value="Pending">Pending</OPTION>
</SELECT>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/////////////////////////////// Editing Text Areas for {{ table }}ML.php DBMS/////////////////////////////////////////////
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field01 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field01 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field01 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field02 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field02 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field02 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field03 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field03 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field03 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field04 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field04 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field04 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field05 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field05 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field05 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field06 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field06 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field06 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field07 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field07 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field07 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field08 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field08 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field08 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field09 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field09 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field09 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field10 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field10 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field10 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field11 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field11 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field11 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field12 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field12 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field12 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field13 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field13 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field13 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field14 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field14 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field14 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field15 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field15 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field15 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field16 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field16}}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field16}}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field17 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field17 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field17 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field18 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field18 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field18 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field19 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field19 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field19 }}"])) ?></TEXTAREA></td>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("{{ field20 }}")." " ?></td>
<td valign=top class="dr">
<TEXTAREA id="styled" NAME="{{ field20 }}" ROWS="5" COLS="24" WRAP="virtual">
<?php echo str_replace('"', '"', trim($row["{{ field20 }}"])) ?></TEXTAREA></td>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field01 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field02 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field03 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field04 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field05 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field06 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field07 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field08 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field09 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field10 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field11 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field12 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field13 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field14 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field15 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field16 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field17 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field18 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field19 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<TEXTAREA class="moosetext" id="styled" NAME="{{ field20 }}" ROWS="5" COLS="24" WRAP="virtual"></TEXTAREA>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}search.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ table }}search.php?a=logout">Logout</a>
<style type="text/css">
*{font-family:sans-serif;}
.Fear{
text-align: right;
white-space: nowrap;
}
.moosetext {
background-color : #eee;
border: 1px solid #ddd;
width: 230px;
}
.moosebutt {
background-color: #369;
padding-left:6px;
padding-right:6px;
padding-top:3px;
padding-bottom:3px;
color: #ffffff;
border:1px solid #003;
background-image: url(images/button_bg.jpg);
}
.moosebutt:hover {
background-color: #000000;
border:1px solid #000000;
background-image: url(images/button_bg_over.jpg);
}
</style>
<form name="{{ table }}" action="{{ table }}results.php" method="post">
<table class="FearFarm" border="0" cellpadding="5" cellspacing="2" width="600">
<tr>
<td class="Fear" valign=top>{{ field01 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field01 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field02 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field02 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field03 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field03 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field04 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field04 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field05 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field05 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field06 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field06 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field07 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field07 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field08 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field08 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field09 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field09 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field10 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field10 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field11 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field11 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field12 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field12 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field13 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field13 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field14 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field14 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field15 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field15 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field16 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field16 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field17 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field17 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field18 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field18 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field19 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field19 }}" size="24" value=""> </td>
</tr>
<td class="Fear" valign=top>{{ field20 }} </td>
<td class="Farm" valign="top"><input class="moosetext" type="text" name="{{ field20 }}" size="24" value=""> </td>
</tr>
<tr>
<td class="Farm" valign="top" colspan=4><center><input type="submit" class="moosebutt" Name="submit" value="submit" alt="Please Submit"></td>
</tr>
</table>
</form>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<style>
body {
font-family: arial;
}
table {
border: 1px solid #ccc;
width: 100%;
margin:0;
padding:0;
border-collapse: collapse;
border-spacing: 0;
}
table tr {
border: 1px solid #ddd;
padding: 5px;
}
table th, table td {
padding: 10px;
text-align: center;
}
table th {
text-transform: uppercase;
font-size: 14px;
letter-spacing: 1px;
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table thead {
display: none;
}
table tr {
margin-bottom: 10px;
display: block;
border-bottom: 2px solid #ddd;
}
table td {
display: block;
text-align: right;
font-size: 13px;
border-bottom: 1px dotted #ccc;
}
table td:last-child {
border-bottom: 0;
}
table td:before {
content: attr(data-label);
float: left;
text-transform: uppercase;
font-weight: bold;
}
}
</style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}results.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; }
table {
border: 1px solid #ccc;
width: 100%;
margin:0;
padding:0;
border-collapse: collapse;
border-spacing: 0;
}
table tr {
border: 1px solid #ddd;
padding: 5px;
}
table th, table td {
padding: 10px;
text-align: center;
}
table th {
text-transform: uppercase;
font-size: 14px;
letter-spacing: 1px;
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table thead {
display: none;
}
table tr {
margin-bottom: 10px;
display: block;
border-bottom: 2px solid #ddd;
}
table td {
display: block;
text-align: right;
font-size: 13px;
border-bottom: 1px dotted #ccc;
}
table td:last-child {
border-bottom: 0;
}
table td:before {
content: attr(data-label);
float: left;
text-transform: uppercase;
font-weight: bold;
}
}
</style>
<a style="float:right" class="moosebutt" href="{{ table }}results.php?a=logout">Logout</a>
<?php
${{ field01 }}=$_POST['{{ field01 }}'];
${{ field02 }}=$_POST['{{ field02 }}'];
${{ field03 }}=$_POST['{{ field03 }}'];
${{ field04 }}=$_POST['{{ field04 }}'];
${{ field05 }}=$_POST['{{ field05 }}'];
${{ field06 }}=$_POST['{{ field06 }}'];
${{ field07 }}=$_POST['{{ field07 }}'];
${{ field08 }}=$_POST['{{ field08 }}'];
${{ field09 }}=$_POST['{{ field09 }}'];
${{ field10 }}=$_POST['{{ field10 }}'];
${{ field11 }}=$_POST['{{ field11 }}'];
${{ field12 }}=$_POST['{{ field12 }}'];
${{ field13 }}=$_POST['{{ field13 }}'];
${{ field14 }}=$_POST['{{ field14 }}'];
${{ field15 }}=$_POST['{{ field15 }}'];
${{ field16 }}=$_POST['{{ field16 }}'];
${{ field17 }}=$_POST['{{ field17 }}'];
${{ field18 }}=$_POST['{{ field18 }}'];
${{ field19 }}=$_POST['{{ field19 }}'];
${{ field20 }}=$_POST['{{ field20 }}'];
?>
<style>
*{font-family:sans-serif;}
td{ font: 12px "arial"; font-weight: normal; color: #000000;padding:8px;border-right:1px dotted #ddd;}
A:link{font-family: Arial, Helvetica, Sans-Serif; color: #369; text-decoration: none;}
A:visited{font-family: Arial, Helvetica, Sans-Serif; color: #369; text-decoration: none;}
A:hover{font-family: Arial, Helvetica, Sans-Serif;color: #000;text-decoration: none;}
th{width:100px;background-color:#369;text-align:left;color:#fff;padding:8px;border-right:1px solid #fff;}
</style>
<?php
${{ field01 }}="%" . ${{ field01 }} ."%";
${{ field02 }}="%" . ${{ field02 }} ."%";
${{ field03 }}="%" . ${{ field03 }} ."%";
${{ field04 }}="%" . ${{ field04 }} ."%";
${{ field05 }}="%" . ${{ field05 }} ."%";
${{ field06 }}="%" . ${{ field06 }} ."%";
${{ field07 }}="%" . ${{ field07 }} ."%";
${{ field08 }}="%" . ${{ field08 }} ."%";
${{ field09 }}="%" . ${{ field09 }} ."%";
${{ field10 }}="%" . ${{ field10 }} ."%";
${{ field11 }}="%" . ${{ field11 }} ."%";
${{ field12 }}="%" . ${{ field12 }} ."%";
${{ field13 }}="%" . ${{ field13 }} ."%";
${{ field14 }}="%" . ${{ field14 }} ."%";
${{ field15 }}="%" . ${{ field15 }} ."%";
${{ field16 }}="%" . ${{ field16 }} ."%";
${{ field17 }}="%" . ${{ field17 }} ."%";
${{ field18 }}="%" . ${{ field18 }} ."%";
${{ field19 }}="%" . ${{ field19 }} ."%";
${{ field20 }}="%" . ${{ field20 }} ."%";
?>
<?php
$conn = mysql_connect('{{ host }}', '{{ username }}','{{ password }}', '{{ database }}');
$result=mysql_select_db('{{ database }}',$conn);
$query = "select * from {{ table }} WHERE
{{ field01 }} like '${{ field01 }}'
and {{ field02 }} like '${{ field02 }}'
and {{ field03 }} like '${{ field03 }}'
and {{ field04 }} like '${{ field04 }}'
and {{ field05 }} like '${{ field05 }}'
and {{ field06 }} like '${{ field06 }}'
and {{ field07 }} like '${{ field07 }}'
and {{ field08 }} like '${{ field08 }}'
and {{ field09 }} like '${{ field09 }}'
and {{ field10 }} like '${{ field10 }}'
and {{ field11 }} like '${{ field11 }}'
and {{ field12 }} like '${{ field12 }}'
and {{ field13 }} like '${{ field13 }}'
and {{ field14 }} like '${{ field14 }}'
and {{ field15 }} like '${{ field15 }}'
and {{ field16 }} like '${{ field16 }}'
and {{ field17 }} like '${{ field17 }}'
and {{ field18 }} like '${{ field18 }}'
and {{ field19 }} like '${{ field19 }}'
and {{ field20 }} like '${{ field20 }}'
order by {{ field01 }}
" ;
$result= mysql_query($query, $conn) ;
echo "<table border=0 cellpadding=0 width=450 cellspacing=0><thead><tr>";
echo "<th><b>{{ field01 }}</th>";
echo "<th><b>{{ field02 }}</th>";
echo "<th><b>{{ field03 }}</th>";
echo "<th><b>{{ field04 }}</th>";
echo "<th><b>{{ field05 }}</th>";
echo "<th><b>{{ field06 }}</th>";
echo "<th><b>{{ field07 }}</th>";
echo "<th><b>{{ field08 }}</th>";
echo "<th><b>{{ field09 }}</th>";
echo "<th><b>{{ field10 }}</th>";
echo "<th><b>{{ field11 }}</th>";
echo "<th><b>{{ field12 }}</th>";
echo "<th><b>{{ field13 }}</th>";
echo "<th><b>{{ field14 }}</th>";
echo "<th><b>{{ field15 }}</th>";
echo "<th><b>{{ field16 }}</th>";
echo "<th><b>{{ field17 }}</th>";
echo "<th><b>{{ field18 }}</th>";
echo "<th><b>{{ field19 }}</th>";
echo "<th><b>{{ field20 }}</th>";
echo "</thead>";
$i = 0;
while ($r=mysql_fetch_array($result))
{
if ($i % 2 != 0) # An odd row
$rowColor = "#eeeeee";
else # An even row
$rowColor = "#ffffff";
$id=$r["id"];
${{ field01 }}=$r["{{ field01 }}"];
${{ field02 }}=$r["{{ field02 }}"];
${{ field03 }}=$r["{{ field03 }}"];
${{ field04 }}=$r["{{ field04 }}"];
${{ field05 }}=$r["{{ field05 }}"];
${{ field06 }}=$r["{{ field06 }}"];
${{ field07 }}=$r["{{ field07 }}"];
${{ field08 }}=$r["{{ field08 }}"];
${{ field09 }}=$r["{{ field09 }}"];
${{ field10 }}=$r["{{ field10 }}"];
${{ field11 }}=$r["{{ field11 }}"];
${{ field12 }}=$r["{{ field12 }}"];
${{ field13 }}=$r["{{ field13 }}"];
${{ field14 }}=$r["{{ field14 }}"];
${{ field15 }}=$r["{{ field15 }}"];
${{ field16 }}=$r["{{ field16 }}"];
${{ field17 }}=$r["{{ field17 }}"];
${{ field18 }}=$r["{{ field18 }}"];
${{ field19 }}=$r["{{ field19 }}"];
${{ field20 }}=$r["{{ field20 }}"];
echo "<tr bgcolor=$rowColor>
<td data-label=\"{{ field01 }}\">${{ field01 }}</td>
<td data-label=\"{{ field02 }}\">${{ field02 }}</td>
<td data-label=\"{{ field03 }}\">${{ field03 }}</td>
<td data-label=\"{{ field04 }}\">${{ field04 }}</td>
<td data-label=\"{{ field05 }}\">${{ field05 }}</td>
<td data-label=\"{{ field06 }}\">${{ field06 }}</td>
<td data-label=\"{{ field07 }}\">${{ field07 }}</td>
<td data-label=\"{{ field08 }}\">${{ field08 }}</td>
<td data-label=\"{{ field09 }}\">${{ field09 }}</td>
<td data-label=\"{{ field10 }}\">${{ field10 }}</td>
<td data-label=\"{{ field11 }}\">${{ field11 }}</td>
<td data-label=\"{{ field12 }}\">${{ field12 }}</td>
<td data-label=\"{{ field13 }}\">${{ field13 }}</td>
<td data-label=\"{{ field14 }}\">${{ field14 }}</td>
<td data-label=\"{{ field15 }}\">${{ field15 }}</td>
<td data-label=\"{{ field16 }}\">${{ field16 }}</td>
<td data-label=\"{{ field17 }}\">${{ field17 }}</td>
<td data-label=\"{{ field18 }}\">${{ field18 }}</td>
<td data-label=\"{{ field19 }}\">${{ field19 }}</td>
<td data-label=\"{{ field20 }}\">${{ field20 }}</td>
<tr>";
$i++;
}
mysql_free_result($result);
echo "</table>";
?><br><br>
<A HREF="{{ table }}search.php">
Search Again!</A>
Needed Files
{{ table }}json.php ➕
<?php
$con = mysql_connect("{{host}}","{{username}}","{{password}}");
$db = mysql_select_db("{{database}}",$con);
$query = mysql_query("select * from {{table}}");
while($fetch = mysql_fetch_array($query))
{
$output[] = array (
$fetch[0],
$fetch[1],
$fetch[2],
$fetch[3],
$fetch[4],
$fetch[5],
$fetch[6],
$fetch[7],
$fetch[8],
$fetch[9],
$fetch[10],
$fetch[11],
$fetch[12],
$fetch[13],
$fetch[14],
$fetch[15],
$fetch[16],
$fetch[17],
$fetch[18],
$fetch[19],
$fetch[20],
$fetch[21]
);
}
echo json_encode($output);
?>
{{ table }}quick.php ➕
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}quick.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ table }}quick.php?a=logout">Logout</a>
<link rel="stylesheet" href="jsonworks/jquery.dataTables.css" />
<link rel="stylesheet" href="jsonworks/bootstrap.min.css" />
<meta name="viewport" content="width=device-width">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="jsonworks/bootstrap.min.js"></script>
<script src="jsonworks/jquery.dataTables.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var oTable = $('#jsontable').dataTable(); //Initialize the datatable
$('#load').on('click',function(){
var user = $(this).attr('id');
if(user != '')
{
$.ajax({
url: '{{ table }}json.php?method=fetchdata',
dataType: 'json',
success: function(s){
console.log(s);
oTable.fnClearTable();
for(var i = 0; i < s.length; i++) {
oTable.fnAddData([
s[i][0], // {{ field01 }}
s[i][1], // {{ field02 }}
s[i][2], // {{ field03 }}
s[i][3], // {{ field04 }}
s[i][4], // {{ field05 }}
s[i][5], // {{ field06 }}
s[i][6], // {{ field07 }}
s[i][7], // {{ field08 }}
s[i][8], // {{ field09 }}
s[i][9], // {{ field10 }}
s[i][10], // {{ field11 }}
s[i][11], // {{ field12 }}
s[i][12], // {{ field13 }}
s[i][13], // {{ field14 }}
s[i][14], // {{ field15 }}
s[i][15], // {{ field16 }}
s[i][16], // {{ field17 }}
s[i][17], // {{ field18 }}
s[i][18], // {{ field19 }}
s[i][19], // {{ field20 }}
s[i][20] // {{ field21 }}
]);
} // End For
},
error: function(e){
console.log(e.responseText);
}
});
}
});
});
</script>
<div class="container">
<header><!-- <img class="bg" src="phonehead.jpg"> --></header>
<input type="button" class="btn btn-primary" value="Activate" id="load"/>
<table id="jsontable" class="display table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th width="10"> {{ field01 }} </th>
<th width="10"> {{ field02 }} </th>
<th width="10"> {{ field03 }} </th>
<th width="10"> {{ field04 }} </th>
<th width="10"> {{ field05 }} </th>
<th width="10"> {{ field06 }} </th>
<th width="10"> {{ field07 }} </th>
<th width="10"> {{ field08 }} </th>
<th width="10"> {{ field09 }} </th>
<th width="10"> {{ field10 }} </th>
<th width="10"> {{ field11 }} </th>
<th width="10"> {{ field12 }} </th>
<th width="10"> {{ field13 }} </th>
<th width="10"> {{ field14 }} </th>
<th width="10"> {{ field15 }} </th>
<th width="10"> {{ field16 }} </th>
<th width="10"> {{ field17 }} </th>
<th width="10"> {{ field18 }} </th>
<th width="10"> {{ field19 }} </th>
<th width="10"> {{ field20 }} </th>
</tr>
</thead>
</table>
</div>
<?php
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$result=mysql_select_db($dbName,$conn);
?>
<input class="moosetext" name="{{ bield }}" list="{{ bield }}" type="select" />
<datalist id="{{ bield }}">
<?php
$results= mysql_query("SELECT distinct {{ bield }} from {{ table }} Order by {{ bield }} ");
echo mysql_error();
if (mysql_Numrows($results)>0)
{
$numrows=mysql_NumRows($results);
$x=0;
while ($x<$numrows){
$theName=mysql_result($results,$x,${{ bield }});
echo "<option value=\"$theName\">$theName</option>n";
$x++;
}
}
?>
</datalist>
############################################################################
<?php
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$result=mysql_select_db($dbName,$conn);
echo" <select class=\"moosetext\" name=\"{{ bield }}\"> <option Value=\"%\"> ";
$results= mysql_query("SELECT distinct {{ bield }} from {{ table }} Order by {{ bield }}");
echo mysql_error();
if (mysql_Numrows($results)>0)
{
$numrows=mysql_NumRows($results);
$x=0;
while ($x<$numrows){
$theName=mysql_result($results,$x,${{ bield }});
echo "<option value=\"$theName\">$theName</option>\n";
$x++;
}
}
echo "</select>";
?>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}printable.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ table }}printable.php?a=logout">Logout</a>
<?php
$dbhost = '{{ host }}';
$dbuser = '{{ username }}';
$dbpass = '{{ password }}';
$db = '{{ database }}';
$conn = mysql_connect($dbhost, $dbuser, $dbpass,$db);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT * FROM {{ table }}';
mysql_select_db($db);
$retval = mysql_query( $sql, $conn );
if(! $retval )
{die('Could not get data: ' . mysql_error());}
while($row = mysql_fetch_array($retval, MYSQL_NUM))
{echo
" {{ field01 }} : {$row[0]} <br>" .
" {{ field02 }} : {$row[1]} <br>" .
" {{ field03 }} : {$row[2]} <br>" .
" {{ field04 }} : {$row[3]} <br>" .
" {{ field05 }} : {$row[4]} <br>" .
" {{ field06 }} : {$row[5]} <br>" .
" {{ field07 }} : {$row[6]} <br>" .
" {{ field08 }} : {$row[7]} <br>" .
" {{ field09 }} : {$row[8]} <br>" .
" {{ field10 }} : {$row[9]} <br>" .
" {{ field11 }} : {$row[10]} <br>" .
" {{ field12 }} : {$row[11]} <br>" .
" {{ field13 }} : {$row[12]} <br>" .
" {{ field14 }} : {$row[13]} <br>" .
" {{ field15 }} : {$row[14]} <br>" .
" {{ field16 }} : {$row[15]} <br>" .
" {{ field17 }} : {$row[16]} <br>" .
" {{ field18 }} : {$row[17]} <br>" .
" {{ field19 }} : {$row[18]} <br>" .
" {{ field20 }} : {$row[19]} <br>" .
"--------------------------------<br>";
}
mysql_free_result($retval);
echo "Data From {{ table }}!\n";
mysql_close($conn);
?>
<select class="moosetext" name="{{ bield }}">
<option selected="selected"></option>
<?php
$file = 'TEXTFILE GOES HERE';
$handle = @fopen($file, 'r');
if ($handle) {
while (!feof($handle)) {
$line = fgets($handle, 4096);
$item = explode('|', $line);
echo '<option value="' . $item[0] . '">' . $item[0] . '</option>' . "\n";
}
fclose($handle);
}
?>
</select>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="{{ table }}replace.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="{{ table }}replace.php?a=logout">Logout</a>
<?php
if (!$submit){
$link = mysql_connect("{{ host }}","{{ username }}","{{ password }}") or die(mysql_error());
mysql_select_db("{{ database }}", $link) or die(mysql_error());
mysql_query("TRUNCATE TABLE {{ table }}", $link) or die(mysql_error());
mysql_close($link);
}
$connect = mysql_connect("{{ host }}","{{ username }}","{{ password }}");
mysql_select_db("{{ database }}",$connect);
if ($_FILES[csv][size] > 0) {
$file = $_FILES[csv][tmp_name];
$handle = fopen($file,"r");
do {
if ($data[0]) {
$todae=date ("Y/m/d-G:i");
mysql_query("INSERT INTO {{ table }} (
{{ field01 }}
,{{ field02 }}
,{{ field03 }}
,{{ field04 }}
,{{ field05 }}
,{{ field06 }}
,{{ field07 }}
,{{ field08 }}
,{{ field09 }}
,{{ field10 }}
,{{ field11 }}
,{{ field12 }}
,{{ field13 }}
,{{ field14 }}
,{{ field15 }}
,{{ field16 }}
,{{ field17 }}
,{{ field18 }}
,{{ field19 }}
,{{ field20 }}
,todae
)
VALUES (
'".addslashes($data[0])."'
,'".addslashes($data[1])."'
,'".addslashes($data[2])."'
,'".addslashes($data[3])."'
,'".addslashes($data[4])."'
,'".addslashes($data[5])."'
,'".addslashes($data[6])."'
,'".addslashes($data[7])."'
,'".addslashes($data[8])."'
,'".addslashes($data[9])."'
,'".addslashes($data[10])."'
,'".addslashes($data[11])."'
,'".addslashes($data[12])."'
,'".addslashes($data[3])."'
,'".addslashes($data[14])."'
,'".addslashes($data[15])."'
,'".addslashes($data[16])."'
,'".addslashes($data[17])."'
,'".addslashes($data[18])."'
,'".addslashes($data[19])."'
,'".addslashes($todae)."'
)
");
}
} while ($data = fgetcsv($handle,1000,",","'"));
header('Location: {{ filename }}?success=1'); die;
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Import a CSV File with PHP & MySQL</title>
<style type="text/css">
*{font-family:sans-serif;}
.Fear{
text-align: right;
white-space: nowrap;
}
.moosetext {
background-color : #eee;
border: 1px solid #ddd;
width: 230px;
}
.moosebutt {
background-color: #369;
padding-left:6px;
padding-right:6px;
padding-top:3px;
padding-bottom:3px;
color: #ffffff;
border:1px solid #003;
background-image: url(images/button_bg.jpg);
}
.moosebutt:hover {
background-color: #000000;
border:1px solid #000000;
background-image: url(images/button_bg_over.jpg);
}
</style>
</head>
<body>
<h3>Use this form to Upload Data From {{ csv }}</h3>
<?php if (!empty($_GET[success])) { echo "<b>Your file has been imported.</b><br><br>"; } //generic success notice ?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
Choose your file: <br />
<input class="moosebutt" name="csv" type="file" id="csv" />
<input class="moosebutt" type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
</td></tr> </table>
<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="index.php" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>
<a style="float:right" class="moosebutt" href="index.php?a=logout">Logout</a>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<STYLE>
*{font-family:sans-serif;}
.ui-helper-hidden {
display: none;
}
.ui-helper-reset { margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin-top: 2px;
padding: .5em .5em .5em .7em;
min-height: 0; /* support: IE7 */
}
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
position: absolute;
left: .5em;
top: 50%;
margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-widget {
font-family: Verdana,Arial,sans-serif;
font-size: 14PX;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 6px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 6px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 6px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 6px;
}
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #000;
background: #0000CC;
font-weight: normal;
color: #FFFFFF;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
color: #FFFFFF;
text-decoration: none;
}
.ui-state-default a:hover {
color: #FFFFFF;
text-decoration: none;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #000;
background: #003399 ;
color: #FFFFFF ;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #FFFFFF ;
text-decoration: none;
}
.ui-widget-content {
border: 1px solid #000;
background: #FFFFCC ;
color: #000000 ;
}
.ui-widget-content a {
color: #000000 ;
text-decoration:none;
}
.ui-widget-content a:hover {
color: #000000 ;
text-decoration:none;
}
</STYLE>
<!-- begin html for {{ table }}accordion -->
<script type="text/javascript">
$(document).ready(
function () {
$("#{{ table }}accordion").accordion({ header: "h3",
autoheight: false,
active: false,
alwaysOpen: false,
fillspace: false,
collapsible: true,
//heightStyle: content //auto, fill, content
});
});
</script>
<div></div>
<div style="float:left;width: 250px;margin:5px">
<center><h3> {{database}} | {{ table }} </h3></center>
<div id="{{ table }}accordion">
<h3>
<a href="#">Search</a></h3>
<div class="">
<a href="{{ table }}search.php" target="_blank">Detailed Search</a><br>
<a href="{{ table }}quick.php" target="_blank">Quick Search</a><br>
<a href="{{ table }}ML.php" target="_blank">Mangement System</a><br>
<a href="{{ table }}_UsersML.php" target="_blank">User Mangement System</a><br>
</div>
<h3>
<a href="#">Add</a></h3>
<div class="">
<a href="{{ table }}ML.php" target="_blank">Mangement System</a><br>
<a href="{{ table }}_UsersML.php" target="_blank">User Mangement System</a><br>
<a href="{{ table }}new.php" target="_blank">New Individual Record</a><br>
<a href="{{ filename }}" target="_blank">Import from {{ csv }}</a>
</div>
<h3>
<a href="#">Output</a></h3>
<div class="">
<a href="{{ table }}excel.php" target="_blank">Export to Excel</a><br>
<a href="{{ table }}printable.php" target="_blank">Copy and Paste Printable</a>
</div>
<h3>
<a href="#">Delete and Replace All Data <span style="font-size:18pt">☠</span></a></h3>
<div style="background-color:red;color:#fff;">
<span style="font-size:28pt;font-weight:bold;">☠☠☠☠</span><br>
<p><strong>By Clicking the link below, you will DELETE ALL data in the database. You will than be able to upload the data from an updated {{ filename }}. If you want to export the current data before you click the link, go to <a href="{{ table }}excel.php">Export to Excel</a></strong></p>
<a href="{{ table }}replace.php" target="_blank">Delete and Replace Now</a><br><br>
<br>
</div>
<h3>
<a href="#">Support</a></h3>
<div class="">
<strong>Gary R. Farmer</strong><br>
Moose Loose LLC<br>
<a href="mailto:Gary@MooseLoose.com">Gary@MooseLoose.com</A><br>
txt: 218.460.0911
</div>
</div>
<!-- end html for {{ table }}accordion -->
<?php session_start("{{ table }}_Users");
if (isset($_GET["order"])) $order = @$_GET["order"];
if (isset($_GET["type"])) $ordtype = @$_GET["type"];
if (isset($_POST["filter"])) $filter = @$_POST["filter"];
if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"];
$wholeonly = false;
if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"];
if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"];
if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"];
if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"];
if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"];
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off'); ?>
<html>
<head>
<title></title>
<link rel="SHORTCUT ICON" href="http://mooseloose.com/moose.ico">
<meta name="generator" http-equiv="content-type" content="text/html">
<style type="text/css">
<style type="text/css">
a:link { color: #000000; text-decoration: none}
a:vlink { color: #000000; text-decoration: none}
a:hover { color:Red; text-decoration: underline}
a:active { color: 000000; text-decoration: none; }
a { color: #000000; text-decoration: none; }
body {background: #E9AFA4;color: #000000;}
CITE { font-size: 14px; color: #ff0000; text-decoration: none}
/*background color behind buttons and links*/
.bd {
background-color: #ECDEAD;
color: #000000;
font-family: Arial;
font-size: 12px;
text-align:left;
}
td{color: #000000;; font-family: Arial; font-size: 18px;}
/*Table Border around the information*/
.tbl {
border-left: 1px solid #ffffff;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #dddddd;
border-right: 1px solid #dddddd;
background-color: #F7F6F1;
}
/*Footer background and TH*/
.hr {
background-color: #BB4A26;
color: #ffffff;
font-family: Arial;
font-size: 14px;
padding:5px;
}
/*Links in the TH*/
.hr a:link{
background-color: transparent;
color: #ffffff;
font-family: Arial;
font-size: 14px;
font-weight:bold;
}
/*Header*/
.th01{
background-image:url(http://mooseloose.com/header.png);
height:107px;
background-color:transparent;
background-repeat:no-repeat;
border: 0px solid black;
}
/*Links in th main page*/
a.hr:link {
color: #ffffff;
font-family: Arial;
font-size: 12px;
}
a.hr:visited {
color: #ffffff;
}
a.hr:hover {
color: #ECDEAD;
}
a.hr:active {
color: #ECDEAD;
}
/*odd and bg of record details*/
.dr {
background-color: #ECDEAD;
color: #000000;
font-family: Arial;
font-size: 12px;
}
/*even*/
.sr {
background-color: #FDFDDE;
color: #000000;
font-family: Arial;
font-size: 12px;
}
.detaillabels{width:100px;
text-align:right;
font-family: Arial;
font-size: 14px;
background-color: #BB4A26;
color: #ffffff;
}
.op02
a {
font-family: Arial;
font-size: 12px;
color: #EAF3FA;
text-decoration: none;
float: left;
background-image: url(butaX.jpg);
background-color: #984832;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: white #C7C7C7 #C7C7C7 white;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px; }
.op02
a:hover {
color: #ffffff;
text-decoration: none;
float: left;
background-image: url(butbX.jpg);
background-color: #545231;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: #C7C7C7 white white #C7C7C7;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible }
.moosebutt {
font-family: Arial;
font-size: 12px;
color: #EAF3FA;
text-decoration: none;
float: left;
background-image: url(butaX.jpg);
background-color: #984832;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: white #C7C7C7 #C7C7C7 white;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;}
.moosebutt:hover {
color: #ffffff;
text-decoration: none;
float: left;
background-image: url(butbX.jpg);
background-color: #545231;
text-align: center;
vertical-align: middle;
border-style: solid;
border-width: 1px;
border-color: #C7C7C7 white white #C7C7C7;
top: 10px;
left: 10px;
width:100px;
height:18px;
overflow: visible}
table{width:960px;}
.search{width:500px}
.success{ font-family: Arial;
font-size: 14px;
}
</style> </head>
<body>
<center><table border=0><tr><td valign=top class="th01"></table>
<table>
<tr>
<td valign=top valign="top">
<?php
if (!login()) exit;
?><div style="float: right"><span class="op02 "><a href="{{ table }}_UsersML.php?a=logout">Logout</a></span></div>
<br>
<?php
$conn = connect();
$showrecs = 20;
$pagerange = 10;
$a = @$_GET["a"];
$recid = @$_GET["recid"];
$page = @$_GET["page"];
if (!isset($page)) $page = 1;
$sql = @$_POST["sql"];
switch ($sql) {
case "insert":
sql_insert();
break;
case "update":
sql_update();
break;
case "delete":
sql_delete();
break;
}
switch ($a) {
case "add":
addrec();
break;
case "view":
viewrec($recid);
break;
case "edit":
editrec($recid);
break;
case "del":
deleterec($recid);
break;
default:
select();
break;
}
if (isset($order)) $_SESSION["order"] = $order;
if (isset($ordtype)) $_SESSION["type"] = $ordtype;
if (isset($filter)) $_SESSION["filter"] = $filter;
if (isset($filterfield)) $_SESSION["filter_field"] = $filterfield;
if (isset($wholeonly)) $_SESSION["wholeonly"] = $wholeonly;
mysql_close($conn);
?>
</td></tr></table>
<table ><tr><td valign=top class="hr">
</td></tr></table>
</body>
</html>
<?php function select()
{
global $a;
global $showrecs;
global $page;
global $filter;
global $filterfield;
global $wholeonly;
global $order;
global $ordtype;
if ($a == "reset") {
$filter = "";
$filterfield = "";
$wholeonly = "";
$order = "";
$ordtype = "";
}
$checkstr = "";
if ($wholeonly) $checkstr = " checked";
if ($ordtype == "asc") { $ordtypestr = "desc"; } else { $ordtypestr = "asc"; }
$res = sql_select();
$count = sql_getrecordcount();
if ($count % $showrecs != 0) {
$pagecount = intval($count / $showrecs) + 1;
}
else {
$pagecount = intval($count / $showrecs);
}
$startrec = $showrecs * ($page - 1);
if ($startrec < $count) {mysql_data_seek($res, $startrec);}
$reccount = min($showrecs * $page, $count);
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>Records shown <?php echo $startrec + 1 ?> - <?php echo $reccount ?> of <?php echo $count ?></td></tr>
</table>
<form name="{{ table }}_Users" action="{{ table }}_UsersML.php" method="post">
<table class="search" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><b>Find</b> </td>
<td><input type="text" name="filter" value="<?php echo $filter ?>"></td>
<td>
<select name="filter_field">
<option value="">All Fields</option>
<option value="<?php echo "Id" ?>"<?php if ($filterfield == "Id") { echo "selected"; } ?>><?php echo htmlspecialchars("Id") ?></option>
<option value="<?php echo "First" ?>"<?php if ($filterfield == "First") { echo "selected"; } ?>><?php echo htmlspecialchars("First") ?></option>
<option value="<?php echo "Last" ?>"<?php if ($filterfield == "Last") { echo "selected"; } ?>><?php echo htmlspecialchars("Last") ?></option>
<option value="<?php echo "Username" ?>"<?php if ($filterfield == "Username") { echo "selected"; } ?>><?php echo htmlspecialchars("Username") ?></option>
<option value="<?php echo "Password" ?>"<?php if ($filterfield == "Password") { echo "selected"; } ?>><?php echo htmlspecialchars("Password") ?></option>
<option value="<?php echo "Email" ?>"<?php if ($filterfield == "Email") { echo "selected"; } ?>><?php echo htmlspecialchars("Email") ?></option>
</select>
</td>
<td><nobr><input type="checkbox" name="wholeonly"<?php echo $checkstr ?>>Whole words only</td>
</td>
<td> </td>
<td><input class="moosebutt" type="submit" name="action" value="Search Now"></td>
<td></td>
</tr>
</table>
</form>
<?php showpagenav($page, $pagecount); ?>
<br>
<!--------------------------------------------------------------------------view all table--------------------------------------------------->
<table class="tbl" border="0" cellspacing="1" cellpadding="5">
<tr>
<td valign=top class="hr"> </td>
<td valign=top class="hr"> </td>
<td valign=top class="hr"> </td>
<td valign=top class="hr"><a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "Id" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Id") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "First" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("First") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "Last" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("Last") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "Username" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("Username") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "Password" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("Password") ?></a></td>
<td valign=top class="hr">
<a class="hr" href="{{ table }}_UsersML.php?order=<?php echo "Email" ?>&type=<?php echo $ordtypestr ?>">
<?php echo htmlspecialchars("Email") ?></a></td>
</tr>
<?php
for ($i = $startrec; $i < $reccount; $i++)
{
$row = mysql_fetch_assoc($res);
$style = "dr";
if ($i % 2 != 0) {
$style = "sr";
}
?>
<tr>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}_UsersML.php?a=view&recid=<?php echo $i ?>"><img src="http://mooseloose.com/view.png" border=0 width=20 height=20></a></td>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}_UsersML.php?a=edit&recid=<?php echo $i ?>"><img src="http://mooseloose.com/edit.png" border=0 width=20 height=20></a></td>
<td width=10 valign=top class="<?php echo $style ?>"><a href="{{ table }}_UsersML.php?a=del&recid=<?php echo $i ?>"><img src="http://mooseloose.com/delete.png" border=0 width=20 height=20></a></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Id"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["First"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Last"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Username"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Password"]) ?></td>
<td valign=top class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Email"]) ?></td>
</tr>
<?php
}
mysql_free_result($res);
?>
</table>
<br>
<?php showpagenav($page, $pagecount); ?>
<?php } ?>
<!-- Login Function Begin -->
<?php function login()
{
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
$sql = "select Password from {{ table }}_Users where Username='$login'";
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res) or $row = array(0 => "");;
if (isset($row)) reset($row);
if (isset($password) && ($password == trim(current($row)))) {
$_SESSION["logged_in"] = true;
}
else {
?>
<!-- Login Function End -->
<p><b><font color="-1">Sorry, the login/password combination you've entered is invalid</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name={{ table }}_Users action="{{ table }}_UsersML.php" method="post">
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td>Username</td>
<td><input type="text" name="login" value="<?php echo $login ?>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" value="<?php echo $password ?>"></td>
</tr>
<tr>
<td><input type="submit" name="action" value="Login"></td>
</tr>
</table>
</form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
} ?>
<?php function showrow($row, $recid)
{
?>
<!--------------------------------------------------------------------------View Record Detail------------------>
<table class="tbl" border="0" cellspacing="1" cellpadding="5">
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Id")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Id"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("First")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["First"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Last")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Last"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Username")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Username"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Password")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Password"]) ?></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Email")." " ?></td>
<td valign=top class="dr"><?php echo htmlspecialchars($row["Email"]) ?></td>
</tr>
</tr>
</table>
<?php } ?>
<?php function showroweditor($row, $iseditmode)
{
global $conn;
?>
<!--------------------------------------------Add and Edit Page------------------------------------------------------------->
<table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
<input type="hidden" name="Id" size="55" value="<?php echo str_replace('"', '"', trim($row["Id"])) ?>">
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("First")." " ?></td>
<td valign=top class="dr"><input type="text" name="First" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["First"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Last")." " ?></td>
<td valign=top class="dr"><input type="text" name="Last" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["Last"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Username")." " ?></td>
<td valign=top class="dr"><input type="text" name="Username" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["Username"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Password")." " ?></td>
<td valign=top class="dr"><input type="text" name="Password" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["Password"])) ?>"></td>
</tr>
<tr>
<td valign=top class="detaillabels"><nobr><?php echo htmlspecialchars("Email")." " ?></td>
<td valign=top class="dr"><input type="text" name="Email" maxlength="250" size="55" value="<?php echo str_replace('"', '"', trim($row["Email"])) ?>"></td>
</tr>
</table>
<?php } ?>
<?php function showpagenav($page, $pagecount)
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}_UsersML.php?a=add">Add Record</a> <span class="op02"><a href="{{ table }}_UsersML.php?a=reset">List All Records</a></span></td>
<?php if ($page > 1) { ?>
<td><a href="{{ table }}_UsersML.php?page=<?php echo $page - 1 ?>"><< Prev</a> </td>
<?php } ?>
<?php
global $pagerange;
if ($pagecount > 1) {
if ($pagecount % $pagerange != 0) {
$rangecount = intval($pagecount / $pagerange) + 1;
}
else {
$rangecount = intval($pagecount / $pagerange);
}
for ($i = 1; $i < $rangecount + 1; $i++) {
$startpage = (($i - 1) * $pagerange) + 1;
$count = min($i * $pagerange, $pagecount);
if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) {
for ($j = $startpage; $j < $count + 1; $j++) {
if ($j == $page) {
?>
<td><b><?php echo $j ?></b></td>
<?php } else { ?>
<td><a href="{{ table }}_UsersML.php?page=<?php echo $j ?>"><?php echo $j ?></a></td>
<?php } } } else { ?>
<td><a href="{{ table }}_UsersML.php?page=<?php echo $startpage ?>"><?php echo $startpage ."..." .$count ?></a></td>
<?php } } } ?>
<?php if ($page < $pagecount) { ?>
<td> <a href="{{ table }}_UsersML.php?page=<?php echo $page + 1 ?>">Next >></a> </td>
<?php } ?>
</tr>
</table>
<?php } ?>
<?php function showrecnav($a, $recid, $count)
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}_UsersML.php">Index Page</a>
<?php if ($recid > 0) { ?>
<span class="op02 "><a href="{{ table }}_UsersML.php?a=<?php echo $a ?>&recid=<?php echo $recid - 1 ?>">Prior Record</a>
<?php } if ($recid < $count - 1) { ?>
<span class="op02 "><a href="{{ table }}_UsersML.php?a=<?php echo $a ?>&recid=<?php echo $recid + 1 ?>">Next Record</a></td>
<?php } ?>
</tr>
</table>
<?php } ?>
<?php function addrec()
{
?>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}_UsersML.php">Index Page</a></td>
</tr>
</table>
<form name="{{ table }}_Users" enctype="multipart/form-data" action="{{ table }}_UsersML.php" method="post">
<p><input type="hidden" name="sql" value="insert"></p>
<?php
$row = array(
"Id" => "",
"First" => "" ,
"Last" => "" ,
"Username" => "" ,
"Password" => "" ,
"Email" => ""
);
showroweditor($row, false);
?>
<p><input type="submit" name="action" value="Post"></p>
</form>
<?php } ?>
<?php function viewrec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("view", $recid, $count);
?>
<br>
<?php showrow($row, $recid) ?>
<br>
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><span class="op02 "><a href="{{ table }}_UsersML.php?a=add">Add Record</a>
<span class="op02 "><a href="{{ table }}_UsersML.php?a=edit&recid=<?php echo $recid ?>">Edit Record</a></td>
<td><span class="op02 "><a href="{{ table }}_UsersML.php?a=del&recid=<?php echo $recid ?>">Delete Record</a></td>
</tr>
</table>
<?php
mysql_free_result($res);
} ?>
<?php function editrec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("edit", $recid, $count);
?>
<br>
<form name="{{ table }}_Users" enctype="multipart/form-data" action="{{ table }}_UsersML.php" method="post">
<input type="hidden" name="sql" value="update">
<input type="hidden" name="xId" value="<?php echo $row["Id"] ?>">
<?php showroweditor($row, true); ?>
<p><input type="submit" name="action" value="Post"></p>
</form>
<?php
mysql_free_result($res);
} ?>
<?php function deleterec($recid)
{
$res = sql_select();
$count = sql_getrecordcount();
mysql_data_seek($res, $recid);
$row = mysql_fetch_assoc($res);
showrecnav("del", $recid, $count);
?>
<br>
<form name="{{ table }}_Users" action="{{ table }}_UsersML.php" method="post">
<input type="hidden" name="sql" value="delete">
<input type="hidden" name="xId" value="<?php echo $row["Id"] ?>">
<?php showrow($row, $recid) ?>
<p><input type="submit" name="action" value="Confirm"></p>
</form>
<?php
mysql_free_result($res);
} ?>
<?php function connect()
{
$conn = mysql_connect("{{ host }}", "{{ username }}", "{{ password }}");
mysql_select_db("{{ database }}");
return $conn;
}
function sqlvalue($val, $quote)
{
if ($quote)
$tmp = sqlstr($val);
else
$tmp = $val;
if ($tmp == "")
$tmp = "NULL";
elseif ($quote)
$tmp = "'".$tmp."'";
return $tmp;
}
function sqlstr($val)
{
return str_replace("'", "'", $val);
}
function sql_select()
{
global $conn;
global $order;
global $ordtype;
global $filter;
global $filterfield;
global $wholeonly;
$filterstr = sqlstr($filter);
if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
$sql = "SELECT `Id`,
`First` ,
`Last` ,
`Username` ,
`Password` ,
`Email` FROM `{{ table }}_Users`";
if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
$sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
} elseif (isset($filterstr) && $filterstr!='') {
$sql .= " where
(`Id` like '" .$filterstr ."') or
(`First` like '" .$filterstr ."') or
(`Last` like '" .$filterstr ."') or
(`Username` like '" .$filterstr ."') or
(`Password` like '" .$filterstr ."') or
(`Email` like '" .$filterstr ."') ";
}
if (isset($order) && $order!='') $sql .= " order by `" .sqlstr($order) ."`";
if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype);
$res = mysql_query($sql, $conn) or die(mysql_error());
return $res;
}
function sql_getrecordcount()
{
global $conn;
global $order;
global $ordtype;
global $filter;
global $filterfield;
global $wholeonly;
$filterstr = sqlstr($filter);
if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
$sql = "SELECT COUNT(*) FROM `{{ table }}_Users`";
if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
$sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
} elseif (isset($filterstr) && $filterstr!='') {
$sql .= " where
(`Id` like '" .$filterstr ."') or
(`First` like '" .$filterstr ."') or
(`Last` like '" .$filterstr ."') or
(`Username` like '" .$filterstr ."') or
(`Password` like '" .$filterstr ."') or
(`Email` like '" .$filterstr ."') ";
}
$res = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($res);
reset($row);
return current($row);
}
function sql_insert()
{
global $conn;
global $_POST;
$sql = "insert into `{{ table }}_Users`
(`Id`,
`First` ,
`Last` ,
`Username` ,
`Password` ,
`Email` ) values (
" .sqlvalue(@$_POST["Id"], false).",
" .sqlvalue(@$_POST["First"], true)." ,
" .sqlvalue(@$_POST["Last"], true)." ,
" .sqlvalue(@$_POST["Username"], true)." ,
" .sqlvalue(@$_POST["Password"], true)." ,
" .sqlvalue(@$_POST["Email"], true)." )";
mysql_query($sql, $conn) or die(mysql_error());
}
function sql_update()
{
global $conn;
global $_POST;
$sql = "update `{{ table }}_Users` set
`Id`=" .sqlvalue(@$_POST["Id"], false).",
`First`=" .sqlvalue(@$_POST["First"], true)." ,
`Last`=" .sqlvalue(@$_POST["Last"], true)." ,
`Username`=" .sqlvalue(@$_POST["Username"], true)." ,
`Password`=" .sqlvalue(@$_POST["Password"], true)." ,
`Email`=" .sqlvalue(@$_POST["Email"], true)." where " .primarykeycondition();
mysql_query($sql, $conn) or die(mysql_error());
}
function sql_delete()
{
global $conn;
$sql = "delete from `{{ table }}_Users` where " .primarykeycondition();
mysql_query($sql, $conn) or die(mysql_error());
}
function primarykeycondition()
{
global $_POST;
$pk = "";
$pk .= "(`Id`";
if (@$_POST["xId"] == "") {
$pk .= " IS NULL";
}else{
$pk .= " = " .sqlvalue(@$_POST["xId"], false);
};
$pk .= ")";
return $pk;
}
?>