Changeset 1132

Show
Ignore:
Timestamp:
04/30/08 00:25:33 (5 months ago)
Author:
rats
Message:

* Fixed #1148: DNS serial is not updated more than once a day when changing sub domains
* Fixed #1200: orderpanel {THEME_CHARSET}
* Fixed #1212: Syntax Error in edit_mail_acc.php
* Fixed #1221: Fatal error on database error
* Updated Polish
* Updated Czech

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1131 r1132  
    11ispCP ω 1.0.0 Changelog 
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     3 
     42008-04-29 Benedikt Heintel 
     5        - ENGINE: 
     6                * Fixed #1148: DNS serial is not updated more than once a day when changing sub domains 
     7        - GUI: 
     8                * Fixed #1200: orderpanel {THEME_CHARSET} 
     9                * Fixed #1212: Syntax Error in edit_mail_acc.php 
     10                * Fixed #1221: Fatal error on database error 
     11        - LANGUAGES: 
     12                * Updated Polish 
     13                * Updated Czech 
    314 
    4152008-04-29 Jochen Manz 
  • trunk/engine/ispcp-sub-mngr

    r1124 r1132  
    508508 
    509509    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 
    510     my $time2 = sprintf "%4d%02d%02d01",$year+1900,$mon+1,$mday,$seq; 
     510       my $time2 = sprintf "%4d%02d%02d%02d",$year+1900,$mon+1,$mday,$seq; 
    511511 
    512512    my $db_time_val = "$db_time_b\t\t\t $time2\t\n$db_time_e"; 
  • trunk/gui/client/edit_mail_acc.php

    r1128 r1132  
    126126                                        ) 
    127127                                ); 
    128                 if (count($mtype) > 1) { 
     128                if (($mail_forward === '_no_') ||(count($mtype) > 1)) { 
    129129                        $tpl->assign( 
    130130                                        array( 
  • trunk/gui/include/database-update-functions.php

    r1129 r1132  
    8989 
    9090                if(function_exists($functionName)) { 
    91                         $queryArray   = $functionName(); 
     91                        $queryArray[]         = $functionName(); 
    9292 
    9393                        // Query to set the new Database Revision 
     
    121121function _databaseUpdate_1() { 
    122122        $sqlUpd = array(); 
    123          
     123 
    124124        $sqlUpd[] = "INSERT INTO config (name, value) VALUES (DATABASE_REVISION , 1)"; 
    125125 
     
    182182function _databaseUpdate_3() { 
    183183        $sqlUpd = array(); 
    184          
     184 
    185185        $sqlUpd[] = "ALTER IGNORE TABLE `orders_settings` CHANGE `id` `id` int(10) unsigned NOT NULL auto_increment;"; 
    186186 
  • trunk/gui/orderpanel/addon.php

    r771 r1132  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  * @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **
     11 * @license 
     12 *  This program is free software; you can redistribute it and/or modify it under 
     13 *  the terms of the MPL General Public License as published by the Free Software 
     14 *  Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *  version. 
     16 *  You should have received a copy of the MPL Mozilla Public License along with 
     17 *  this program; if not, write to the Open Source Initiative (OSI) 
     18 *  http://opensource.org | osi@opensource.org 
     19 *
    1920 
    2021require '../include/ispcp-lib.php'; 
    2122 
    2223$tpl = new pTemplate(); 
    23  
    24 $tpl -> define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'].'/addon.tpl'); 
    25  
    26 $tpl -> define_dynamic('page_message', 'page'); 
    27  
    28 $tpl -> define_dynamic('purchase_header', 'page'); 
    29  
    30 $tpl -> define_dynamic('purchase_footer', 'page'); 
    31  
     24$tpl->define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'] . '/addon.tpl'); 
     25$tpl->define_dynamic('page_message', 'page'); 
     26$tpl->define_dynamic('purchase_header', 'page'); 
     27$tpl->define_dynamic('purchase_footer', 'page'); 
    3228 
    3329/* 
     
    3531*/ 
    3632 
    37 function addon_domain($dmn_name) 
    38 
     33function addon_domain($dmn_name) { 
    3934        $dmn_name = strtolower($dmn_name); 
    4035        $dmn_name = encode_idna($dmn_name); 
    4136 
    4237        if (!chk_dname($dmn_name)) { 
    43  
    44         set_page_message(tr('Wrong domain name syntax!')); 
     38                set_page_message(tr('Wrong domain name syntax!')); 
    4539                return; 
    46  
    47     } else if (ispcp_domain_exists($dmn_name, 0)) { 
    48  
    49         set_page_message(tr('Domain with that name already exists on the system!')); 
     40        } else if (ispcp_domain_exists($dmn_name, 0)) { 
     41                set_page_message(tr('Domain with that name already exists on the system!')); 
    5042                return; 
    51  
    52     } 
     43        } 
    5344 
    5445        $_SESSION['domainname'] = $dmn_name; 
    55         header( "Location: address.php" ); 
     46        header("Location: address.php"); 
    5647        die(); 
    57  
    5848} 
    5949 
     
    6151* Functions end 
    6252*/ 
    63  
    64  
    65  
    66  
    67  
    6853 
    6954/* 
     
    7358*/ 
    7459 
    75 if (isset($_SESSION['user_id']))
     60if (isset($_SESSION['user_id']))
    7661        $user_id = $_SESSION['user_id']; 
    7762 
    78         if (isset($_SESSION['plan_id']))
     63        if (isset($_SESSION['plan_id']))
    7964                $plan_id = $_SESSION['plan_id']; 
    80         } else if(isset($_GET['id']))
     65        } else if (isset($_GET['id']))
    8166                $plan_id = $_GET['id']; 
    8267                $_SESSION['plan_id'] = $plan_id; 
     
    8873} 
    8974 
    90 if (isset($_SESSION['domainname']))
    91         header( "Location: address.php" ); 
     75if (isset($_SESSION['domainname']))
     76        header("Location: address.php"); 
    9277        die(); 
    9378} 
    9479 
    95 if (isset($_POST['domainname']) && $_POST['domainname'] != '')
     80if (isset($_POST['domainname']) && $_POST['domainname'] != '')
    9681        addon_domain($_POST['domainname']); 
    9782} 
     
    10186gen_page_message($tpl); 
    10287 
    103         $tpl -> assign( 
    104                 array( 
    105                         'DOMAIN_ADDON' => tr('Add On A Domain'), 
    106                                                 'TR_DOMAIN_NAME' => tr('Domain name'), 
    107                                                 'TR_CONTINUE' => tr('Continue'), 
    108                                                 'TR_EXAMPLE' => tr('(e.g. domain-of-your-choice.com)'), 
    109                                                 'THEME_CHARSET' => tr('encoding'), 
     88$tpl->assign( 
     89        array( 
     90                'DOMAIN_ADDON' => tr('Add On A Domain'), 
     91                'TR_DOMAIN_NAME' => tr('Domain name'), 
     92                'TR_CONTINUE' => tr('Continue'), 
     93                'TR_EXAMPLE' => tr('(e.g. domain-of-your-choice.com)'), 
     94                'THEME_CHARSET' => tr('encoding'), 
     95                ) 
     96        ); 
    11097 
     98$tpl->parse('PAGE', 'page'); 
     99$tpl->prnt(); 
    111100 
    112                                         ) 
    113                         ); 
    114  
    115 $tpl -> parse('PAGE', 'page'); 
    116  
    117 $tpl -> prnt(); 
    118  
    119 if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); 
     101if ($cfg['DUMP_GUI_DEBUG']) 
     102        dump_gui_debug(); 
    120103 
    121104unset_messages(); 
     105 
    122106?> 
  • trunk/gui/orderpanel/address.php

    r952 r1132  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
    78 * @link                http://isp-control.net 
    8  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    910 * 
    1011 * @license 
  • trunk/gui/orderpanel/chart.php

    r747 r1132  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  *  @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **/ 
    19  
    20  
     11 * @license 
     12 *   This program is free software; you can redistribute it and/or modify it under 
     13 *   the terms of the MPL General Public License as published by the Free Software 
     14 *   Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *   version. 
     16 *   You should have received a copy of the MPL Mozilla Public License along with 
     17 *   this program; if not, write to the Open Source Initiative (OSI) 
     18 *   http://opensource.org | osi@opensource.org 
     19 */ 
    2120 
    2221require '../include/ispcp-lib.php'; 
    2322 
    2423$tpl = new pTemplate(); 
    25  
    26 $tpl -> define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'].'/chart.tpl'); 
    27  
    28 $tpl -> define_dynamic('page_message', 'page'); 
    29  
    30 $tpl -> define_dynamic('purchase_header', 'page'); 
    31  
    32 $tpl -> define_dynamic('purchase_footer', 'page'); 
    33  
     24$tpl->define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'] . '/chart.tpl'); 
     25$tpl->define_dynamic('page_message', 'page'); 
     26$tpl->define_dynamic('purchase_header', 'page'); 
     27$tpl->define_dynamic('purchase_footer', 'page'); 
    3428 
    3529/* 
     
    3731*/ 
    3832 
    39 function gen_chart(&$tpl, &$sql, $user_id, $plan_id) 
    40 
    41 global $cfg; 
    42 if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin'){ 
    43         $query = <<<SQL_QUERY 
     33function gen_chart(&$tpl, &$sql, $user_id, $plan_id) { 
     34        global $cfg; 
     35        if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin') { 
     36                $query = <<<SQL_QUERY 
    4437                        select 
    4538                                * 
     
    5043SQL_QUERY; 
    5144 
    52   $rs = exec_query($sql, $query, array($plan_id)); 
    53 } else { 
    54  
    55         $query = <<<SQL_QUERY 
     45                $rs = exec_query($sql, $query, array($plan_id)); 
     46        } else { 
     47                $query = <<<SQL_QUERY 
    5648                        select 
    5749                                * 
     
    6456SQL_QUERY; 
    6557 
    66   $rs = exec_query($sql, $query, array($user_id, $plan_id)); 
    67  } 
    68   if ($rs -> RecordCount() == 0) { 
    69  
    70     header("Location: index.php"); 
    71         die(); 
    72  
    73   } else { 
    74  
    75                 $price = $rs -> fields['price']; 
    76                 $setup_fee = $rs -> fields['setup_fee']; 
     58                $rs = exec_query($sql, $query, array($user_id, $plan_id)); 
     59        } 
     60        if ($rs->RecordCount() == 0) { 
     61                header("Location: index.php"); 
     62                die(); 
     63        } else { 
     64                $price = $rs->fields['price']; 
     65                $setup_fee = $rs->fields['setup_fee']; 
    7766                $total = $price + $setup_fee; 
    7867 
    79                         if ($price == 0 || $price == '') { 
    80                                 $price = tr('free of charge'); 
    81                         } else { 
    82                                 $price = $price." ".$rs -> fields['value']." ".$rs -> fields['payment']; 
    83                         } 
    84  
    85                         if ($setup_fee == 0 || $setup_fee == '') { 
    86                                 $setup_fee = tr('free of charge'); 
    87                         } else { 
    88                                 $setup_fee = $setup_fee." ".$rs -> fields['value']; 
    89                         } 
    90  
    91                         if ($total == 0 ) { 
    92                                 $total = tr('free of charge'); 
    93                         } else { 
    94                                 $total = $total." ".$rs -> fields['value']; 
    95                         } 
    96  
    97                 $tpl -> assign( 
    98                             array( 
    99                                     'PRICE' => $price, 
    100                                                                         'SETUP' => $setup_fee, 
    101                                                                         'TOTAL' => $total, 
    102                                                                         'TR_PACKAGE_NAME' => $rs -> fields['name'], 
    103  
    104  
    105                                  ) 
    106                           ); 
    107  
    108   } 
    109  
     68                if ($price == 0 || $price == '') { 
     69                        $price = tr('free of charge'); 
     70                } else { 
     71                        $price = $price . " " . $rs->fields['value'] . " " . $rs->fields['payment']; 
     72                } 
     73 
     74                if ($setup_fee == 0 || $setup_fee == '') { 
     75                        $setup_fee = tr('free of charge'); 
     76                } else { 
     77                        $setup_fee = $setup_fee . " " . $rs->fields['value']; 
     78                } 
     79 
     80                if ($total == 0) { 
     81                        $total = tr('free of charge'); 
     82                } else { 
     83                        $total = $total . " " . $rs->fields['value']; 
     84                } 
     85 
     86                $tpl->assign( 
     87                        array('PRICE' => $price, 
     88                                'SETUP' => $setup_fee, 
     89                                'TOTAL' => $total, 
     90                                'TR_PACKAGE_NAME' => $rs->fields['name'], 
     91 
     92                                ) 
     93                        ); 
     94        } 
    11095} 
    11196 
    112 function gen_personal_data(&$tpl) 
    113 
    114         if (isset($_SESSION['fname'])){ 
     97function gen_personal_data(&$tpl) { 
     98        if (isset($_SESSION['fname'])) { 
    11599                $first_name = $_SESSION['fname']; 
    116100        } else { 
     
    118102        } 
    119103 
    120  
    121  
    122         if (isset($_SESSION['lname'])){ 
     104        if (isset($_SESSION['lname'])) { 
    123105                $last_name = $_SESSION['lname']; 
    124106        } else { 
     
    126108        } 
    127109 
    128  
    129         if (isset($_SESSION['firm'])){ 
     110        if (isset($_SESSION['firm'])) { 
    130111                $company = $_SESSION['firm']; 
    131112        } else { 
     
    133114        } 
    134115 
    135  
    136         if (isset($_SESSION['zip'])){ 
     116        if (isset($_SESSION['zip'])) { 
    137117                $postal_code = $_SESSION['zip']; 
    138118        } else { 
     
    140120        } 
    141121 
    142  
    143         if (isset($_SESSION['city'])){ 
     122        if (isset($_SESSION['city'])) { 
    144123                $city = $_SESSION['city']; 
    145124        } else { 
     
    147126        } 
    148127 
    149  
    150         if (isset($_SESSION['country'])){ 
     128        if (isset($_SESSION['country'])) { 
    151129                $country = $_SESSION['country']; 
    152130        } else { 
     
    154132        } 
    155133 
    156  
    157         if (isset($_SESSION['street1'])){ 
     134        if (isset($_SESSION['street1'])) { 
    158135                $street1 = $_SESSION['street1']; 
    159136        } else { 
     
    161138        } 
    162139 
    163  
    164         if (isset($_SESSION['street2'])){ 
     140        if (isset($_SESSION['street2'])) { 
    165141                $street2 = $_SESSION['street2']; 
    166142        } else { 
     
    168144        } 
    169145 
    170         if (isset($_SESSION['phone']))
     146        if (isset($_SESSION['phone']))
    171147                $phone = $_SESSION['phone']; 
    172148        } else { 
     
    174150        } 
    175151 
    176         if (isset($_SESSION['fax']))
     152        if (isset($_SESSION['fax']))
    177153                $fax = $_SESSION['fax']; 
    178154        } else { 
    179155                $fax = ''; 
    180156        } 
    181         if (isset($_SESSION['email']))
     157        if (isset($_SESSION['email']))
    182158                $email = $_SESSION['email']; 
    183159        } else { 
    184160                $email = ''; 
    185161        } 
    186         if (isset($_SESSION['gender']))
     162        if (isset($_SESSION['gender']))
    187163                $gender = get_gender_by_code($_SESSION['gender']); 
    188164        } else { 
     
    190166        } 
    191167 
    192  
    193  
    194  
    195         $tpl -> assign( 
    196                 array( 
    197                      'VL_USR_NAME' => $first_name, 
    198                                          'VL_LAST_USRNAME' => $last_name, 
    199                      'VL_USR_FIRM' => $company, 
    200                      'VL_USR_POSTCODE' => $postal_code, 
    201                      'VL_USR_GENDER' => $gender, 
    202                      'VL_USRCITY' => $city, 
    203                      'VL_COUNTRY' => $country, 
    204                      'VL_STREET1' => $street1, 
    205                      'VL_STREET2' => $street2, 
    206                      'VL_PHONE' => $phone, 
    207                      'VL_FAX' => $fax, 
    208                                          'VL_EMAIL' => $email, 
    209  
    210  
    211                                         ) 
    212                         ); 
    213  
    214  
     168        $tpl->assign( 
     169                array('VL_USR_NAME' => $first_name, 
     170                        'VL_LAST_USRNAME' => $last_name, 
     171                        'VL_USR_FIRM' => $company, 
     172                        'VL_USR_POSTCODE' => $postal_code, 
     173                        'VL_USR_GENDER' => $gender, 
     174                        'VL_USRCITY' => $city, 
     175                        'VL_COUNTRY' => $country, 
     176                        'VL_STREET1' => $street1, 
     177                        'VL_STREET2' => $street2, 
     178                        'VL_PHONE' => $phone, 
     179                        'VL_FAX' => $fax, 
     180                        'VL_EMAIL' => $email, 
     181 
     182                        ) 
     183                ); 
    215184} 
    216185 
     
    218187* Functions end 
    219188*/ 
    220  
    221  
    222  
    223  
    224  
    225189 
    226190/* 
     
    230194*/ 
    231195 
    232 if (isset($_SESSION['user_id']) && $_SESSION['plan_id'])
     196if (isset($_SESSION['user_id']) && $_SESSION['plan_id'])
    233197        $user_id = $_SESSION['user_id']; 
    234198        $plan_id = $_SESSION['plan_id']; 
     
    243207gen_page_message($tpl); 
    244208 
    245         $tpl -> assign( 
    246                 array( 
    247                         'YOUR_CHART' => tr('Your Chart'), 
    248                                                 'TR_COSTS' => tr('Costs'), 
    249                                                 'TR_PACKAGE_PRICE' => tr('Price'), 
    250                                                 'TR_PACKAGE_SETUPFEE' => tr('Setup fee'), 
    251                                                 'TR_TOTAL' => tr('Total'), 
    252                                                 'TR_CONTINUE' => tr('Purchase'), 
    253                                                 'TR_CHANGE' => tr('Change'), 
    254                                                 'TR_FIRSTNAME' => tr('First name'), 
    255                             'TR_LASTNAME' => tr('Last name'), 
    256                             'TR_GENDER' => tr('Gender'), 
    257                                 'TR_COMPANY' => tr('Company'), 
    258                         'TR_POST_CODE' => tr('Zip/Postal code'), 
    259                             'TR_CITY' => tr('City'), 
    260                         'TR_COUNTRY' => tr('Country'), 
    261                         'TR_STREET1' => tr('Street 1'), 
    262                         'TR_STREET2' => tr('Street 2'), 
    263                         'TR_EMAIL' => tr('Email'), 
    264                         'TR_PHONE' => tr('Phone'), 
    265                         'TR_FAX' => tr('Fax'), 
    266                                                 'TR_EMAIL' => tr('Email'), 
    267                                                 'TR_PERSONAL_DATA' => tr('Personal Data'), 
    268                                                 'THEME_CHARSET' => tr('encoding'), 
    269  
    270  
    271                                         ) 
    272                         ); 
    273  
    274 $tpl -> parse('PAGE', 'page'); 
    275  
    276 $tpl -> prnt(); 
    277  
    278 if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); 
     209$tpl->assign( 
     210        array('YOUR_CHART' => tr('Your Chart'), 
     211                'TR_COSTS' => tr('Costs'), 
     212                'TR_PACKAGE_PRICE' => tr('Price'), 
     213                'TR_PACKAGE_SETUPFEE' => tr('Setup fee'), 
     214                'TR_TOTAL' => tr('Total'), 
     215                'TR_CONTINUE' => tr('Purchase'), 
     216                'TR_CHANGE' => tr('Change'), 
     217                'TR_FIRSTNAME' => tr('First name'), 
     218                'TR_LASTNAME' => tr('Last name'), 
     219                'TR_GENDER' => tr('Gender'), 
     220                'TR_COMPANY' => tr('Company'), 
     221                'TR_POST_CODE' => tr('Zip/Postal code'), 
     222                'TR_CITY' => tr('City'), 
     223                'TR_COUNTRY' => tr('Country'), 
     224                'TR_STREET1' => tr('Street 1'), 
     225                'TR_STREET2' => tr('Street 2'), 
     226                'TR_EMAIL' => tr('Email'), 
     227                'TR_PHONE' => tr('Phone'), 
     228                'TR_FAX' => tr('Fax'), 
     229                'TR_EMAIL' => tr('Email'), 
     230                'TR_PERSONAL_DATA' => tr('Personal Data'), 
     231                'THEME_CHARSET' => tr('encoding'), 
     232                ) 
     233        ); 
     234 
     235$tpl->parse('PAGE', 'page'); 
     236$tpl->prnt(); 
     237 
     238if ($cfg['DUMP_GUI_DEBUG']) 
     239        dump_gui_debug(); 
    279240 
    280241unset_messages(); 
     242 
    281243?> 
  • trunk/gui/orderpanel/checkout.php

    r745 r1132  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  *  @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **/ 
    19  
     11 * @license 
     12 *   This program is free software; you can redistribute it and/or modify it under 
     13 *   the terms of the MPL General Public License as published by the Free Software 
     14 *   Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *   version. 
     16 *   You should have received a copy of the MPL Mozilla Public License along with 
     17 *   this program; if not, write to the Open Source Initiative (OSI) 
     18 *   http://opensource.org | osi@opensource.org 
     19 */ 
    2020 
    2121require '../include/ispcp-lib.php'; 
    2222 
    2323$tpl = new pTemplate(); 
    24  
    25 $tpl -> define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'].'/checkout.tpl'); 
    26  
    27 $tpl -> define_dynamic('page_message', 'page'); 
    28  
    29 $tpl -> define_dynamic('purchase_header', 'page'); 
    30  
    31 $tpl -> define_dynamic('purchase_footer', 'page'); 
    32  
     24$tpl->define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'] . '/checkout.tpl'); 
     25$tpl->define_dynamic('page_message', 'page'); 
     26$tpl->define_dynamic('purchase_header', 'page'); 
     27$tpl->define_dynamic('purchase_footer', 'page'); 
    3328 
    3429/* 
     
    3631*/ 
    3732 
    38 function gen_checkout(&$tpl, &$sql, $user_id, $plan_id) 
    39 
    40  
     33function gen_checkout(&$tpl, &$sql, $user_id, $plan_id) { 
    4134        $date = time(); 
    4235        $domain_name = $_SESSION['domainname']; 
     
    4437        $lname = $_SESSION['lname']; 
    4538 
    46         if (isset($_SESSION['firm']))
     39        if (isset($_SESSION['firm']))
    4740                $firm = $_SESSION['firm']; 
    4841        } else { 
     
    5649        $phone = $_SESSION['phone']; 
    5750 
    58         if (isset($_SESSION['fax']))
     51        if (isset($_SESSION['fax']))
    5952                $fax = $_SESSION['fax']; 
    6053        } else { 
     
    6457        $street1 = $_SESSION['street1']; 
    6558 
    66         if (isset($_SESSION['street2']))
     59        if (isset($_SESSION['street2']))
    6760                $street2 = $_SESSION['street2']; 
    6861        } else { 
     
    7265        $status = "new"; 
    7366 
    74     $query = <<<SQL_QUERY 
     67       $query = <<<SQL_QUERY 
    7568              insert into 
    7669                                        orders 
     
    9588SQL_QUERY; 
    9689 
    97     $rs = exec_query($sql, $query, array($user_id, $plan_id, $date, $domain_name, $fname, $lname, $firm, $zip, $city, $country, $email, $phone, $fax, $street1, $street2, $status)); 
    98         print $sql -> ErrorMsg(); 
    99         $order_id = $sql -> Insert_ID(); 
     90       $rs = exec_query($sql, $query, array($user_id, $plan_id, $date, $domain_name, $fname, $lname, $firm, $zip, $city, $country, $email, $phone, $fax, $street1, $street2, $status)); 
     91        print $sql->ErrorMsg(); 
     92        $order_id = $sql->Insert_ID(); 
    10093        send_order_emails($user_id, $domain_name, $fname, $lname, $email, $order_id); 
    10194 
     
    141134        if (isset($_SESSION['plan_id'])) 
    142135                unset($_SESSION['plan_id']); 
    143  
    144  
    145136} 
    146137 
     
    148139* Functions end 
    149140*/ 
    150  
    151  
    152  
    153  
    154  
    155141 
    156142/* 
     
    160146*/ 
    161147 
    162 if (isset($_SESSION['user_id']) && $_SESSION['plan_id'])
     148if (isset($_SESSION['user_id']) && $_SESSION['plan_id'])
    163149        $user_id = $_SESSION['user_id']; 
    164150        $plan_id = $_SESSION['plan_id']; 
     
    169155if ( 
    170156        (isset($_SESSION['fname']) && $_SESSION['fname'] != '') and 
    171         (isset($_SESSION['lname']) && $_SESSION['lname'] != '') and 
    172         (isset($_SESSION['email']) && $_SESSION['email'] != '') and 
    173         (isset($_SESSION['zip']) && $_SESSION['zip'] != '') and 
    174         (isset($_SESSION['city']) && $_SESSION['city'] != '') and 
    175         (isset($_SESSION['country']) && $_SESSION['country'] != '') and 
    176         (isset($_SESSION['street1']) && $_SESSION['street1'] != '') and 
    177         (isset($_SESSION['phone']) && $_SESSION['phone'] != '') 
    178         ) { 
    179  
     157                (isset($_SESSION['lname']) && $_SESSION['lname'] != '') and 
     158                (isset($_SESSION['email']) && $_SESSION['email'] != '') and 
     159                (isset($_SESSION['zip']) && $_SESSION['zip'] != '') and 
     160                (isset($_SESSION['city']) && $_SESSION['city'] != '') and 
     161                (isset($_SESSION['country']) && $_SESSION['country'] != '') and 
     162                (isset($_SESSION['street1']) && $_SESSION['street1'] != '') and 
     163                (isset($_SESSION['phone']) && $_SESSION['phone'] != '') 
     164                ) { 
    180165        gen_checkout($tpl, $sql, $user_id, $plan_id); 
    181  
    182166} else { 
    183         header( "Location: index.php?user_id=$user_id" ); 
     167        header("Location: index.php?user_id=$user_id"); 
    184168        die(); 
    185  
    186169} 
    187  
    188170 
    189171gen_purchase_haf($tpl, $sql, $user_id); 
     
    191173gen_page_message($tpl); 
    192174 
    193         $tpl -> assign( 
    194                 array( 
    195                         'CHECK_OUT' => tr('Check Out'), 
    196                                                 'THANK_YOU_MESSAGE' => tr('<b>Thank You for purchasing</b><br>You will receive an email with more details and information'), 
    197                                                 'THEME_CHARSET' => tr('encoding'), 
    198                                         ) 
    199                         ); 
     175$tpl->assign( 
     176        array('CHECK_OUT' => tr('Check Out'), 
     177                'THANK_YOU_MESSAGE' => tr('<b>Thank You for purchasing</b><br>You will receive an email with more details and information'), 
     178                'THEME_CHARSET' => tr('encoding'), 
     179                ) 
     180        ); 
    200181 
    201 $tpl -> parse('PAGE', 'page'); 
     182$tpl->parse('PAGE', 'page'); 
     183$tpl->prnt(); 
    202184 
    203 $tpl -> prnt(); 
     185if ($cfg['DUMP_GUI_DEBUG']) 
     186        dump_gui_debug(); 
    204187 
    205  
    206  
    207 if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); 
    208188?> 
  • trunk/gui/orderpanel/index.php

    r745 r1132  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  *  @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **/ 
    19  
     11 * @license 
     12 *   This program is free software; you can redistribute it and/or modify it under 
     13 *   the terms of the MPL General Public License as published by the Free Software 
     14 *   Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *   version. 
     16 *   You should have received a copy of the MPL Mozilla Public License along with 
     17 *   this program; if not, write to the Open Source Initiative (OSI) 
     18 *   http://opensource.org | osi@opensource.org 
     19 */ 
    2020 
    2121require '../include/ispcp-lib.php'; 
    2222 
    2323$tpl = new pTemplate(); 
    24  
    25 $tpl -> define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'].'/index.tpl'); 
    26  
    27 $tpl -> define_dynamic('purchase_list', 'page'); 
    28  
    29 $tpl -> define_dynamic('purchase_message', 'page'); 
    30  
    31 $tpl -> define_dynamic('purchase_header', 'page'); 
    32  
    33 $tpl -> define_dynamic('purchase_footer', 'page'); 
    34  
     24$tpl->define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'] . '/index.tpl'); 
     25$tpl->define_dynamic('purchase_list', 'page'); 
     26$tpl->define_dynamic('purchase_message', 'page'); 
     27$tpl->define_dynamic('purchase_header', 'page'); 
     28$tpl->define_dynamic('purchase_footer', 'page'); 
    3529 
    3630/* 
    3731* Functions start 
    3832*/ 
    39 function gen_packages_list(&$tpl, &$sql, $user_id) 
    40 
    41  
     33function gen_packages_list(&$tpl, &$sql, $user_id) { 
    4234        global $cfg; 
    43         if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin'){ 
    44  
     35        if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin') { 
    4536                $query = <<<SQL_QUERY 
    4637                        select 
     
    6051SQL_QUERY; 
    6152 
    62         $rs = exec_query($sql, $query, array('admin')); 
    63  
     53                $rs = exec_query($sql, $query, array('admin')); 
    6454        } else { 
    65                                $query = <<<SQL_QUERY 
     55                $query = <<<SQL_QUERY 
    6656                                select 
    6757                                        * 
     
    7464SQL_QUERY; 
    7565 
    76           $rs = exec_query($sql, $query, array($user_id)); 
     66               $rs = exec_query($sql, $query, array($user_id)); 
    7767        } 
    7868 
    79