First commit of biketree to github!

This commit is contained in:
Jonathan Rosenbaum
2017-09-05 03:39:54 +00:00
commit 8ca61d45eb
175 changed files with 24173 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
<?php session_start();
include ("../settings.php");
include("../language/$cfg_language");
include ("../classes/db_functions.php");
include ("../classes/display.php");
include ("../classes/security_functions.php");
$lang=new language();
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
$sec=new security_functions($dbf,'Sales Clerk',$lang);
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
if(isset($_GET['generateWith']))
{
$generateWith=$_GET['generateWith'];
}
else
{
$generateWith='id';
}
$display->displayTitle("$lang->customersBarcode"." ($generateWith)");
echo "<a href='customers_barcode.php?generateWith=account_number'>$lang->accountNumber</a> / <a href='customers_barcode.php?generateWith=id'>id</a>";
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit();
}
$customers_table=$cfg_tableprefix.'customers';
$result=mysql_query("SELECT * FROM $customers_table ORDER by last_name",$dbf->conn);
echo '<table border=0 width=85% align=center cellspacing=5 cellpadding=12>
<tr>';
$counter=0;
while($row=mysql_fetch_assoc($result))
{
if($counter%2==0)
{
echo '</tr><tr>';
}
echo "<td align='center'><img src='../classes/barcode.php?barcode=$row[$generateWith]&width=227&text=*$row[last_name], $row[first_name]*'></td>";
$counter++;
}
echo '</tr></table>';
$dbf->closeDBlink();
?>
+15
View File
@@ -0,0 +1,15 @@
[10-Mar-2017 00:43:46 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:43:48 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:43:51 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:44:28 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:44:28 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:44:31 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:44:33 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:56:19 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:56:25 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:56:30 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:57:44 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:57:44 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 00:57:47 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 01:05:43 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
[10-Mar-2017 01:07:10 America/Toronto] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/variousa/public_html/pos/classes/db_functions.php on line 24
+102
View File
@@ -0,0 +1,102 @@
<?php session_start(); ?>
<html>
<head>
</head>
<body>
<?php
include ("../settings.php");
include("../language/$cfg_language");
include ("../classes/db_functions.php");
include ("../classes/security_functions.php");
include ("../classes/form.php");
include ("../classes/display.php");
$lang=new language();
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
$sec=new security_functions($dbf,'Sales Clerk',$lang);
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit();
}
//set default values, these will change if $action==update.
$first_name_value='';
$last_name_value='';
$account_number_value='';
$phone_number_value='';
$email_value='';
$street_address_value='';
$comments_value='';
$id=-1;
//decides if the form will be used to update or add a user.
if(isset($_GET['action']))
{
$action=$_GET['action'];
}
else
{
$action="insert";
}
//if action is update, sets variables to what the current users data is.
if($action=="update")
{
$display->displayTitle("Update a Member");
if(isset($_GET['id']))
{
$id=$_GET['id'];
$tablename = "$cfg_tableprefix".'customers';
$result = mysql_query("SELECT * FROM $tablename WHERE id=\"$id\"",$dbf->conn);
$row = mysql_fetch_assoc($result);
$first_name_value=$row['first_name'];
$last_name_value=$row['last_name'];
$account_number_value=$row['account_number'];
$phone_number_value=$row['phone_number'];
$email_value=$row['email'];
$street_address_value=$row['street_address'];
$comments_value=$row['comments'];
}
}
else
{
$display->displayTitle("Add a Member");
}
//creates a form object
$f1=new form('process_form_customers.php','POST','customers','450',$cfg_theme,$lang);
//creates form parts.
$f1->createInputField("<b>$lang->firstName:</b> ",'text','first_name',"$first_name_value",'24','150');
$f1->createInputField("<b>$lang->lastName:</b> ",'text','last_name',"$last_name_value",'24','150');
$f1->createInputField("$lang->accountNumber: ",'text','account_number',"$account_number_value",'24','150');
$f1->createInputField("<b>$lang->phoneNumber</b> ",'text','phone_number',"$phone_number_value",'24','150');
$f1->createInputField("$lang->email:",'text','email',"$email_value",'24','150');
$f1->createInputField("$lang->streetAddress:",'text','street_address',"$street_address_value",'24','150');
$f1->createInputField("$lang->commentsOrOther:",'text','comments',"$comments_value",'40','150');
//sends 2 hidden varibles needed for process_form_users.php.
echo "
<input type='hidden' name='action' value='$action'>
<input type='hidden' name='id' value='$id'>";
$f1->endForm();
$dbf->closeDBlink();
?>
</body>
</html>
+57
View File
@@ -0,0 +1,57 @@
<?php session_start();
include ("../settings.php");
include("../language/$cfg_language");
include ("../classes/db_functions.php");
include ("../classes/security_functions.php");
$lang=new language();
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
$sec=new security_functions($dbf,'Sales Clerk',$lang);
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit();
}
$tablename = $cfg_tableprefix.'users';
$auth = $dbf->idToField($tablename,'type',$_SESSION['session_user_id']);
$first_name = $dbf->idToField($tablename,'first_name',$_SESSION['session_user_id']);
$last_name= $dbf->idToField($tablename,'last_name',$_SESSION['session_user_id']);
$today = date("Y-m-d");
if($auth=="Sales Clerk"){
if(!$sec->isOpen()){
header("location: ../books/openshop.php");
exit();
}
}
echo "
<html>
<body>
<head>
</head>
<table border=\"0\" width=\"500\">
<tr>
<td><img border=\"0\" src=\"../images/customers.gif\" width=\"41\" height=\"33\" valign='top'><font color='#005B7F' size='4'>&nbsp;<b>Members</b></font><br>
<br>
<font face=\"Verdana\" size=\"2\">Welcome to the Members panel! Here you can manage our members database. What would you like to do?</font>
<ul>
<li><font face=\"Verdana\" size=\"2\"><a href=\"../members/add.php?action=insert\">New Member</a></font></li>
<li><font face=\"Verdana\" size=\"2\"><a href=\"manage_customers.php\">Edit or remove Members</a></font></li>
<br /><br />
<li><font face=\"Verdana\" size=\"2\"><a href=\"customers_barcode.php\">Member Barcode Sheet (don't even bother...)</a></font></li>
</ul>
</td>
</tr>
</table>
</body>
</html>";
$dbf->closeDBlink();
?>
+74
View File
@@ -0,0 +1,74 @@
<?php session_start(); ?>
<html>
<head>
<SCRIPT LANGUAGE="Javascript">
<!---
function decision(message, url)
{
if(confirm(message) )
{
location.href = url;
}
}
// --->
</SCRIPT>
</head>
<body>
<?php
include ("../settings.php");
include ("../language/$cfg_language");
include ("../classes/db_functions.php");
include ("../classes/security_functions.php");
include ("../classes/display.php");
include ("../classes/form.php");
$lang=new language();
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
$sec=new security_functions($dbf,'Sales Clerk',$lang);
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit();
}
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
$display->displayTitle("Manage Members");
$f1=new form('manage_customers.php','POST','customers','450',$cfg_theme,$lang);
$f1->createInputField("<b>$lang->searchForCustomer</b>",'text','search','','24','150');
$option_values2=array('first_name','last_name','account_number','id');
$option_titles2=array("$lang->firstName","$lang->lastName","$lang->accountNumber",'ID');
$f1->createSelectField("<b>$lang->searchBy</b>",'searching_by',$option_values2,$option_titles2,100);
$f1->endForm();
$tableheaders=array("$lang->rowID","$lang->lastName","$lang->firstName","$lang->phoneNumber","$lang->email","$lang->streetAddress","Update/Edit Member","Remove Member","Get User Info/Records");
$tablefields=array('id','last_name','first_name','phone_number','email','street_address');
if(isset($_POST['search']))
{
$search=$_POST['search'];
$searching_by =$_POST['searching_by'];
echo "<center>$lang->searchedForItem: <b>$search</b> $lang->searchBy <b>$searching_by</b></center>";
$display->displayManageTable("$cfg_tableprefix",'customers',$tableheaders,$tablefields,"$searching_by","$search",'last_name');
}
else
{
$display->displayManageTable("$cfg_tableprefix",'customers',$tableheaders,$tablefields,'','','last_name');
}
$dbf->closeDBlink();
?>
</body>
</html>
+111
View File
@@ -0,0 +1,111 @@
<?php session_start(); ?>
<html>
<head>
</head>
<body>
<?php
include ("../settings.php");
include ("../language/$cfg_language");
include ("../classes/db_functions.php");
include ("../classes/security_functions.php");
//creates 3 objects needed for this script.
$lang=new language();
$dbf=new db_functions($cfg_server,$cfg_username,$cfg_password,$cfg_database,$cfg_tableprefix,$cfg_theme,$lang);
$sec=new security_functions($dbf,'Sales Clerk',$lang);
//checks if user is logged in.
if(!$sec->isLoggedIn())
{
header ("location: ../login.php");
exit ();
}
//variables needed globably in this file.
$tablename="$cfg_tableprefix".'customers';
$field_names=null;
$field_data=null;
$id=-1;
//checks to see if action is delete and an ID is specified. (only delete uses $_GET.)
if(isset($_GET['action']) and isset($_GET['id']))
{
$action=$_GET['action'];
$id=$_GET['id'];
}
//checks to make sure data is comming from form ($action is either delete or update)
elseif(isset($_POST['first_name']) and isset($_POST['last_name']) and isset($_POST['account_number'])
and isset($_POST['phone_number']) and isset($_POST['email']) and isset($_POST['street_address']) and isset($_POST['comments']) and isset($_POST['id']) and isset($_POST['action']) )
{
$action=$_POST['action'];
$id = $_POST['id'];
//gets variables entered by user.
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$account_number = $_POST['account_number'];
$phone_number = $_POST['phone_number'];
$email = $_POST['email'];
$street_address = $_POST['street_address'];
$comments = $_POST['comments'];
//insure all fields are filled in.
if($first_name=='' or $last_name=='' or $phone_number=='')
{
echo "$lang->forgottenFields";
exit();
}
else
{
$field_names=array('first_name','last_name','account_number','phone_number','email','street_address','comments');
$field_data=array("$first_name","$last_name","$account_number","$phone_number","$email","$street_address","$comments");
}
}
else
{
//outputs error message because user did not use form to fill out data.
echo "$lang->mustUseForm";
exit();
}
switch ($action)
{
//finds out what action needs to be taken and preforms it by calling methods from dbf class.
case $action=="insert":
$dbf->insert($field_names,$field_data,$tablename,true);
break;
case $action=="update":
$dbf->update($field_names,$field_data,$tablename,$id,true);
break;
case $action=="delete":
$dbf->deleteRow($tablename,$id);
break;
default:
echo "$lang->noActionSpecified";
break;
}
$dbf->closeDBlink();
?>
<br>
<a href="manage_customers.php">Manage Members--></a>
<br>
<a href="../biketree/users/add.php?action=insert">Add a New Member--></a>
</body>
</html>