Jump to content

jamesnkk

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jamesnkk's Achievements

Member

Member (2/5)

0

Reputation

  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.
×
×
  • 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.