modifying the database

Questions and Answers about the POS Pizza 6 & 7 Databases
Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

modifying the database

Postby jobah » Thu Mar 07, 2013 10:52 am

In your cs version would I have the ability to write custom extensions to the database? Especially for the web side of things. I would like to go in and tweak the ordering process to better suet my needs. If I can extend the database and then access it through something like asp.net that would be awesome. I would love to give my site a unique look and feel that is different than what is just the stock online ordering system. Is there a way that this can be done?

Site Admin
User avatar
Posts: 2090
Joined: Wed Apr 16, 2003 4:35 pm
Location: Western PA

Re: modifying the database

Postby Scott » Thu Mar 07, 2013 1:36 pm

The database is open source, so to answer your question; Yes and No. Yes the data is accessible, but No you can't access it via the POS Pizza DB Server. You would either need to install an ODBC driver for SQLite, or modify the file directly from the server folder.

If you do either and modify the database from its original structure, you are responsible for any outcome. We cannot support issues that arise as a result of changing the database externally. The POS system is expecting things to be a certain way and if those are changed, they can cause unwanted side-effects like bad report data or worse yet, failure of the program modules to operate in some extreme cases.

Scott

Member
User avatar
Posts: 14
Joined: Thu Dec 13, 2012 11:00 am

Re: modifying the database

Postby JohnnyD » Thu Mar 07, 2013 1:38 pm

jobah wrote:In your cs version would I have the ability to write custom extensions to the database? Especially for the web side of things. I would like to go in and tweak the ordering process to better suet my needs. If I can extend the database and then access it through something like asp.net that would be awesome. I would love to give my site a unique look and feel that is different than what is just the stock online ordering system. Is there a way that this can be done?



Have you taken a look at the POS Pizza Online Ordering Docs? I am pretty sure that you could give your site a "unique look and feel" just using HTML and without any custom extensions to the database. The online ordering system is comprised of a group of HTML docs and CGI applets which are on your server. The customers go to the CGI urls and the CGI in turn loads the HTML content, which dynamically changes anything that is needed, and then transmits the page to the customer. The general order process is controlled by the CGI's, so I don't think the order process can change.

But, you do have alot of flexibility in creating additional pages / modifying existing pages. So, if you understand HTML, you can customize the look of each webpage. You can also customize your head/foot pages, generic pages and other single page CGI's with any of the standard output variables shown in the web-developer portion of the Online Ordering docs. Obviously, you do not want to go playing around with the HTML files unless you have a good enough understanding to modify or create new templates, but if you do, this is a good option.

I would suggest taking a quick look at those docs. They should give you a pretty clear understanding on customizing your template.

Hope this helps.

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Thu Mar 07, 2013 1:49 pm

Scott wrote:The database is open source, so to answer your question; Yes and No. Yes the data is accessible, but No you can't access it via the POS Pizza DB Server. You would either need to install an ODBC driver for SQLite, or modify the file directly from the server folder.

If you do either and modify the database from its original structure, you are responsible for any outcome. We cannot support issues that arise as a result of changing the database externally. The POS system is expecting things to be a certain way and if those are changed, they can cause unwanted side-effects like bad report data or worse yet, failure of the program modules to operate in some extreme cases.

Scott



I can work with sqlite and am quite familiar with sql coding. I am assuming that the database in the free version is the same structure as in the full version? I will take a look at that to see how your tables and data is organized and go from there. I have some ideas that I would like to implement online such as member cards for special discounts etc. I am quite capable of doing this as long as it doesn't inhibit the flow of the pos system components.

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Thu Mar 07, 2013 1:54 pm

JohnnyD wrote:Have you taken a look at the POS Pizza Online Ordering Docs? I am pretty sure that you could give your site a "unique look and feel" just using HTML and without any custom extensions to the database. The online ordering system is comprised of a group of HTML docs and CGI applets which are on your server. The customers go to the CGI urls and the CGI in turn loads the HTML content, which dynamically changes anything that is needed, and then transmits the page to the customer. The general order process is controlled by the CGI's, so I don't think the order process can change.

