コード例 #1
0
ファイル: index.php プロジェクト: yunsite/demila
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['contacts']);
//是否登录
check_login();
#加载类别
$categoriesClass = new ccategories();
$categories = $categoriesClass->getAll(0, 0, " `visible` = 'true'");
abr('categories', $categories);
#发送联系支持请求
if (isset($_POST['action'])) {
    //验证码验证
    if (isset($_POST['verify'])) {
        if (empty($_POST['verify'])) {
            addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
        }
        require_once ROOT_PATH . '/classes/Verify.class.php';
        $verify = new Verify();
        $yz_verify = $verify->check($_POST['verify'], 1);
        if (!$yz_verify) {
            addErrorMessage($langArray['error_invalid_verify'], '', 'error');
        } else {
コード例 #2
0
ファイル: itemslist.php プロジェクト: ahmarmahmood/tabedaar
 function ExportData()
 {
     $utf8 = strtolower(EW_CHARSET) == "utf-8";
     $bSelectLimit = $this->UseSelectLimit;
     // Load recordset
     if ($bSelectLimit) {
         $this->TotalRecs = $this->SelectRecordCount();
     } else {
         if (!$this->Recordset) {
             $this->Recordset = $this->LoadRecordset();
         }
         $rs =& $this->Recordset;
         if ($rs) {
             $this->TotalRecs = $rs->RecordCount();
         }
     }
     $this->StartRec = 1;
     // Export all
     if ($this->ExportAll) {
         set_time_limit(EW_EXPORT_ALL_TIME_LIMIT);
         $this->DisplayRecs = $this->TotalRecs;
         $this->StopRec = $this->TotalRecs;
     } else {
         // Export one page only
         $this->SetUpStartRec();
         // Set up start record position
         // Set the last record to display
         if ($this->DisplayRecs <= 0) {
             $this->StopRec = $this->TotalRecs;
         } else {
             $this->StopRec = $this->StartRec + $this->DisplayRecs - 1;
         }
     }
     if ($bSelectLimit) {
         $rs = $this->LoadRecordset($this->StartRec - 1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs);
     }
     if (!$rs) {
         header("Content-Type:");
         // Remove header
         header("Content-Disposition:");
         $this->ShowMessage();
         return;
     }
     $this->ExportDoc = ew_ExportDocument($this, "h");
     $Doc =& $this->ExportDoc;
     if ($bSelectLimit) {
         $this->StartRec = 1;
         $this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;
     } else {
         //$this->StartRec = $this->StartRec;
         //$this->StopRec = $this->StopRec;
     }
     // Call Page Exporting server event
     $this->ExportDoc->ExportCustom = !$this->Page_Exporting();
     $ParentTable = "";
     // Export master record
     if (EW_EXPORT_MASTER_RECORD && $this->GetMasterFilter() != "" && $this->getCurrentMasterTable() == "categories") {
         global $categories;
         if (!isset($categories)) {
             $categories = new ccategories();
         }
         $rsmaster = $categories->LoadRs($this->DbMasterFilter);
         // Load master record
         if ($rsmaster && !$rsmaster->EOF) {
             $ExportStyle = $Doc->Style;
             $Doc->SetStyle("v");
             // Change to vertical
             if ($this->Export != "csv" || EW_EXPORT_MASTER_RECORD_FOR_CSV) {
                 $Doc->Table =& $categories;
                 $categories->ExportDocument($Doc, $rsmaster, 1, 1);
                 $Doc->ExportEmptyRow();
                 $Doc->Table =& $this;
             }
             $Doc->SetStyle($ExportStyle);
             // Restore
             $rsmaster->Close();
         }
     }
     $sHeader = $this->PageHeader;
     $this->Page_DataRendering($sHeader);
     $Doc->Text .= $sHeader;
     $this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, "");
     $sFooter = $this->PageFooter;
     $this->Page_DataRendered($sFooter);
     $Doc->Text .= $sFooter;
     // Close recordset
     $rs->Close();
     // Call Page Exported server event
     $this->Page_Exported();
     // Export header and footer
     $Doc->ExportHeaderAndFooter();
     // Clean output buffer
     if (!EW_DEBUG_ENABLED && ob_get_length()) {
         ob_end_clean();
     }
     // Write debug message if enabled
     if (EW_DEBUG_ENABLED) {
         echo ew_DebugMsg();
     }
     // Output data
     if ($this->Export == "email") {
         echo $this->ExportEmail($Doc->Text);
     } else {
         $Doc->Export();
     }
 }
コード例 #3
0
ファイル: edit.php プロジェクト: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new ccategories();
if (isset($_POST['edit'])) {
    $status = $cms->edit($_GET['id']);
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=categories&p=" . $_GET['p'], $langArray['edit_complete']);
    }
} else {
    $_POST = $cms->get($_GET['id']);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
コード例 #4
0
ファイル: categories.php プロジェクト: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['issue_categories']);
$cms = new ccategories();
if (isset($_GET['up']) || isset($_GET['down'])) {
    $cms->tableName = 'contacts_categories';
    $cms->idColumn = 'id';
    if (isset($_GET['up']) && is_numeric($_GET['up'])) {
        $cms->moveUp($_GET['up']);
    } elseif (isset($_GET['down']) && is_numeric($_GET['down'])) {
        $cms->moveDown($_GET['down']);
    }
}
$data = $cms->getAll(START, LIMIT);
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=categories&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
コード例 #5
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (categories)
     if (!isset($GLOBALS["categories"]) || get_class($GLOBALS["categories"]) == "ccategories") {
         $GLOBALS["categories"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["categories"];
     }
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Table object (restaurants)
     if (!isset($GLOBALS['restaurants'])) {
         $GLOBALS['restaurants'] = new crestaurants();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'edit', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'categories', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
 }
コード例 #6
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (categories)
     if (!isset($GLOBALS["categories"]) || get_class($GLOBALS["categories"]) == "ccategories") {
         $GLOBALS["categories"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["categories"];
     }
     // Initialize URLs
     $this->ExportPrintUrl = $this->PageUrl() . "export=print";
     $this->ExportExcelUrl = $this->PageUrl() . "export=excel";
     $this->ExportWordUrl = $this->PageUrl() . "export=word";
     $this->ExportHtmlUrl = $this->PageUrl() . "export=html";
     $this->ExportXmlUrl = $this->PageUrl() . "export=xml";
     $this->ExportCsvUrl = $this->PageUrl() . "export=csv";
     $this->ExportPdfUrl = $this->PageUrl() . "export=pdf";
     $this->AddUrl = "categoriesadd.php?" . EW_TABLE_SHOW_DETAIL . "=";
     $this->InlineAddUrl = $this->PageUrl() . "a=add";
     $this->GridAddUrl = $this->PageUrl() . "a=gridadd";
     $this->GridEditUrl = $this->PageUrl() . "a=gridedit";
     $this->MultiDeleteUrl = "categoriesdelete.php";
     $this->MultiUpdateUrl = "categoriesupdate.php";
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Table object (restaurants)
     if (!isset($GLOBALS['restaurants'])) {
         $GLOBALS['restaurants'] = new crestaurants();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'list', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'categories', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
     // List options
     $this->ListOptions = new cListOptions();
     $this->ListOptions->TableVar = $this->TableVar;
     // Export options
     $this->ExportOptions = new cListOptions();
     $this->ExportOptions->Tag = "div";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Other options
     $this->OtherOptions['addedit'] = new cListOptions();
     $this->OtherOptions['addedit']->Tag = "div";
     $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption";
     $this->OtherOptions['detail'] = new cListOptions();
     $this->OtherOptions['detail']->Tag = "div";
     $this->OtherOptions['detail']->TagClassName = "ewDetailOption";
     $this->OtherOptions['action'] = new cListOptions();
     $this->OtherOptions['action']->Tag = "div";
     $this->OtherOptions['action']->TagClassName = "ewActionOption";
     // Filter options
     $this->FilterOptions = new cListOptions();
     $this->FilterOptions->Tag = "div";
     $this->FilterOptions->TagClassName = "ewFilterOption fcategorieslistsrch";
     // List actions
     $this->ListActions = new cListActions();
 }
コード例 #7
0
ファイル: delete.php プロジェクト: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['deleteMail']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) {
    require_once ROOT_PATH . "/apps/contacts/models/contacts.class.php";
    $cms = new contacts();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteCategory']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) {
    require_once ROOT_PATH . "/apps/contacts/models/ccategories.class.php";
    $cms = new ccategories();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;
コード例 #8
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $GLOBALS["Page"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (categories)
     if (!isset($GLOBALS["categories"]) || get_class($GLOBALS["categories"]) == "ccategories") {
         $GLOBALS["categories"] =& $this;
         $GLOBALS["Table"] =& $GLOBALS["categories"];
     }
     $KeyUrl = "";
     if (@$_GET["cat_id"] != "") {
         $this->RecKey["cat_id"] = $_GET["cat_id"];
         $KeyUrl .= "&amp;cat_id=" . urlencode($this->RecKey["cat_id"]);
     }
     $this->ExportPrintUrl = $this->PageUrl() . "export=print" . $KeyUrl;
     $this->ExportHtmlUrl = $this->PageUrl() . "export=html" . $KeyUrl;
     $this->ExportExcelUrl = $this->PageUrl() . "export=excel" . $KeyUrl;
     $this->ExportWordUrl = $this->PageUrl() . "export=word" . $KeyUrl;
     $this->ExportXmlUrl = $this->PageUrl() . "export=xml" . $KeyUrl;
     $this->ExportCsvUrl = $this->PageUrl() . "export=csv" . $KeyUrl;
     $this->ExportPdfUrl = $this->PageUrl() . "export=pdf" . $KeyUrl;
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Table object (restaurants)
     if (!isset($GLOBALS['restaurants'])) {
         $GLOBALS['restaurants'] = new crestaurants();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'view', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'categories', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
     // Export options
     $this->ExportOptions = new cListOptions();
     $this->ExportOptions->Tag = "div";
     $this->ExportOptions->TagClassName = "ewExportOption";
     // Other options
     $this->OtherOptions['action'] = new cListOptions();
     $this->OtherOptions['action']->Tag = "div";
     $this->OtherOptions['action']->TagClassName = "ewActionOption";
     $this->OtherOptions['detail'] = new cListOptions();
     $this->OtherOptions['detail']->Tag = "div";
     $this->OtherOptions['detail']->TagClassName = "ewDetailOption";
 }
コード例 #9
0
 function __construct()
 {
     global $conn, $Language;
     global $UserTable, $UserTableConn;
     $this->FormActionName .= '_' . $this->FormName;
     $this->FormKeyName .= '_' . $this->FormName;
     $this->FormOldKeyName .= '_' . $this->FormName;
     $this->FormBlankRowName .= '_' . $this->FormName;
     $this->FormKeyCountName .= '_' . $this->FormName;
     $GLOBALS["Grid"] =& $this;
     $this->TokenTimeout = ew_SessionTimeoutTime();
     // Language object
     if (!isset($Language)) {
         $Language = new cLanguage();
     }
     // Parent constuctor
     parent::__construct();
     // Table object (categories)
     if (!isset($GLOBALS["categories"]) || get_class($GLOBALS["categories"]) == "ccategories") {
         $GLOBALS["categories"] =& $this;
         //			$GLOBALS["MasterTable"] = &$GLOBALS["Table"];
         //			if (!isset($GLOBALS["Table"])) $GLOBALS["Table"] = &$GLOBALS["categories"];
     }
     // Table object (user)
     if (!isset($GLOBALS['user'])) {
         $GLOBALS['user'] = new cuser();
     }
     // Page ID
     if (!defined("EW_PAGE_ID")) {
         define("EW_PAGE_ID", 'grid', TRUE);
     }
     // Table name (for backward compatibility)
     if (!defined("EW_TABLE_NAME")) {
         define("EW_TABLE_NAME", 'categories', TRUE);
     }
     // Start timer
     if (!isset($GLOBALS["gTimer"])) {
         $GLOBALS["gTimer"] = new cTimer();
     }
     // Open connection
     if (!isset($conn)) {
         $conn = ew_Connect($this->DBID);
     }
     // User table object (user)
     if (!isset($UserTable)) {
         $UserTable = new cuser();
         $UserTableConn = Conn($UserTable->DBID);
     }
     // List options
     $this->ListOptions = new cListOptions();
     $this->ListOptions->TableVar = $this->TableVar;
     // Other options
     $this->OtherOptions['addedit'] = new cListOptions();
     $this->OtherOptions['addedit']->Tag = "div";
     $this->OtherOptions['addedit']->TagClassName = "ewAddEditOption";
 }
コード例 #10
0
ファイル: add.php プロジェクト: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['add']);
$cms = new ccategories();
if (isset($_POST['add'])) {
    $status = $cms->add();
    if ($status !== true) {
        abr('error', $status);
    } else {
        refresh("?m=" . $_GET['m'] . "&c=categories", $langArray['add_complete']);
    }
} else {
    $_POST['visible'] = 'true';
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';