当前位置: 首页>>代码示例>>PHP>>正文


PHP Banner::add方法代码示例

本文整理汇总了PHP中Banner::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Banner::add方法的具体用法?PHP Banner::add怎么用?PHP Banner::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Banner的用法示例。


在下文中一共展示了Banner::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Business

     $msg = "<div class='alert alert-error' id='error_box'>" . $msg . "</div>";
 } else {
     $gbizObj = new Business();
     $package = $gbizObj->getPkg($requested_pkg);
     $gbizObj->setBizInfo($id, $title, $tagline, $category, $subCategory, $description, $listingUrl);
     $gbizObj->setContactInfo($email, $phone, $fax, $mobile, $contactP);
     $gbizObj->setLocationInfo($street, $city, $country, $zip, $latitude, $longitude);
     $gbizObj->setKeywordInfo($keywords);
     $gbizObj->setPkg($package);
     $result = $gbizObj->add();
     // Cause insert a new business record in to the database
     if ($result) {
         $bizId = $gbizObj->business_id;
         $gbannerObj = new Banner();
         $gbannerObj->setBannerInfo($banerType, $caption, $adUrl, $bizId, $id);
         $gbannerObj->add();
         $bannerId = $gdbObj->insert_id();
         $msg .= "<b>You have successfully added a new business with the Id of " . $bizId . "</b>";
         $msg = "<div class='alert alert-info' id='error_box'>" . $msg . "</div>";
         //upload the logo file
         mkdir(SITE_ROOT . "/biz/{$bizId}", 0755);
         $tmp_file = $_FILES['file_upload']['tmp_name'];
         $originalFile = basename($_FILES['file_upload']['name']);
         $extension = substr($originalFile, strripos($originalFile, '.'), strlen($originalFile));
         $renamedFile = "logo" . $extension;
         $upload_dir = "biz/{$bizId}";
         move_uploaded_file($tmp_file, $upload_dir . "/" . $renamedFile);
         //upload banner image file
         $tmp_file = $_FILES['banner_upload']['tmp_name'];
         $originalFile = basename($_FILES['banner_upload']['name']);
         $extension = substr($originalFile, strripos($originalFile, '.'), strlen($originalFile));
开发者ID:rajitha-bandara,项目名称:odwlbs-peoject,代码行数:31,代码来源:process_add_listings.php

示例2: Banner

 $adUrl = $urlProtocol . $destination;
 if ($destination == NULL) {
     $adUrl = "";
 } else {
     if ($destination != NULL && !$gvalObj->isURL($adUrl)) {
         $msg = $msg . "Invalid banner URL<br>";
         $status = "NOTOK";
     }
 }
 if ($status == "NOTOK") {
     $msg = "<div class='alert alert-error' id='error_box'>" . $msg . "</div>";
 } else {
     $gbannerObj = new Banner();
     $gbannerObj->setListingId($lid);
     $gbannerObj->setBannerInfo($banerType, $caption, $adUrl);
     $result = $gbannerObj->add();
     $bannerID = $gbannerObj->getBannerId();
     if ($result) {
         //upload banner image file
         $tmp_file = $_FILES['banner_upload']['tmp_name'];
         $originalFile = basename($_FILES['banner_upload']['name']);
         $extension = substr($originalFile, strripos($originalFile, '.'), strlen($originalFile));
         $renamedFile = $bannerID . "" . $extension;
         $upload_dir = "ads/{$banerType}";
         move_uploaded_file($tmp_file, $upload_dir . "/" . $renamedFile);
         $msg .= "<b>Listing updated successfully</b>";
         $msg = "<div class='alert alert-info'>" . $msg . "</div>";
     } else {
         $msg .= "An error occurred while updating data. Please try again.";
         $msg = "<div class='alert alert-error' id='error_box'>" . $msg . "</div>";
     }
开发者ID:rajitha-bandara,项目名称:odwlbs-peoject,代码行数:31,代码来源:process_edit_listings.php

示例3: Banner

$data = new Banner();
require_once '../../models/BannerCategoria.php';
$bannerCategoria = new BannerCategoria();
require_once '../../models/Imagem.php';
$imagem = new Imagem();
foreach ($_REQUEST as $key => $value) {
    if (!is_array($value)) {
        $_REQUEST[$key] = utf8_decode($value);
    } elseif (is_array($value)) {
        foreach ($value as $key2 => $value2) {
            $_REQUEST[$key][$key2] = utf8_decode($value2);
        }
    }
}
if ($_REQUEST['acao'] == 1 && $_REQUEST['operacao'] == 2) {
    if ($data->add()) {
        echo json_encode(array('success' => 1));
    } else {
        echo json_encode(array('success' => 0));
    }
} elseif ($_REQUEST['acao'] == 2 && $_REQUEST['operacao'] == 2) {
    if ($data->edit()) {
        echo json_encode(array('success' => 1));
    } else {
        echo json_encode(array('success' => 0));
    }
} elseif ($_REQUEST['acao'] == 3 && $_REQUEST['operacao'] == 2) {
    if ($data->delete()) {
        echo json_encode(array('success' => 1));
    } else {
        echo json_encode(array('success' => 0));
开发者ID:alanansilva,项目名称:3heads,代码行数:31,代码来源:persistence.php

示例4: Banner

 */
ini_set('error_reporting', E_ALL);
include "includes/functions.php";
include "includes/classes/class.banner.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    /*echo "<pre>";
    		print_r($_POST);
    		print_r($_FILES); exit;*/
    $banner = new Banner();
    $arrData = array();
    $arrData['name'] = addslashes(ucwords($_POST['name']));
    $arrData['details'] = addslashes($_POST['details']);
    $arrData['status'] = addslashes($_POST['status']);
    if (empty($_POST['id'])) {
        $arrData['added_date'] = date('Y-m-d H:i:s');
        $insert = $banner->add($arrData);
        if ($insert) {
            $cover = '';
            if ($_FILES['image']['name'] != '') {
                $cover = 'banner_' . $insert . '.jpg';
                saveBannerImage($_FILES['image'], $insert, 'banner');
            }
            $_SESSION['insert_banner'] = 'added';
        } else {
            $_SESSION['insert_banner'] = 'insert_faild';
        }
    } else {
        $arrData['id'] = $_POST['id'];
        // $arrData['banner'] = 'banner_' . $_POST['id'] . '.jpg';
        if ($_FILES['image']['name'] != '') {
            $cover = 'banner_' . $arrData['id'] . '.jpg';
开发者ID:Kylemurray25,项目名称:wmlmusicguide,代码行数:31,代码来源:bannercontroller.php


注:本文中的Banner::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。