????

Your IP : 216.73.216.152


Current Path : /home2/morganrand/www/ecommerce/os/catalog/
Upload File :
Current File : /home2/morganrand/www/ecommerce/os/catalog/designs_history_info_20.php

<?php
/*
  $Id: designs_history_info.php
  $Id: account_history_info.php,v 1.2 2004/08/25 22:39:50 akhan Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 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['design_id']) || (isset($HTTP_GET_VARS['design_id']) && !is_numeric($HTTP_GET_VARS['design_id']))) {
    tep_redirect(tep_href_link(FILENAME_DESIGNS_HISTORY, '', 'SSL'));
  }
  
  $customer_info_query = tep_db_query("select customers_id, designs_name from " . TABLE_DESIGNS . " where designs_id = '". (int)$HTTP_GET_VARS['design_id'] . "'");
  $customer_info = tep_db_fetch_array($customer_info_query);
  if ($customer_info['customers_id'] != $customer_id) {
    tep_redirect(tep_href_link(FILENAME_DESIGNS_HISTORY, '', 'SSL'));
  }

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

  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_DESIGNS_HISTORY, '', 'SSL'));
  $breadcrumb->add($customer_info['designs_name'], tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'design_id=' . $HTTP_GET_VARS['design_id'], 'SSL'));
//  $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['design_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'design_id=' . $HTTP_GET_VARS['design_id'], 'SSL'));

//  require(DIR_WS_CLASSES . 'order.php');
//  $order = new order($HTTP_GET_VARS['order_id']);
//ag
  $history_info_query = tep_db_query("select designs_id, date_created, designs_name, designs_description, designs_comment, designs_data, designs_event_name, designs_event_date, designs_event_type from " . TABLE_DESIGNS . " where designs_id = '" . (int)$HTTP_GET_VARS['design_id'] . "'");
  $history_info = tep_db_fetch_array($history_info_query);

  $keep_quiet = false;

  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

  if (tep_not_null($action)) {
    switch ($action) {
      case 'update_design':
        $dID = tep_db_prepare_input($HTTP_GET_VARS['design_id']);
        $design_updated = false;
        $check_status_query = tep_db_query("select designs_name, designs_description, designs_comment, designs_data, date_expires, designs_event_name, designs_event_date, designs_event_type from " . TABLE_DESIGNS . " where designs_id = '" . (int)$dID . "'");
        $check_status = tep_db_fetch_array($check_status_query);

        if (isset($HTTP_GET_VARS['data'])) {
          $d_data = tep_db_prepare_input($HTTP_GET_VARS['data']);
          if (($check_status['designs_data'] != $d_data)) {
            if (isset($HTTP_GET_VARS['name'])) {
              $d_name = tep_db_prepare_input($HTTP_GET_VARS['name']);
              tep_db_query("update " . TABLE_DESIGNS . " set designs_name = '" . tep_db_input($d_name) . "', designs_data = '" . tep_db_input($d_data) . "' where designs_id = '" . (int)$dID . "'");
            } else {
              tep_db_query("update " . TABLE_DESIGNS . " set designs_data = '" . tep_db_input($d_data) . "' where designs_id = '" . (int)$dID . "'");
              $keep_quiet = true;
            }
            $design_updated = true;
          }
        } else {
          $d_name = tep_db_prepare_input($HTTP_POST_VARS['design_name']);
          $d_event_name = tep_db_prepare_input($HTTP_POST_VARS['event_name']);
          $d_event_date = tep_db_prepare_input($HTTP_POST_VARS['event_date']);
          $d_event_type = tep_db_prepare_input($HTTP_POST_VARS['event_type']);
          $d_description = tep_db_prepare_input($HTTP_POST_VARS['description']);
          $d_comments = tep_db_prepare_input($HTTP_POST_VARS['comment']);


          $date_check_error = false;
          if (tep_not_null($d_event_date)) {
            if (!tep_checkdate($d_event_date, DOB_FORMAT_STRING, $d_event_date_array)) {
              $date_check_error = true;
              $messageStack->add('design_edit', ERROR_INVALID_DESIGN_DATE);
            } else {
              $d_event_date = (int)$d_event_date_array[0] . "-" . (int)$d_event_date_array[1] . "-" . (int)$d_event_date_array[2];
            }
          }

          if ( $date_check_error == false) {
            if ( ($check_status['designs_name'] != $d_name) || ($check_status['designs_description'] != $d_description) || ($check_status['designs_comment'] != $comments) || ($check_status['event_name'] != $d_event_name) || ($check_status['event_date'] != $d_event_date) || ($check_status['event_type'] != $d_event_type)) {
              tep_db_query("update " . TABLE_DESIGNS . " set designs_name = '" . tep_db_input($d_name) . "', designs_description = '" . tep_db_input($d_description) . "', designs_comment = '" . tep_db_input($d_comments) . "', designs_event_name = '" . tep_db_input($d_event_name) . "', designs_event_date = '" . tep_db_input($d_event_date) . "', designs_event_type = '" . tep_db_input($d_event_type) . "' where designs_id = '" . (int)$dID . "'");
              $history_info['designs_name'] = tep_db_input($d_name);
              $design_updated = true;
            }
          }
        }



 
        if ($design_updated == true) {
//          $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
          $messageStack->add('design_edit', SUCCESS_ORDER_UPDATED);
        } else {
//          $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
          $messageStack->add('design_edit', WARNING_ORDER_NOT_UPDATED);
        }

        if ($keep_quiet == false) {
//          tep_redirect(tep_href_link(FILENAME_DESIGNS_HISTORY_INFO, tep_get_all_get_params(array('action', 'data')), 'SSL'));
        }
        break;
      case 'new_design':
        break;
    }
  }

  $infoo = tep_href_link(FILENAME_DESIGNS_HISTORY_INFO, tep_get_all_get_params(array('action', 'data')) . 'action=update_design','SSL');

  if ($keep_quiet == true) {
    echo 'design updated' . chr(13) . chr(10);
  } else {

//ag-eof
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head><script src="//cdn.optimizely.com/js/1865631164.js"></script>
<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">
</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"><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 $history_info['designs_event_name']; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, 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>


<?php
  if ($messageStack->size('design_edit') > 0) {
?>
      <tr>
        <td><?php echo $messageStack->output('design_edit'); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  }
?>


      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main" colspan="2"><?php echo ' <h3>' . $history_info['designs_name'] . '</h3>'; ?></td>
          </tr>
          <tr>
            <td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_short($history_info['date_created']); ?></td>
          </tr>
<!-- ag_plus //-->
          <tr>
            <center>
<?php
  if (tep_get_customer_plevel()  == 'A') {
?>

            <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
             codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,0,0"
             ID=proto1c_web width=640 height=604>
            <param name=src value="design/proto2c_web.dcr">
            <param name=swRemote value="swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false'"> 
            <param name=swStretchStyle value=none>
            <PARAM NAME=bgColor VALUE=#000000>
            <param name="sw1" value=<?php echo '"' . rtrim($history_info['designs_data']) . '">'; ?> 
            <param name="sw2" value=<?php echo '"' . $infoo . '&data=' . '">'; ?> 
            <embed src="design/proto2c_web.dcr" bgColor=#000000  width=640 height=604 swRemote="swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false'" swStretchStyle=none
             type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/" sw1=<?php echo '"' . rtrim($history_info['designs_data']) . '"'; ?> sw2=<?php echo '"' . $infoo . '&data=' . '"'; ?> ></embed>
            </object>
<?php
  } else {
?>
            <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
             codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,0,0"
             ID=test7b width=640 height=480>
            <param name=src value="design/pro7c.dcr">
            <param name=swRemote value="swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false'"> 
            <param name=swStretchStyle value=none>
            <PARAM NAME=bgColor VALUE=#000000>
            <param name="sw1" value=<?php echo '"' . rtrim($history_info['designs_data']) . '">'; ?> 
            <param name="sw2" value="none"> 
            <embed src="design/pro7c.dcr" bgColor=#000000  width=640 height=480 swRemote="swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false'" swStretchStyle=none
             type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/" sw1=<?php echo '"' . rtrim($history_info['designs_data']) . '"'; ?> sw2="none"></embed>
            </object>
<?php
  }
?>
            </center>
          </tr>
<!-- ag_plus_eof //-->
        </table></td>
      </tr>


<?php
  if (tep_get_customer_plevel()  == 'A') {
?>

      <tr><?php echo tep_draw_form('s001', tep_href_link(FILENAME_DESIGNS_HISTORY_INFO, tep_get_all_get_params(array('action')) . 'action=update_design', 'SSL')); ?>
        <td><table border="0" cellspacing="0" cellpadding="3">
          <tr>
            <td class="main"><b><?php echo HEADING_DESIGN_NAME; ?></b></td>
            <td class="main"><?php echo tep_draw_input_field('design_name', $history_info['designs_name'], 'maxlength="64", size="40"'); ?></td>        
          </tr>
          <tr>
            <td class="main"><b><?php echo HEADING_EVENT_NAME; ?></b></td>
            <td class="main"><?php echo tep_draw_input_field('event_name', $history_info['designs_event_name'], 'maxlength="64", size="40"'); ?></td>        
          </tr>
          <tr>
            <td class="main"><b><?php echo HEADING_EVENT_DATE; ?></b></td>
            <td class="main"><?php echo tep_draw_input_field('event_date', tep_date_short($history_info['designs_event_date']), 'maxlength="64", size="40"'); ?></td>
            <td class="main"><b><?php echo HEADING_EVENT_TYPE; ?></b></td>
            <td class="main"><?php echo tep_draw_input_field('event_type', $history_info['designs_event_type'], 'maxlength="64", size="40"'); ?></td>
           </tr>
          <tr>
            <td class="main"><b><?php echo HEADING_DESIGN_DESCRIPTION; ?></b></td>
            <td class="main" colspan="3"><?php echo tep_draw_input_field('description', $history_info['designs_description'], 'maxlength="64", size="40"'); ?></td>        
          </tr>
          <tr>
            <td class="main"><b><?php echo HEADING_DESIGN_COMMENTS; ?></b></td>
          </tr>
          <tr>
            <td class="main" colspan="4"><?php echo tep_draw_textarea_field('comment', 'soft', '76', '5', $history_info['designs_comment']); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
          </tr>
        </table></td>
      </form></tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main"><?php echo '<b>' . HEADING_EVENT_DATE . '</b> ' . tep_date_long($history_info['designs_event_date']); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo '<b>' . HEADING_EVENT_TYPE . '</b> ' . $history_info['designs_event_type']; ?></td>
              </tr>
            </table></td>
            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main"><?php echo '<b>' . HEADING_DESIGN_DESCRIPTION . '</b> ' . $history_info['designs_description']; ?></td>
                  </tr>
                  <tr>
                    <td class="main"><?php echo '<b>' . HEADING_DESIGN_COMMENTS . '</b> ' . $history_info['designs_comment']; ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>

<?php
  }
?>

      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
  if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td><?php echo '<a href="' . tep_href_link(FILENAME_DESIGNS_HISTORY, tep_get_all_get_params(array('design_id','action')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></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>
<!-- Hotjar Tracking Code for wanderfuls.com -->
<script>
    (function(h,o,t,j,a,r){
        h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
        h._hjSettings={hjid:78806,hjsv:5};
        a=o.getElementsByTagName('head')[0];
        r=o.createElement('script');r.async=1;
        r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
        a.appendChild(r);
    })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
</script></body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

<?php 
  }
// END OF $keep_quiet =! true
?>