Hi guys,
I need a favor. I am creating my data-driven website using a freeware called phpMyEdit. The site for this tool is at:
This freeware helped me to create mySql tables and then the php pages for my website, thus making my job as a non-programmer person easier. Now I have successfullly created my php pages and they can link to my mysql database running on Webmin. When users access my php pages, they can also add, view, change, copy and delete records which are the five basic functions by default from phpMyEdit.
On to my problem. I have created five tables and subsequently five php pages. They are namely Customer. Supplier, Products, SalesDetails and SalesOrders tables. Now just take a look at say SalesDetails.php.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SalesDetails</title>
<style type="text/css">
table { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
th { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
td { border: #004d9c 1px solid; padding: 3px; }
hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
</style>
</head>
<body>
<?php
/
IMPORTANT NOTE: This generated file contains only a subset of huge amount
of options that can be used with phpMyEdit. To get information about all
features offered by phpMyEdit, check official documentation. It is available
online and also for download on phpMyEdit project management page:
http://www.platon.sk/projects/main_page.php?project_id=5
/
// MySQL host name, user name, password, database, and table
$opts['hn'] = 'localhost';
$opts['un'] = 'daniel';
$opts['pw'] = 'dck';
$opts['db'] = 'mygifts';
$opts['tb'] = 'SalesDetails';
// Name of field which is the unique key
$opts['key'] = 'SalesDetails_id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int';
// Sorting field(s)
$opts['sort_field'] = array('SalesDetails_id');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = 15;
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'ACPVDF';
// Number of lines to display on multiple selection filters
$opts['multiple'] = '4';
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'DB';
// Display special page elements
$opts['display'] = array(
'query' => true,
'sort' => true,
'time' => true
);
/ Get the user's default language and use it if possible or you can
specify particular one you want to use. Refer to official documentation
for list of available languages. /
$opts['language'] = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
/* Table-level filter capability. If set, it is included in the WHERE clause
of any generated SELECT statement in SQL query. This gives you ability to
work only with subset of data from table.
$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "Table0.sessions_count > 200";
*/
/* Field definitions
Fields will be displayed left to right on the screen in the order in which they
appear in generated list. Here are some most used field options documented.
['name'] is the title used for column headings, etc.;
['maxlen'] maximum length to display add/edit/search input boxes
['trimlen'] maximum length of string content to display in row listing
['width'] is an optional display width specification for the column
e.g. ['width'] = '100px';
['mask'] a string that is used by sprintf() to format field output
['sort'] true or false; means the users may sort the display on this column
['strip_tags'] true or false; whether to strip tags from content
['nowrap'] true or false; whether this field should get a NOWRAP
['required'] true or false; if generate javascript to prevent null entries
['select'] T - text, N - numeric, D - drop-down, M - multiple selection
['options'] optional parameter to control whether a field is displayed
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view
Another flags are:
R - indicates that a field is read only
W - indicates that a field is a password field
H - indicates that a field is to be hidden and marked as hidden
['URL'] is used to make a field 'clickable' in the display
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff';
['URLtarget'] HTML target link specification (for example: _blank)
['textarea']['rows'] and/or ['textarea']['cols']
specifies a textarea is to be used to give multi-line input
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10
['values'] restricts user input to the specified constants,
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99)
['values']['table'] and ['values']['column'] restricts user input
to the values found in the specified column of another table
['values']['description'] = 'desc_column'
The optional ['values']['description'] field allows the value(s) displayed
to the user to be different to those in the ['values']['column'] field.
This is useful for giving more meaning to column values. Multiple
descriptions fields are also possible. Check documentation for this.
*/
$opts['fdd']['SalesDetails_id'] = array(
'name' => 'SalesDetails ID',
'select' => 'T',
'options' => 'AVCPDR',
'maxlen' => 4,
'default' => '0',
'sort' => true
);
$opts['fdd']['Company'] = array(
'name' => 'Company',
'select' => 'T',
'maxlen' => 40,
'sort' => true
);
$opts['fdd']['DateOfPurchase'] = array(
'name' => 'DateOfPurchase',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['Product'] = array(
'name' => 'Product',
'select' => 'T',
'maxlen' => 100,
'sort' => true
);
$opts['fdd']['Logo'] = array(
'name' => 'Logo',
'select' => 'T',
'maxlen' => 40,
'sort' => true
);
$opts['fdd']['Quantity'] = array(
'name' => 'Quantity',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);
$opts['fdd']['UnitPrice'] = array(
'name' => 'UnitPrice',
'select' => 'T',
'maxlen' => 12,
'sort' => true
);
$opts['fdd']['TotalAmount'] = array(
'name' => 'TotalAmount',
'select' => 'T',
'maxlen' => 12,
'sort' => true
);
$opts['fdd']['PaymentStatus'] = array(
'name' => 'PaymentStatus',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['Remarks'] = array(
'name' => 'Remarks',
'select' => 'T',
'maxlen' => 100,
'sort' => true
);
// Now important call to phpMyEdit
require_once 'phpMyEdit.class.php';
new phpMyEdit($opts);
?>
</body>
</html>
Interesting isn't it? Well that's the wonder of this program and it helps me a lot as a non-technical guy trying to create a small customer relationship management web-enabled database for my company adminstrative staff.
First you would have to create a database filled with sales details information before you can run SalesDetails.php successfully. After SalesDetails.php runs successfully, you would notice that you can tell who's the customers that buy something from me on a certain date. But i can't click on the customer name, in this case called company. I don't have a hyperlink that lets me view the full details(things like contact info) that form the data in the Customer table. This is the tricky part. I don't want to just view sales details for a particular day or month, i want to be able to, still inside SalesDetails.php, click the name of a company aka customer to see his details. Now how do i go about doing that in phpMyEdit? If phpMyEdit can't help with that and i'd have to come out with my own php code, how do i write that code? Or is there any other tool that can help me to incorporate the code i want into phpMyEdit?
Your input in this matter is highly regarded. I know it's tough to help me out here 'coz you would have to go to the phpMyEdit website to read up on what this freeware is all about. But i can promise you it's all worth it. And also i'd really appreciate your help. Thanks and God bless you.