close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Function using if isseet Post not getting or triggering function

Thread began 10/28/2020 7:10 am by lr_leal239405 | Last modified 10/28/2020 2:59 pm by Ray Borduin | 838 views | 5 replies |

lr_leal239405

Function using if isseet Post not getting or triggering function

Can you look at my fle attached starting from line #159. (copied below). I would like it to perform function of Insertirng based on if (isset($_POST["quote_record_exists_ID_".$z])) . It's not seeing my post "quote_record_template_exists_ID_<?php echo $z; ?>" from line 673.

You can see the whole function on (see info on private below)


if (isset($_POST["quote_record_exists_ID_".$z])) {
$qz = $_POST["quote_record_exists_ID_".$z];
//echo $qz;
//die();
$WADAquote_record_exists_ID = new WA_MySQLi_RS("WADAquote_record_exists_ID",$convacc_cx,1);
$WADAquote_record_exists_ID->setQuery("SELECT * FROM cac_quote_new_records WHERE quote_id = ? ");
$WADAquote_record_exists_ID->bindParam("i", "". $qz ."", "-1"); //Paramprod_id
$WADAquote_record_exists_ID->execute();
if ($WADAquote_record_exists_ID->TotalRows > 0) {
$opts = $WADAquote_record_exists_ID->getColumnVal("optionals");
$WADAquote_optionals = new WA_MySQLi_RS("WADAquote_optionals",$convacc_cx,0);
$WADAquote_optionals->setQuery("SELECT * FROM cac_quote_new_optionals WHERE quotenum = ? AND session_id = '$opts' ORDER BY optional_id ASC");
$WADAquote_optionals->bindParam("i", "". $WADAquote_record_exists_ID->getColumnVal("quotenum") ."", "-1"); //Paramprod_id
$WADAquote_optionals->execute();
if ($WADAquote_optionals->TotalRows > 0) {
$wa_startindex = 0;
while(!$WADAquote_optionals->atEnd()) {
$wa_startindex = $WADAquote_optionals->Index;
$InsertQuery2 = new WA_MySQLi_Query($convacc_cx);
$InsertQuery2->Action = "insert";
$InsertQuery2->Table = "cac_quote_new_optionals";
$InsertQuery2->bindColumn("quote_id_person", "s", "". $_SESSION['aq_ID'] ."", "WA_BLANK");
$InsertQuery2->bindColumn("session_ID", "s", "". $produniqid ."", "WA_BLANK");
$InsertQuery2->bindColumn("quotenum", "s", "". $quotenum ."", "WA_BLANK");
$InsertQuery2->bindColumn("quantity", "s", "". $WADAquote_optionals->getColumnVal("quantity") ."", "WA_BLANK");
$InsertQuery2->bindColumn("part_no", "s", "". $WADAquote_optionals->getColumnVal("part_no") ."", "WA_BLANK");
$InsertQuery2->bindColumn("prod_name", "s", "". $WADAquote_optionals->getColumnVal("prod_name") ."", "WA_BLANK");
$InsertQuery2->bindColumn("price", "d", "". $WADAquote_optionals->getColumnVal("price") ."", "WA_BLANK");
$InsertQuery2->bindColumn("totalprice", "d", "". $WADAquote_optionals->getColumnVal("total_price") ."", "WA_BLANK");
$InsertQuery2->bindColumn("DimensionsForShipping", "s", "". $WADAquote_optionals->getColumnVal("DimensionsForShipping") ."", "WA_BLANK");
$InsertQuery2->execute();
$WADAquote_optionals->moveNext();
}
$WADAquote_optionals->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
}
}
}

Sign in to reply to this post

Ray BorduinWebAssist

I think instead of:

if (isset($_POST["quote_record_template_exists_ID_".$z])) {

you want:

for ($z=0; isset($_POST["quote_record_template_exists_ID_".$z]); $z++) {

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

Thanks so much. It definitely goes in with that code. However, when the Search finds lots of results, and I add my 'Add to Autoquote' button, it inserts lots of Optionals instead of only the ones that belong to that quote (which is the intent). I don't know where my logic is flawed. Attached is the new file. (You'll see I added the code 2x for different posts).

you can do a search in this quote (below on private)

Press the 'Search All Products with Keywords' link. Search on empty and it yields all results. When you select any it will now insert Optionals repeatedly for any. And Some of those, like the first ones on the list are not even part of the $_POST.

Not sue what is flawed with my logic.

Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

I'm afraid I don't understand your requirements enough to do this outside of a phone call with screen sharing. If you want to do that then give me a call or send me a skype message and we can schedule a time.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

I tried calling. What time is good for you? I'll show you on the screen sharing

Sign in to reply to this post

Ray BorduinWebAssist

I'm here now for the next few hours if you want to try calling.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...