Example #1
0
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'ipsandports' || $page == 'overview') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
        $fields = array('ip' => $lng['admin']['ipsandports']['ip'], 'port' => $lng['admin']['ipsandports']['port']);
        $paging = new paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
        $ipsandports = '';
        $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt);
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                    $row['ip'] = '[' . $row['ip'] . ']';
Example #2
0
<?php

session_start();
//include_once("../include/db_mysqli.inc");
include_once "../include/template.inc";
include_once "../include/confGral.php";
require "../include/paging_class.php";
include_once "../include/acceso.class.php";
$usuario = new Acceso();
$t = new Template("../templates", "keep");
$paging = new paging(15, 5, "<< prev", "next >>", "(%%number%%) ");
$paging->db("localhost", "nesoftwa_root", ";L9Nehbfaxts", "nesoftwa_ALMARTCON");
// Identificar si pertenece a una Naviera
$sesIdUsr = $_SESSION['sesIdUsuario'];
$idNaviera = getValueTable("id_naviera", "USUARIO", "id_usuario", $sesIdUsr);
if ($usuario->havePerm("1,3,4", $_SESSION['sesArrPerms'])) {
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function explode_keyword($q)
    {
        //trim
        $q = trim($q);
        $q = preg_replace("/[\\s]+/", " ", $q);
        $mode = "AND ";
        if (!empty($q)) {
            $condition = $condition . " eir='{$q}' " . $mode;
        }
        //$condition= substr($condition,0,-4);
        return $condition;
    }
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function explode_keyword2($q)
Example #3
0
$_SESSION['s_page_admin'] = $_SERVER['PHP_SELF'];
$OPERADOR_AREA = false;
if (isset($_SESSION['s_area_admin']) && $_SESSION['s_area_admin'] == '1' && $_SESSION['s_nivel'] != '1') {
    $OPERADOR_AREA = true;
}
print "<HTML>";
print "<BODY bgcolor='" . BODY_COLOR . "'>";
$auth = new auth();
if ($OPERADOR_AREA) {
    $auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
} else {
    $auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 1);
}
print "<BR><B>" . TRANS('ADM_PROBS') . "</B><BR>";
print "<FORM method='POST' action='" . $_SERVER['PHP_SELF'] . "' onSubmit=\"return valida()\">";
$PAGE = new paging("PRINCIPAL");
$PAGE->setRegPerPage($_SESSION['s_page_size']);
if (!isset($_GET['cellStyle'])) {
    $cellStyle = "cellpadding='5' cellspacing='0'";
} else {
    $cellStyle = "cellpadding='0' cellspacing='1'";
}
print "<TABLE border='0' align='left' " . $cellStyle . "  width='100%' bgcolor='" . BODY_COLOR . "'>";
if (isset($_POST['search'])) {
    $search = $_POST['search'];
} else {
    $search = "";
}
$qry_config = "SELECT * FROM config ";
$exec_config = mysql_query($qry_config) or die(TRANS('ERR_TABLE_CONFIG'));
$row_config = mysql_fetch_array($exec_config);
Example #4
0
}
global $koneksi_db, $maxdata;
$tengah = '<h4 class="bg">Hasil Pencarian</h4>';
$query = cleartext($_GET['query']);
if ($query == '' or !isset($query)) {
    $tengah .= "<div class=\"error\">Tidak Ada Pencarian</div>";
} else {
    $limit = 10;
    $s1 = '';
    $query = htmlentities($query);
    $hasil = $koneksi_db->sql_query("SELECT * FROM artikel WHERE ((judul LIKE '%{$query}%' OR konten LIKE '%{$query}%' OR user LIKE '%{$query}%')AND publikasi=1)");
    $jumlah = $koneksi_db->sql_numrows($hasil);
    if ($jumlah < 1) {
        $s1 = "tidak ada";
    }
    $a = new paging($limit);
    if (!$s1) {
        $tengah .= '<div class="border">';
        $tengah .= "Yang dicari <b>\"{$query}\"</b>";
        $tengah .= '</div>';
        $offset = int_filter(@$_GET['offset']);
        $pg = int_filter(@$_GET['pg']);
        $stg = int_filter(@$_GET['stg']);
        $hasil2 = $koneksi_db->sql_query("SELECT * FROM artikel WHERE ((judul LIKE '%{$query}%' OR konten LIKE '%{$query}%' OR user LIKE '%{$query}%')AND publikasi=1) ORDER By id LIMIT {$offset},{$limit}");
        $tengah .= '<div class="border">';
        $tengah .= "Ditemukan <b>" . $jumlah . "</b> artikel mengandung kata: <b>{$query}</b>";
        $tengah .= '</div>';
        $tengah .= '<div class="border">';
        while ($data = $koneksi_db->sql_fetchrow($hasil2)) {
            $tengah .= "<p class=\"konten\"><a href=\"?pilih=news&amp;mod=yes&amp;aksi=lihat&amp;id={$data['0']}\">{$data['1']}</a><br />";
            $data[5] = datetimes($data['tgl']);
Example #5
0
<?php

session_start();
//include_once("../include/db_mysqli.inc");
include_once "../include/template.inc";
include_once "../include/confGral.php";
require "../include/paging_class.php";
$t = new Template("../templates", "keep");
$paging = new paging(15, 5, "<< prev", "next >>", "(%%number%%) ");
$paging->db("localhost", "nesoftwa_root", ";L9Nehbfaxts", "nesoftwa_MOPSAPRO");
// Identificar si pertenece a una Naviera
$idUsr = $_SESSION['sesIdUsuario'];
$sesIdOficina = $_SESSION['sesIdOficina'];
// fffffffffffffffffffffffffffffffffffffffffffffffffffffff
function explode_keyword1($q)
{
    //trim
    $q = trim($q);
    $q = preg_replace("/[\\s]+/", " ", $q);
    $mode = "AND ";
    $condition = $condition . "posicion like '%{$q}%' " . $mode;
    //$condition= substr($condition,0,-4);
    return $condition;
}
// fffffffffffffffffffffffffffffffffffffffffffffffffffffff
function explode_keyword2($q)
{
    //trim
    $q = trim($q);
    //$q= preg_replace("/[\s]+/"," ",$q);
    $mode = "AND ";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    $taxclasses = array();
    $taxclasses_option = '';
    $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
    while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
        $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
        $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
    }
    if ($action == '') {
        $fields = array('tld' => $lng['domains']['topleveldomain'], 'valid_from' => $lng['service']['valid_from'], 'valid_to' => $lng['service']['valid_to'], 'interval_fee' => $lng['service']['interval_fee'], 'interval_length' => $lng['service']['interval_length'], 'setup_fee' => $lng['service']['setup_fee']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query('SELECT *  ' . 'FROM `' . TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES . '` ' . $paging->getSqlWhere() . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
        $i = 0;
        $domainstemplates = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                eval('$domainstemplates.="' . getTemplate('billing/domains_templates_row') . '";');
            }
            ++$i;
Example #7
0
<?php

session_start();
//include_once("../include/db_mysqli.inc");
include_once "../include/template.inc";
include_once "../include/confGral.php";
require "../include/paging_class.php";
$t = new Template("../templates", "keep");
$paging = new paging(15, 5, "<< prev", "next >>", "(%%number%%) ");
$paging->db("localhost", "nesoftwa_root", ";L9Nehbfaxts", "nesoftwa_ANAKOSTA");
// Identificar si pertenece a una Naviera
$idUsr = $_SESSION['sesIdUsuario'];
$idNaviera = getValueTable("id_naviera", "USUARIO", "id_usuario", $idUsr);
// fffffffffffffffffffffffffffffffffffffffffffffffffffffff
function explode_keyword1($q)
{
    //trim
    $q = trim($q);
    $q = preg_replace("/[\\s]+/", " ", $q);
    $idConte = getValueTable("id_contenedor", "CONTENEDOR", "numero", $q);
    if (empty($idConte) && !empty($q)) {
        $idConte = '-';
    }
    $mode = "AND ";
    $condition = $condition . "i.id_contenedor like '{$idConte}%' " . $mode;
    //$condition= substr($condition,0,-4);
    return $condition;
}
// fffffffffffffffffffffffffffffffffffffffffffffffffffffff
function explode_keyword2($q)
{
Example #8
0
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
    if ($action == '') {
        $fields = array('date' => $lng['logger']['date'], 'type' => $lng['logger']['type'], 'user' => $lng['logger']['user'], 'text' => $lng['logger']['action']);
        $paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
        $result_stmt = Database::query('
			SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $logs_count = Database::num_rows();
        $paging->setEntries($logs_count);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $clog = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($clog[$row['action']]) || !is_array($clog[$row['action']])) {
                $clog[$row['action']] = array();
            }
            $clog[$row['action']][$row['logid']] = $row;
        }
Example #9
0
function customPaging($sql, $ListRecPerPage = 20, $rewrite_url = false)
{
    //var_dump($rewrite_url);
    global $link;
    //===============Paging========================
    //$ListRecPerPage = 10;
    $pg = new paging($link, "page", $ListRecPerPage, "&raquo;", "&laquo;", 5, @$CurlLink);
    $pg->sql = $sql;
    $r = $pg->get_page_result();
    // result set
    $num_rows = $pg->get_page_num_rows();
    // number of records in result set
    $data = array();
    if ($num_rows > 0) {
        while ($o = GetArr($r)) {
            array_push($data, $o);
        }
    }
    mysql_data_seek($r, 0);
    //if( @$iscurl )
    //$nav_links = $pg->navigation_curl(" | ", "price" ); // the navigation links (define a CSS class selector for the current link)
    //else $separator = " | ", $css_current = "", $back_forward = false, $rewrite_url = false
    $nav_links = $pg->navigation(" ", "current", false, $rewrite_url);
    // the navigation links (define a CSS class selector for the current link)
    $nav_info = $pg->page_info("to");
    // information about the number of records on page ("to" is the text between the number)
    $simple_nav_links = $pg->back_forward_link();
    // the navigation with only the back and forward links
    $total_recs = $pg->get_total_rows();
    // the total number of records*/
    //=============================================
    return array('data' => $data, 'result' => $r, 'total_recs' => $total_recs, 'nav_links' => $nav_links, 'nav_info' => $nav_info, 'simple_nav_links' => $simple_nav_links);
}
Example #10
0
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'customers' && $userinfo['customers'] != '0') {
    if ($action == '') {
        // clear request data
        unset($_SESSION['requestData']);
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_customers");
        $fields = array('c.loginname' => $lng['login']['username'], 'a.loginname' => $lng['admin']['admin'], 'c.name' => $lng['customer']['name'], 'c.email' => $lng['customer']['email'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'c.diskspace' => $lng['customer']['diskspace'], 'c.diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')', 'c.traffic' => $lng['customer']['traffic'], 'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')');
        $paging = new paging($userinfo, TABLE_PANEL_CUSTOMERS, $fields);
        $customers = '';
        $result_stmt = Database::prepare("\n\t\t\tSELECT `c`.*, `a`.`loginname` AS `adminname`\n\t\t\tFROM `" . TABLE_PANEL_CUSTOMERS . "` `c`, `" . TABLE_PANEL_ADMINS . "` `a`\n\t\t\tWHERE " . ($userinfo['customers_see_all'] ? '' : " `c`.`adminid` = :adminid AND ") . "\n\t\t\t`c`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
        $num_rows = Database::num_rows();
        $paging->setEntries($num_rows);
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                $domains_stmt = Database::prepare("\n\t\t\t\t\tSELECT COUNT(`id`) AS `domains`\n\t\t\t\t\tFROM `" . TABLE_PANEL_DOMAINS . "`\n\t\t\t\t\tWHERE `customerid` = :cid\n\t\t\t\t\tAND `parentdomainid` = '0'\n\t\t\t\t\tAND `id`<> :stdd");
                Database::pexecute($domains_stmt, array('cid' => $row['customerid'], 'stdd' => $row['standardsubdomain']));
Example #11
0
 function showTable()
 {
     global $error_msg;
     global $report_msg;
     global $warning_msg_displayed;
     global $num_ajaxCRUD_tables_instantiated;
     $num_ajaxCRUD_tables_instantiated++;
     /* Sort Table
           Note: this cancels out default sorting set by addOrderBy()
        */
     if ($this->db_table == $_REQUEST['table'] && $_REQUEST['sort_field'] != '') {
         $sort_field = $_REQUEST['sort_field'];
         $user_sort_order_direction = $_REQUEST['sort_direction'];
         if ($user_sort_order_direction == 'asc') {
             $this->sort_direction = "desc";
         } else {
             $this->sort_direction = "asc";
         }
         $sort_sql = " ORDER BY {$sort_field} {$this->sort_direction}";
         $this->addOrderBy($sort_sql);
         $this->sorted_table = true;
     }
     //the HTML to display
     $top_html = "";
     //top header stuff
     $table_html = "";
     //for the html table itself
     $bottom_html = "";
     $add_html = "";
     //for the add form
     $html = "";
     //all combined
     if ($num_ajaxCRUD_tables_instantiated == 1) {
         //pull in the  css and javascript files
         $this->insertHeader($this->ajax_file);
     }
     if ($this->doActionOnShowTable) {
         if ($_REQUEST['action'] != '') {
             $this->doAction($_REQUEST['action']);
         }
     }
     $item = $this->item;
     $top_html .= "<a name='ajaxCRUD" . $num_ajaxCRUD_tables_instantiated . "' id='ajaxCRUD" . $num_ajaxCRUD_tables_instantiated . "'></a>\n";
     if (count($this->ajaxFilter_fields) > 0) {
         $top_html .= "<form id=\"" . $this->db_table . "_filter_form\">\n";
         $top_html .= "<table cellspacing='5' align='center'><tr>";
         foreach ($this->ajaxFilter_fields as $filter_field) {
             $display_field = $filter_field;
             if ($this->displayAs_array[$filter_field] != '') {
                 $display_field = $this->displayAs_array[$filter_field];
             }
             $textbox_size = $this->ajaxFilterBoxSize[$filter_field];
             $filter_value = "";
             if ($_REQUEST[$filter_field] != '') {
                 $filter_value = $_REQUEST[$filter_field];
             }
             $top_html .= "<td><b>{$display_field}</b>: <input type=\"text\" size=\"{$textbox_size}\" name=\"{$filter_field}\" value=\"{$filter_value}\" onKeyUp=\"filterTable(this, '" . $this->db_table . "', '{$filter_field}', '{$extra_query_params}');\"></td>";
         }
         $top_html .= "</tr></table>\n";
         $top_html .= "</form>\n";
     }
     #############################################
     #
     # Begin code for displaying database elements
     #
     #############################################
     $select_fields = implode(",", $this->fields);
     $sql = "SELECT * FROM " . $this->db_table . $this->sql_where_clause . $this->sql_order_by;
     if ($this->showPaging) {
         $pageid = $_GET['pid'];
         //Get the pid value
         if (intval($pageid) == 0) {
             $pageid = 1;
         }
         $Paging = new paging();
         $Paging->tableName = $this->db_table;
         $total_records = $Paging->myRecordCount($sql);
         //count records
         $totalpage = $Paging->processPaging($this->limit, $pageid);
         $rows = $Paging->startPaging($sql);
         //get records in the databse
         $links = $Paging->pageLinks(basename($PHP_SELF));
         //1234 links
         unset($Paging);
     } else {
         $rows = q($sql . $this->sql_limit);
     }
     //$rows = q("SELECT * FROM " . $this->db_table");
     $row_count = count($rows);
     $this->row_count = $row_count;
     $_SESSION['row_count'] = $row_count;
     if ($row_count == 0) {
         $report_msg[] = $this->emptyTableMessage;
     }
     #this is an optional function which will allow you to display errors or report messages as desired. comment it out if desired
     //only show the message box if it hasn't been displayed already
     if ($warning_msg_displayed == 0 || $warning_msg_displayed == '') {
         echo_msg_box();
     }
     $dropdown_array = array();
     foreach ($this->category_table_array as $key => $category_table) {
         $category_field_name = $this->category_field_array[$key];
         $category_table_pk = $this->category_table_pk_array[$key];
         $order_by = '';
         if ($this->category_sort_field_array[$key] != '') {
             $order_by = " ORDER BY " . $this->category_sort_field_array[$key];
         }
         $whereclause = '';
         if ($this->category_whereclause_array[$key] != '') {
             $whereclause = $this->category_whereclause_array[$key];
         }
         $dropdown_array[] = q("SELECT {$category_table_pk}, {$category_field_name} FROM {$category_table} {$whereclause} {$order_by}");
     }
     $top_html .= "<div id='{$this->db_table}'>\n";
     if ($row_count > 0) {
         //$edit_word = "Edit";
         //if ($row_count == 0) $edit_word = "No";
         //$top_html .= "<h3>Edit " . $this->item_plural . "</h3>\n";
         $table_html .= "<table align='center' class='ajaxCRUD' name='table_" . $this->db_table . "' id='table_" . $this->db_table . "' cellspacing='" . $this->cellspacing . "' border=" . $this->border . ">\n";
         $table_html .= "<tr>\n";
         //for an (optional) checkbox
         if ($this->showCheckbox) {
             $table_html .= "<th>&nbsp;</th>";
         }
         foreach ($this->display_fields as $field) {
             $field_name = $field;
             if ($this->displayAs_array[$field] != '') {
                 $field = $this->displayAs_array[$field];
             }
             if (array_key_exists($field_name, $this->checkboxall)) {
                 $table_html .= "<th><input type=\"checkbox\" name=\"{$field_name}" . "_checkboxall\" value=\"checkAll\" onClick=\"\n\t\t\t\t\t\t\tif (this.checked) {\n\t\t\t\t\t\t\t\tsetAllCheckboxes('{$field_name}" . "_fieldckbox',false);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetAllCheckboxes('{$field_name}" . "_fieldckbox',true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\">";
                 if ($this->checkboxall[$field_name] == true) {
                     $table_html .= "<a href='javascript:;' onClick=\"changeSort('{$this->db_table}', '{$field_name}', '{$this->sort_direction}');\" >" . $field . "</a>";
                 }
                 $table_html .= "</th>";
             } else {
                 $table_html .= "<th><a href='javascript:;' onClick=\"changeSort('{$this->db_table}', '{$field_name}', '{$this->sort_direction}');\" >" . $field . "</a></th>";
             }
         }
         if ($this->delete || count($this->row_button) > 0) {
             $table_html .= "<th>Action</th>\n";
         }
         $table_html .= "</tr>\n";
         $count = 0;
         $class = "odd";
         $attach_params = "";
         foreach ($rows as $row) {
             $id = $row[$this->db_table_pk];
             $table_html .= "<tr class='{$class}' id=\"" . $this->db_table . "_row_{$id}\" valign='top'>\n";
             if ($this->showCheckbox) {
                 $checkbox_selected = "";
                 if ($id == $_REQUEST[$this->db_table_pk]) {
                     $checkbox_selected = " checked";
                 }
                 $table_html .= "<td><input type='checkbox' {$checkbox_selected} onClick=\"window.location ='" . $_SERVER['PHP_SELF'] . "?{$this->db_table_pk}={$id}'\" /></td>";
             }
             foreach ($this->display_fields as $field) {
                 $cell_data = $row[$field];
                 //for adding a button via addButtonToRow (using "all" as the "attach params" optional third parameter)
                 if (count($this->row_button) > 0) {
                     $attach_params .= "&" . $field . "=" . $cell_data;
                 }
                 $cell_value = $cell_data;
                 //retain original value in new variable (before executing callback method)
                 if ($this->format_field_with_function[$field] != '') {
                     $cell_data = call_user_func($this->format_field_with_function[$field], $cell_data);
                 }
                 //try to find a reference to another table relationship
                 $found_category_index = array_search($field, $this->db_table_fk_array);
                 //don't allow uneditable fields (which usually includes the primary key) to be editable
                 if ($this->fieldInArray($field, $this->uneditable_fields) && !is_numeric($found_category_index) || !$this->ajax_editing) {
                     $table_html .= "<td>";
                     $key = array_search($field, $this->display_fields);
                     if ($this->fieldInArray($field, $this->file_uploads)) {
                         //a file exists for this field
                         if ($cell_data != '') {
                             $file_link = $this->file_upload_info[$field][relative_folder] . $row[$field];
                             $file_dest = $this->file_upload_info[$field][destination_folder];
                             $table_html .= "<span id='text_" . $field . $id . "'><a target=\"_new\" href=\"{$file_link}\">" . $cell_data . "</a> (<a style=\"font-size: 9px;\" href=\"javascript:\" onClick=\"document.getElementById('file_{$field}{$id}').style.display = ''; document.getElementById('text_{$field}{$id}').style.display = 'none'; \">edit</a> <a style=\"font-size: 9px;\" href=\"javascript:\" onClick=\"deleteFile('{$field}', '{$id}')\">delete</a>)</span> \n";
                             $table_html .= "<div id='file_" . $field . $id . "' style='display:none;'>\n";
                             $table_html .= $this->showUploadForm($field, $file_dest, $id);
                             $table_html .= "</div>\n";
                         }
                         if ($cell_data == '') {
                             $table_html .= "<span id='text_" . $field . $id . "'><a style=\"font-size: 9px;\" href=\"javascript:\" onClick=\"document.getElementById('file_{$field}{$id}').style.display = ''; document.getElementById('text_{$field}{$id}').style.display = 'none'; \">Add File</a></span> \n";
                             $table_html .= "<div id='file_" . $field . $id . "' style='display:none;'>\n";
                             $table_html .= $this->showUploadForm($field, $file_dest, $id);
                             $table_html .= "</div>\n";
                         }
                     } else {
                         $table_html .= $cell_data;
                     }
                 } else {
                     $table_html .= "<td>";
                     if (!is_numeric($found_category_index)) {
                         //was allowable values for this field defined?
                         if (is_array($this->allowed_values[$field]) && !$this->field_no_dropdown[$field]) {
                             $table_html .= $this->makeAjaxDropdown($id, $field, $cell_data, $this->db_table, $this->db_table_pk, $this->allowed_values[$field]);
                         } else {
                             //if a checkbox
                             if (is_array($this->checkbox[$field])) {
                                 $table_html .= $this->makeAjaxCheckbox($id, $field, $cell_data);
                             } else {
                                 //is an editable field
                                 //if ($cell_data == '') $cell_data = "&nbsp;&nbsp;";
                                 $field_onKeyPress = "";
                                 if ($this->fieldIsInt($this->getFieldDataType($field)) || $this->fieldIsDecimal($this->getFieldDataType($field))) {
                                     $field_onKeyPress = "return fn_validateNumeric(event, this, 'n');";
                                     if ($this->fieldIsDecimal($this->getFieldDataType($field))) {
                                         $field_onKeyPress = "return fn_validateNumeric(event, this, 'y');";
                                     }
                                 }
                                 if ($this->fieldIsEnum($this->getFieldDataType($field))) {
                                     $allowed_enum_values_array = $this->getEnumArray($this->getFieldDataType($field));
                                     $table_html .= $this->makeAjaxDropdown($id, $field, $cell_data, $this->db_table, $this->db_table_pk, $allowed_enum_values_array);
                                 } else {
                                     $field_length = strlen($row[$field]);
                                     if ($field_length < 51) {
                                         $table_html .= $this->makeAjaxEditor($id, $field, $cell_value, 'text', $field_length, $cell_data, $field_onKeyPress);
                                     } else {
                                         $textarea_height = '';
                                         if ($this->textarea_height[$field] != '') {
                                             $textarea_height = $this->textarea_height[$field];
                                         }
                                         $table_html .= $this->makeAjaxEditor($id, $field, $cell_value, 'textarea', $textarea_height, $cell_data, $field_onKeyPress);
                                     }
                                 }
                             }
                         }
                     } else {
                         //this field is a reference to another table's primary key (eg it must be a foreign key)
                         $category_field_name = $this->category_field_array[$found_category_index];
                         $category_table_name = $this->category_table_array[$found_category_index];
                         $category_table_pk = $this->category_table_pk_array[$found_category_index];
                         $selected_dropdown_text = "--";
                         //in case value is blank
                         if ($cell_data != "") {
                             $selected_dropdown_text = q1("SELECT {$category_field_name} FROM {$category_table_name} WHERE {$category_table_pk} = \"" . $cell_value . "\"");
                             //echo "field: $field - $selected_dropdown_text <br />\n";
                         }
                         if (!$this->fieldInArray($field, $this->uneditable_fields)) {
                             $table_html .= $this->makeAjaxDropdown($id, $field, $cell_value, $category_table_name, $category_table_pk, $dropdown_array[$found_category_index], $selected_dropdown_text);
                         } else {
                             $table_html .= $selected_dropdown_text;
                         }
                     }
                 }
                 $html .= "</td>";
             }
             if ($this->delete || count($this->row_button) > 0) {
                 $table_html .= "<td>\n";
                 if ($this->delete) {
                     $table_html .= "<input type=\"button\" class=\"editingSize\" onClick=\"confirmDelete('{$id}', '" . $this->db_table . "', '" . $this->db_table_pk . "');\" value=\"delete\" />\n";
                 }
                 if (count($this->row_button) > 0) {
                     foreach ($this->row_button as $the_row_button) {
                         $value = $the_row_button[0];
                         $url = $the_row_button[1];
                         $attach_param = $the_row_button[2];
                         $javascript_onclick_function = $the_row_button[3];
                         if ($attach_param == "all") {
                             $attach = "?attachments" . $attach_params;
                         } else {
                             $attach = "?" . $this->db_table_pk . "={$id}";
                         }
                         //its most likely a user-defined ajax function
                         if ($javascript_onclick_function != "") {
                             $javascript_for_button = "onClick=\"" . $javascript_onclick_function . "({$id});\"";
                         } else {
                             $javascript_for_button = "onClick=\"location.href='" . $url . $attach . "'\"";
                         }
                         $table_html .= "<input type=\"button\" {$javascript_for_button} class=\"btn editingSize\" value=\"{$value}\" />\n";
                     }
                 }
                 $table_html .= "</td>\n";
             }
             $table_html .= "</tr>";
             if ($count % 2 == 0) {
                 $class = "cell_row";
             } else {
                 $class = "odd";
             }
             $count++;
         }
         //foreach row
         $table_html .= "</table>\n";
         //paging links
         if ($totalpage > 1) {
             $table_html .= "<br /><div style='width: 800px; position: relative; left: 50%; margin-left: -400px; text-align: center;'><center> {$links} </center></div><br /><br />";
         }
     }
     //if rows > 0
     //closing div for paging links (if applicable)
     $bottom_html = "</div><br />\n";
     //now we come to the "add" fields
     if ($this->add) {
         $add_html .= "<center>\n";
         $add_html .= "   <input type=\"button\" value=\"Add {$item}\" class=\"btn editingSize\" onClick=\"\$('#add_form_{$this->db_table}').slideDown('slow');\">\n";
         if (count($this->bottom_button) > 0) {
             $button_value = $this->bottom_button[0];
             $button_url = $this->bottom_button[1];
             $button_tags = $this->bottom_button[2];
             if ($button_tags == '') {
                 $tag_stuff = "onClick=\"location.href = '{$button_url}';\"";
             } else {
                 $tag_stuff = $button_tags;
             }
             $add_html .= "  <input type=\"button\" value=\"{$button_value}\" href=\"{$button_url}\" class=\"btn\" {$tag_stuff}>\n";
         }
         //$add_html .= "  <input type=\"button\" value=\"Go Back\" class=\"btn\" onClick=\"history.back();\">\n";
         $add_html .= "</center>\n";
         $add_html .= "<form action=\"" . $_SERVER['PHP_SELF'] . "#ajaxCRUD\" id=\"add_form_{$this->db_table}\" method=\"POST\" ENCTYPE=\"multipart/form-data\" style=\"display:none;\">\n";
         $add_html .= "  <br /><h3>New <b>{$item}</b></h3>\n";
         $add_html .= "  <table align='center' name='form'>\n";
         $add_html .= "<tr valign='top'>\n";
         //for here display ALL 'addable' fields
         foreach ($this->add_fields as $field) {
             if ($field != $this->db_table_pk || $this->on_add_specify_primary_key) {
                 $field_value = "";
                 if ($_REQUEST[$field] != '') {
                     $field_value = $_REQUEST[$field];
                 }
                 if ($this->displayAs_array[$field] != '') {
                     $display_field = $this->displayAs_array[$field];
                 } else {
                     $display_field = $field;
                 }
                 //if a checkbox
                 if (is_array($this->checkbox[$field])) {
                     $values = $this->checkbox[$field];
                     $value_on = $values[0];
                     $value_off = $values[1];
                     $add_html .= "<th width='20%'>{$display_field}</th><td>\n";
                     $add_html .= "<input type='checkbox' name=\"{$field}\" value=\"{$value_on}\">\n";
                     $add_html .= "</td></tr>\n";
                 } else {
                     $found_category_index = array_search($field, $this->db_table_fk_array);
                     if (!is_numeric($found_category_index) && $found_category_index == '') {
                         //it's from a set of predefined allowed values for this field
                         if (is_array($this->allowed_values[$field])) {
                             $add_html .= "<th width='20%'>{$display_field}</th><td>\n";
                             $add_html .= "<select name=\"{$field}\" class='editingSize'>\n";
                             foreach ($this->allowed_values[$field] as $dropdown) {
                                 $selected = "";
                                 $dropdown_value = $dropdown[0];
                                 $dropdown_text = $dropdown[1];
                                 if ($field_value == $dropdown_value) {
                                     $selected = " selected";
                                 }
                                 $add_html .= "<option value=\"{$dropdown_value}\" {$selected}>{$dropdown_text}</option>\n";
                             }
                             $add_html .= "</select></td></tr>\n";
                         } else {
                             if ($this->fieldInArray($field, $this->file_uploads)) {
                                 //this field is an file upload
                                 $add_html .= "<th width='20%'>{$display_field}</th><td><input class=\"editingSize\" type=\"file\" name=\"{$field}\" size=\"15\"></td></tr>\n";
                                 $file_uploads = true;
                             } else {
                                 if ($this->fieldIsEnum($this->getFieldDataType($field))) {
                                     $allowed_enum_values_array = $this->getEnumArray($this->getFieldDataType($field));
                                     $add_html .= "<th width='20%'>{$display_field}</th><td>\n";
                                     $add_html .= "<select name=\"{$field}\" class='editingSize'>\n";
                                     foreach ($allowed_enum_values_array as $dropdown) {
                                         $dropdown_value = $dropdown;
                                         $dropdown_text = $dropdown;
                                         if ($field_value == $dropdown_value) {
                                             $selected = " selected";
                                         }
                                         $add_html .= "<option value=\"{$dropdown_value}\" {$selected}>{$dropdown_text}</option>\n";
                                     }
                                     $add_html .= "</select></td></tr>\n";
                                 } else {
                                     $field_onKeyPress = "";
                                     if ($this->fieldIsInt($this->getFieldDataType($field)) || $this->fieldIsDecimal($this->getFieldDataType($field))) {
                                         $field_onKeyPress = "return fn_validateNumeric(event, this, 'n');";
                                         if ($this->fieldIsDecimal($this->getFieldDataType($field))) {
                                             $field_onKeyPress = "return fn_validateNumeric(event, this, 'y');";
                                         }
                                     }
                                     //textarea fields
                                     if ($this->textarea_height[$field] != '') {
                                         $add_html .= "<th width='20%'>{$display_field}</th><td><textarea onKeyPress=\"{$field_onKeyPress}\" class=\"editingSize\" name=\"{$field}\" style='width: 97%; height: " . $this->textarea_height[$field] . "px;'>{$field_value}</textarea></td></tr>\n";
                                     } else {
                                         //any ol' data will do
                                         $field_size = "";
                                         if ($this->fieldIsInt($this->getFieldDataType($field)) || $this->fieldIsDecimal($this->getFieldDataType($field))) {
                                             $field_size = 7;
                                         }
                                         $add_html .= "<th width='20%'>{$display_field}</th><td><input onKeyPress=\"{$field_onKeyPress}\" class=\"editingSize\" type=\"text\" name=\"{$field}\" size=\"{$field_size}\" value=\"{$field_value}\" maxlength=\"150\"></td></tr>\n";
                                     }
                                 }
                                 //else not enum field
                             }
                             //not an uploaded file
                         }
                         //not a pre-defined value
                     } else {
                         //field is from a defined relationship
                         $key = $found_category_index;
                         $add_html .= "<th>{$display_field}</th><td>\n";
                         $add_html .= "<select name=\"{$field}\" class='editingSize'>\n";
                         if ($this->category_required[$field] != TRUE) {
                             if ($this->fieldIsInt($this->getFieldDataType($field)) || $this->fieldIsDecimal($this->getFieldDataType($field))) {
                                 $add_html .= "<option value=0>--Select--</option>\n";
                             } else {
                                 $add_html .= "<option value=''>--Select--</option>\n";
                             }
                         }
                         foreach ($dropdown_array[$key] as $dropdown) {
                             $selected = "";
                             $dropdown_value = $dropdown[$this->category_table_pk_array[$key]];
                             $dropdown_text = $dropdown[$this->category_field_array[$key]];
                             if ($field_value == $dropdown_value) {
                                 $selected = " selected";
                             }
                             $add_html .= "<option value=\"{$dropdown_value}\" {$selected}>{$dropdown_text}</option>\n";
                         }
                         $add_html .= "</select></td></tr>\n";
                     }
                 }
                 //not a checkbox
             }
             //not the primary pk
         }
         //foreach
         $add_html .= "</tr><tr><td>\n";
         if ($this->ajax_add) {
             $add_html .= "<input class=\"editingSize\" type=\"button\" onClick=\"\n                    setLoadingImage('{$this->db_table}');\n                    var fields = getFormValues(document.getElementById('add_form_{$this->db_table}'), '');\n                    fields = fields + '&table={$this->db_table}';\n                    var req = '" . $_SERVER[PHP_SELF] . "?action=add&' + fields;\n                    clearForm('add_form_{$this->db_table}');\n                    sndAddReq(req, '{$this->db_table}');\n                    return false;\" value=\"Add {$item}\">";
         } else {
             $add_html .= "<input class=\"editingSize\" type=\"submit\" value=\"Add {$item}\">";
         }
         $add_html .= "</td><td><input style='float: right;' class=\"editingSize\" type=\"button\" onClick=\"\$('#add_form_{$this->db_table}').slideUp('slow');\" value=\"Cancel\"></td></tr>\n</table>\n";
         $add_html .= "<input type=\"hidden\" name=\"action\" value=\"add\">\n";
         $add_html .= "<input type=\"hidden\" name=\"table\" value=\"{$this->db_table}\">\n";
         if ($file_uploads) {
             $add_html .= "<input type=\"hidden\" name=\"uploads_on\" value=\"true\">\n";
         }
         $add_html .= "</form>\n";
     }
     //if adding fields is "allowed"
     /*
             THIS IS IMPORTANT
             for ajax retrieval (see top of page) */
     $_SESSION[$this->db_table] = $table_html;
     $html = $top_html . $table_html . $bottom_html . $add_html;
     if ($this->add_form_top) {
         $html = $add_html . $top_html . $table_html . $bottom_html;
     }
     echo $html;
 }
Example #12
0
 $categories = array();
 $subject = validate($_POST['subject'], 'subject');
 $priority[0] = isset($_POST['priority1']) ? $_POST['priority1'] : '';
 $priority[1] = isset($_POST['priority2']) ? $_POST['priority2'] : '';
 $priority[2] = isset($_POST['priority3']) ? $_POST['priority3'] : '';
 $fromdate = validate($_POST['fromdate'], 'fromdate');
 $todate = validate($_POST['todate'], 'todate');
 $message = validate($_POST['message'], 'message');
 $customer = validate($_POST['customer'], 'customer');
 $cat = $db->query_first('SELECT COUNT(`id`) as `ccount` FROM `' . TABLE_PANEL_TICKET_CATS . '`');
 for ($x = 0; $x < $cat['ccount']; $x++) {
     $categories[$x] = isset($_POST['category' . $x]) ? $_POST['category' . $x] : '';
 }
 $query = ticket::getArchiveSearchStatement($db, $subject, $priority, $fromdate, $todate, $message, $customer, $userinfo['adminid'], $categories);
 $fields = array('lastchange' => $lng['ticket']['lastchange'], 'ticket_answers' => $lng['ticket']['ticket_answers'], 'subject' => $lng['ticket']['subject'], 'lastreplier' => $lng['ticket']['lastreplier'], 'priority' => $lng['ticket']['priority']);
 $paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
 $result = $db->query($query . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
 $sortcode = $paging->getHtmlSortCode($lng);
 $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
 $searchcode = $paging->getHtmlSearchCode($lng);
 $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
 $ctickets = array();
 while ($row = $db->fetch_array($result)) {
     if (!isset($ctickets[$row['customerid']]) || !is_array($ctickets[$row['customerid']])) {
         $ctickets[$row['customerid']] = array();
     }
     $ctickets[$row['customerid']][$row['id']] = $row;
 }
 if ($paging->sortfield == 'customerid' && $paging->sortorder == 'desc') {
     krsort($ctickets);
 } else {
Example #13
0
                $oClass->actives($id, 0);
            }
        }
        $hook->redirect($refresh);
    } else {
        $hook->redirect($refresh);
    }
} else {
    $tpl->setfile(array('body' => 'member.tpl'));
    $cond = " active=0";
    $cat = $oClass->view($cond);
    $total = $cat->num_rows();
    $orderby = "timestamp DESC";
    $start = LIMIT * intval($_GET['page']);
    $url = './?mod=' . $system->module . '&parentid=' . intval($_GET['parentid']) . '&type=' . intval($_GET['type']);
    $dp = new paging($url, $total, LIMIT);
    $request['divpage'] = $dp->simple();
    $cat = $oClass->view($cond, $start, LIMIT, $orderby);
    while ($rs = $cat->fetch()) {
        //$rs['delete'] = $rs['is_admin']?'':'style="display: inline;"';
        $rs['checked'] = $rs['active'] ? 'checked' : '';
        $rs['avatar'] = $rs['avatar'] ? '<a href="' . _UPLOAD . $rs['avatar'] . '" class="divbox"><img src="' . _UPLOAD . $rs['avatar'] . '" width="30" height="30" /></a>' : '';
        $tpl->assign($rs, 'user');
    }
    $breadcrumb->reset();
    $menu = explode('.', $_SESSION['cms_menu']);
    $breadcrumb->assign("", $MenuName[$menu[0]]);
    $level = $MenuLink[$menu[0]][$menu[1]];
    $breadcrumb->assign($level['link'], $level['name']);
}
$request['breadcrumb'] = $breadcrumb->parse();
Example #14
0
    $result = $db->query_first($sql);
    if ($result == null) {
        // no rights to see the requested ticket
        standard_error(array('ticketnotaccessible'));
    }
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
    eval("echo \"" . getTemplate("tickets/ticket") . "\";");
} elseif ($page == 'tickets') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
        $fields = array('status' => $lng['ticket']['status'], 'priority' => $lng['ticket']['priority'], 'lastchange' => $lng['ticket']['lastchange'], 'ticket_answers' => $lng['ticket']['ticket_answers'], 'subject' => $lng['ticket']['subject'], 'lastreplier' => $lng['ticket']['lastreplier']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $paging->sortfield = 'lastchange';
        $paging->sortorder = 'desc';
        $result = $db->query('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub` WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority` FROM `' . TABLE_PANEL_TICKETS . '` as `main` WHERE `main`.`answerto` = "0" AND `archived` = "0" AND `customerid`="' . (int) $userinfo['customerid'] . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $tickets = '';
        $tickets_count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $tickets_count++;
Example #15
0
 * Include our init.php, which manages Sessions, Language etc.
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email");
    eval("echo \"" . getTemplate("email/email") . "\";");
} elseif ($page == 'emails') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'm.email_full' => $lng['emails']['emailaddress'], 'm.destination' => $lng['emails']['forwarders']);
        $paging = new paging($userinfo, $db, TABLE_MAIL_VIRTUAL, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain` FROM `' . TABLE_MAIL_VIRTUAL . '` `m` LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`) LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`) WHERE `m`.`customerid`="' . $db->escape($userinfo['customerid']) . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $emails = array();
        while ($row = $db->fetch_array($result)) {
            if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) {
                $emails[$row['domain']] = array();
            }
            $emails[$row['domain']][$row['email_full']] = $row;
        }
        if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
            krsort($emails);
Example #16
0
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'cronjobs' || $page == 'overview') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs');
        $fields = array('c.lastrun' => $lng['cron']['lastrun'], 'c.interval' => $lng['cron']['interval'], 'c.isactive' => $lng['cron']['isactive']);
        $paging = new paging($userinfo, TABLE_PANEL_CRONRUNS, $fields);
        $crons = '';
        $result_stmt = Database::prepare("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `module` ASC, `cronfile` ASC");
        Database::pexecute($result_stmt);
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $cmod = '';
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($cmod != $row['module']) {
                $_mod = explode("/", $row['module']);
                $module = ucfirst($_mod[1]);
Example #17
0
</form></div>';
    $query = $_GET['query'];
    $topik = $_GET['topik'];
    $limit = $maxadmindata;
    if ($query) {
        $total = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0 and judul like '%{$query}%' or user like '%{$query}%' ORDER BY `id`");
    } elseif ($topik) {
        $total = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0 and topik = " . $topik . " ORDER BY `id`");
    } else {
        $total = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0  ORDER BY `id`");
    }
    $jumlah = $koneksi_db->sql_numrows($total);
    if (!isset($_GET['offset'])) {
        $offset = 0;
    }
    $a = new paging($limit);
    if ($jumlah < 1) {
        $admin .= '<div class="error">Tidak Ada Artikel </div>';
    } else {
        if ($query) {
            $hasil = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0 and judul like '%{$query}%' or user like '%{$query}%' ORDER BY `id` DESC LIMIT {$offset},{$limit} ");
        } elseif ($topik) {
            $hasil = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0 and topik = " . $topik . " ORDER BY `id` DESC LIMIT {$offset},{$limit} ");
        } else {
            $hasil = $koneksi_db->sql_query("SELECT * FROM artikel WHERE publikasi=0  ORDER BY `id` DESC LIMIT {$offset},{$limit}");
        }
        if ($offset) {
            $no = $offset + 1;
        } else {
            $no = 1;
        }
Example #18
0
 */
define('AREA', 'customer');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email");
    eval("echo \"" . getTemplate("email/email") . "\";");
} elseif ($page == 'emails') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'm.email_full' => $lng['emails']['emailaddress'], 'm.destination' => $lng['emails']['forwarders']);
        $paging = new paging($userinfo, TABLE_MAIL_VIRTUAL, $fields);
        $result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
			LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
			LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
			WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
        $emailscount = Database::num_rows();
        $paging->setEntries($emailscount);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $emails = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) {
                $emails[$row['domain']] = array();
Example #19
0
 * Include our init.php, which manages Sessions, Language etc.
 */
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, 'viewed customer_ftp');
    eval('echo "' . getTemplate('ftp/ftp') . '";');
} elseif ($page == 'accounts') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, 'viewed customer_ftp::accounts');
        $fields = array('username' => $lng['login']['username'], 'homedir' => $lng['panel']['path']);
        $paging = new paging($userinfo, $db, TABLE_FTP_USERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query('SELECT `id`, `username`, `homedir` FROM `' . TABLE_FTP_USERS . "` WHERE `customerid`='" . $userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $accounts = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
                    $row['documentroot'] = substr($row['homedir'], strlen($userinfo['documentroot']));
                } else {
                    $row['documentroot'] = $row['homedir'];
Example #20
0
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    $taxclasses = array();
    $taxclasses_option = '';
    $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
    while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
        $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
        $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
    }
    if ($action == '') {
        $fields = array('c.classname' => $lng['billing']['taxclass'], 'r.taxrate' => $lng['billing']['taxrate'], 'r.valid_from' => $lng['service']['valid_from']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_TAXRATES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query('SELECT `r`.*, `c`.*  ' . 'FROM `' . TABLE_BILLING_TAXRATES . '` `r` LEFT JOIN `' . TABLE_BILLING_TAXCLASSES . '` `c` ON( `r`.`taxclass` = `c`.`classid` ) ' . $paging->getSqlWhere() . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
        $i = 0;
        $taxrates = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row['taxrate_percent'] = $row['taxrate'] * 100;
                $row = htmlentities_array($row);
                eval('$taxrates.="' . getTemplate('billing/taxrates_row') . '";');
            }
Example #21
0
         } else {
             $open['paging'] = '';
         }
         $query = mysql_query("SELECT `kategori` FROM `mod_cat_download` WHERE `kid` = '{$kid}'");
         $getsql = mysql_fetch_assoc($query);
         $open['kategori'] = array($getsql['kategori'] . ' (' . $jumlah . ')');
         $j = new JSON_obj();
         echo $j->encode($open);
     }
     break;
 default:
     $num = mysql_query("SELECT kid FROM `mod_cat_download`");
     $jumlah = mysql_num_rows($num);
     mysql_free_result($num);
     $limit = 10;
     $pembagian = new paging($limit);
     $pagging = $pembagian->getPagingajax($jumlah, $pg, $stg);
     if (is_array($pagging)) {
         $ddl = '';
         foreach ($pagging as $k => $v) {
             if ($v['link'] == "") {
                 $ddl .= $v['title'] . ' | ';
             } else {
                 $ddl .= '<a onclick="weblink.links(\'' . $v['link'] . '\');" style="cursor:pointer" title="Page ' . $v['title'] . '">' . $v['title'] . '</a> | ';
             }
         }
         unset($pagging);
         $pagging = substr($ddl, 0, strlen($ddl) - 3);
     } else {
         $pagging = null;
     }
Example #22
0
    }
}
// Pluralize keywords function - singularize and pluralize
function pluralizeKeywords($keyword)
{
}
// XXXXXXXX Search fields
// Title
// Description
//echo 'psf: '.$postSearchForm.'-';
/*
 * Paging
 */
$mediaPerPage = $config['settings']['media_perpage'];
// Set the default media per page amount
$mediaPages = new paging('search');
$mediaPages->setPerPage($mediaPerPage);
$mediaPages->setPageName('search.php?');
$mediaPages->setPageVar();
// No get or post data sent or a clearSearch request - resetting search
if (!$_GET and !$_POST or $_REQUEST['clearSearch']) {
    $mediaPages->setCurrentPage(1);
    unset($_SESSION['searchForm']);
    $_SESSION['searchForm']['allFields'] = true;
}
//echo $_SESSION['searchForm']['firstLoad'];
if ($postSearchForm) {
    $mediaPages->setCurrentPage(1);
    unset($_SESSION['searchForm']['resultsArray']);
    // Clear any previous results array
}
Example #23
0
         foreach ($_POST['id'] as $K => $V) {
             if (!empty($V)) {
                 $del = mysql_query("DELETE FROM `shoutbox` WHERE `id`='{$V}'");
             }
         }
     }
 }
 $pager = mysql_query("SELECT id FROM shoutbox");
 $jumlah = mysql_num_rows($pager);
 $limit = 20;
 if (empty($_GET['offset']) and !isset($_GET['offset'])) {
     $offset = 0;
 } else {
     $offset = int_filter($_GET['offset']);
 }
 $a = new paging($limit);
 // Pembagian halaman dimulai
 if (!isset($_GET['pg'], $_GET['stg'])) {
     $_GET['pg'] = 1;
     $_GET['stg'] = 1;
 }
 $paging = $a->getPaging($jumlah, $_GET['pg'], $_GET['stg']);
 if (!empty($paging)) {
     $content .= '<br><br>';
     $content .= $paging;
     $content .= '';
 }
 $content .= '<form method="post" action="#"><table style="width:100%">';
 $perintah = "SELECT * FROM shoutbox ORDER BY id DESC LIMIT {$offset},{$limit}";
 $hasil = mysql_query($perintah);
 $no = 0;
Example #24
0
if (Settings::IsInList('panel.customer_hide_options', 'domains')) {
    redirectTo('customer_index.php');
}
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains");
    eval("echo \"" . getTemplate("domains/domains") . "\";");
} elseif ($page == 'domains') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
        $fields = array('d.domain' => $lng['domains']['domainname']);
        $paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
        $domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `d`.`termination_date`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`\n\t\t\tWHERE `d`.`customerid`= :customerid\n\t\t\tAND `d`.`email_only`='0'\n\t\t\tAND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domains = '';
        $parentdomains_count = 0;
        $domains_count = 0;
        $domain_array = array();
        while ($row = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
            $row['domain'] = $idna_convert->decode($row['domain']);
            $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
            $row['domainalias'] = $idna_convert->decode($row['domainalias']);
Example #25
0
<?php

session_start();
//include_once("../include/db_mysqli.inc");
include_once "../include/template.inc";
include_once "../include/confGral.php";
require "../include/paging_class.php";
$t = new Template("../templates", "keep");
$paging = new paging(15, 5, "<< prev", "next >>", "(%%number%%) ");
$paging->db("localhost", "nesoftwa_root", ";L9Nehbfaxts", "nesoftwa_TRANE");
// Identificar si pertenece a una Naviera
$idUsr = $_SESSION['sesIdUsuario'];
$idNaviera = getValueTable("id_naviera", "USUARIO", "id_usuario", $idUsr);
if ($idUsr > 0 && $idNaviera) {
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function explode_keyword($q)
    {
        //trim
        $q = trim($q);
        $q = str_replace("/[\\s]+/", " ", $q);
        $mode = "AND ";
        $condition = $condition . " eir like '%{$q}' " . $mode;
        //$condition= substr($condition,0,-4);
        return $condition;
    }
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function explode_keyword2($q)
    {
        //trim
        $q = trim($q);
        $q = str_replace("/[\\s]+/", " ", $q);
Example #26
0
$need_root_db_sql_data = true;
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql");
    $lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']);
    eval("echo \"" . getTemplate("mysql/mysql") . "\";");
} elseif ($page == 'mysqls') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql::mysqls");
        $fields = array('databasename' => $lng['mysql']['databasename'], 'description' => $lng['mysql']['databasedescription']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $mysqls = '';
        // Begin root-session
        $db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                $mbdata = $db_root->query_first("SELECT SUM( data_length + index_length) / 1024 / 1024 'MB' FROM information_schema.TABLES WHERE table_schema = '" . $db_root->escape($row['databasename']) . "' GROUP BY table_schema ;");
Example #27
0
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'domains' || $page == 'overview') {
    // Let's see how many customers we have
    $stmt = Database::prepare("\n\t\tSELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid"));
    $params = array();
    if ($userinfo['customers_see_all'] == '0') {
        $params['adminid'] = $userinfo['adminid'];
    }
    $countcustomers = Database::pexecute_first($stmt, $params);
    $countcustomers = (int) $countcustomers['countcustomers'];
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'c.loginname' => $lng['login']['username'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
        $paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
        $domains = '';
        $result_stmt = Database::prepare("\n\t\t\tSELECT `d`.*, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`\n\t\t\tFROM `" . TABLE_PANEL_DOMAINS . "` `d`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`\n\t\t\tWHERE `d`.`parentdomainid`='0' " . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $params = array();
        if ($userinfo['customers_see_all'] == '0') {
            $params['adminid'] = $userinfo['adminid'];
        }
        Database::pexecute($result_stmt, $params);
        $numrows_domains = Database::num_rows();
        $paging->setEntries($numrows_domains);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domain_array = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
Example #28
0
define('AREA', 'customer');
require './lib/init.php';
$id = 0;
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp");
    eval("echo \"" . getTemplate('ftp/ftp') . "\";");
} elseif ($page == 'accounts') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
        $fields = array('username' => $lng['login']['username'], 'homedir' => $lng['panel']['path'], 'description' => $lng['panel']['ftpdesc']);
        $paging = new paging($userinfo, TABLE_FTP_USERS, $fields);
        $result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir` FROM `" . TABLE_FTP_USERS . "`\n\t\t\tWHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
        $ftps_count = Database::num_rows();
        $paging->setEntries($ftps_count);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $accounts = '';
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
                    $row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']);
Example #29
0
<?php

session_start();
//include_once("../include/db_mysqli.inc");
include_once "../include/template.inc";
include_once "../include/confGral.php";
require "../include/paging_class.php";
include_once "../include/acceso.class.php";
$usuario = new Acceso();
$t = new Template("../templates", "keep");
if ($usuario->havePerm("1", $_SESSION['sesArrPerms'])) {
    $paging = new paging(15, 5, "<< prev", "next >>", "(%%number%%) ");
    $paging->db("localhost", "nesoftwa_root", ";L9Nehbfaxts", "nesoftwa_LITION");
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function explode_keyword($q)
    {
        //trim
        $q = trim($q);
        $q = preg_replace("/[\\s]+/", " ", $q);
        $mode = "AND ";
        $condition = $condition . "usuario like '%{$q}%' " . $mode;
        $condition = substr($condition, 0, -4);
        return $condition;
    }
    // fffffffffffffffffffffffffffffffffffffffffffffffffffffff
    function showForm($data = "", $msg = "")
    {
        global $t, $PHP_SELF, $paging, $db2;
        $t->set_file("page", "catUsuario.inc.html");
        $t->set_var(array("lnTupla" => "", "ACTION" => $PHP_SELF, "MENSAJE" => "", "NUEVO" => "<a href=\"javascript:ventanaNueva('catUsuarioCaptura.php?modo=nuevo',700,700)\">Nuevo</a>"));
        // ----------------------------------------------------------------
Example #30
0
 * Include our init.php, which manages Sessions, Language etc.
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains");
    eval("echo \"" . getTemplate("domains/domains") . "\";");
} elseif ($page == 'domains') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'd.documentroot' => $lng['panel']['path'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` WHERE `d`.`customerid`='" . (int) $userinfo['customerid'] . "' AND `d`.`email_only`='0' AND `d`.`id` <> " . (int) $userinfo['standardsubdomain'] . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domains = '';
        $parentdomains_count = 0;
        $domains_count = 0;
        $domain_array = array();
        while ($row = $db->fetch_array($result)) {
            $row['domain'] = $idna_convert->decode($row['domain']);
            $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
            $row['domainalias'] = $idna_convert->decode($row['domainalias']);
            if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {