Link to home
Start Free TrialLog in
Avatar of net-workx
net-workxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

jQuery Modal Popup ASP

I have the code attached.  The code:

                                        <div id='basic-modal'>
                                            <input type='image' src="/admin/epos/images/buttons/btn_tender.png" name='basic' value='Tender' class='basic'/>
                                        </div>

fires the correct jQuery modal page (tender.asp), but the code:

<a class='EditLineItem' href="#" id="LineID" title="1"><% =RSlines("txtProductName") %></a>

does not fire the jQuery modal page edit_line_item.asp

Can anyone see where the fault is with the jQuery popup?
Avatar of net-workx
net-workx
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

<% @codepage=1252 %>
<!--#include virtual="/common/includes/personalisation.asp"-->
<!--INCLUDE SECURITY INFO HERE-->
<!--#include virtual="/common/includes/connection_string.asp"-->
<!--#include virtual="/common/includes/functions/images.asp"-->
<!--#include virtual="/common/includes/functions/products.asp"-->
<!--#include virtual="/common/includes/functions/quotes.asp"-->
<!--#include virtual="/common/includes/functions/depts_cats_subcat.asp"-->
<!--#include virtual="/common/includes/functions/calculations.asp"-->

<%
//********************************************************************************
//Copyright 2006 - 2011 - NET-WORKX Ltd
//Modified: 27/06/2011 -	New EPOS screen created
//This code builds the touchscreen till function
//********************************************************************************
%>
<% strAction = "New Retail Sale - Till" %>
<!--#include virtual="/admin/includes/pages/sitestats/systemlog/system_log.asp"-->

<%
'//GETS THE CUSTOMER ID AND QUOTE NUMBER IF THERE IS ANY
intCustomerID = Request.QueryString("CustomerID")
    IF isNull(intCustomerID) OR intCustomerID = "" THEN
        intCustomerID = 0
    END IF
intQuoteID = Request.QueryString("QuoteID")

'//IF THERE IS NO QUOTEID CREATED THEN CREATED A NEW ONE
IF isNull(intQuoteID) or intQuoteID = "" THEN
    
    '//GETS LAST QUOTE NUMBER AND ADDS ONE TO IT
	Set RS = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT MAX(intQuoteID) AS intLastQuoteID FROM tblQuoteHeaders"
	RS.Open SQL,Connection,3,3
	
		intLastQuoteID = RS("intLastQuoteID")
		intNextQuoteID = intLastQuoteID + 1
	
	RS.Close
	Set RS = Nothing
	SQL = " "
	
    '//CHECKS FOR NULLS
	IF isNull(intNextQuoteID) OR intNextQuoteID = "" THEN
		intNextQuoteID = 1
	END IF
	
    '//ADDS A NEW QUOTE HEADER INTO THE tblQuoteHeaders TABLE
	Set RS = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT * FROM tblQuoteHeaders WHERE intQuoteID = 0"
	RS.Open SQL,Connection,3,3
	
		RS.AddNew
			RS.Fields("intQuoteID") = intNextQuoteID
			RS.Fields("intCustomerID") = intCustomerID
			RS.Fields("txtStatus") = "QUOTE"
			RS.Fields("intSource") = 11
			RS.Fields("intTakenBy") = Session("UserID")
		RS.Update
	
	RS.Close
	Set RS = Nothing
	SQL = " "
	
    '//REDIRECTS TO TILL PAGE WITH A QUERYSTRING QUOTEID POPULATED SO THAT WE KNOW THAT THE HEADER HAS BEEN CREATED
	Response.Redirect "/admin/epos/till.asp?QuoteID=" & intNextQuoteID
ELSE
    '//WE HAVE A QUOTE ID SO LETS BUILD THE ORDER
	Set RS = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT * FROM tblQuoteHeaders WHERE intQuoteID = " & intQuoteID
	RS.Open SQL,Connection,3,3
		txtStatus = RS("txtStatus")
		intSource = RS("intSource")
		dtmDateStamp = RS("dtmDateStamp")
		intTakenBy = RS("intTakenBy")
		intCustomerID = RS("intCustomerID")
	RS.Close
	Set RS = Nothing
	SQL = " "
