Jump to content

klpang

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by klpang

  1. I have created a 2 dimension array just coding, when pass to action, it just pass vas[] value only by using $_POST[vas], the rest value does not pass into again. Please help me to point out what is error. Please refer attachment for the coding part. Thanks in advance. [attachment deleted by admin]
  2. $sql2 = "SELECT group_concat(vas) as vas from woservice WHERE workorderID = '$workorderID'"; $result2 = mysql_query($sql2) or die (mysql_error()); $row2 = mysql_fetch_array($result2); $package=explode(",", $row2["vas"]); $sqlvas = "SELECT * FROM vas ORDER BY vasname"; $resultvas = mysql_query($sqlvas); $rowvas = mysql_fetch_array($resultvas); do { $sqltest3 = "SELECT * FROM woservice WHERE workorderID = '$workorderID' AND vas='$package[$i]'"; $resulttest3 = mysql_query($sqltest3); $rowtest3 = mysql_fetch_array($resulttest3); ?> <INPUT TYPE="checkbox" NAME="vas[]" VALUE="<?php echo $rowvas["vasID"]; ?>" <?php for ($i=0; $i<count($package); $i++) { if ($package[$i] == $rowtest3["vasID"] ) { print 'checked'; } }?>><FONT CLASS="normalText"> <?php echo $rowvas["vasname"]; ?> (<?php echo $rowvas["price"]; ?>)</FONT><INPUT TYPE="text" NAME="vasDate[<?php echo $rowvas["vasID"]; ?>]" MAXLENGTH="10" SIZE="15" ONBLUR=javascript:isDate(this.value); <?php if ($rowtest3) {?> value="<?php printf ($rowtest3["vasstartdate"]); ?>"<?php } ?>> <FONT CLASS="normalText">(dd-mm-yyyy)</FONT><BR><FONT CLASS="UserSort">Remark</FONT> <TEXTAREA COLS="30" ROWS="3" NAME="vasremark[<?php echo $rowvas["vasID"]; ?>]"><?php echo $rowtest3["vasremark"]; ?></TEXTAREA><BR> <?php } while ($rowvas = mysql_fetch_array($resultvas)) Thanks for the previous code. Currently, when the check box is checked, the date and the remark doesn't show. Or missing for loop for the package? Please advise where is the erorr.
  3. I have some dynamic checkboxes and corresponding textboxes. After input into table. How do show which check box has been check. $sqltest3 = "SELECT * FROM woservice WHERE workorderID = '$workorderID' AND vas='$id'"; $resulttest3 = mysql_query($sqltest3); $rowtest3 = mysql_fetch_array($resulttest3); $sqlvas = "SELECT * FROM vas ORDER BY vasname"; $resultvas = mysql_query($sqlvas); $rowvas = mysql_fetch_array($resultvas); do { ?> <INPUT TYPE="checkbox" NAME="vas[]" VALUE="<?php echo $rowvas["vasID"]; ?>" <?php for ($i=0; $i<count($package); $i++) { if ($package[$i] == $rowtest3["vasID"] ) { print 'checked'; } }?>><FONT CLASS="normalText"> <?php echo $rowvas["vasname"]; ?> (<?php echo $rowvas["price"]; ?>)</FONT><INPUT TYPE="text" NAME="vasDate[<?php echo $rowvas["vasID"]; ?>]" MAXLENGTH="10" SIZE="15" ONBLUR=javascript:isDate(this.value); <?php if ($rowtest3) {?> value="<?php printf ($rowtest3["vasstartdate"]); ?>"<?php } ?>> <FONT CLASS="normalText">(dd-mm-yyyy)</FONT><BR><FONT CLASS="UserSort">Remark</FONT> <TEXTAREA COLS="30" ROWS="3" NAME="vasremark[<?php echo $rowvas["vasID"]; ?>]"><?php echo $rowtest3["vasremark"]; ?></TEXTAREA><BR> <?php //} } while ($rowtest3 = mysql_fetch_array($resulttest3)) After edit, how do it pass the value to next page. Please advise.
  4. Dear Sasa, Please ignore previous reply. i already find a way to validate the txtdate and successful insert into tables individually. if need to edit, how do i know which package is has been checked by customer and the date text box and remark textarea will also will display information. $sql2 = "SELECT group_concat(vas) as vas from woservice WHERE workorderID = '$workorderID'"; print $sql2; $result2 = mysql_query($sql2) or die (mysql_error()); $row2 = mysql_fetch_array($result2); $package=explode(",", $row2["vas"]); <?php $sqlvas = "SELECT * FROM vas ORDER BY vasname"; $resultvas = mysql_query($sqlvas); $rowvas = mysql_fetch_array($resultvas); ?> <TR> <TD><?php IF ($rowvas) { DO { ?> <INPUT TYPE="checkbox" NAME="vas[]" VALUE="<?php echo $rowvas["vasID"]; ?>"><FONT CLASS="normalText"> <?php echo $rowvas["vasname"]; ?> (<?php echo $rowvas["price"]; ?>)</FONT><INPUT TYPE="text" NAME="vasDate[<?php echo $rowvas["vasID"]; ?>]" MAXLENGTH="10" SIZE="15" ONBLUR=javascript:isDate(this.value);> <FONT CLASS="normalText">(dd-mm-yyyy)</FONT><BR><FONT CLASS="UserSort">Remark</FONT> <TEXTAREA COLS="30" ROWS="3" NAME="vasremark[<?php echo $rowvas["vasID"]; ?>]"></TEXTAREA><BR> <?php } while ($rowvas = mysql_fetch_array($resultvas)); }?> </TD> </TR> Thanks in advance.
  5. Thanks a lot. it solve partial of the problem. How should i to validate the txtdate by validate with javascript after click the submit button. Please advise.
  6. I have some dynamic checkboxes and corresponding textboxes. <?php $sqlvas = "SELECT * FROM vas ORDER BY vasname"; $resultvas = mysql_query($sqlvas); $rowvas = mysql_fetch_array($resultvas); ?> <TR> <TD><?php IF ($rowvas) { DO { ?> <INPUT TYPE="checkbox" NAME="vas[]" VALUE="<?php echo $rowvas["vasID"]; ?>"><FONT CLASS="normalText"> <?php echo $rowvas["vasname"]; ?> (<?php echo $rowvas["price"]; ?>)</FONT><INPUT TYPE="text" NAME="txtDate[]" MAXLENGTH="10" SIZE="15"><BR> <?php } while ($rowvas = mysql_fetch_array($resultvas)); }?> When a user ticks a checkbox and enters data into the corresponding textbox and submits, the value of the checkbox and textbox should be inserted into the database. I can insert the checkbox values perfectly, but the textbox values have issues. How to match the textbox and check has been checked and insert into database after post it to next page? Does it will involve javascript to handle it? Please advise.
  7. refer subject above. i need a source code have mutliple checkbox and each checkbox having a textbox. when a check box is checked, the text will prompt respective value of it. the text value is capture from database. When the checkbox is unchecked, the value of the textbox will disappear. Please advise.
  8. Try to increase max_execution_time in your php.ini. It will solve the issue. ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 60 ; Maximum execution time of each script, in seconds
  9. Thanks a lot. But still can't connect to database. already add port 3306 (tcp/udp) in iptables, still the same result. Is there any way to connect. For example mysql_connect(publicaddress/domainname, "root", "password"); Result Can't connect to MySQL server on 'publicaddress/domainname' (10061) Please advise.
  10. Dear All, I have a website need to connect a database in other webserver. In the scirpt, i put $sql = mysql_connect("xxx.xxx.xxx.xxx", "root", "xyzpassword") or die(mysql_error()) and the result is Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061). The webserver is in linux platfrom, at first i taught that is block by firewall. when i stop firewall service, the progarm still prompt same result. please advise.
  11. I have design a script. need to change the price while a package is choose. The price will be display in the text box. <SCRIPT LANGUAGE="JAVASCRIPT" SRC="./lib/jsrsClient.js"></SCRIPT> <SCRIPT LANGUAGE="JAVASCRIPT"> function getprice() { var f=document.wo; price=f.bbpackage.value; jsrsExecute("get_price.php","getprice",price); } </SCRIPT> <SELECT NAME="bbpackage" CLASS="selectbox" onchange="getprice()"> get_price.php <?php include("jsrsServer.php.inc"); jsrsDispatch( "getprice" ); function getprice($price) { $return_value=""; $dblink=mysql_connect("localhost","root","xxxxxxx"); mysql_select_db("xxxxx",$dblink); $query="select id,name from package where packageID=$price"; $query_result=mysql_query($query,$dblink) or die(mysql_error()); while($row=mysql_fetch_array($query_result,MYSQL_ASSOC)) $return_value.=$row["name"]."~".$row["id"]."|"; return $return_value; } May i know what wrong with the coding. Please advise.
  12. the sql query return a NULL value. Please check your query part.
  13. i have developed a program to group package, serial no. and expire day of package. but i face one issue, during group by same package name but the expire day is different. the program will group it as a same package without differentiate the expire day. below is the my coding that group different package with different expire day. $result3 = mysql_query("SELECT package, serialNo, expireDay FROM orderdetail WHERE resellerID = '$resellerID' AND orderNo='$orderNo' order by package, serialNo"); $data = array(); while (list($p, $s, $e) = mysql_fetch_row($result3)) { echo $data[$p][] = $s; } foreach($data as $pkg => $s_array) { $num = count($s_array); $serial= listSerNums($s_array,0); $resultvalue = mysql_query("select package, valuedesc, pricePerUnit from batch a, prepaidcard b where a.batchNo = b.batchNo and b.serialNo in ($serial)") or die(mysql_error()); $rowvalue = mysql_fetch_array($resultvalue); } function listSerNums($sers, $n) { $i = 1; $j = 1; $x = count($sers); foreach ($sers as $s) { if ($j++ == $x) { $res .= $s; } else { $res .= $s . ', '; } if ($n != 0) { if ($i++ % $n == 0) $res .= '<br />'; } } return $res; } The result data for $result3 is as below : - package serialNo expireday pr_unlimited 1000 1 pr_unlimited 1001 1 pr_unlimited 1010 7 pr_unlimited 1011 7 pr_Oneday 1020 1 pr_Oneday 1021 1 How to group the package as below : - package expireday serialNo pr_unlimited 1 1000,1001 pr_unlimited 7 1010,1011 pr_Oneday 1 1020,1021 Please advise. Thanks.
  14. Is there any one know to use spreadsheet excel writer. When i use it, always prompt me error message during open the excel in microsoft excel viewer or microsoft excel 2000. the error message as below: - 'xxx.xls' can't be accessed. the file ma be read only or you may trying to access a readonly location. Or, the server the document is stored or may not be responding. please advise. thanks.
  15. [!--quoteo(post=359888:date=Mar 30 2006, 11:51 AM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 30 2006, 11:51 AM) [snapback]359888[/snapback][/div][div class=\'quotemain\'][!--quotec--] the check boxes cannot be the same name, only radio buttons. You have to label them name=txtc[] then a digit will be put in after. Ray [/quote] but all the checkbox is under a same group. so how?
  16. [!--quoteo(post=359889:date=Mar 30 2006, 11:59 AM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 30 2006, 11:59 AM) [snapback]359889[/snapback][/div][div class=\'quotemain\'][!--quotec--] Well first thing we need to do is teach you how to link a picture cause we still cannot see your layout. Ray [/quote] okay. how to link the picture.
  17. i have done a HTML form in php script. when i check 2 value in a check box, it just pass 1 value instead of 2 checkbox that i have checked. i not sure what happen to my script. below is the script that i have done. please point out the error that i have been made. for(i=0;i<f.txtc.length;i++) { if(f.txtc[i].checked==true) { c++; } } if(c==0) { alert("Please select 1 or more option in Question 3"); f.txtc[0].focus(); return; } if((f.txtc[6].checked==true)&&((Trim(f.txtcothers.value)).length==0)) { alert("Please fill in the text box in Question 3"); f.txtcothers.focus(); return; } Here is the HTML code about the checkbox <TR> <TD WIDTH="50%"><FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="Streamyx" NAME="txtc">Streamyx</FONT></TD> <TD WIDTH="50%"><FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="Maxis" NAME="txtc">Maxis</FONT></TD> </TR> <TR> <TD WIDTH="50%"><FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="Jaring" NAME="txtc">Jaring</FONT></TD> <TD WIDTH="50%"> <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="Time" NAME="txtc">Time</FONT></TD> </TR> <TR> <TD WIDTH="50%"><FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="Dailup" NAME="txtc">Dial up</FONT></TD> <TD WIDTH="50%"> <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="myLynx" NAME="txtc">myLynx</FONT></TD> </TR> <TR> <TD WIDTH="50%"><FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; <INPUT TYPE="checkbox" VALUE="others" NAME="txtc[]">Others <INPUT NAME="txtcothers"></FONT></TD> <TD WIDTH="50%"></TD> </TR> thanks again.
  18. [img src=\"http://localhost/layout.gif\" border=\"0\" alt=\"IPB Image\" /] How to design the layout like this? i already done the coding in PHP code. but do not know how to export the value in this layout and do not know how to merge cell by using the php code. please advise. p/s: sorry ober, last post i did not mention it properly. is an php code and not html code.
  19. [img src=\"http://localhost/layout.gif\" border=\"0\" alt=\"IPB Image\" /] how to design the layout like this in excel file format. please advise. Thanks and urgent.
  20. [!--quoteo(post=350463:date=Mar 1 2006, 10:02 AM:name=eranwein)--][div class=\'quotetop\']QUOTE(eranwein @ Mar 1 2006, 10:02 AM) [snapback]350463[/snapback][/div][div class=\'quotemain\'][!--quotec--] i'm trying to send mail but it doesnt work. this is what i wrote: <? mail('myMail@yahoo.com', 'My Subject', 'something'); ?> what am i'm doing wrong? [/quote] should be <?php mail('myMail@yahoo.com','My Subject', 'something'); ?>
  21. you are missing single quote in your insert statement $query = "INSERT INTO survey VALUES ($name','$q1','$q2','$q3','$q4','$q5','$q6')"; should be $query = "INSERT INTO survey VALUES([b]'[/b]$name','$q1','$q2','$q3','$q4','$q5','$q6')";
  22. how to design a progress bar script to show progress bar on frontend but a sql scripting is running on backend. please advise.
  23. how do i design a layout as below : - Item Description Serial Number Qty Unit Price Amount(RM) 1. ABC 3956, 3957 2 8.00 16.00 2. ABD 4235, 4236, 4237, 18 16.00 288.00 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4251, 4253, 4254 total 254.00 commission 10% 25.40 Grand Total 229.60 I have already done a part of the php script just lack how to fit unit price and amount in the coding. Below is the script that i have done, please help me to modify the script to design the layout as above. please advise.Thanks a lot. $count = 1; $result3 = mysql_query("SELECT package, serialNo FROM orderdetail WHERE resellerID = '$resellerID' AND orderNo='$orderNo' ORDER BY package, serialNo"); $data = array(); // build array of serial numbers for each package while (list($p, $s) = mysql_fetch_row($result3)) { $data[$p][]= $s; } echo "<TABLE WIDTH='100%' BORDER ='1'>"; echo "<TR>"; echo "<TD WIDTH='10%' ALIGN='center'><FONT CLASS = 'View'><B>Item</B></FONT></TD> <TD WIDTH='30%' ALIGN='center'><FONT CLASS = 'View'><B>Description</B></FONT></TD> <TD WIDTH='10%' ALIGN='center'><FONT CLASS = 'View'><B>Quantity</B></FONT></TD> <TD WIDTH='50%' ALIGN='center'><FONT CLASS = 'View'><B>Serial</B></FONT></TD>"; foreach($data as $pkg => $s_array) { $num = count($s_array); $gserial = listSerNums($s_array,0); echo "<TR valign='top'> <TD><FONT CLASS='normalText'>$count</FONT></TD> <TD><FONT CLASS='normalText'>$pkg</FONT></TD> <TD><FONT CLASS='normalText'>$num</FONT></TD> <TD><FONT CLASS='normalText'>" . listSerNums($s_array, 6) . "</FONT></TD> </TR>"; $count++; } echo "</TABLE>"; function listSerNums($sers, $n) { $i = 1; $j = 1; $x = count($sers); foreach ($sers as $s) { if ($j++ == $x) { $res .= $s; } else { $res .= $s . ', '; } if ($n != 0) { if ($i++ % $n == 0) $res .= '<br />'; } } return $res; }
  24. I'm using window.opener.location.reload(); to reload a parent window after a child window event is fired. But I'm getting a message "The page cannot be refreshed without resending the information. Click Retry to send the information again, or click Cancel to return to the page that you were trying to view. RETRY CANCEL". Is there a way I can suppress this message or automatically make a selection?
×
×
  • 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.