Changeset 1247

Show
Ignore:
Timestamp:
06/29/08 00:56:27 (2 months ago)
Author:
rats
Message:

GUI Update 5/5: reseller

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gui/reseller/ahp.php

    r1241 r1247  
    2323check_login(__FILE__); 
    2424 
    25 if (Config::exists('HOSTING_PLANS_LEVEL') && Config::get('HOSTING_PLANS_LEVEL') == strtolower('admin')) { 
     25if (Config::exists('HOSTING_PLANS_LEVEL') && strtolower(Config::get('HOSTING_PLANS_LEVEL')) == 'admin') { 
    2626        Header("Location: hp.php"); 
    27  
    2827        die(); 
    2928} 
     
    8382                        'TR_STATUS' => tr('Available for purchasing'), 
    8483                        'TR_TEMPLATE_DESCRIPTON' => tr('Description'), 
    85                         'TR_EXAMPEL' => tr('(e.g. EUR)'), 
     84                        'TR_EXAMPLE' => tr('(e.g. EUR)'), 
    8685                        'TR_ADD_PLAN' => tr('Add plan') 
    8786                        ) 
     
    124123                                'HP_PAYMENT' => '', 
    125124                                'HP_DESCRIPTION_VALUE' => '', 
    126                                 'TR_STATUS_NO' => 'checked', 
    127                                 'HP_DISK_VALUE' => '' 
    128                                 ) 
    129                         ); 
     125                'TR_STATUS_YES'                 => '', 
     126                'TR_STATUS_NO'                  => 'checked', 
     127                'TR_PHP_YES'                    => '', 
     128                'TR_PHP_NO'                             => 'checked', 
     129                'TR_CGI_YES'                    => '', 
     130                'TR_CGI_NO'                             => 'checked', 
     131                'HP_DISK_VALUE'                 => '' 
     132        )); 
    130133        $tpl->assign('MESSAGE', ''); 
    131134} // End of gen_empty_hp_page() 
     
    258261                return false; 
    259262        } 
    260  
    261         return TRUE; 
    262263} // End of check_data_correction() 
    263264 
     
    304305 
    305306                                $_SESSION['hp_added'] = '_yes_'; 
    306                                 header("Location: ehp.php"); 
     307                                header("Location: hp.php"); 
    307308                                die(); 
    308309                        } 
  • trunk/gui/reseller/change_personal.php

    r1241 r1247  
    5757            city, 
    5858            country, 
     59            street1, 
     60            street2, 
    5961            email, 
    6062            phone, 
    61             fax, 
    62             street1, 
    63             street2 
     63            fax 
    6464        from 
    6565            admin 
     
    7272        $tpl->assign( 
    7373                        array( 
    74                                'FIRST_NAME' => $rs->fields['fname']
    75                                'LAST_NAME' => $rs->fields['lname']
    76                                'FIRM' => $rs->fields['firm']
    77                                'ZIP' => $rs->fields['zip']
    78                                'CITY' => $rs->fields['city']
    79                                'COUNTRY' => $rs->fields['country']
    80                                'EMAIL' => $rs->fields['email']
    81                                'PHONE' => $rs->fields['phone']
    82                                'FAX' => $rs->fields['fax']
    83                                'STREET1' => $rs->fields['street1']
    84                                'STREET2' => $rs->fields['street2']
    85                                'VL_MALE' => (($rs->fields['gender'] === 'M') ? 'selected' : ''), 
    86                                'VL_FEMALE' => (($rs->fields['gender'] === 'F') ? 'selected' : ''), 
    87                                'VL_UNKNOWN' => ((($rs->fields['gender'] === 'U') || (empty($rs->fields['gender']))) ? 'selected' : '') 
    88                                
    89                        ); 
     74                        'FIRST_NAME'   => (($rs->fields['fname'] == null)              ? '' : $rs->fields['fname'])
     75                        'LAST_NAME'    => (($rs->fields['lname'] == null)              ? '' : $rs->fields['lname'])
     76                        'FIRM'                         => (($rs->fields['firm'] == null)               ? '' : $rs->fields['firm'])
     77                        'ZIP'                  => (($rs->fields['zip'] == null)                ? '' : $rs->fields['zip'])
     78                        'CITY'                         => (($rs->fields['city'] == null)               ? '' : $rs->fields['city'])
     79                        'COUNTRY'              => (($rs->fields['country'] == null)    ? '' : $rs->fields['country'])
     80                        'STREET_1'             => (($rs->fields['street1'] == null)    ? '' : $rs->fields['street1'])
     81                        'STREET_2'             => (($rs->fields['street2'] == null)    ? '' : $rs->fields['street2'])
     82                        'EMAIL'                => (($rs->fields['email'] == null)              ? '' : $rs->fields['email'])
     83                        'PHONE'                => (($rs->fields['phone'] == null)              ? '' : $rs->fields['phone'])
     84                        'FAX'                  => (($rs->fields['fax'] == null)                ? '' : $rs->fields['fax'])
     85                        'VL_MALE'              => (($rs->fields['gender'] == 'M')              ? 'selected' : ''), 
     86                        'VL_FEMALE'    => (($rs->fields['gender'] == 'F')              ? 'selected' : ''), 
     87                        'VL_UNKNOWN'   => ((($rs->fields['gender'] == 'U') || (empty($rs->fields['gender']))) ? 'selected' : '') 
     88                       
     89                ); 
    9090} 
    9191 
  • trunk/gui/reseller/change_status.php

    r1241 r1247  
    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'; 
     
    2423check_login(__FILE__); 
    2524 
    26  
    2725if (!isset($_GET['domain_id'])) { 
    28  
    2926    header( "Location: users.php" ); 
    30  
    3127    die(); 
    3228} 
    3329 
    3430if (!is_numeric($_GET['domain_id'])) { 
    35  
    3631    header( "Location: users.php" ); 
    37  
    3832    die(); 
    39  
    4033} 
    41  
    4234 
    4335// so we have domain id and lets disable or enable it 
    4436$domain_id = $_GET['domain_id']; 
    4537 
    46  
    47  
    48  
    49  
    50 // hopa tropa - check statsu to know if have to disable or enable it 
     38// check status to know if have to disable or enable it 
    5139$query = <<<SQL_QUERY 
    5240    select 
     
    6452//lets check if this reseller has rights to disable/enable this domain 
    6553if ($rs -> fields['domain_created_id'] != $_SESSION['user_id']){ 
    66  
    6754        header( "Location: users.php" ); 
    6855    die(); 
    69  
    7056} 
    7157 
    7258$location = 'reseller'; 
    7359 
    74 if ($rs -> fields['domain_status'] == Config::get('ITEM_OK_STATUS')) 
    75 
     60if ($rs -> fields['domain_status'] == Config::get('ITEM_OK_STATUS')) { 
    7661 
    7762                //disable_domain ($sql, $domain_id, $rs -> fields['domain_name']); 
    7863                $action = "disable"; 
    7964                change_domain_status(&$sql, &$domain_id, $rs -> fields['domain_name'], $action, $location); 
    80 
    81  
    82 else if ($rs -> fields['domain_status'] == Config::get('ITEM_DISABLED_STATUS')) 
    83 
     65} else if ($rs -> fields['domain_status'] == Config::get('ITEM_DISABLED_STATUS')) { 
    8466 
    8567        //enable_domain ($sql, $domain_id, $rs -> fields['domain_name']); 
     
    8769        change_domain_status(&$sql, &$domain_id, $rs -> fields['domain_name'], $action, $location); 
    8870 
    89 
    90 else { 
     71} else { 
    9172 
    9273        header( "Location: users.php" ); 
    93  
    9474    die(); 
    9575} 
  • trunk/gui/reseller/change_user_interface.php

    r1241 r1247  
    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'; 
     
    2626 
    2727if (isset($_SESSION['logged_from']) && isset($_SESSION['logged_from_id']) && isset($_GET['action']) && $_GET['action'] == "go_back") { 
    28  
    2928    change_user_interface($_SESSION['user_id'], $_SESSION['logged_from_id']); 
    30  
    3129} else if (isset($_SESSION['user_id']) && isset($_GET['to_id'])) { 
    3230 
     
    3533    // admin logged as reseller: 
    3634    if (isset($_SESSION['logged_from']) && isset($_SESSION['logged_from_id'])) { 
    37  
    3835        $from_id = $_SESSION['logged_from_id']; 
    39  
    4036    } else {// reseller: 
    4137 
     
    4743 
    4844            header('Location: users.php'); 
    49  
    5045            die(); 
    51  
    5246        } 
    5347 
     
    5953 
    6054    header('Location: index.php'); 
    61  
    6255    die(); 
    63  
    6456} 
    6557 
  • trunk/gui/reseller/delete_domain.php

    r1241 r1247  
    3535} 
    3636 
    37 /* check for domain ouwns */ 
    38 $query = "select domain_id from domain where domain_id=? and domain_created_id=?"; 
     37/* check for domain owns */ 
     38$query = "SELECT domain_id FROM domain WHERE domain_id=? AND domain_created_id=?"; 
    3939$res = exec_query($sql, $query, array($del_id, $reseller)); 
    4040$data = $res->FetchRow(); 
     
    4646 
    4747/* check for mail acc in MAIN domain */ 
    48 $query = "select count(mail_id) as mailnum from mail_users where domain_id=?"; 
     48$query = "SELECT COUNT(mail_id) AS mailnum FROM mail_users WHERE domain_id=?"; 
    4949$res = exec_query($sql, $query, array($del_id)); 
    5050$data = $res->FetchRow(); 
     
    5757 
    5858/* check for ftp acc in MAIN domain */ 
    59 $query = "select count(fg.gid) as ftpnum from ftp_group fg,domain d where d.domain_id=? and fg.groupname=d.domain_name"; 
     59$query = "SELECT COUNT(fg.gid) AS ftpnum FROM ftp_group fg,domain d WHERE d.domain_id=? AND fg.groupname=d.domain_name"; 
    6060$res = exec_query($sql, $query, array($del_id)); 
    6161$data = $res->FetchRow(); 
     
    6868 
    6969/* check for alias domains */ 
    70 $query = "select count(alias_id) as aliasnum from domain_aliasses where domain_id=?"; 
     70$query = "SELECT COUNT(alias_id) AS aliasnum FROM domain_aliasses WHERE domain_id=?"; 
    7171$res = exec_query($sql, $query, array($del_id)); 
    7272$data = $res->FetchRow(); 
     
    7979 
    8080/* check for subdomains */ 
    81 $query = "select count(subdomain_id) as subnum from subdomain where domain_id=?"; 
     81$query = "SELECT COUNT(subdomain_id) AS subnum FROM subdomain WHERE domain_id = ?"; 
    8282$res = exec_query($sql, $query, array($del_id)); 
    8383$data = $res->FetchRow(); 
     
    9191substract_from_reseller_props($_SESSION['user_id'], $del_id); 
    9292 
    93 $query = "update domain set domain_status='delete' where domain_id=?"; 
     93$query = "UPDATE domain SET domain_status='delete' WHERE domain_id = ?"; 
    9494$res = exec_query($sql, $query, array($del_id)); 
    9595send_request(); 
    9696 
    9797/* delete admin of this domain */ 
    98 $query = "select domain_admin_id,domain_name from domain where domain_id=?"; 
     98$query = "SELECT domain_admin_id,domain_name FROM domain WHERE domain_id = ?"; 
    9999$res = exec_query($sql, $query, array($del_id)); 
    100100$dat = $res->FetchRow(); 
    101101 
    102 $query = "delete from admin where admin_id=?"; 
    103 $res = exec_query($sql, $query, array($dat[domain_admin_id])); 
     102$query = "DELETE FROM admin WHERE admin_id = ?"; 
     103$res = exec_query($sql, $query, array($dat['domain_admin_id'])); 
    104104 
    105105/* delete the quota section */ 
    106 $query = "delete from quotalimits where name=?"; 
    107 $res = exec_query($sql, $query, array($dat[domain_admin_id])); 
     106$query = "DELETE FROM quotalimits WHERE name = ?"; 
     107$res = exec_query($sql, $query, array($dat['domain_admin_id'])); 
    108108 
    109 $admin_login = $_SESSION['user_logged']; 
    110 write_log("$admin_login: delete domain " . $dat['domain_name']); 
     109 
     110write_log($_SESSION['user_logged'] .": deletes domain " . $dat['domain_name']); 
    111111 
    112112$_SESSION['ddel'] = '_yes_'; 
     
    163163        $rdisk_current -= $disk_max; 
    164164 
    165         $rprops = "$rdmn_current;$rdmn_max;"; 
     165        $rprops = "$rdmn_current;$rdmn_max;"; 
    166166        $rprops .= "$rsub_current;$rsub_max;"; 
    167167        $rprops .= "$rals_current;$rals_max;"; 
  • trunk/gui/reseller/delete_domainalias.php

    r1241 r1247  
    8080send_request(); 
    8181$admin_login = $_SESSION['user_logged']; 
    82 write_log("$admin_login: delete domain alias: " . $dat['alias_name']); 
     82write_log("$admin_login: deletes domain alias: " . $dat['alias_name']); 
    8383 
    8484$_SESSION['aldel'] = '_yes_'; 
  • trunk/gui/reseller/delete_subdomain.php

    r1241 r1247  
    9898send_request(); 
    9999$admin_login = $_SESSION['user_logged']; 
    100 write_log("$admin_login: delete subdomain: " . $dat['subdomain_name']); 
     100write_log("$admin_login: deletes subdomain: " . $dat['subdomain_name']); 
    101101 
    102102$_SESSION['dadel'] = '_yes_'; 
  • trunk/gui/reseller/domain_statistics.php

    r1241 r1247  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version 
    4  * 
    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) 
    9  * 
    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  
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
     4 * 
     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 
     10 * 
     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'; 
     
    2424 
    2525$tpl = new pTemplate(); 
    26 $tpl -> define_dynamic('page', Config::get('RESELLER_TEMPLATE_PATH') . '/domain_statistics.tpl'); 
    27 $tpl -> define_dynamic('page_message', 'page'); 
    28 $tpl -> define_dynamic('logged_from', 'page'); 
    29 $tpl -> define_dynamic('month_list', 'page'); 
    30 $tpl -> define_dynamic('year_list', 'page'); 
    31 $tpl -> define_dynamic('traffic_table', 'page'); 
    32 $tpl -> define_dynamic('traffic_table_item', 'traffic_table'); 
     26$tpl->define_dynamic('page', Config::get('RESELLER_TEMPLATE_PATH') . '/domain_statistics.tpl'); 
     27$tpl->define_dynamic('page_message', 'page'); 
     28$tpl->define_dynamic('logged_from', 'page'); 
     29$tpl->define_dynamic('month_list', 'page'); 
     30$tpl->define_dynamic('year_list', 'page'); 
     31$tpl->define_dynamic('traffic_table', 'page'); 
     32$tpl->define_dynamic('traffic_table_item', 'traffic_table'); 
    3333 
    3434$theme_color = Config::get('USER_INITIAL_THEME'); 
    3535 
    36 $tpl -> assign(array('TR_ADMIN_DOMAIN_STATISTICS_PAGE_TITLE' => tr('ispCP - Domain Statistics Data'), 
    37                      'THEME_COLOR_PATH' => "../themes/$theme_color", 
    38                      'THEME_CHARSET' => tr('encoding'), 
    39                      'ISP_LOGO' => get_logo($_SESSION['user_id']))); 
     36$tpl->assign(array('TR_ADMIN_DOMAIN_STATISTICS_PAGE_TITLE' => tr('ispCP - Domain Statistics Data'), 
     37        'THEME_COLOR_PATH' => "../themes/$theme_color", 
     38        'THEME_CHARSET' => tr('encoding'), 
     39        'ISP_LOGO' => get_logo($_SESSION['user_id']))); 
    4040 
    4141if (isset($_POST['domain_id'])) { 
    42   $domain_id = $_POST['domain_id']; 
     42    $domain_id = $_POST['domain_id']; 
    4343} else if (isset($_GET['domain_id'])) { 
    44   $domain_id = $_GET['domain_id']; 
     44    $domain_id = $_GET['domain_id']; 
    4545} 
    4646 
    4747if (isset($_POST['month']) && isset($_POST['year'])) { 
    48   $year = intval($_POST['year']); 
    49   $month = intval($_POST['month']); 
     48    $year = intval($_POST['year']); 
     49    $month = intval($_POST['month']); 
    5050} else if (isset($_GET['month']) && isset($_GET['year'])) { 
    51   $month = intval($_GET['month']); 
    52   $year = intval($_GET['year']); 
     51    $month = intval($_GET['month']); 
     52    $year = intval($_GET['year']); 
    5353} else { 
    54   $month = date("m"); 
    55   $year = date("Y"); 
     54    $month = date("m"); 
     55    $year = date("Y"); 
    5656} 
    5757 
    5858if (!is_numeric($domain_id) || !is_numeric($month) || !is_numeric($year)) { 
    59   header("Location: reseller_statistics.php"); 
    60   die(); 
     59    header("Location: reseller_statistics.php"); 
     60    die(); 
    6161} 
    6262 
    6363function get_domain_trafic($from, $to, $domain_id) 
    6464{ 
    65   $sql = Database::getInstance(); 
    66   $reseller_id = $_SESSION['user_id']; 
    67   $query = <<<SQL_QUERY 
     65    $sql = Database::getInstance(); 
     66    $reseller_id = $_SESSION['user_id']; 
     67    $query = <<<SQL_QUERY 
    6868        select 
    6969          domain_id 
     
    7474SQL_QUERY; 
    7575 
    76   $rs = exec_query($sql, $query, array($domain_id, $reseller_id)); 
    77   if ($rs -> RecordCount() == 0) { 
    78     set_page_message(tr('User does not exist or you do not have permission to access this interface!')); 
    79     header('Location: reseller_user_statistics.php'); 
    80     die(); 
    81  
    82  
    83   $query = <<<SQL_QUERY 
     76    $rs = exec_query($sql, $query, array($domain_id, $reseller_id)); 
     77    if ($rs->RecordCount() == 0) { 
     78        set_page_message(tr('User does not exist or you do not have permission to access this interface!')); 
     79        header('Location: reseller_user_statistics.php'); 
     80        die(); 
     81   
     82 
     83    $query = <<<SQL_QUERY 
    8484        select 
    8585            IFNULL(sum(dtraff_web), 0) as web_dr, 
     
    9292            domain_id = ? and dtraff_time >= ? and dtraff_time <= ? 
    9393SQL_QUERY; 
    94   $rs =  exec_query($sql, $query, array($domain_id, $from, $to)); 
    95  
    96   if($rs -> RecordCount() == 0) { 
    97     return array(0,0,0,0); 
    98   } else { 
    99     return array($rs->fields['web_dr'], 
    100                  $rs->fields['ftp_dr'], 
    101                  $rs->fields['pop_dr'], 
    102                  $rs->fields['mail_dr']); 
    103   } 
    104 
    105  
    106 function generate_page (&$tpl, $domain_id) 
    107 
    108   $sql = Database::getInstance(); 
    109   global $month,$year; 
    110   global $web_trf, $ftp_trf, $smtp_trf, $pop_trf, 
    111          $sum_web, $sum_ftp, $sum_mail, $sum_pop; 
    112  
    113   $fdofmnth = mktime(0,0,0,$month,1,$year); 
    114   $ldofmnth = mktime(1,0,0,$month+1,0,$year); 
    115  
    116   if ($month == date('m') && $year== date('Y')) { 
    117     $curday = date('j'); 
    118   } else { 
    119     $tmp = mktime(1,0,0,$month+1,0,$year); 
    120     $curday = date('j',$tmp); 
    121   } 
    122  
    123   $curtimestamp = time(); 
    124   $firsttimestamp = mktime(0,0,0,$month,1,$year); 
    125  
    126   $all[0] = 0; 
    127   $all[1] = 0; 
    128   $all[2] = 0; 
    129   $all[3] = 0; 
    130   $all[4] = 0; 
    131   $all[5] = 0; 
    132   $all[6] = 0; 
    133   $all[7] = 0; 
    134  
    135   $counter = 0; 
    136   for ($i = 1; $i <= $curday; $i++) { 
    137     $ftm = mktime(0,0,0,$month,$i,$year); 
    138     $ltm = mktime(23,59,59,$month,$i,$year); 
    139  
    140     $query = <<<SQL_QUERY 
     94    $rs = exec_query($sql, $query, array($domain_id, $from, $to)); 
     95 
     96    if ($rs->RecordCount() == 0) { 
     97        return array(0, 0, 0, 0); 
     98    } else { 
     99        return array($rs->fields['web_dr'], 
     100            $rs->fields['ftp_dr'], 
     101            $rs->fields['pop_dr'], 
     102            $rs->fields['mail_dr']); 
     103    } 
     104
     105 
     106function generate_page (&$tpl, $domain_id) { 
     107    $sql = Database::getInstance(); 
     108    global $month, $year; 
     109    global $web_trf, $ftp_trf, $smtp_trf, $pop_trf, 
     110    $sum_web, $sum_ftp, $sum_mail, $sum_pop; 
     111 
     112    $fdofmnth = mktime(0, 0, 0, $month, 1, $year); 
     113    $ldofmnth = mktime(1, 0, 0, $month + 1, 0, $year); 
     114 
     115    if ($month == date('m') && $year == date('Y')) { 
     116        $curday = date('j'); 
     117    } else { 
     118        $tmp = mktime(1, 0, 0, $month + 1, 0, $year); 
     119        $curday = date('j', $tmp); 
     120    } 
     121 
     122    $curtimestamp = time(); 
     123    $firsttimestamp = mktime(0, 0, 0, $month, 1, $year); 
     124 
     125    $all[0] = 0; 
     126    $all[1] = 0; 
     127    $all[2] = 0; 
     128    $all[3] = 0; 
     129    $all[4] = 0; 
     130    $all[5] = 0; 
     131    $all[6] = 0; 
     132    $all[7] = 0; 
     133 
     134    $counter = 0; 
     135    for ($i = 1; $i <= $curday; $i++) { 
     136        $ftm = mktime(0, 0, 0, $month, $i, $year); 
     137        $ltm = mktime(23, 59, 59, $month, $i, $year); 
     138 
     139        $query = <<<SQL_QUERY 
    141140            select 
    142141                dtraff_web,dtraff_ftp,dtraff_mail,dtraff_pop,dtraff_time 
     
    146145                domain_id = ? and dtraff_time >= ? and dtraff_time <= ? 
    147146SQL_QUERY; 
    148     $rs =  exec_query($sql, $query, array($domain_id, $ftm, $ltm)); 
    149  
    150     $has_data = false; 
    151     list($web_trf, $ftp_trf, $pop_trf, $smtp_trf) = get_domain_trafic($ftm, $ltm, $domain_id); 
    152  
    153         $date_formt = Config::get('DATE_FORMAT'); 
    154     if ($web_trf == 0 && $ftp_trf == 0 && $smtp_trf == 0 && $pop_trf == 0) { 
    155                 $tpl -> assign(array('MONTH' => $month, 
    156                            'YEAR' => $year, 
    157                            'DOMAIN_ID' => $domain_id, 
    158                            'DATE' => date($date_formt, strtotime($year."-".$month."-".$i)), 
    159                            'WEB_TRAFFIC' => 0, 
    160                            'FTP_TRAFFIC' => 0, 
    161                            'SMTP_TRAFFIC' => 0, 
    162                            'POP3_TRAFFIC' => 0, 
    163                            'ALL_TRAFFIC' => 0)); 
    164     } else { 
    165       if ($counter % 2 == 0) { 
    166         $tpl -> assign('ITEM_CLASS', 'content'); 
    167       } else { 
    168         $tpl -> assign('ITEM_CLASS', 'content2'); 
    169       } 
    170  
    171       $sum_web += $web_trf; 
    172       $sum_ftp += $ftp_trf; 
    173       $sum_mail += $smtp_trf; 
    174       $sum_pop += $pop_trf; 
    175  
    176       $tpl -> assign(array('DATE' => date($date_formt, strtotime($year."-".$month."-".$i)), 
    177                            'WEB_TRAFFIC' => sizeit($web_trf), 
    178                            'FTP_TRAFFIC' => sizeit($ftp_trf), 
    179                            'SMTP_TRAFFIC' => sizeit($smtp_trf), 
    180                            'POP3_TRAFFIC' => sizeit($pop_trf), 
    181                            'ALL_TRAFFIC' => sizeit($web_trf + $ftp_trf + $smtp_trf + $pop_trf))); 
    182       $tpl -> parse('TRAFFIC_TABLE_ITEM', '.traffic_table_item'); 
    183       $counter ++; 
    184     } 
    185  
    186     $tpl -> assign(array('MONTH' => $month, 
    187                          'YEAR' => $year, 
    188                          'DOMAIN_ID' => $domain_id, 
    189                          'ALL_WEB_TRAFFIC' => sizeit($sum_web), 
    190                          'ALL_FTP_TRAFFIC' => sizeit($sum_ftp), 
    191                          'ALL_SMTP_TRAFFIC' => sizeit($sum_mail), 
    192                          'ALL_POP3_TRAFFIC' => sizeit($sum_pop), 
    193                          'ALL_ALL_TRAFFIC' => sizeit($sum_web + $sum_ftp + $sum_mail + $sum_pop))); 
    194  
    195     $tpl -> parse('TRAFFIC_TABLE', 'traffic_table'); 
    196  
    197   } 
    198 
    199  
     147        $rs = exec_query($sql, $query, array($domain_id, $ftm, $ltm)); 
     148 
     149        $has_data = false; 
     150        list($web_trf, $ftp_trf, $pop_trf, $smtp_trf) = get_domain_trafic($ftm, $ltm, $domain_id); 
     151 
     152        $date_formt = Config::get('DATE_FORMAT'); 
     153        if ($web_trf == 0 && $ftp_trf == 0 && $smtp_trf == 0 && $pop_trf == 0) { 
     154            $tpl->assign(array('MONTH' => $month, 
     155                    'YEAR' => $year, 
     156                    'DOMAIN_ID' => $domain_id, 
     157                    'DATE' => date($date_formt, strtotime($year . "-" . $month . "-" . $i)), 
     158                    'WEB_TRAFFIC' => 0, 
     159                    'FTP_TRAFFIC' => 0, 
     160                    'SMTP_TRAFFIC' => 0, 
     161                    'POP3_TRAFFIC' => 0, 
     162                    'ALL_TRAFFIC' => 0)); 
     163        } else { 
     164            if ($counter % 2 == 0) { 
     165                $tpl->assign('ITEM_CLASS', 'content'); 
     166            } else { 
     167                $tpl->assign('ITEM_CLASS', 'content2'); 
     168            } 
     169 
     170            $sum_web += $web_trf; 
     171            $sum_ftp += $ftp_trf; 
     172            $sum_mail += $smtp_trf; 
     173            $sum_pop += $pop_trf; 
     174 
     175            $tpl->assign(array('DATE' => date($date_formt, strtotime($year . "-" . $month . "-" . $i)), 
     176                    'WEB_TRAFFIC' => sizeit($web_trf), 
     177                    'FTP_TRAFFIC' => sizeit($ftp_trf), 
     178                    'SMTP_TRAFFIC' => sizeit($smtp_trf), 
     179                    'POP3_TRAFFIC' => sizeit($pop_trf), 
     180                    'ALL_TRAFFIC' => sizeit($web_trf + $ftp_trf + $smtp_trf + $pop_trf))); 
     181            $tpl->parse('TRAFFIC_TABLE_ITEM', '.traffic_table_item'); 
     182            $counter ++; 
     183        } 
     184 
     185        $tpl->assign(array('MONTH' => $month, 
     186                'YEAR' => $year, 
     187                'DOMAIN_ID' => $domain_id, 
     188                'ALL_WEB_TRAFFIC' => sizeit($sum_web), 
     189                'ALL_FTP_TRAFFIC' => sizeit($sum_ftp), 
     190                'ALL_SMTP_TRAFFIC' => sizeit($sum_mail), 
     191                'ALL_POP3_TRAFFIC' => sizeit($sum_pop), 
     192                'ALL_ALL_TRAFFIC' => sizeit($sum_web + $sum_ftp + $sum_mail + $sum_pop))); 
     193 
     194        $tpl->parse('TRAFFIC_TABLE', 'traffic_table'); 
     195    } 
     196
    200197 
    201198/* 
     
    211208 
    212209$tpl->assign(array('TR_DOMAIN_STATISTICS' => tr('Domain statistics'), 
    213                    'TR_MONTH' => tr('Month'), 
    214                    'TR_YEAR' => tr('Year'), 
    215                    'TR_SHOW' => tr('Show'), 
    216                    'TR_WEB_TRAFFIC' => tr('Web traffic'), 
    217                    'TR_FTP_TRAFFIC' => tr('FTP traffic'), 
    218                    'TR_SMTP_TRAFFIC' => tr('SMTP traffic'), 
    219                    'TR_POP3_TRAFFIC' => tr('POP3/IMAP traffic'), 
    220                    'TR_ALL_TRAFFIC' => tr('All traffic'), 
    221                    'TR_ALL' => tr('All'), 
    222                    'TR_DAY' => tr('Day')) 
    223 ); 
     210        'TR_MONTH' => tr('Month'), 
     211        'TR_YEAR' => tr('Year'), 
     212        'TR_SHOW' => tr('Show'), 
     213        'TR_WEB_TRAFFIC' => tr('Web traffic'), 
     214        'TR_FTP_TRAFFIC' => tr('FTP traffic'), 
     215        'TR_SMTP_TRAFFIC' => tr('SMTP traffic'), 
     216        'TR_POP3_TRAFFIC' => tr('POP3/IMAP traffic'), 
     217        'TR_ALL_TRAFFIC' => tr('All traffic'), 
     218        'TR_ALL' => tr('All'), 
     219        'TR_DAY' => tr('Day')) 
     220    ); 
    224221 
    225222gen_select_lists($tpl, $month, $year); 
    226223generate_page($tpl, $domain_id); 
    227224gen_page_message($tpl); 
    228 $tpl -> parse('PAGE', 'page'); 
    229 $tpl -> prnt(); 
    230  
    231 if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug(); 
     225 
     226$tpl->parse('PAGE', 'page'); 
     227$tpl->prnt(); 
     228 
     229if (Config::get('DUMP_GUI_DEBUG')) 
     230        dump_gui_debug(); 
    232231 
    233232unset_messages(); 
     233 
    234234?> 
  • trunk/gui/reseller/edit_alias.php

    r1241 r1247  
    216216 
    217217                $admin_login = $_SESSION['user_logged']; 
    218                 write_log("$admin_login: change domain alias forward: " . $rs->fields['t1.alias_name']); 
     218                write_log("$admin_login: changes domain alias forward: " . $rs->fields['t1.alias_name']); 
    219219                unset($_SESSION['edit_ID']); 
    220220                $tpl->assign('MESSAGE', ""); 
  • trunk/gui/reseller/edit_user.php

    r1241 r1247  
    401401 
    402402        $admin_login = $_SESSION['user_logged']; 
    403     write_log("$admin_login changed data/password for $dmn_user_name!"); 
     403    write_log("$admin_login changes data/password for $dmn_user_name!"); 
    404404 
    405405        if (isset($_POST['send_data']) && !empty($inpass)) { 
  • trunk/gui/reseller/ehp.php

    r1241 r1247  
    7777                        'TR_STATUS' => tr('Available for purchasing'), 
    7878                        'TR_TEMPLATE_DESCRIPTON' => tr('Description'), 
    79                         'TR_EXAMPEL' => tr('(e.g. EUR)'), 
     79                        'TR_EXAMPLE' => tr('(e.g. EUR)'), 
    8080                        'TR_EDIT_HOSTING_PLAN' => tr('Update plan'), 
    8181                        'TR_UPDATE_PLAN' => tr('Update plan') 
     
    309309                return false; 
    310310        } 
    311  
    312         return TRUE; 
    313311} // End of check_data_iscorrect() 
    314312 
  • trunk/gui/reseller/email_setup.php

    r1241 r1247  
    6666gen_logged_from($tpl); 
    6767 
    68 $tpl->assign(array('TR_EMAIL_SETUP' => tr('Email setup'), 
     68$tpl->assign( 
     69        array( 
     70                'TR_EMAIL_SETUP' => tr('Email setup'), 
    6971                'TR_MESSAGE_TEMPLATE_INFO' => tr('Message template info'), 
    7072                'TR_USER_LOGIN_NAME' => tr('User login (system) name'), 
     
    7779                'TR_SENDER_NAME' => tr('Senders name'), 
    7880                'TR_APPLY_CHANGES' => tr('Apply changes'), 
     81                'TR_USERTYPE' => tr('User type (admin, reseller, user)'), 
     82                'TR_BASE_SERVER_VHOST' => tr('URL to this admin panel'), 
    7983                'SUBJECT_VALUE' => $data['subject'], 
    8084                'MESSAGE_VALUE' => $data['message'], 
    8185                'SENDER_EMAIL_VALUE' => $data['sender_email'], 
    82                 'SENDER_NAME_VALUE' => $data['sender_name'])); 
     86                'SENDER_NAME_VALUE' => $data['sender_name'] 
     87                ) 
     88        ); 
    8389 
    8490gen_page_message($tpl); 
  • trunk/gui/reseller/lostpassword.php

    r1241 r1247  
    11<?php 
    2 /** 
    32/** 
    43 * ispCP ω (OMEGA) a Virtual Hosting Control System 
     
    2827$tpl->define_dynamic('page_message', 'page'); 
    2928$tpl->define_dynamic('logged_from', 'page'); 
     29$tpl->define_dynamic('custom_buttons', 'page'); 
    3030 
    3131$theme_color = Config::get('USER_INITIAL_THEME'); 
     
    106106                        'TR_SENDER_EMAIL' => tr('Senders email'), 
    107107                        'TR_SENDER_NAME' => tr('Senders name'), 
    108                         'TR_APPLY_CHANGES' => tr('Apply changes') 
     108                        'TR_APPLY_CHANGES' => tr('Apply changes'), 
     109                        'TR_BASE_SERVER_VHOST' => tr('URL to this admin panel') 
    109110                        ) 
    110111                ); 
  • trunk/gui/reseller/orders_delete.php

    r1241 r1247  
    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  *  Thi