END IF
%>

<html>
<head>
    <title>Point Of Sale Screen</title>
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="Refresh" content="600">
    <link href="/admin/epos/stylesheet/till.css" rel="stylesheet" type="text/css">

<!--jQuery Framework-->
	<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>

<!-- Load jQuery, SimpleModal and Basic JS files -->
<script type='text/javascript' src='/admin/epos/common/jquery/modal/jquery.simplemodal.js'></script>

<script type='text/javascript'>
    jQuery(function ($) {
        var URL;
        // Load dialog on click
        $('#basic-modal .basic').click(function (e) {
            URL = 'tender.asp?QuoteID=<% =intQuoteID %>&rnd=' + new Date().getTime();
            $('<div></div>').load(URL).modal(); // AJAX
            return false;
        });
        $('#EditLineItem').click(function (e) {
            URL = 'edit_line_item.asp?QuoteID=<% =intQuoteID %>&&rnd=' + new Date().getTime();
            $('<div></div>').load(URL).modal(); // AJAX
            return false;
        });
        $('#somebutton').click(function (e) {
            URL = '...';
            $("#tender").close();
            $('<div id="account"></div>').load(URL).modal(); // AJAX
        });

    });
</script> 

<script language="JavaScript" type="text/javascript">
<!--
    function letter(x) {
        document.softkeyboard.txtCustomerName.value += x;
    }
//-->
</script>

</head>

