Jump to content

jamesnkk

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by jamesnkk

  1. Hi, can someone enlighten me, on how do I validate a date entry, I have a table with columns - Qty and Recd_date. If user enter a qty > 0, then I need to check if recd_date was enter, If recd_date was not enter I will prompt for an error. I am using php and mysql. Thanks
  2. Thanls, usually are shopping cart program.
  3. Hi, Does anyone know a Sales Inventory system consist of Inventory, Quotation, Purchase Order and Invoice written in PHP and mysql that I can buy off the shelf. Thanks
  4. Thanks for your advise, seem like no choice.
  5. Hi, I am working at home to send email using php , my machine is windows XP Pro, I have a broadband and a Gmail Account, what configuration do I need to setup in my php.ini or other files to enable me to send email ? Thanks Jame Ng
  6. Hi, I have a table consist of 3 columns, the 1st column which I already populate into a drop down list, when the user select the product item from drop down list, It immediately display the price on the 2nd column like an invoice. How can I do it in Php and mysql , any advise from the experts out there . Your contributions and advise is very important to me.
  7. [!--quoteo(post=358982:date=Mar 28 2006, 02:35 AM:name=Levinax)--][div class=\'quotetop\']QUOTE(Levinax @ Mar 28 2006, 02:35 AM) [snapback]358982[/snapback][/div][div class=\'quotemain\'][!--quotec--] here is a function i wrote to query a database and populate a SELECT box based on the results of that query if thats what you're looking for. there are probably better ways of doing it, but i know this one works. one thing i should note, this POSTS the information, and keeps whatever you selected selected. you might want to modify it if thats not what you want to do. and i was using PostgreSQL, so you might need to change some things from there too. [code]function first_form($db, &$location){ //Getting the data from Postgres table for first list box $quer1="SELECT DISTINCT location FROM info"; $result1 = pg_query($db, $quer1); $rows1 = pg_num_rows($result1); $location = $_POST["loc"]; //creat first form echo "<form method=POST name=f1 action=$PHP_SELF>"; echo "<select name=loc onchange=\"Javascript:submit()\"><option value=\"\">Location</option>"; for($i = 0; $i < $rows1; $i++) {         $results1 = pg_fetch_array($result1, NULL, PGSQL_ASSOC);         if($results1[location] == $location)         {                 echo "<option selected value=$location>$location</option>";         }         else         {                 echo "<option value=\"$results1[location]\">$results1[location]</option>";         } } echo "</select>"; } [/code] [/quote] Thank so much for your coding , I will try as I am using mysql and php
  8. [!--quoteo(post=358796:date=Mar 27 2006, 03:55 PM:name=shortj75)--][div class=\'quotetop\']QUOTE(shortj75 @ Mar 27 2006, 03:55 PM) [snapback]358796[/snapback][/div][div class=\'quotemain\'][!--quotec--] are you asking how to input the data into the data base if so [code] $item=$_POST['item']; $price=$_POST['price']; $quantity=$_POST['quantity']; mysql_query("insert into your_table(item,price,quantity)values('$item','$price'.'$quantity')) or die("couldnt insert"); [/code] have you form point to the page you put this code on and change all the variables to the correct names [/quote] Thanks for your prompt reply, what I actually asking is how do I design the Invoice form entry using table, which can increment the row when adding a new item into it. Sorry I am just a newbies, hope you get me right.
  9. Hi, can anyone show me, how can I populate data into the drop down menu. Example I want to display all the customer name in the drop down menu, so when the user selected the customer name, I could also capture the cust id together with the customer name into another table.
  10. [!--quoteo(post=358756:date=Mar 27 2006, 11:25 AM:name=micah1701)--][div class=\'quotetop\']QUOTE(micah1701 @ Mar 27 2006, 11:25 AM) [snapback]358756[/snapback][/div][div class=\'quotemain\'][!--quotec--] what method are you using to re-populate the text field? if your are just echoing the posted values (value="<? echo $_POST['value'] ?>") then for the drop down just do: <select name="dropdown"> <option value="option1" <? if($_POST['dropdown'] == 'option1'){ echo "selected"; } ?>> Option 1 </option> <option value="option2" <? if($_POST['dropdown'] == 'option2'){ echo "selected"; } ?>> Option 2 </option> <option value="option3" <? if($_POST['dropdown'] == 'option3'){ echo "selected"; } ?>> Option 3 </option> </select> get the idea? [/quote] Thanks for the prompt reply, here the code to populate from a table on form-1(create_partno.php) <select name="aid" id="aid" size="1"> <option selected value="">Please select</option> <? while ($company = mysql_fetch_array($companys) ) { $aid=$company['company']; $aname=htmlspecialchars($company['company']); echo "<option value='$aid'>$aname</option>\n"; } ?> </select> Then on the 2nd form (create_part.php) I use header to return, - header("Location: create_partno.php?part_no=".$_POST['part_no']."&supp_partno=".$_POST['supp_partno']."&part_desp=".$_POST['part_desp'] ."&cost_price=".$_POST['cost_price']."&sell_price=".$_POST['sell_price'] ."&brand=".$_POST['brand']."&package=".$_POST['package']."&qty_bal=".$_POST['qty_bal'] ."$aid=".$_POST[aid] ."&qty_order=".$_POST['qty_order']."&re_order=".$_POST['re_order']."&error=".$_POST['error'].$error1 ); When return to form-1, Just could not retain the selected value from the drop down menu,
  11. Hi, I have an entry form that contain some text entry and one drop down menu which I retrieve the data from a table. The problem is when I click the submit button, It go to the 2nd form to validate for error, if error it will return to the entry form, I could manage to retain all text entry, so that user donlt have to re-type all over again. But I cannot retain the selected item from a drop down menu, is there a way ?, please help me. Thanks
  12. [!--quoteo(post=358628:date=Mar 27 2006, 04:03 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 27 2006, 04:03 AM) [snapback]358628[/snapback][/div][div class=\'quotemain\'][!--quotec--] Invoicing systems I have used have had two tables viz. invoice and invoice_item invoice [code]invoice_number(PK) | invoice_date | cust_id(FK) |[/code] invoice_item [code]invoice_number(FK) | item_id(PK) | prod_id(FK) |  qty |  price |[/code] Produce the invoice by joining these table and also joining with customer and product tables [/quote] How do I construct an Invoice Entry ?
  13. [!--quoteo(post=358608:date=Mar 27 2006, 03:10 AM:name=shortj75)--][div class=\'quotetop\']QUOTE(shortj75 @ Mar 27 2006, 03:10 AM) [snapback]358608[/snapback][/div][div class=\'quotemain\'][!--quotec--] are you goping to be useing a mysql or some other database [/quote] Yes, I am using MySQL [!--quoteo(post=358610:date=Mar 27 2006, 03:13 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 27 2006, 03:13 AM) [snapback]358610[/snapback][/div][div class=\'quotemain\'][!--quotec--] Is this for an online store, or for an intranet app? [/quote] An intranet Application
  14. Hi, How can I create an Invoice entry using PHP, I know it involve with table, but I have no idea, Or is it possible to create using PHP, I know MS Access can be easily done. The Invoice columns have a product Item, desp qty, cost and Total Amount. It can allow me to select from the drop down menu to select the product item store in my table and then dispay the price on the 2nd column, while it compute the Total amount on the last column. It allow me to increment a new row for another new item or I can return to the previous row to edit. I have trying searching the web, could't find any information about invoice. Is there such a script nor any expert out here, can give advise on how to construct an Invoice Entry. Thanks for your patience reading my post.
  15. [!--quoteo(post=357245:date=Mar 22 2006, 07:17 PM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Mar 22 2006, 07:17 PM) [snapback]357245[/snapback][/div][div class=\'quotemain\'][!--quotec--] Six of one half a dozen of the other. Personally I don't like microsoft or their failure to adhere to widely accepted standards, so I stay out of ASP whenever I can help it, but each language has its own ups and downs. As for your delima, you never passed the information back to the page. You simply told it to go to page just the same as the first time you went to the page the form was blank because there was no data being submitted. You can still use the same format you have now and have everything you want, but you will need to setup a way to pass variables back to the page (URL or by some type of cookie possibly). Once you get them back to the page you will need to make them the default value of their respected field. [code]<?php header("Location: form.php?field1=".$_POST['field1']."&field2=".$_POST['field2']); ?>[/code] [code]<input type="text" value="<?php echo $_GET['field1']; ?>" id="field1" name="field1" />[/code] This is just one of several options. I hope this gives you some ideas and points you in the right direction. Micah, is once again right though. His suggestions are excellent and will work adequately. His last suggestion about using a single file for both form and processing script would be my natural first choice. I only point out this other method for your benefit. EDIT: I almost forgot...for errors you could pass error via the url back to the form page and then of the form page if $error != "" echo $error... [/quote] Thanks so much for your help and the sample code your provided is very important to me, as a newbies myself, I can understand more by looking at the actual code you provided.
  16. [!--quoteo(post=357075:date=Mar 22 2006, 04:26 AM:name=micah1701)--][div class=\'quotetop\']QUOTE(micah1701 @ Mar 22 2006, 04:26 AM) [snapback]357075[/snapback][/div][div class=\'quotemain\'][!--quotec--] ah, the old PostBack problem. you could use .NET and its forms that runat="server" but this is a php forum so thats no good. that leaves two options. 1) use AJAX. On submit, use javascript's XMLHTTPRequest to submit the form to your submit page and return true or false if the data validates. if it does, then great - everything worked and you can forward the user to the confirmation page. If it returns false, prompt with the error. 2) don't use a seperate page for of PHP to process your form. Instead, do all the PHP Processing at the top of your page that has the form. When the user hits submit, the data is submitted back to the same page and is parsed by the PHP script at the top. If everything validates, then use your header() to forward to the confirmation page. If not, then echo the error - as the page reloads, the HTML part of the page (with your form) will also display again. Since the page being displayed contains all the $_POST data that was sent, simply set the value="" of each form field to echo the posted data. (ie: name="field1" value="<? echo $field1 ?>") [/quote] Hi thanks for your advise, are you saying if I were to use asp.net it could be much more easy ? Thanks anyway
  17. Hi, I have an entry form, after user click the submit button, it goes to the 2nd form to validate and query the table if data is exist or not. The problem arise here - when the query result show that the data is exist in the table, I use the header to return to the form, but when return, the form entry is all blank, I doesn't want to show blank and also like to display an error message to indciate an eror was detected. How can I achieve in doing that ? Please help me. Thanks in advance to all expert out there.
  18. Is it possible in PHP, where the user filled up the entry form and click the submit button, which use the 2nd form to query from the table to see if data is duplicate, if data is not duplicate then update into the table, but if duplicate it re-driect back to the form where the previous text entry still displayed on the form and then indicate an error message on the form. I tried use header to return to the form, but all the text entry is empty and I can't display error message. Please help.
  19. [!--quoteo(post=355614:date=Mar 17 2006, 02:33 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 17 2006, 02:33 AM) [snapback]355614[/snapback][/div][div class=\'quotemain\'][!--quotec--] You can do this both ways. 1) You can have them enter a part number and give them a button. The button submits the form and either takes them to a second form where they fill in additional information about the part to be submitted for insertion, or it takes them to a page that says the part already exists. 2) Same as above, but you use AJAX to return the results. If you don't understand what AJAX is, check out www.ajaxfreaks.com (a sister site of phpfreaks). It's a javascript call that can run a PHP script that will return data to a specified area of your page without reloading the page. I'd personally go with AJAX, but it requires the user to have Javascript enabled to use the functionality of the site. [/quote] Thank for the advises, well consider
  20. [!--quoteo(post=355599:date=Mar 17 2006, 01:55 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 17 2006, 01:55 AM) [snapback]355599[/snapback][/div][div class=\'quotemain\'][!--quotec--] That can only be done via Javascript and AJAX. Ken [/quote] Ken, Thank for your fast response, do you mean I can only use javascript to query the table ?, and not possible in PHP ?
  21. Hi, I am a newbies here, just started learning PHP, Could not find an answer to my requirement, hope some experts can offer help. Here I have an entry from for entering Part numbers, description, price and qty so on... So when a user enter a part number, I would want to immediate check if this part numbers already exist before the user click the submit button to post.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.