Plugin Directory

Changeset 1052715


Ignore:
Timestamp:
12/23/2014 03:27:08 PM (11 years ago)
Author:
subscriptiondna
Message:

Adding updates of my plugin

Location:
subscriptiondna/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • subscriptiondna/trunk/dna.js

    r952299 r1052715  
    11focused=0;
    22function countryChanged(country) {
    3     if(country=="223") {
    4         document.getElementById('stateList').style.display='block';
     3    if(country=="223")
     4    {
     5        document.getElementById('stateList').style.display='';
    56        document.getElementById('state').style.display='none';
    6     } else {
     7        document.getElementById('stateListCa').style.display='none';
     8    }
     9    else if(country=="38")
     10    {
    711        document.getElementById('stateList').style.display='none';
    8         document.getElementById('state').style.display='block';
     12        document.getElementById('stateListCa').style.display='';
     13        document.getElementById('state').style.display='none';
     14    }
     15    else {
     16        document.getElementById('stateList').style.display='none';
     17        document.getElementById('stateListCa').style.display='none';
     18        document.getElementById('state').style.display='';
    919        document.getElementById('state').value="";
    1020    }
     
    222232    if(!xGetElementById("check_mo_1").checked && !xGetElementById("check_mo").checked)
    223233        ValidateField(false,"check_mo","Please select payment method.");
    224    
    225     if(xGetElementById("check_mo_1").checked)
     234    else
     235        ValidateField(true,"check_mo","Please select payment method.");
     236    if(xGetElementById("check_mo_1").checked && xGetElementById("payment_info_not_required").value!="1")
    226237    {
    227238        checkEmpty("cc_name","Please enter Name on Card.");
     
    236247    checkEmpty("address1","Please enter Address.");
    237248    checkEmpty("city","Please enter City.");
     249    if(document.getElementById('country').value=="223" && document.getElementById('stateList').value!="")
     250    {
     251        document.getElementById('state').value=document.getElementById('stateList').value;
     252    }
    238253    checkEmpty("state","Please select State.");
    239254    checkEmpty("zipcode","Please enter Zip.");
     
    250265    }
    251266    else
    252     return true;
    253 }
     267    {
     268        xGetElementById("x_submit").disabled=true;
     269        return true;
     270    }
     271}
  • subscriptiondna/trunk/dna.php

    r952299 r1052715  
    111111            {
    112112
     113                $newcost=$_REQUEST["selected_package_cost"];
     114                $newcostmsg="$".$_REQUEST["selected_package_cost"];
     115                $payment_info_not_required=0;
    113116                $blocked_codes=array("blk1","blk2"); 
    114117                if(!in_array($_REQUEST["promo_code"],$blocked_codes))
    115118                {
    116                      list($service_id,$billing_routine)=split(";",$_REQUEST["packages"][0]);
    117                      $data=array("promo_code"=>$_REQUEST["promo_code"],"services"=>$service_id,"billing_routine_id"=>$billing_routine);
     119                    list($service_id,$billing_routine)=split(";",$_REQUEST["selected_package"]);
     120                    $data=array("promo_code"=>$_REQUEST["promo_code"],"services"=>$service_id,"billing_routine_id"=>$billing_routine);
    118121                     $promocode = SubscriptionDNA_ProcessRequest($data,"subscription/validate_promocode",true);
    119122                     if($promocode["errCode"]<0)
     
    124127                     else
    125128                     {
    126                             if($promocode["discount_mod"]=="%")
    127                                 $msg='You save '.$promocode["discount"].$promocode["discount_mod"].'';
    128                             elseif($promocode["discount_mod"]=="$")
    129                                 $msg='You save $'.$promocode["discount"].'';
    130                             elseif($promocode["discount_mod"]=="b")
    131                                 $msg='Your code is valid. '.$promocode["billing"];
    132                              $validCode="t";
     129                        if($promocode["discount_mod"]=="%")
     130                        {
     131                            $msg='You save '.$promocode["discount"].$promocode["discount_mod"].'';
     132                            $discount=$_REQUEST["selected_package_cost"]*($promocode["discount"]/100);
     133                            $newcost=$_REQUEST["selected_package_cost"]-$discount;
     134                            $newcost=number_format($newcost, 2);
     135                            $discount=number_format($discount, 2);
     136                            if($newcost<0)
     137                                $newcost=0;
     138                            $newcostmsg="<strike style='color:#b90000;'>$".$_REQUEST["selected_package_cost"]."</strike> - $".$discount." (".$promocode["discount"]."% discount) = $".$newcost;
     139                        }
     140                        elseif($promocode["discount_mod"]=="$")
     141                        {
     142                            $msg='You save $'.$promocode["discount"].'';
     143                            $newcost=$_REQUEST["selected_package_cost"]-$promocode["discount"];
     144                            if($newcost<0)
     145                                $newcost=0;
     146                            $promocode["discount"]=number_format($promocode["discount"], 2);
     147                            $newcostmsg="<strike style='color:#b90000;'>$".$_REQUEST["selected_package_cost"]."</strike> - $".$promocode["discount"]." ($".$promocode["discount"]." discount) = $".$newcost;
     148                        }
     149                        elseif($promocode["discount_mod"]=="b")
     150                        {
     151                            $msg='<br>'.$promocode["billing"];
     152                            $newcost=$promocode["first_period_cost"];
     153                            $discount=$_REQUEST["selected_package_cost"]-$newcost;
     154                            $discount=number_format($discount, 2);
     155                            $newcostmsg="<strike style='color:#b90000;'>$".$_REQUEST["selected_package_cost"]."</strike> - $".$discount." ($".$discount." discount) = $".$newcost;
     156                            $payment_info_not_required=$promocode["payment_info_not_required"];
     157                        }
     158                         $validCode="t";
    133159                     }
    134160
     
    146172                     $msg=" Invalid discount code: ".$_REQUEST["promo_code"];
    147173                }
     174                $msg=  json_encode(array("msg"=>$msg,"newcost"=>$newcost,"newcostmsg"=>$newcostmsg,"payment_info_not_required"=>$payment_info_not_required));
    148175            }
    149176            die($msg);
     
    11281155*/
    11291156
     1157function SubscriptionDNA_GetProvinces()
     1158{
     1159    $canada_provinces=array("Alberta"=>"AB","British Columbia"=>"BC","Manitoba"=>"MB","New Brunswick"=>"NB","Newfoundland and Labrador"=>"NL","Northwest Territories"=>"NT","Nova Scotia"=>"NS","Nunavut"=>"NU","Ontario"=>"ON","Prince Edward Island"=>"PE","Quebec"=>"QC","Saskatchewan"=>"SK","Yukon"=>"YT");
     1160    return($canada_provinces);
     1161}
     1162
    11301163
    11311164if ( function_exists ( 'add_action' ) )
  • subscriptiondna/trunk/login.php

    r952299 r1052715  
    2323            {
    2424                $_SESSION['user_session_id'] = $result->user_session_id;
    25                 $_SESSION['login_name'] = $_POST['login_name'];
     25                $_SESSION['login_name'] = $result->login_name;
    2626                $_SESSION['password'] = $_POST['password'];
    2727
  • subscriptiondna/trunk/myprofile.php

    r969112 r1052715  
    11<?
     2@session_start();
     3include_once ('lib/common.php');
     4include ('../header.php');
    25       
    36    if($_POST['send']){
  • subscriptiondna/trunk/mysubs.php

    r981519 r1052715  
    2020<?php
    2121       
    22         $msg='<font color="#009933">'.$_REQUEST["msg"].'</font>';        
     22        echo(urldecode($_REQUEST["msg"]));       
    2323    $login_name = $_SESSION['login_name'];
    2424    $alreadySigned=array();
    25         if(isset($_REQUEST["Subscribe_API"]))
     25        if(isset($_REQUEST["SubscribeAPI"]))
    2626        {
    2727            $paid_by_credit_card=1;
     
    6464            //print_r($requestData);die();
    6565            $result = SubscriptionDNA_ProcessRequest($requestData,"service/subscribe",true);
     66            if($_REQUEST["stop_auto_bill"]=="1" && $result["sub_id"]!="")
     67            {
     68                $data=array("login_name"=>$login_name,"sub_id"=>$result["sub_id"], "status"=>"Discontinued");
     69                SubscriptionDNA_ProcessRequest($data,"subscription/change_status");
     70            }
    6671            //print_r($result);
    6772            $msg='<font color="#00FF00">'.$result["errDesc"].'</font>';
     73           
     74            ?>
     75            <script>
     76            location.href='<?php echo(get_permalink($GLOBALS['SubscriptionDNA']['Settings']["dna_pages"]['manage-subscriptions'])); ?>?msg=<?php echo(urlencode($msg)); ?>';
     77            </script>
     78            <?php
     79            die();
     80           
    6881        }   
    6982    if($_REQUEST['status']){
     
    7285        ?>
    7386        <script>
    74         location.href='<?php echo(get_permalink($GLOBALS['SubscriptionDNA']['Settings']["dna_pages"]['manage-subscriptions'])); ?>?msg=<?php echo($result->errDesc); ?>';
     87        location.href='<?php echo(get_permalink($GLOBALS['SubscriptionDNA']['Settings']["dna_pages"]['manage-subscriptions'])); ?>?msg=<?php echo(urlencode($result->errDesc)); ?>';
    7588        </script>
    7689        <?php
     
    8598                        $data=array("sub_id"=>$_REQUEST['subId'], "confirmation_page"=>$_REQUEST['confirmation_page'], "login_name"=>$login_name);
    8699            $result = SubscriptionDNA_ProcessRequest($data,"subscription/renew");
    87                        
     100                        //print_r($result);
    88101                       
    89102                        $ccList = SubscriptionDNA_ProcessRequest(array("login_name"=>$login_name),"creditcard/list");
     
    101114
    102115                        <script type="text/javascript" src="<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/wp-content/plugins/subscriptiondna/ccinfo.js"></script>
    103                 <form method="post" action="?&subId=<?=$_REQUEST['subId']?>&renew=renew&confirmation_page=0">
     116                <form method="post" action="?&subId=<?=$_REQUEST['subId']?>&renew=renew">
    104117                                    <input type="hidden" name="card_id" value="<?php echo($_REQUEST["card_id"]); ?>">
     118                                    <input type="hidden" name="confirmation_page" value="<?php if ($_REQUEST["confirmation_page"] == "21"){echo("2");}else{echo("0");} ?>">
    105119                <h2><?php if ($_REQUEST["confirmation_page"] == "21"){echo("Extend Your ");}else{echo("Renew Your Expired ");} ?>Subscription</h2>
    106120               
     
    128142                                                <td valign="top">
    129143                                                <b>Subscription:</b><br />
    130                                                         <?=$result->services ?><br />
    131                                                         <?=$result->billing_routine ?>
     144                                                        <?=$result->services ?>
     145                                                        <?=$result->billing_routine ?><br>
    132146                                                        <br>
    133147                                                        Subscription Date: <?php echo($result->start_date); ?><br />
     
    212226                                                    $result=array();
    213227                                                    include 'cc_info.php';
    214                                                     ?>                                           
     228                                                    ?>   
     229                                        <tr valign=top id="tr_no_auto_bill" >
     230                                            <td nowrap>Disable Auto-Renewal: </td>
     231                                            <td>&nbsp;</td>
     232                                            <td >
     233                                                <input type="checkbox" name="stop_auto_bill" id="stop_auto_bill" value="1" <?php if($_REQUEST["stop_auto_bill"]=="1")echo("checked"); ?>>
     234                                            </td>
     235                                        </tr>
     236                                           
    215237</table>
    216238                    </td>
    217239                   
    218240                                        </tr>
    219                    
     241                                       
    220242                        <tr><td><br>
    221                         <input type="submit" value="<?php if ($_REQUEST["confirmation_page"] == "21"){echo("Extend");}else{echo("Renew");} ?> Subscription" /></td></tr>
     243                                                <h3 id="msgProgress" style="display:none">Processing your request, Please wait..</h3>       
     244                        <input type="submit" onclick="this.style.display='none';document.getElementById('msgProgress').style.display='';" value="<?php if ($_REQUEST["confirmation_page"] == "21"){echo("Extend");}else{echo("Renew");} ?> Subscription" /></td></tr>
    222245                    </table>
    223246                </form>
     
    227250        else
    228251        {
     252                    if(isset($_POST["confirmation_page"]))
     253                    {
    229254                        if($_REQUEST["payment_method"]=="2")
    230255                            $_REQUEST["paid_by_new_card"]=1;
     
    251276   
    252277            if($result["errCode"]!=10){
    253                 $msg='<font color="#FF0000">'.$result["errDesc"].', Please try again</font>';
    254             }else{
    255                 $msg='<font color="#009933">'.$result["errDesc"].'</font>';
     278                $msg='<font color="#063">'.$result["errDesc"].', Please try again</font>';
    256279            }
     280                        else
     281                        {
     282                            if($_REQUEST["stop_auto_bill"]=="1")
     283                            {
     284                                $data=array("login_name"=>$login_name,"sub_id"=>$_REQUEST['subId'], "status"=>"Discontinued");
     285                                SubscriptionDNA_ProcessRequest($data,"subscription/change_status");
     286                            }
     287                            $msg='<font color="#009933">'.$result["errDesc"].'</font>';
     288            }
     289                        ?>
     290                        <script>
     291                        location.href='<?php echo(get_permalink($GLOBALS['SubscriptionDNA']['Settings']["dna_pages"]['manage-subscriptions'])); ?>?msg=<?php echo(urlencode($msg)); ?>';
     292                        </script>
     293                        <?php
     294                        die();
     295                    }
     296                       
    257297        }   
    258298    }
     
    291331    else
    292332    {
     333           
     334           
    293335    ?>
    294336
     
    335377
    336378        <?php
    337                 if(trim($subscription->status)=='Discontinued' || $subscription->recurring!="1")
     379                if(trim($subscription->status)=='Discontinued' || $subscription->recurring!="1" || !$ccinfo)
    338380                {
    339381                    echo "<a href='?&subId=" . $subscription->sub_id ."&card_id=".$subscription->ccid."&renew=renew&confirmation_page=21'>Extend</a>&nbsp; | &nbsp;";
     
    342384                {
    343385                   
    344                     echo "<a href='?&change=" . $subscription->sub_id . "'>Change</a>&nbsp; | &nbsp;<a  onClick=\"dnaAskConfimation('Yes','No','Are you sure you want to Unsubscribe?','?&subId=" . $subscription->sub_id . "&status=Unsubscribed')\" href='#'>Unsubscribe</a>&nbsp; | &nbsp;<a onClick=\"dnaAskConfimation('Yes','No','Please confirm you want to Stop Auto-Billing.','?&subId=" . $subscription->sub_id . "&status=Discontinued')\"  href='#'>Stop Auto-Billing</a><br>";
     386                    echo "<a href='?&change=" . $subscription->sub_id . "'>Change</a>&nbsp; | &nbsp;<a  onClick=\"dnaAskConfimation('Yes','No','Are you sure you want to Unsubscribe?','?&subId=" . $subscription->sub_id . "&status=Unsubscribed')\" href='#'>Unsubscribe</a>";
     387                    if($subscription->recurring=="1")
     388                    {
     389                        if($subscription->rebilling=="1")
     390                            echo("&nbsp; | &nbsp;<a onClick=\"dnaAskConfimation('Yes','No','Please confirm you want to Stop Auto-Billing.','?&subId=" . $subscription->sub_id . "&status=Discontinued')\"  href='#'>Stop Auto-Billing</a><br>");
     391                        else
     392                            echo("&nbsp; | &nbsp;<a   onClick=\"dnaAskConfimation('Yes','No','Please confirm you want to Start Auto-Billing.','?&subId=" . $subscription->sub_id . "&status=Active')\" href='#'>Start Auto-Billing</a><br>");
     393                    }
    345394        }
    346395                else if($subscription->status=='Discontinued')
    347396                {
    348                     echo "<a onClick=\"dnaAskConfimation('Yes','No','Are you sure you want to Unsubscribe?','?&subId=" . $subscription->sub_id . "&status=Unsubscribed')\" href='#'>Unsubscribe</a>&nbsp; | &nbsp;<a   onClick=\"dnaAskConfimation('Yes','No','Please confirm you want to Start Auto-Billing.','?&subId=" . $subscription->sub_id . "&status=Active')\" href='#'>Start Auto-Billing</a><br>";
     397                    echo "<a onClick=\"dnaAskConfimation('Yes','No','Are you sure you want to Unsubscribe?','?&subId=" . $subscription->sub_id . "&status=Unsubscribed')\" href='#'>Unsubscribe</a>";
     398                    if($subscription->recurring=="1")
     399                        echo("&nbsp; | &nbsp;<a   onClick=\"dnaAskConfimation('Yes','No','Please confirm you want to Start Auto-Billing.','?&subId=" . $subscription->sub_id . "&status=Active')\" href='#'>Start Auto-Billing</a><br>");
    349400        }
    350401?>
     
    353404            </td>
    354405            </tr></table>
    355 
    356 <p>
    357 <small><b>Please note that UNSUBSCRIBE will immediately terminate your subscription.  Therefore, please only UNSUBSCRIBE if you have decided for sure to permanently cancel the service. If you would like to cancel your subscription at the expiration of the current billing period (allowing you to finish your current subscription term), please click on DISCONTINUE. When you do so, you can change your mind until the expiration date by clicking on REACTIVATE to restore your subscription.</b></small>
    358 </p>
    359 <?php
     406<?php
     407    /*
     408    ?>
     409    <p>
     410    <small><b>Please note that UNSUBSCRIBE will immediately terminate your subscription.  Therefore, please only UNSUBSCRIBE if you have decided for sure to permanently cancel the service. If you would like to cancel your subscription at the expiration of the current billing period (allowing you to finish your current subscription term), please click on DISCONTINUE. When you do so, you can change your mind until the expiration date by clicking on REACTIVATE to restore your subscription.</b></small>
     411    </p>
     412    <?php
     413    */
    360414}
    361415
     
    470524<div id="DNAFormFields">
    471525<form name='customSubscribeForm' action='' method='POST'>
     526    <input type='hidden' name='SubscribeAPI' id="SubscribeAPI" value='Submit'>
    472527    <table id="packagesList" cellpadding="3" width="100%">
    473528       
     
    575630        include 'cc_info.php';
    576631        ?>
     632                <tr valign=top id="tr_no_auto_bill">
     633                    <td nowrap>Disable Auto-Renewal: </td>
     634                    <td>&nbsp;</td>
     635                    <td >
     636                        <input type="checkbox" name="stop_auto_bill" id="stop_auto_bill" value="1" <?php if($_REQUEST["stop_auto_bill"]=="1")echo("checked"); ?>>
     637                    </td>
     638                </tr>       
    577639        <tr>
    578            <td colspan="3"><input type='submit' name='Subscribe_API' id="Subscribe_API" value='Submit'>&nbsp;</td>
     640           <td colspan="3"><h3 id="msgProgress" style="display:none">Processing your request, Please wait..</h3><input type='submit' name='Subscribe_API' onclick="this.style.display='none';document.getElementById('msgProgress').style.display='';" id="Subscribe_API" value='Submit'>&nbsp;</td>
    579641        </tr>
    580642    </table>
  • subscriptiondna/trunk/readme.txt

    r981561 r1052715  
    55Tags: saas, invoice, enroll, paywall, registration, subscribe, ordering, signup, protect, subscription, member, membership, billing, payments, authentication, pay per view, premium content, credit card, login
    66Requires at least: 2.8
    7 Tested up to: 4.0
     7Tested up to: 4.1
    88Stable tag: trunk
    99
  • subscriptiondna/trunk/register.php

    r969111 r1052715  
    11<?php
     2$canada_provinces=SubscriptionDNA_GetProvinces();
     3
    24if(isset($_REQUEST["x_submit"]))
    35{
     
    1719        }
    1820    }
    19     if($_REQUEST["check_mo"]=="1")
     21    if($_REQUEST["check_mo"]=="1" || $_REQUEST["payment_info_not_required"]=="1")
    2022        $_REQUEST["paid_by_credit_card"]="";
    2123    else
     
    8890$customFields=SubscriptionDNA_ProcessRequest("","list/custom_fields");
    8991
     92$categories=array();
     93foreach($packages as $package)
     94{
     95    $categories[$package->category]=$package->category;
     96}
    9097
    9198
     
    95102<script type="text/javascript">
    96103<!--
     104function showPackage(c){
     105       
     106        for(i=0;i<<?php echo(count($categories)); ?>;i++)
     107        {
     108            jQuery("#divPackageType"+i).hide();
     109        }
     110       
     111        jQuery( "#divPackageType"+c).slideDown( "slow" );
     112
     113}
    97114function paymentMethodChanged(method)
    98115{
     
    108125    }
    109126}
    110 function packageChanged(packob,package_id)
     127function packageChanged(packob,package_id,payment_info_not_required)
    111128{
    112129    jQuery("#selected_package").val(package_id);
     
    123140        jQuery(packob).addClass("package-box-active")
    124141    }
    125 }
    126 
     142    pcode=jQuery('#promo_code');
     143    if(pcode.val()!="")
     144    {
     145        pcode.blur();
     146    }
     147    showHidePaymentInfo(payment_info_not_required);
     148}
     149function showHidePaymentInfo(payment_info_not_required)
     150{
     151    if(payment_info_not_required=="1")
     152    {
     153        for(i=2;i<=7;i++)
     154            jQuery("#paymentinfo"+i).hide();
     155    }
     156    else
     157    {
     158        for(i=2;i<=7;i++)
     159            jQuery("#paymentinfo"+i).show();
     160    }
     161    jQuery("#payment_info_not_required").val(payment_info_not_required);
     162}
     163function displayTotal(total)
     164{
     165    jQuery('#selected_package_cost').val(total);
     166    document.getElementById('displayTaxInfo').innerHTML="$"+total;
     167}
    127168jQuery(document).ready(function () {
    128169    var validateUsername = jQuery('#login_name_lbl_error');
     
    138179            this.timer = setTimeout(function () {
    139180                jQuery.ajax({
    140                     url: '/?dna_validate=login_name',
     181                    url: '<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/?dna_validate=login_name',
    141182                    data: 'login_name=' + t.value,
    142183                    dataType: 'html',
     
    171212            this.timer = setTimeout(function () {
    172213                jQuery.ajax({
    173                     url: '/?dna_validate=email' ,
     214                    url: '<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/?dna_validate=email' ,
    174215                    data: 'email='+ t.value,
    175216                    dataType: 'html',
     
    194235
    195236    var validatePromo = jQuery('#promo_code_lbl_error');
    196     jQuery('#promo_code').blur(function () {
    197         var t = this;
    198         if (this.value != this.lastValue && this.value!="") {
    199             if (this.timer) clearTimeout(this.timer);
    200             validatePromo.removeClass('error').html('<img src="<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/wp-content/plugins/subscriptiondna//images/loader.gif" height="16" width="16" />');
    201             this.timer = setTimeout(function () {
    202                 jQuery.ajax({
    203                     url: '/?dna_validate=promo_code',
    204                     data: 'promo_code=' + t.value,
    205                     dataType: 'html',
    206                     type: 'post',
    207                     success: function (j) {
    208                         validatePromo.html(j);
    209                         hidePaymentInfo();
    210                     }
    211                 });
    212             }, 200);
    213             this.lastValue = this.value;
    214         }
    215     });
    216 
     237    if(selected_package=="")
     238    {
     239        validatePromo.html("Please select a package to validate promocode.");
     240    }
     241    else
     242    {
     243        jQuery('#promo_code').blur(function () {
     244            var t = this;
     245               
     246                var selected_package = jQuery('#selected_package').val();
     247                var selected_package_cost = jQuery('#selected_package_cost').val();
     248           
     249                if (this.timer) clearTimeout(this.timer);
     250                validatePromo.removeClass('error').html('<img src="<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/wp-content/plugins/subscriptiondna//images/loader.gif" height="16" width="16" />');
     251                this.timer = setTimeout(function () {
     252                    jQuery.ajax({
     253                        url: '<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/?dna_validate=promo_code',
     254                        data: 'promo_code=' + t.value+"&selected_package_cost="+selected_package_cost+"&selected_package="+selected_package,
     255                        dataType: 'json',
     256                        type: 'post',
     257                        success: function (j) {
     258                            validatePromo.html(j.msg);
     259                            document.getElementById('displayTaxInfo').innerHTML=j.newcostmsg;
     260                            showHidePaymentInfo(j.payment_info_not_required);
     261                        }
     262                    });
     263                }, 200);
     264                this.lastValue = this.value;
     265           
     266        });
     267    }
    217268});
    218269//-->
    219270</script> 
    220 <script type="text/javascript" src="<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/wp-content/plugins/subscriptiondna/dna.js"></script>
     271<script type="text/javascript" src="<?php echo($GLOBALS['SubscriptionDNA']["siteurl"]); ?>/wp-content/plugins/subscriptiondna/dna.js?cache=1"></script>
    221272
    222273<div align="center" id="DNAFormFields">
     
    229280<form method="post" name="customSubscribeForm" action="" >
    230281           
     282    <input type='hidden' name='payment_info_not_required' id="payment_info_not_required" value='<?php echo($_REQUEST["payment_info_not_required"]); ?>'>
    231283    <input type='hidden' name='x_confirmurl' value='<?php echo(get_permalink($GLOBALS['SubscriptionDNA']['Settings']["dna_pages"]['login'])); ?>'>
    232284
     
    241293<table border="0" width="100%">
    242294<tr valign=top>
    243     <td colspan="2"><h3>Subscription Plans:</h3></td>
     295    <td colspan="2"><h3>Please select a subscription plan:</h3></td>
     296</tr>
     297<tr>
     298    <td  colspan="2" style="border-bottom: 0px;background: none;">
     299    <?php
     300    $catcount=0;
     301    $package_types=array();
     302    foreach($categories as $category)
     303    {
     304        $package_types[$catcount]=array();
     305        foreach($packages as $package)
     306        {
     307           if($package->category==$category)
     308           {
     309              $package_types[$catcount][]=$package;
     310           }
     311        }
     312       
     313        ?>
     314       <div class="choice" onclick="showPackage(<?php echo($catcount); ?>);" style="float: left; margin-right: 15px;">
     315        <a href="javascript:;"><?php echo($category); ?></a>
     316
     317        </div>
     318        <?php
     319        $catcount++;
     320    }
     321    ?>
     322   
     323    </td>
     324</tr>
    244325<tr valign=top>           
    245     <td colspan="2">
     326    <td colspan="2" style="border-bottom: 0px;background: none;">
     327            <div style="height: 8px;"></div>
    246328            <?php
    247329            $count=0;
    248             foreach($packages as $package)
     330            foreach($package_types as $key=>$package_type)
    249331            {
    250                 if(in_array($package->service_id.";".$package->billing_routine_id,$_POST["packages"]) || ($package->defaultval=="Yes" && !$selected))
     332                $packages=$package_type;
     333                ?>
     334                <div id="divPackageType<?php echo($key); ?>"  style="<?php if($key!=1 || true)echo("display: none"); ?>">
     335                <?php
     336                $count=0;
     337                foreach($packages as $package)
    251338                {
    252                     $selected=$package->uid;
    253                     $selected_billing=$package->billing_routine_id;
    254                     $selected_package=$package->service_id.";".$package->billing_routine_id;
     339                    if(in_array($package->service_id.";".$package->billing_routine_id,$_POST["packages"]) || ($package->defaultval=="Yes" && !$selected))
     340                    {
     341                        $selected=$package->uid;
     342                        $selected_billing=$package->billing_routine_id;
     343                        $selected_package=$package->service_id.";".$package->billing_routine_id;
     344                        $sel_payment_info_not_required=$package->payment_info_not_required;
     345                        $sel_cost=$package->cost;
     346                    }
     347                    ?>
     348                    <div title="Click to select your subscription plan."  id="innerDiv_<?php echo($package->uid); ?>"  class='package-box package-box-main' onclick='packageChanged(this,"<?php echo($package->service_id); ?>;<?php echo($package->billing_routine_id); ?>","<?php echo($package->payment_info_not_required); ?>");displayTotal("<?php echo($package->cost); ?>");'>
     349                    <strong><?php echo($package->package_name);  ?></strong>
     350                    <div ><?php echo($package->package_description); ?></div>
     351                    </div>
     352                    <?php
     353                    $count++;
    255354                }
    256355                ?>
    257                 <div title="Click to select your subscription plan."  id="innerDiv_<?php echo($package->uid); ?>"  class='package-box package-box-main' onclick='packageChanged(this,"<?php echo($package->service_id); ?>;<?php echo($package->billing_routine_id); ?>");'>
    258                 <strong><?php echo($package->package_name);  ?></strong>
    259                 <div ><?php echo($package->package_description); ?></div>
    260                 </div>
    261                 <?php
    262                 $count++;
     356            </div>
     357            <?php
    263358            }
    264359            ?>
     360            <br>               
    265361        <span id="package_lbl_error" class="lblErr"></span>
    266362        <input type="hidden" name="package" value="" id="package" />
    267363        <input type="hidden" name="packages[]" id='selected_package' value="<?php echo($selected_package);  ?>" />
     364        <input type='hidden' name='selected_package_cost' id="selected_package_cost" value='<?php echo($sel_cost); ?>'>
     365       
    268366    </td>
    269367</tr>
     
    365463<h3>Payment Information</h3></td></tr>
    366464<tr>
     465<td style="vertical-align: top;" align="left" width='200'><b>Your Total Today:</b></td>
     466<td>
     467    <b><div id='displayTaxInfo'><?php echo($sel_cost==""?"Please select a package.":"$".$sel_cost); ?></div></b><br />
     468</td>
     469</tr>
     470
     471<tr id='paymentinfo7'>
    367472<td align="left" valign="top"><span id="check_mo_lbl" class="lbl">Payment Method</span></td>
    368473<td>
    369     <input type='radio' name='check_mo' id='check_mo_1' value='0' onclick='paymentMethodChanged("0");'>Credit Card <input type='radio' name='check_mo' id='check_mo' value='1' onclick='paymentMethodChanged("1");'> Check/Mo
     474    <input type='radio' name='check_mo' id='check_mo_1' value='0' onclick='paymentMethodChanged("0");'> Credit Card &nbsp; <input type='radio' name='check_mo' id='check_mo' value='1' onclick='paymentMethodChanged("1");'> Check/Mo
    370475    <br><span id="check_mo_lbl_error" class="lblErr"></span>
    371476</td>
     
    529634<option  value="WY">Wyoming</option>
    530635<option  value="XX">Other</option>
    531 </select>  <input name="state" value="<?php echo($_REQUEST["state"]); ?>" style="display:none" size="30" type="text" id="state" />
     636</select> 
     637<input name="state" value="<?php echo($_REQUEST["state"]); ?>" style="display:none" size="30" type="text" id="state" />
     638<select name="stateListCa" id="stateListCa" style="display:none" onchange="stateChanged(this.value);" >     
     639<option value=""></option>
     640<?php
     641foreach($canada_provinces as $key=>$province)
     642{
     643    ?>
     644    <option value="<?php echo($province); ?>"><?php echo($key); ?></option>
     645    <?php
     646}
     647?>
     648</select>
    532649<br><span id="state_lbl_error" class="lblErr"></span>
    533650</td>
     
    744861<td></td>
    745862<td ><br><br>
    746 <input TYPE="submit" name="x_submit" VALUE="Click here to submit form" onclick="return checkForm(this.form);"  style="font-size: 13pt;"></td>
     863<input TYPE="submit" name="x_submit" id="x_submit" VALUE="Click here to submit form" onclick="return checkForm(this.form);"  style="font-size: 13pt;"></td>
    747864</tr>
    748865</table>
     
    754871}
    755872if("<?php echo($selected_package); ?>"!="")
    756 packageChanged(document.getElementById("innerDiv_<?php echo($selected); ?>") ,"<?php echo($selected_package); ?>");
     873packageChanged(document.getElementById("innerDiv_<?php echo($selected); ?>") ,"<?php echo($selected_package); ?>","<?php echo($sel_payment_info_not_required); ?>");
    757874</script>   
    758875<?php
  • subscriptiondna/trunk/styles.css

    r981519 r1052715  
    3333#dna-register .lblErr {color: #ed2f60; }
    3434
     35.choice {
     36    background-color: #f8f8f8;
     37    border: 1px solid #cccccc;
     38    border-radius: 8px;
     39    box-shadow: 3px 3px 3px #b3b3b3;
     40    color: #525252;
     41    cursor: pointer;
     42    font-size: 17pt;
     43    padding: 10px;
     44}       
     45.choice a {
     46    color: #313131;
     47    text-decoration: none;
     48}
     49.choice:hover {
     50    background-color: #ffffff;
     51}
     52.packageDiv {
     53    background-color: #efefef;
     54    border: 1px solid #cccccc;
     55    border-radius: 8px;
     56    box-shadow: 3px 3px 3px #b3b3b3;
     57    margin-bottom: 10px;
     58    padding: 10px;
     59}
     60.packageDiv:hover { background-color: #E8F9FF; }
     61.package-sticky{ background-color: #E8F9FF; }
     62.package-selection { float: left; width: 3%; }
     63.package-info { float: left; width: 97%; }
     64.package-title { color:#069; font-size: 20px; }
     65.package-description { margin-top: 8px; }
    3566
    3667
Note: See TracChangeset for help on using the changeset viewer.