<body style="overflow: hidden">
    <!--MAIN OUTER BORDER-->
    <table style="border: 0; width: 1020px; height: 765px">
        <tr>
            <td>
                <!--TABLE TO DIVIDE PAGE INTO TWO COLUMNS-->
                <table style="width: 100%; border: 0px solid black;" cellpadding="10px">
                    <tr style="height: 45px; width: 100%; border: 0px solid black;">
                        <td colspan="2" style="width: 100%; vertical-align: middle; border: 0px solid black;">
                            POS - Future Fitness - <% Response.Write Date() & " " & Time() %>
                        </td>
                    </tr>
                    <tr style="height: 720px; width: 100%;">
                        <td style="width: 50%; vertical-align: top; border: 0px solid black;">
                            <%
                            'Response.Write "CustomerID= " & intCustomerID & "<br>"
                            'Response.Write "QuoteNo= " & intQuoteID & "<br>"
                            'Response.Write "txtStatus= " & txtStatus & "<br>"
                            'Response.Write "intSource= " & intSource & "<br>"
                            'Response.Write "dtmDateStamp= " & dtmDateStamp & "<br>"
                            'Response.Write "intTakenBy= " & intTakenBy & "<br>"
                            %>

                            <!--VIRTUAL RECIEPT HERE-->
                            <%
                            Set RSlines = Server.CreateObject("ADODB.Recordset")
                            SQLlines = "SELECT * FROM tblQuoteLines WHERE intQuoteID = " & intQuoteID
                            RSlines.Open SQLlines,Connection,3,3
                            %>
                            <table style="width: 100%; border: 4px solid #444; background-color: #FFFFFF; height: 450px; color: #000;" cellpadding="5">
                                <tr style="height: 20px;">
                                    <td style="border-bottom: 1px solid #000000; width: 21px;">&nbsp;</td>
                                    <td style="border-bottom: 1px solid #000000; width: 250px;">Item/Product</td>
                                    <td style="border-bottom: 1px solid #000000; width: 50px; text-align: center;">Qty</td>
                                    <td style="border-bottom: 1px solid #000000; width: 75px;">Price</td>
                                    <td style="border-bottom: 1px solid #000000; width: 75px;">Total</td>
                                </tr>
                                <tr style="height: 400px;">
                                    <td colspan="5" style="vertical-align: top;">
                                        <table style="width: 100%; color: #000;">
                                            <% Do While Not RSlines.EOF %>
                                            <tr>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 21px; vertical-align: middle;"><a href="/admin/epos/processing/new_sale/process_delete_sale_item.asp?QuoteID=<%=intQuoteID%>&QuoteLineID=<%=RSlines("intQuoteLineID")%>"><img style="border: 0;" src="/images/common/icons/ico_cross.gif"></a></td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 250px; vertical-align: top;"><a class='EditLineItem' href="#" id="LineID" title="1"><% =RSlines("txtProductName") %></a>&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 50px; vertical-align: top; text-align: center;"><% =RSlines("intQty") %>&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 75px; vertical-align: top;"><% =strCurrencySymbol & formatNumber(PriceIncVat(RSlines("intPrice"),RSlines("intVatRate")),2)%>&nbsp;</td>
                                                <td style="border-bottom: 1px solid #CCCCCC; font-family: Courier; width: 75px; vertical-align: top;"><% =strCurrencySymbol & formatNumber(GetLineSubTotalIncVat(PriceIncVat(RSlines("intPrice"),RSlines("intVatRate")),RSlines("intQty")),2)%>&nbsp;</td>
                                            </tr>
                                            <%
                                            RSlines.MoveNext
                                            Loop
                                            %>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right;" colspan="5"><span class="total">Total: <% =strCurrencySymbol & formatNumber(GetQuoteSubTotelIncVat(intQuoteID),2) %></span></td>
                                </tr>
                            </table>
                            <%
                            RSLines.Close
                            Set RSLines = Nothing
                            SQLlines = " "
                            %>
                            <table style="width: 100%; border: 0px;" cellpadding="5">
                                <tr>
                                    <td><input type="image" src="/admin/epos/images/buttons/btn_cancel.png" value="Transaction Cancel" name="TransactionCancel" onclick='location="/admin/epos/processing/transaction_cancel/transaction_cancel.asp?QuoteID=<%=intQuoteID %>";'></td>
                                    <td style="text-align: right;">
                                        <div id='basic-modal'>
                                            <input type='image' src="/admin/epos/images/buttons/btn_tender.png" name='basic' value='Tender' class='basic'/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%; vertical-align: top; border: 0px solid black;">
                        <%
                            intDepartmentID = Request.QueryString("DepartmentID")
                            intCategoryID = Request.QueryString("CategoryID")
                            intSubCategoryID = Request.QueryString("SubCategoryID")
                            intShowCustomerSelection = Request.QueryString("ShowCustomerSelection")
                        %>

                        <% IF intShowCustomerSelection = 1 THEN %>
                            <!--#include virtual="/admin/epos/select_customer.asp"-->
                        <% ELSEIF isNull(intDepartmentID) OR intDepartmentID = "" THEN %>
                            <!--#include virtual="/admin/epos/departments.asp"-->
                        <% ELSEIF intDepartmentID <> 0 AND intCategoryID <> 0 AND intSubCategoryID <> 0 THEN %>
                            <!--#include virtual="/admin/epos/products.asp"-->
                        <% ELSEIF intDepartmentID <> 0 AND intCategoryID <> 0 THEN %>
                            <!--#include virtual="/admin/epos/subcategories.asp"-->
                        <% ELSEIF intDepartmentID <> 0 THEN %>
                            <!--#include virtual="/admin/epos/categories.asp"-->
                        <% END IF %>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

    	<!-- preload the images -->
		<div style='display:none'>
			<img src='img/basic/x.png' alt='' />
		</div>


</body>
</html>

Open in new window

Avatar of amit_g
Change

<a class='EditLineItem' href="#" id="LineID" title="1"><% =RSlines("txtProductName") %></a>

to

<a class='EditLineItem' href="#" id="EditLineItem" title="1"><% =RSlines("txtProductName") %></a>
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial