<%      
    metaTitle = "Call Clicks Dash - 24hrs Locksmith"; 
    metaDescr = ""; 
    seoNoIndex = "true"; 

    if(typeof(newPhone) !== "undefined" && newPhone){
        phoneNr = newPhone;
    } else {
        phoneNr = process.env.WEB_PHONE;
    }

    const urlParams = url ? url.split('?')[1] : '';

    const date = urlParams ? urlParams.split('=')[1] : '';

    console.log('urlparams:', urlParams);
    


    const categories = [
        { value: 'option1', label: 'Option 1' },
        { value: 'option2', label: 'Option 2' },
        { value: 'option3', label: 'Option 3' },
        // Add more categories as needed
    ];
%>
<%- include("../partials/headerView") %>

<%- include("../partials/menuView") %>

<div class="container-fluid di_m_t_20px">
    <div class="row dip_p_0_10px">
        <div class="col-12">

            <div class="rc_pricing_cont">
                <h1 class="h2 di_f_l di_m_b_20px">Conversion Clicks</h1>
                <form action="/logout" method="post">
                    <button type="submit" class="btn keys_secondary_bg di_clr_w di_p_t_0">
                        <div class="rc_mask_icon di_op_7 di_size_25px di_m_r_5px di_bg_w di_d_inline_block di_p_relative" style="top: 7px; mask-image: url(/img/icons/logout_FILL0_wght400_GRAD0_opsz24.svg); -webkit-mask-image: url(/img/icons/logout_FILL0_wght400_GRAD0_opsz24.svg); "></div>
                        <span class="h4">Logout</span>
                    </button>
                    <!-- <span action="" class="h4 di_f_r">Logout</span> -->
                </form>
            </div>

            <div>
                <!-- Date: <textarea><%= url %></textarea> -->
                <!-- <select name="category">
                    <% categories.forEach(category => { %>
                        <option value="<%= category.value %>"><%= category.label %></option>
                    <% }); %>
                </select> -->
            </div>
            
            <div class="di_w_100P di_o_x_scroll">
                <table class="di_conv_clicks_table">
                    <tr style="border-bottom: 1px solid rgba(0,0,0,0.3); margin-bottom: 10px; background-color:rgba(0,0,0,0.05);">
                        <td>ID</td>
                        <td>IP</td>
                        <td>Page</td>
                        <td>Postcode</td>
                        <td>Location</td>
                        <td>Campaign</td>
                        <td>Ad Group</td>
                        <td>Keyword</td>
                        <td>Ad Position</td>
                        <td>Device</td>
                        <td>Date</td>
                        <td>Hour</td>
                        <td>Google Source</td>
                        <td>Button Position</td>
                        <td>Blocked IP</td>
                        <td>URL</td>
                    </tr>
    
                    <% clickLogs.forEach(function(click) { %>
                        <tr>
                            <td>#<%= click.id %></td>
                            <td><%= click.ip %></td>
                            <td><%= click.page %></td>
                            <td><%= click.postcode %></td>
                            <td><%= click.location %></td>
                            <td><%= click.campaign %></td>
                            <td><%= click.adgroup %></td>
                            <td><%= click.keyword %></td>
                            <td><%= click.adposition %></td>
                            <td><%= click.device %></td>
                            <td><%= click.dateOnly %></td>
                            <td><%= click.hourOnly %></td>
                            <td><%= click.GoogleSource ? "yes" : "no" %></td>
                            <td><%= click.btnPosition %></td>
                            <td><%= click.isBlockedIp ? "yes" : "no" %></td>
                            <td><%= click.url %></td>
                        </tr>
                    <% }); %>
                </table>
            </div>
            
        </div>
    </div>
</div>


<%- include("../partials/footerView") %>