But, you do have alot of flexibility in creating additional pages / modifying existing pages. So, if you understand HTML, you can customize the look of each webpage. You can also customize your head/foot pages, generic pages and other single page CGI's with any of the standard output variables shown in the web-developer portion of the Online Ordering docs. Obviously, you do not want to go playing around with the HTML files unless you have a good enough understanding to modify or create new templates, but if you do, this is a good option.

I would suggest taking a quick look at those docs. They should give you a pretty clear understanding on customizing your template.

Hope this helps.


No, I don't have the full version yet. I would love to have a look at the docs and the cgi files so that I can get the feel of things. I can modify the cgi files to meet my own personal needs along with the html pages themselves. If these cgi files are doing the talking to the db server, I would bet that I can figure out how to add some custom stuff and make it work.

I am quite capable of modifying html files along with a host of other programming related stuff.

Member
User avatar
Posts: 14
Joined: Thu Dec 13, 2012 11:00 am

Re: modifying the database

Postby JohnnyD » Thu Mar 07, 2013 2:37 pm

jobah wrote:No, I don't have the full version yet. I would love to have a look at the docs and the cgi files so that I can get the feel of things. I can modify the cgi files to meet my own personal needs along with the html pages themselves. If these cgi files are doing the talking to the db server, I would bet that I can figure out how to add some custom stuff and make it work.

I am quite capable of modifying html files along with a host of other programming related stuff.


To clarify: I do not think that the CGI's are "modifiable". Don't quote me on that though. I think the way you would customize your website would be by a) modifying the HTML to change the look and feel (this includes images, themes, buttons, text, etc.) and b) referencing any of the desired Standard Output Variables that a CGI provides to the HTML page (customer info, business info, order info, date info, etc.). These available standard output variables offer a ton of flexibility and may be sufficient in your customization.

Hope this helps.

Site Admin
User avatar
Posts: 2090
Joined: Wed Apr 16, 2003 4:35 pm
Location: Western PA

Re: modifying the database

Postby Scott » Fri Mar 08, 2013 8:17 am

jobah wrote:I would love to have a look at the docs and the cgi files so that I can get the feel of things.


I will email the docs to you if you want. Email me first and I will reply to the email address that you email from and attach the docs to the email. There is nothing to see with the CGI files. They are binary compiled files, so they are meaningless to look at. The docs describe each of them and how they are used.

Scott

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Fri Mar 08, 2013 8:50 am

I sent an email.

Another question. Since the cgi files are compiled, do we get the source? How would I go about making changes to them? These would need to be modified to add new features to the system correct?

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Fri Mar 08, 2013 8:56 am

Still another question. I have been looking at the database in the LT version, and understand most of it. The employees table seems to be in some unusual format however. There are 2 columns that are readable and then 3 blocks of unreadable data on that table. The same also seems to be true of the main_cfgs_tbl table. How would I go about deciphering the data contained within these tables?

Site Admin
User avatar
Posts: 2090
Joined: Wed Apr 16, 2003 4:35 pm
Location: Western PA

Re: modifying the database

Postby Scott » Fri Mar 08, 2013 9:50 am

jobah wrote:I sent an email.

Another question. Since the cgi files are compiled, do we get the source? How would I go about making changes to them? These would need to be modified to add new features to the system correct?


We do not provide the source to any of our modules online or otherwise. There is not anything that you would need to modify on the existing CGIs. There is a generic.cgi that is provided to allow you to build any extra pages on your site and link them in where needed. The generic.cgi keeps the customer logged in and does all of the necessary security checking to flow with the rest of the site. An example of this is provided with the RAW template that ships with the online ordering package.

