function orders_update($event, $step)
{
    global $txp_user, $vars, $txpcfg, $prefs;
    extract($prefs);
    extract(doSlash($_REQUEST));
    if (isset($ship_now)) {
        $ship_date = 'current_timestamp()';
    } else {
        $ship_date = "'" . date("Y-m-d", strtotime($ship_year . '-' . $ship_month . '-' . $ship_day)) . "'";
    }
    $rs = safe_update('orders', "\n\t\t\ttracking_number\t\t = '{$tracking_number}',\n\t\t\torder_status\t\t = '{$order_status}',\n\t\t\tship_date \t\t\t = {$ship_date},\n\t\t\tship_method\t\t\t = '{$ship_method}',\n\t\t\tnote \t\t\t\t = '{$note}'", "id = {$id}");
    if ($rs) {
        orders_edit('', '', "Order updated");
    } else {
        orders_edit("There was an error trying to update the order: " . mysql_error());
    }
}
function orders_service_fee_questions()
{
    $id = orders_service_fee_exists();
    $created = false;
    if (!$id) {
        $data['quantity'] = get_conf(__FILE__, __LINE__, "default_quantity");
        $id = orders_create(SERVICE_ID, $data);
        $created = true;
    }
    $start_data['id'] = $id;
    orders_edit($start_data, $created);
}
Esempio n. 3
0
             $back_to_cat = false;
         }
     }
     if ($back_to_cat) {
         $_SESSION['go_back_to_cat'] = 1;
         $dish = new dish($dishid);
         $list['category'] = $dish->data['category'];
         $list['priority'] = $start_data['priority'];
         dish_list($list);
     } else {
         $_SESSION['go_back_to_cat'] = 0;
         orders_list();
     }
     break;
 case 'edit':
     orders_edit($start_data);
     break;
 case 'update':
     if ($start_data['quantity'] == 0) {
         $err = orders_delete($start_data);
         status_report('DELETION', $err);
         orders_list();
         break;
     }
     $err = orders_update($start_data);
     status_report('UPDATE', $err);
     $last_mod = order_get_last_modified();
     if ($last_mod && isset($_SESSION['go_back_to_cat']) && $_SESSION['go_back_to_cat']) {
         $ord = new order((int) $last_mod);
         $dish = new dish($ord->data['dishid']);
         $list['category'] = $dish->data['category'];