Annotation of /com_supacart/trunk/admin_files/html/checkout.thankyou.php
Parent Directory
|
Revision Log
Revision 4 - (view) (download)
| 1 : | andphe | 4 | <?php |
| 2 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 3 : | /** | ||
| 4 : | * This file is called after the order has been placed by the customer | ||
| 5 : | * | ||
| 6 : | * @version $Id: checkout.thankyou.php 862 2007-06-19 01:21:13Z gregdev $ | ||
| 7 : | * @package SupaCart | ||
| 8 : | * @subpackage html | ||
| 9 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 10 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 11 : | * SupaCart is free software, originally derived from Virtuemart. This version may have been modified pursuant | ||
| 12 : | * to the GNU General Public License, and as distributed it includes or | ||
| 13 : | * is derivative of works licensed under the GNU General Public License or | ||
| 14 : | * other free or open source software licenses. | ||
| 15 : | * See /administrator/components/com_supacart/COPYRIGHT.php for copyright notices and details. | ||
| 16 : | * | ||
| 17 : | * http://www.supacart.com | ||
| 18 : | */ | ||
| 19 : | mm_showMyFileName( __FILE__ ); | ||
| 20 : | |||
| 21 : | require_once(CLASSPATH.'ps_product.php'); | ||
| 22 : | $ps_product= new ps_product; | ||
| 23 : | |||
| 24 : | global $vendor_currency; | ||
| 25 : | |||
| 26 : | // Order_id is returned by checkoutComplete function | ||
| 27 : | $order_id = $GLOBALS['vmInputFilter']->process( $vars["order_id"] ); | ||
| 28 : | |||
| 29 : | $print = mosgetparam( $_REQUEST, 'print', 0); | ||
| 30 : | |||
| 31 : | /** Retrieve User Email **/ | ||
| 32 : | $q = "SELECT * FROM #__{sc}_order_user_info WHERE order_id='$order_id' AND address_type='BT'"; | ||
| 33 : | $db->query( $q ); | ||
| 34 : | $db->next_record(); | ||
| 35 : | $user = $db->record[0]; | ||
| 36 : | $dbbt = $db->_clone( $db ); | ||
| 37 : | |||
| 38 : | $user->email = $db->f("user_email"); | ||
| 39 : | |||
| 40 : | /** Retrieve Order & Payment Info **/ | ||
| 41 : | $db = new ps_DB; | ||
| 42 : | $q = "SELECT * FROM (#__{sc}_order_payment LEFT JOIN #__{sc}_payment_method "; | ||
| 43 : | $q .= "ON #__{sc}_payment_method.payment_method_id = #__{sc}_order_payment.payment_method_id), #__{sc}_orders "; | ||
| 44 : | $q .= "WHERE #__{sc}_order_payment.order_id='$order_id' "; | ||
| 45 : | $q .= "AND #__{sc}_orders.user_id='" . $auth["user_id"] . "' "; | ||
| 46 : | $q .= "AND #__{sc}_orders.order_id='$order_id' "; | ||
| 47 : | $db->query($q); | ||
| 48 : | if ($db->next_record()) { | ||
| 49 : | |||
| 50 : | ?> | ||
| 51 : | <h3><?php echo $VM_LANG->_PHPSHOP_THANKYOU ?></h3> | ||
| 52 : | <p> | ||
| 53 : | <?php | ||
| 54 : | if( empty($vars['error'])) { ?> | ||
| 55 : | <img src="<?php echo IMAGEURL ?>ps_image/button_ok.png" height="48" width="48" align="center" alt="Success" border="0" /> | ||
| 56 : | <?php echo $VM_LANG->_PHPSHOP_THANKYOU_SUCCESS?> | ||
| 57 : | |||
| 58 : | <br /><br /> | ||
| 59 : | <?php echo $VM_LANG->_PHPSHOP_EMAIL_SENDTO .": <strong>". $user->user_email; ?></strong><br /> | ||
| 60 : | </p> | ||
| 61 : | <?php | ||
| 62 : | } ?> | ||
| 63 : | |||
| 64 : | <!-- Begin Payment Information --> | ||
| 65 : | <?php | ||
| 66 : | $order_status = $db->f("order_status"); | ||
| 67 : | if($db->f("order_total") <= 0) { | ||
| 68 : | require_once ( CLASSPATH . 'ps_order.php' ); | ||
| 69 : | $ps_order= new ps_order; | ||
| 70 : | $d = array(); | ||
| 71 : | $d['order_id'] = $order_id; | ||
| 72 : | $d['notify_customer'] = "N"; | ||
| 73 : | $d['order_status'] = 'C'; | ||
| 74 : | $ps_order->order_status_update($d); | ||
| 75 : | $order_status = "C"; | ||
| 76 : | } | ||
| 77 : | if ($order_status == "P") { | ||
| 78 : | // Copy the db object to prevent it gets altered | ||
| 79 : | $db_temp = ps_DB::_clone( $db ); | ||
| 80 : | /** Start printing out HTML Form code (Payment Extra Info) **/ ?> | ||
| 81 : | <br /> | ||
| 82 : | <table width="100%"> | ||
| 83 : | <tr> | ||
| 84 : | <td width="100%" align="center"> | ||
| 85 : | <?php | ||
| 86 : | /* Try to get PayPal/PayMate/Worldpay/whatever Configuration File */ | ||
| 87 : | @include( CLASSPATH."payment/".$db->f("payment_class").".cfg.php" ); | ||
| 88 : | |||
| 89 : | echo DEBUG ? vmCommonHTML::getInfoField('Beginning to parse the payment extra info code...' ) : ''; | ||
| 90 : | |||
| 91 : | // Here's the place where the Payment Extra Form Code is included | ||
| 92 : | // Thanks to Steve for this solution (why make it complicated...?) | ||
| 93 : | if( eval('?>' . $db->f("payment_extrainfo") . '<?php ') === false ) { | ||
| 94 : | echo vmCommonHTML::getErrorField( "Error: The code of the payment method ".$db->f( 'payment_method_name').' ('.$db->f('payment_method_code').') ' | ||
| 95 : | .'contains a Parse Error!<br />Please correct that first' ); | ||
| 96 : | } | ||
| 97 : | else { | ||
| 98 : | echo DEBUG ? vmCommonHTML::getInfoField('Successfully parsed the payment extra info code.' ) : ''; | ||
| 99 : | } | ||
| 100 : | /** END printing out HTML Form code (Payment Extra Info) **/ | ||
| 101 : | |||
| 102 : | ?> | ||
| 103 : | </td> | ||
| 104 : | </tr> | ||
| 105 : | </table> | ||
| 106 : | <br /> | ||
| 107 : | <?php | ||
| 108 : | $db = $db_temp; | ||
| 109 : | } | ||
| 110 : | ?> | ||
| 111 : | <p><a href="<?php $sess->purl(SECUREURL."index.php?page=account.order_details&order_id=". $order_id) ?>"> | ||
| 112 : | <?php echo $VM_LANG->_PHPSHOP_ORDER_LINK ?></a> | ||
| 113 : | </p> | ||
| 114 : | <?php | ||
| 115 : | |||
| 116 : | } /* End of security check */ | ||
| 117 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