If you want to make your own cgi files they can be done using any compiler that uses stdin/stdout so that it can communicate with the web server properly. Below is a simple source that will "echo" the input back to the output. This would show the incoming form data to the user's web browser "as-is". with no formatting.

Code: Select all
#include <stdio.h>
#include <string.h>

#define BLOCK_SIZE 512

int main(int argc, const char *argv[])
{
   char buffer[BLOCK_SIZE];
   strcpy(buffer,"Content-Type: text/html\n\n");
   fwrite(buffer, sizeof(char), strlen(buffer), stdout);
   for(;;) {
      size_t bytes = fread(buffer,  sizeof(char),BLOCK_SIZE,stdin);
      fwrite(buffer, sizeof(char), bytes, stdout);
      fflush(stdout);
      if (bytes < BLOCK_SIZE)
         if (feof(stdin))
            break;
   }
   return 0;
}


You would need to implement your own security however, and once the user left the included CGIs they will have effectively been logged out from them.

Scott

Site Admin
User avatar
Posts: 2090
Joined: Wed Apr 16, 2003 4:35 pm
Location: Western PA

Re: modifying the database

Postby Scott » Fri Mar 08, 2013 9:54 am

jobah wrote:Still another question. I have been looking at the database in the LT version, and understand most of it. The employees table seems to be in some unusual format however. There are 2 columns that are readable and then 3 blocks of unreadable data on that table. The same also seems to be true of the main_cfgs_tbl table. How would I go about deciphering the data contained within these tables?


You can't.

That data is intentionally encrypted and in a manner that is unique to every single database. The database creation tool randomly generates a unique encryption key and then the data contained within that database uses that key.

This is to prevent someone from downloading the LT version, creating an admin user, exporting the table data for that user, and then importing it into another database to effectively give themselves admin access to any database. This can't be done because each file uses it's own unique encryption key that is 1280 bits long.

These tables do not need to be nor should they be modified outside of the POS system itself.

Scott

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Fri Mar 08, 2013 5:37 pm

I understand and am happy that you all have thought through things such as this. I was just curious as to whether or not I could access that data. I'm not 100% certain of what I would modify at this point, but want to know that I can when the need comes.

Member
Posts: 10
Joined: Wed Feb 27, 2013 2:50 pm

Re: modifying the database

Postby jobah » Fri Mar 08, 2013 5:41 pm

Scott wrote:
Code: Select all
#include <stdio.h>
#include <string.h>

#define BLOCK_SIZE 512

int main(int argc, const char *argv[])
{
   char buffer[BLOCK_SIZE];
   strcpy(buffer,"Content-Type: text/html\n\n");
   fwrite(buffer, sizeof(char), strlen(buffer), stdout);
   for(;;) {
      size_t bytes = fread(buffer,  sizeof(char),BLOCK_SIZE,stdin);
      fwrite(buffer, sizeof(char), bytes, stdout);
      fflush(stdout);
      if (bytes < BLOCK_SIZE)
         if (feof(stdin))
            break;
   }
   return 0;
}



That looks kinda like php.

Site Admin
User avatar
Posts: 2090
Joined: Wed Apr 16, 2003 4:35 pm
Location: Western PA

Re: modifying the database

Postby Scott » Fri Mar 08, 2013 7:14 pm

jobah wrote:That looks kinda like php.


Its C. PHP is based on it as are many other languages.

Scott

Veteran Member
Posts: 177
Joined: Fri Apr 18, 2003 11:50 am
Location: New Jersey

Re: modifying the database

Postby H-Man » Sun May 05, 2013 8:51 am

I think that the system works great "as-is" and doesn't really constitute anyone poking around under the hood to try to eek out a little more performance so to speak.

If the system doesn't offer what you want, then you will need to do one of two things. 1. use it anyway because you realize what you want to add to it isn't all that critical. or 2. buy something else or write your own system since your golden feature doesn't exist in this one.

Remember the old adage: If it ain't broke, then don't fix it!

Return to Database Help and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest