I want to be able to create a popup window that opens everytime a user logs in. And that window displays all the status of the forms that the user has filled up. I have 3 types of form status. Cancelled, pending, and finished. I want to be able to sort them by date created and by the total number of cancelled and pending forms. How should I do it?
7 1724 code green 1,726
Recognized Expert Top Contributor
You are going to need a database to drive that page.
A simple table should be enough with user ID, name and status.
The user would log on with their details then submit the page.
then a script could verify the input, read the database and display the info back.
You are going to need a database to drive that page.
A simple table should be enough with user ID, name and status.
The user would log on with their details then submit the page.
then a script could verify the input, read the database and display the info back.
Should I just use mysql_num_rows( ) to display and count the number of pending or cancelled transactions?
code green 1,726
Recognized Expert Top Contributor
Should I just use mysql_num_rows( ) to display and count the number of pending or cancelled transactions.
mysql_num_rows( ) returns the number of records returned from a SELECT query.
The most important thing is a good query returning the data needed.
Records can be counted in various ways.
You seem to be only in the planning stage of the whole project at the moment, wheras the number of records is trivial.
Start the DB and form design first.
mysql_num_rows( ) returns the number of records returned from a SELECT query.
The most important thing is a good query returning the data needed.
Records can be counted in various ways.
You seem to be only in the planning stage of the whole project at the moment, wheras the number of records is trivial.
Start the DB and form design first.
I've already done that. I've been working on the project for a few months now. I'm not really an expert in PHP and just needed expert advice.
code green 1,726
Recognized Expert Top Contributor
I've already done that. I've been working on the project for a few months now. I'm not really an expert in PHP and just needed expert advice.
Sorry! Yes it sounds like you need a simple DB table.
Instead of mysql_num_rows( ) you could use COUNT in the query then the recordset returned would be simply a number.
But, as I was trying to drive at, it all depends on your overall design really.
Good luck and please ask again
Sorry! Yes it sounds like you need a simple DB table.
Instead of mysql_num_rows( ) you could use COUNT in the query then the recordset returned would be simply a number.
But, as I was trying to drive at, it all depends on your overall design really.
Good luck and please ask again
Apology accepted. Thanks. Well, what about the date. how do i display it? Say for example, if I put something like 'There are (number) forms pending for approval as of 12/06/2007'?
code green 1,726
Recognized Expert Top Contributor
'There are (number) forms pending for approval as of 12/06/2007'?
Is that June 6 or December 12?
I want to be able to sort them by date created and by the total number of cancelled and pending forms.
How should I do it
- table design of `form_status`
-
with fields of `user_id` INT,`pending` TINYINT,`completed` TINYINT ,`date` DATETIME
You could get all the data and manipulte with code or get the pending/comleted etc seperately.
Lets take the second idea.
[PHP]mysql_connect() etc..
$res = mysql_query(SEL ECT * FROM `form_status` WHERE `pending`
ORDER BY `date` DESC);
$lastEntry = mysql_fetch_ass oc($res);
echo 'There are '.mysql_num_row s($res).' forms pending for approval as of '. date('m/d/Y',strtotime($l astEntry['date'];[/PHP]And then repeat for cancelled etc.
There are other ways of course and my syntax may be out but hopefully this will help
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Eric Osman |
last post by:
Hi,
When I run the following html file on netscape, and the button is
clicked, the new window pops BEHIND all my other windows.
How can I easily fix this html file so the window comes up in front
(like a standard alert window would) ?
Thanks. /Eric
|
by: Randell D. |
last post by:
Folks,
I'm working on a contact name/address database whereby a slimed down list is
shown in the main window. When a record is selected, the complete record is
displayed in a new window via a call to window.open
As opposed to closing and re-opening new windows, I would prefer that when
the user is finished reading the complete record, they can click a link
whereby the main window is sent in to focus.
|
by: Shaun McKinnon |
last post by:
HI...Here's my problem...I have a popup window that loads when i want it to,
but it's not sized properly. I've set the size, but it doesn't seem to
work. I've been on 8 different websites to find out what i'm doing wrong,
and so far it seems i'm doing it the right way. Here's my code...any
suggestions would be appreciated.
<script language="javascript">
<!--
window.open("256fx/index.htm", "", "height=400, width=600");
//-->
|
by: john woo |
last post by:
Hi
if there are 3 selections, named location,department,employee, the
relationshipe is, in a location there are departments, in a department
there are employees, so for a selected location, there should be a set
of associated departments each of which there should be a set of
employees.
I have an example, but only for 2 selections, like
|
by: Jay |
last post by:
I have a situation where the user clicks on a button in a
DataGrid to launch a popup window via javascript. In the
popup window the user does some things that result in
changes to the underlying database the DataGrid is using
as a data source. When the popup window is closed I want
to refresh the main window -- i.e., cause a postback to
happen.
Is this possible?
| |
by: Joe Molloy |
last post by:
Hi,
This isn't a mission critical question but I thought I'dl throw it out there
for your feedback as it's a bit curious.
I have developed a shopping cart for an application I'm working on which is
loosely based on the e-commerce example in the quickstarts tutorial.
In the cart display I have provided functionality so that when a user clicks
on a product name a popup is opened with the full product details displayed.
|
by: Earl Teigrob |
last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at
http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx
but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution.
...
|
by: anthony.turcotte |
last post by:
Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.
Here's the scenario.
1. User accesses pageA.html
2. User clicks on menu link to open popup.html
3. pageA.html checks if popup.html is already open. It is not, open
|
by: RahimAsif |
last post by:
I am writing an application that requires the a portion of the main
menu to be dynamic. The menu has file, panels, view files and help
across the top. The view files sub menu needs to be dynamically
generated, and the dynamic generation needs to occur right when the
user selects this menu item (that is on the Popup event handler).
However, everytime I put following code on the Popup event handler (of
the View Files menuitem) to dynamically...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |