Jump to content

klpang

Members
  • Posts

    24
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

klpang's Achievements

Member

Member (2/5)

0

Reputation

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