Jump to content
Sign in to follow this  
accarter

Gift Registry Occasion

Recommended Posts

Hi, I just installed the Gift Registry, and am having a problem with add_registry_process.php - the dropdown menu and everything else below it isn't running. Is it possible that the dropdown options aren't defined? Where would those be defined?

Thank you!

 

add_registry_details:

<?php
/*
 $Id: address_book_details.php,v 1.6 2003/02/12 23:55:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 if (!isset($process)) $process = false;
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="formAreaTitle"><?php echo CATEGORY_REGISTRY; ?></td>
 </tr>
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
     <tr>
       <td><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"> <?php echo CO_REGISTRANT_FIRST_NAME; ?></td>
           <td class="main"> 
<?php
 if ($process == true) {
   if ($firstname_error == true) {
     echo tep_draw_input_field('co_registrant_first_name') . ' ' . CO_REGISTRANT_FIRST_NAME_ERROR;
   } else {
     echo $co_registrant_first_name . tep_draw_hidden_field('co_registrant_first_name');
   }
 } else {
   echo tep_draw_input_field('co_registrant_first_name', $registry_result['co_registrant_first_name']);
 }
?></td>
         </tr>
         <tr>
           <td class="main"> <?php echo CO_REGISTRANT_LAST_NAME; ?></td>
           <td class="main"> 
<?php
 if ($process == true) {
   if ($lastname_error == true) {
     echo tep_draw_input_field('co_registrant_last_name') . ' ' . CO_REGISTRANT_LAST_NAME_ERROR;
   } else {
     echo $co_registrant_last_name . tep_draw_hidden_field('co_registrant_last_name');
   }
 } else {
   echo tep_draw_input_field('co_registrant_last_name', $registry_result['co_registrant_last_name']);
 }
?></td>
         </tr>
         <tr>
           <td class="main"> <?php echo REGISTRY_OCCASION_DATE; ?></td>
           <td class="main"> 
<?php
 if ($process == true) {
   if ($registry_occasion_date_error == true) {
     echo tep_draw_input_field('registry_occasion_date') . ' ' . REGISTRY_OCCASION_DATE_ERROR;
   } else {
     echo tep_date_short($registry_occasion_date) . tep_draw_hidden_field('registry_occasion_date') . ' ' . REGISTRY_OCCASION_DATE_ERROR;
   }
 } else {
   echo tep_draw_input_field('registry_occasion_date', tep_date_short($registry_result['registry_occasion_date'])) . ' ' . REGISTRY_OCCASION_DATE_TEXT;
 }
?></td>
         </tr>
         <tr>
           <td class="main"> <?php echo REGISTRY_OCCASION; ?></td>
           <td class="main"> 
<?php
 if ($process == true) {
   if ($registry_occasion_error == true) {
     echo tep_draw_pull_down_menu('registry_occasion_id', tep_get_registry_occasions(), '', '') . ' ' . REGISTRY_OCCASION_ERROR;
   } else {
     echo tep_get_registry_occasion_name($registry_occasion_id) . tep_draw_hidden_field('registry_occasion_id');
   }
 } else {
   echo tep_draw_pull_down_menu('registry_occasion_id', tep_get_registry_occasions(), $registry_result['registry_occasion_id'], '') . ' ' . REGISTRY_OCCASION_TEXT;
 }
?></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
 </tr>
</table>

 

add_registry_process.php

<?php
/*
 $Id: add_registry_process.php,v 1.01 2003/04/10 19:30:00 gs Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]
 SammySolutions.com ltd., [url="http://www.SammySolutions.com"]http://www.SammySolutions.com[/url]

 Copyright © 2003 SammySolutions.com and osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'remove') && tep_not_null($HTTP_GET_VARS['registry_id']) ) {
   $registry_id = tep_db_prepare_input($HTTP_GET_VARS['registry_id']);

   tep_db_query("delete from " . TABLE_REGISTRY . " where registry_id = '" . tep_db_input($registry_id) . "' and customers_id = '" . $customer_id . "'");
   //delete the stuff from the registry
   if ($customer_id && ($registry_mode_id != 0)) {
     tep_db_query("delete from " . TABLE_REGISTRY_PRODUCTS . " where customers_id = '" . $customer_id . "' AND registry_id = '" . $registry_mode_id . "'");
     tep_db_query("delete from " . TABLE_REGISTRY_PRODUCTS_ATTRIBUTES . " where customers_id = '" . $customer_id . "' AND registry_id = '" . $registry_mode_id . "'");
   }

   tep_redirect(tep_href_link(FILENAME_ADD_REGISTRY, 'registry_mode_id=0', 'SSL'));
 }

// Post-entry error checking when updating or adding an entry
 $process = false;
 if (isset($HTTP_POST_VARS['action']) && (($HTTP_POST_VARS['action'] == 'process') || ($HTTP_POST_VARS['action'] == 'update'))) {
   $process = true;
   $error = false;

   $registry_occasion_id = tep_db_prepare_input($HTTP_POST_VARS['registry_occasion_id']);
   $registry_occasion_date = tep_db_prepare_input($HTTP_POST_VARS['registry_occasion_date']);
   $co_registrant_first_name = tep_db_prepare_input($HTTP_POST_VARS['co_registrant_first_name']);
   $co_registrant_last_name = tep_db_prepare_input($HTTP_POST_VARS['co_registrant_last_name']);


   if (checkdate(substr(tep_date_raw($registry_occasion_date), 4, 2), substr(tep_date_raw($registry_occasion_date), 6, 2), substr(tep_date_raw($registry_occasion_date), 0, 4))) {
     $registry_occasion_date_error = false;
   } else {
     $error = true;
     $registry_occasion_date_error = true;
   }


   if ($registry_occasion_id == '') {
     $registry_occasion_error = true;
     $error = true;
   } else {
     $registry_occasion_error = false;
   }
   //check the registry date here as well


   if ($error == false) {
     $sql_data_array = array('customers_id' => $customer_id,
                             'registry_occasion_id' => $registry_occasion_id,
                             'registry_occasion_date' => tep_date_raw($registry_occasion_date),
                             'co_registrant_first_name' => $co_registrant_first_name,
                             'co_registrant_last_name' => $co_registrant_last_name
                             );

     $registry_id = tep_db_prepare_input($HTTP_POST_VARS['registry_id']);

     if ($HTTP_POST_VARS['action'] == 'update') {
       tep_db_perform(TABLE_REGISTRY, $sql_data_array, 'update', "registry_id = '" . tep_db_input($registry_id) . "' and customers_id ='" . tep_db_input($customer_id) . "'");
     } else {
       tep_db_perform(TABLE_REGISTRY, $sql_data_array);

// Go back to where we came from
       if (sizeof($navigation->snapshot) > 0) {
         $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
         $navigation->clear_snapshot();

         tep_redirect($origin_href);
       }
     }

     tep_redirect(tep_href_link(FILENAME_ADD_REGISTRY, '', 'SSL'));
   }
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'modify') && tep_not_null($HTTP_GET_VARS['registry_id'])) {
   $registry_query_string = "select registry_id, customers_id, registry_occasion_id, registry_occasion_date, co_registrant_first_name, co_registrant_last_name from " . TABLE_REGISTRY . " where customers_id = '" . $customer_id . "' and registry_id = '" . $HTTP_GET_VARS['registry_id'] . "'";
   $registry_query = tep_db_query($registry_query_string);
   $registry_result = tep_db_fetch_array($registry_query);

 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADD_REGISTRY_PROCESS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ADD_REGISTRY, '', 'SSL'));

 if ( (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'modify')) || (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'update') && tep_not_null($HTTP_POST_VARS['registry_id'])) ) {
   $breadcrumb->add(NAVBAR_TITLE_MODIFY_REGISTRY, tep_href_link(FILENAME_ADD_REGISTRY_PROCESS, 'action=modify&registry_id=' . ((isset($HTTP_GET_VARS['registry_id'])) ? $HTTP_GET_VARS['registry_id'] : $HTTP_POST_VARS['registry_id']), 'SSL'));
 } else {
   $breadcrumb->add(NAVBAR_TITLE_ADD_REGISTRY, tep_href_link(FILENAME_ADD_REGISTRY_PROCESS, '', 'SSL'));
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function check_form() {
 var error = 0;
 var error_message = "<?php echo JS_ERROR; ?>";

 var registry_occasion_id = document.add_registry.registry_occasion_id.value;
 var registry_occasion_date = document.add_registry.registry_occasion_date.value;

 if (registry_occasion_id == "") {
   error_message = error_message + "<?php echo JS_REGISTRY_OCCASION_ID; ?>";
   error = 1;
 }

 if (registry_occasion_date == "" || registry_occasion_date.length < 10) {
   error_message = error_message + "<?php echo JS_REGISTRY_OCCASION_DATE; ?>";
   error = 1;
 }

 if (error == 1) {
   alert(error_message);
   return false;
 } else {
   return true;
 }
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('add_registry', tep_href_link(FILENAME_ADD_REGISTRY_PROCESS, '', 'SSL'), 'post', 'onSubmit="return check_form();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo (isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'modify') ? HEADING_TITLE_MODIFY_REGISTRY : HEADING_TITLE_ADD_REGISTRY; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_add_registry.gif', (isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'modify') ? HEADING_TITLE_MODIFY_REGISTRY : HEADING_TITLE_ADD_REGISTRY, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php include(DIR_WS_MODULES . 'add_registry_details.php'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'modify') && tep_not_null($HTTP_GET_VARS['registry_id'])) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="2" cellpadding="0">
         <tr>
           <td class="main"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('registry_id', $HTTP_GET_VARS['registry_id']) . '<a href="' . tep_href_link(FILENAME_ADD_REGISTRY, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
           <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_ADD_REGISTRY_PROCESS, 'action=remove&registry_id=' . $HTTP_GET_VARS['registry_id'], 'SSL') . '">' . tep_image_button('button_delete.gif', IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
           <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
   } elseif (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'update') && tep_not_null($HTTP_POST_VARS['registry_id'])) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="2" cellpadding="0">
         <tr>
           <td class="main"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('registry_id', $registry_id) . '<a href="' . tep_href_link(FILENAME_ADD_REGISTRY, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
           <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
   } else {
     if (sizeof($navigation->snapshot) > 0) {
       $back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
     } else {
       $back_link = tep_href_link(FILENAME_ADD_REGISTRY, '', 'SSL');
     }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo '<a href="' . $back_link . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
           <td align="right" class="main"><?php echo tep_draw_hidden_field('registry_id', (isset($HTTP_GET_VARS['registry_id']) ? $HTTP_GET_VARS['registry_id'] : $registry_id)) . tep_draw_hidden_field('action', 'process') . tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
         </tr>
       </table></td>
     </tr>
<?php
   }
?>
   </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

pergolina.com/catalog/add_registry_process.php

Thank you!

Allison

Edited by accarter

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×