Plugin Directory

Changeset 1335553


Ignore:
Timestamp:
01/25/2016 02:24:26 PM (10 years ago)
Author:
avdude
Message:

Fixed issue with questions
Partial fix on Authorize.net IPH posting

Location:
event-registration/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • event-registration/trunk/evr_ipn.php

    r1332455 r1335553  
    255255                 'payer_business_name'=>$payer_business_name, 'payment_status'=>$payment_status,
    256256                 'pending_reason'=>$pending_reason, 'reason_code'=>$reason_code, 'txn_type'=>$txn_type );
     257                 
    257258     $sql_data = array('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
    258      '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');
     259                       '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');
    259260      $attendee = $wpdb->get_row($wpdb->prepare("SELECT * FROM ". get_option('evr_attendee') ." WHERE id = %d",$id));
    260261            $attendee_email = $attendee->email;
     
    331332    $events_attendee_tbl = get_option('evr_attendee');
    332333    $id="";
    333     $id=$_REQUEST['id'];//This is the id of the registrant
     334    //$id=$_REQUEST['id'];//This is the id of the registrant
     335    $id=$_REQUEST['x_cust_id'];//This is the id of the registrant
    334336    if ($id ==""){
    335337        echo "ID not supplied.";
     
    342344    else {
    343345                //store the results in reusable variables
    344                 $payer_id = $id;
    345                 $payment_date = $today;
    346                 $txn_id = $_POST['x_trans_id'];
    347                 $first_name = $_POST['x_first_name'];
    348                 $last_name = $_POST['x_last_name'];
    349                 $payer_email = $_POST['x_email'];
    350                 $payer_status = $_POST['x_response_code'];
    351                 $payment_type = $p->ipn_data['payment_type'];
    352                 $memo = $p->ipn_data['memo'];
    353                 $item_name = $_POST['x_description'];
    354                 $item_number = $_POST['x_invoice_num'];
    355                 $quantity = "1";
    356                 $amount_pd = $_POST['x_amount'];
    357                 //$mc_currency = $p->ipn_data['mc_currency'];
    358                 $address_name = $_POST['x_first_name']." ".$_POST['x_last_name'];;
     346                $payer_id = $id;//required
     347                $event_id = $_POST['x_invoice_num'];//required
     348                $payment_date = $today;
     349                $txn_id = $_POST['x_trans_id'];//required
     350                $first_name = $_POST['x_first_name'];//required
     351                $last_name = $_POST['x_last_name'];//required
     352                $payer_email = $_POST['x_email'];//required
     353                $payer_status = $_POST['x_response_code'];//required
     354               
     355                $payment_type = $_POST['x_method'];//required
     356               
     357                $memo = "memo";//required
     358                $item_name = $_POST['x_description'];//required
     359                $item_number = $_POST['x_invoice_num'];//required
     360                $quantity = "1";//required
     361                $amount_pd = $_POST['x_amount'];//required mc gross
     362                $mc_currency = "USD";//required
     363                $address_name = $_POST['x_first_name']." ".$_POST['x_last_name'];
    359364                $address_street = nl2br($_POST['x_address']);
    360365                $address_city = $_POST['x_city'];
     
    363368                $address_country = $_POST['x_country'];
    364369                $phone= $_POST['x_phone'];
    365                 $payment_status = $_POST['x_response_reason_code'];//limited to 17 char
    366                 //$pending_reason = $p->ipn_data['pending_reason'];//limited to 14 char
    367                 //$reason_code =$_POST['x_response_reason_text'];//limited to 15 char
    368                 $txn_type = $_POST['x_type'];//limited to 20 char
     370                $payment_status = $_POST['x_response_reason_code'];//limited to 17 char - required
     371                $pending_reason = "pending";//limited to 14 char
     372                $reason_code =$_POST['x_response_reason_text'];//limited to 15 char
     373                $txn_type = $_POST['x_type'];//limited to 20 char - required
     374               
     375                $payer_business_name = $address_name;
     376                $address_status="status";
    369377                global $wpdb;
    370378            $events_attendee_tbl = get_option('evr_attendee');
     
    372380            //$sql="UPDATE ". $events_attendee_tbl . " SET payment_status = '$payment_status', amount_pd = '$amount_pd', payment_date ='$payment_date' WHERE id = '$id'";
    373381            $wpdb->query($wpdb->prepare("UPDATE ". $events_attendee_tbl . " SET payment_status = '$payment_status', amount_pd = '$amount_pd', payment_date ='$payment_date' WHERE id = %d",$id));
    374                 (is_numeric($_REQUEST['event_id'])) ? $event_id = $_REQUEST['event_id'] : $event_id = "0";
     382               
     383                //(is_numeric($_REQUEST['x_invoice_num'])) ? $event_id = $_REQUEST['x_invoice_num'] : $event_id = "0";
    375384               
    376385                $sql = "SELECT * FROM ". get_option('evr_event') ." WHERE id = $event_id"; 
    377                    
     386                 
    378387                    $event = $wpdb->get_row($sql);
    379388                            $event_id       = $event->id;
     
    407416                 'pending_reason'=>$pending_reason, 'reason_code'=>$reason_code, 'txn_type'=>$txn_type );
    408417     $sql_data = array('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
    409      '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');
     418                        '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s');
     419     
    410420     
    411421     $attendee = $wpdb->get_row($wpdb->prepare("SELECT * FROM ". get_option('evr_attendee') ." WHERE id = %d",$id));
     
    418428    //$wpdb->insert( get_option('evr_payment'), $sql, $sql_data );
    419429      if ($wpdb->insert( get_option('evr_payment'), $sql, $sql_data )){
     430       
     431       
    420432            $headers = "From: " . $company_options['company'] . " <". $company_options['company_email'] . ">\r\n";
    421433            $headers .= "Reply-To: " . $company_options['company'] . "  <" . $company_options['company_email'] . ">\r\n";
  • event-registration/trunk/evr_support_functions.php

    r941152 r1335553  
    296296            foreach ( $values as $key => $value ) {
    297297                $checked = in_array ( $value, $answers ) ? " checked=\"checked\"" : "";
    298                 echo "<p class=\"hanging-indent radio_rows\"><input id=\"SINGLE_$question->id_$key\"$required name=\"SINGLE_$question->id\" title=\"$question->question\" type=\"radio\" value=\"$value\"$checked /> $value  </p>";
     298                echo "<p class=\"hanging-indent radio_rows\"><input id=\"SINGLE_$question->id\" $required name=\"SINGLE_$question->id\" title=\"$question->question\" type=\"radio\" value=\"$value\"$checked /> $value  </p>";
    299299            }
    300300            break;
     
    370370    <ul>
    371371        <li>Event Registration Version <input name="evr_ver" value=" <?php echo $evr_ver;?>"/></li>
    372         <li>Date EVR Activated <input size="50" name="evr_dt" value=" <?php echo date(r,get_option('evr_date_installed'));?>"/></li>
     372        <li>Date EVR Activated <input size="50" name="evr_dt" value=" <?php echo date("r",get_option('evr_date_installed'));?>"/></li>
    373373        <input type="hidden" name="key" value="<?php echo get_option('plug-evr-activate');?>"/>
    374374    </ul>
  • event-registration/trunk/questions/evr_admin_questions-case.php

    r1333789 r1335553  
    2626        break;
    2727        case "edit":
    28        
     28         evr_return_question_button();
    2929         evr_questions_edit();
    30          evr_return_question_button();
     30         
    3131         evr_questions_reorder();
    3232         //evr_check_form_submission();
  • event-registration/trunk/questions/evr_admin_questions-delete.php

    r462905 r1335553  
    55            //$event_id = $_REQUEST['event_id'];
    66            (is_numeric($_REQUEST['event_id'])) ? $event_id = $_REQUEST['event_id'] : $event_id = "0";
    7             $event_name = $_REQUEST['event_name'];
     7            $event_name = @$_REQUEST['event_name'];
    88            $question_id = $_REQUEST['question_id'];
    99           
  • event-registration/trunk/questions/evr_admin_questions-edit.php

    r616585 r1335553  
    33function evr_questions_edit(){
    44    global $wpdb;
    5     $event_name = $_REQUEST['event_name'];
     5    $event_name = @$_REQUEST['event_name'];
    66    //$event_id = $_REQUEST['event_id'];
    77    (is_numeric($_REQUEST['event_id'])) ? $event_id = $_REQUEST['event_id'] : $event_id = "0";
  • event-registration/trunk/questions/evr_admin_questions-new.php

    r944628 r1335553  
    33    $record_limit = "10";
    44    global $wpdb;
    5     $event_name = $_REQUEST['event_name'];
     5    $event_name = @$_REQUEST['event_name'];
    66    //$event_id = $_REQUEST['event_id'];
    77    (is_numeric($_REQUEST['event_id'])) ? $event_id = $_REQUEST['event_id'] : $event_id = "0";
  • event-registration/trunk/questions/evr_admin_questions-post.php

    r941152 r1335553  
    33    global $wpdb;
    44    (is_numeric($_REQUEST['event_id'])) ? $event_id = $_REQUEST['event_id'] : $event_id = "0";
    5     $event_name = $_REQUEST['event_name'];
    6     $question = $_REQUEST ['question'];
    7     $question_type = $_REQUEST ['question_type'];
    8     $values = $_REQUEST ['values'];
    9     $required = $_REQUEST ['required'] ? 'Y' : 'N';
    10     $remark = $_REQUEST['remark'];
     5    $event_name = (string)@$_REQUEST['event_name'];
     6    $question = (string)@$_REQUEST ['question'];
     7    $question_type = (string)@$_REQUEST ['question_type'];
     8    $values = (string)@$_REQUEST ['values'];
     9    $required = (string)@$_REQUEST ['required'] ? 'Y' : 'N';
     10    $remark = (string)@$_REQUEST['remark'];
    1111    $sequence = $wpdb->get_var ( "SELECT max(sequence) FROM ".get_option('evr_question')." where event_id = '$event_id'" ) + 1;
    12     if ($wpdb->query ( "INSERT INTO ".get_option('evr_question')." (`event_id`, `sequence`, `question_type`, `question`, `response`, `required`,`remark`)" . " values('$event_id', '$sequence', '$question_type', '$question', '$values', '$required', '$remark')" )){ ?>
     12   
     13    if ($question != ""){
     14    if ($wpdb->query ( "INSERT INTO ".get_option('evr_question')." (`event_id`, `sequence`, `question_type`, `question`, `response`, `required`,`remark`)" . " values('$event_id', '$sequence', '$question_type', '$question', '$values', '$required', '$remark')" )){ ?>
    1315    <div id="message" class="updated fade"><p><strong><?php _e('The question has been added.','evr_language');?> </strong></p>
    1416    <p><strong><?php _e(' . . .Now returning you to Question Managment . . ','evr_language');?><meta http-equiv="Refresh" content="1; url=admin.php?page=questions&action=new&event_id=<?php echo $event_id;?>&event_name=<?php echo $event_name;?>"></strong></p></div>
     
    1921<?php }
    2022}
     23else {
     24    ?>
     25    <div id="message" class="error"><p><strong><?php _e('There was an error in your submission (No question provided!), please try again. The question was not saved!','evr_language');?><?php print $wpdb->last_error; ?>.</strong></p>
     26    <p><strong><?php _e(' . . .Now returning you to Question Management . . ','evr_language');?><meta http-equiv="Refresh" content="3; url=admin.php?page=questions&action=new&event_id=<?php echo $event_id;?>&event_name=<?php echo $event_name;?>"></strong></p>
     27    </div>
     28<?php
     29   
     30}
     31}
    2132?>
  • event-registration/trunk/questions/evr_admin_questions-reorder.php

    r944628 r1335553  
    44       global $wpdb;
    55$event_id = $_REQUEST['event_id'];
    6 $event_name = $_REQUEST['event_name'];
     6$event_name = @$_REQUEST['event_name'];
    77                                    ?>
    88
  • event-registration/trunk/questions/evr_admin_questions-update.php

    r616585 r1335553  
    88    $question_type = $_REQUEST ['question_type'];
    99    $values = $_REQUEST ['values'];
    10     $required = $_REQUEST ['required'] ? 'Y' : 'N';
     10    $required = @$_REQUEST ['required'] ? 'Y' : 'N';
    1111    $remark = $_REQUEST['remark']; 
    12     $wpdb->query ( "UPDATE ".get_option('evr_question')." set `question_type` = '$question_type', `question` = '$question_text', " . " `response` = '$values', `required` = '$required', `remark` = '$remark' where id = $question_id " );
     12    if ($wpdb->query ( "UPDATE ".get_option('evr_question')." set `question_type` = '$question_type', `question` = '$question_text', " . " `response` = '$values', `required` = '$required', `remark` = '$remark' where id = $question_id " )){
     13       ?>
     14    <div id="message" class="updated fade"><p><strong><?php _e('The question has been updated.','evr_language');?> </strong></p>
     15    <p><strong><?php _e(' . . .Now returning you to Question Managment . . ','evr_language');?><meta http-equiv="Refresh" content="1; url=admin.php?page=questions&action=new&event_id=<?php echo $event_id;?>&event_name=<?php echo $event_name;?>"></strong></p></div>
     16    <?php }else { ?>
     17    <div id="message" class="error"><p><strong><?php _e('There was an error in your submission, please try again. The question was not updated!','evr_language');?><?php print $wpdb->last_error; ?>.</strong></p>
     18    <p><strong><?php _e(' . . .Now returning you to Question Management . . ','evr_language');?><meta http-equiv="Refresh" content="3; url=admin.php?page=questions&action=new&event_id=<?php echo $event_id;?>&event_name=<?php echo $event_name;?>"></strong></p>
     19    </div>
     20<?php }
     21
     22   
    1323?>
    1424<META HTTP-EQUIV="refresh" content="0;URL=admin.php?page=questions&action=new&event_id=<?php echo $event_id . "&event_name=" . $event_name;?>">
  • event-registration/trunk/readme.txt

    r1334833 r1335553  
    105105
    106106== Change Log ==
     107
     108= Version 6.02.03
     109* Fixed bug that allowed blank questions on custom question creation
     110* Added confirmation for new and edit questions added to db
     111* Fixed bug in Attendee Management - Edit when having custom questions with single choice options not listing properly
     112* Fixed date bug in Activation Date on Registration Area
     113
    107114
    108115= Version 6.02.02
Note: See TracChangeset for help on using the changeset viewer.