Ejemplo n.º 1
0
 * This file was automatically generated By Code Smith 
 * Modifications will be overwritten when code smith is run
 *
 * PLEASE DO NOT MAKE MODIFICATIONS TO THIS FILE
 * Date Created 5/6/2012
 *
 */
/// <summary>
/// Implementations of sladtypes represent a AdType
///
/// </summary>
chdir("..");
/* TODO: Add code here */
require 'config/globalconfig.php';
include_once 'class/model_adtype.php';
$objAdType = new Model_AdType($objConnection);
if ($_pgR["act"] == model_AdType::ACT_ADD) {
    if (global_common::isCLogin()) {
        //get user info
        //$c_userInfo = $_SESSION[consts::SES_C_USERINFO];
        //if ($objMenu->getMenuByName($_pgR['name'])) {
        //	echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1));
        //	return;
        //}
        $adTypeID = $_pgR['AdTypeID'];
        $adTypeID = global_editor::rteSafe(html_entity_decode($adTypeID, ENT_COMPAT, 'UTF-8'));
        $adTypeName = $_pgR['AdTypeName'];
        $adTypeName = global_editor::rteSafe(html_entity_decode($adTypeName, ENT_COMPAT, 'UTF-8'));
        $width = $_pgR['Width'];
        $width = global_editor::rteSafe(html_entity_decode($width, ENT_COMPAT, 'UTF-8'));
        $height = $_pgR['Height'];
Ejemplo n.º 2
0
 public function getAllAdvertising($intPage = 0, $selectField = '*', $whereClause = '', $orderBy = '', &$total)
 {
     if (!$selectField) {
         $selectField = '*';
     }
     if ($whereClause) {
         $whereClause = ' WHERE ' . $whereClause;
     }
     if ($orderBy) {
         $orderBy = ' ORDER BY ' . $orderBy;
     }
     if ($intPage > 0) {
         $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Advertising::TBL_SL_ADVERTISING, $whereClause . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
         $strSQLCount .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('count(*)', Model_Advertising::TBL_SL_ADVERTISING, $whereClause . $orderBy));
     } else {
         $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Advertising::TBL_SL_ADVERTISING, $whereClause . $orderBy));
     }
     //echo '<br>SQL:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get All sl_advertising:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     if ($strSQLCount) {
         //echo '<br>$strSQLCount:'.$strSQLCount;
         $arrTotal = $this->_objConnection->selectCommand($strSQLCount);
         $total = $arrTotal[0][0];
     }
     $objAdType = new Model_AdType($this->_objConnection);
     $allAdType = $objAdType->getAllAdType(0, null, null, null);
     $adTypes = array();
     foreach ($allAdType as $key => $info) {
         $adTypes[$info[global_mapping::AdTypeID]] = $info;
         unset($allAdType[$key]);
     }
     $count = count($arrResult);
     for ($index = 0; $index < $count; $index++) {
         $arrResult[$index][global_mapping::AdTypeName] = $adTypes[$arrResult[$index][global_mapping::AdTypeID]][global_mapping::AdTypeName];
     }
     //print_r($arrResult);
     return $arrResult;
 }
 */
/// <summary>
/// Implementations of slAdvertising represent a Advertising
///
/// </summary>
chdir("..");
/* TODO: Add code here */
require 'config/globalconfig.php';
require 'include/_permission_admin.inc';
include_once 'class/model_user.php';
include_once 'class/model_advertising.php';
include_once 'class/model_adtype.php';
include_once 'class/model_articletype.php';
$objArticleType = new model_ArticleType($objConnection);
$objAdvertising = new Model_Advertising($objConnection);
$objAdType = new Model_AdType($objConnection);
if ($_pgR["act"] == Model_Advertising::ACT_ADD || $_pgR["act"] == Model_Advertising::ACT_UPDATE) {
    //get user info
    $c_userInfo = $_SESSION[global_common::SES_C_USERINFO];
    $advertisingName = $_pgR[global_mapping::AdvertisingName];
    $advertisingName = html_entity_decode($advertisingName, ENT_COMPAT, 'UTF-8');
    $adTypeID = html_entity_decode($_pgR[global_mapping::AdTypeID], ENT_COMPAT, 'UTF-8');
    $articleTypeID = html_entity_decode($_pgR[global_mapping::ArticleTypeID], ENT_COMPAT, 'UTF-8');
    $content = html_entity_decode($_pgR[global_mapping::Content], ENT_COMPAT, 'UTF-8');
    $preferLink = html_entity_decode($_pgR[global_mapping::PreferLink], ENT_COMPAT, 'UTF-8');
    $order = html_entity_decode($_pgR[global_mapping::Order], ENT_COMPAT, 'UTF-8');
    $startDate = html_entity_decode($_pgR[global_mapping::StartDate], ENT_COMPAT, 'UTF-8');
    $endDate = html_entity_decode($_pgR[global_mapping::EndDate], ENT_COMPAT, 'UTF-8');
    $imageLink = html_entity_decode($_pgR[global_mapping::ImageLink], ENT_COMPAT, 'UTF-8');
    $partnerID = html_entity_decode($_pgR[global_mapping::PartnerID], ENT_COMPAT, 'UTF-8');
    $status = 1;