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


PHP Display::getRecordByID方法代码示例

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


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

示例1: catch

                    $editPage['page_image'] = $uploadsDirecotry . $upload->getFileUrl();
                } catch (Exception $exc) {
                    $exc->getMessage();
                }
            } else {
                $editPage['page_image'] = 'resources/images/logo.png';
            }
            $tabename = "pages";
            $id = $_GET['id'];
            try {
                $updatePage = new Update($editPage, $tabename);
                $updatedPage = $updatePage->editData($id);
                if ($updatedPage) {
                    echo '<script type="text/javascript"> alert("The New Page was updated !"); history.back();</script>';
                }
            } catch (Exception $exc) {
                echo $exc->getMessage();
            }
        }
    }
} else {
    $tablename = "pages";
    $displaypages = new Display($tablename);
    $PagesDataDisplay = $displaypages->getAllData();
    for ($i = 0; $i < count($PagesDataDisplay); $i++) {
        $id = $PagesDataDisplay[$i]['sectionId'];
        $display = new Display('sections');
        $sectionNames[$i] = $display->getRecordByID($id);
    }
    include 'veiws/pages.php';
}
开发者ID:jeremywong1992,项目名称:awebarts1-93,代码行数:31,代码来源:C_Pages.php

示例2: Display

<?php

// header.php
include 'site/header.php';
// contents start
echo '<div id="contents">';
// sider bar
include 'site/sidebar.php';
echo '<div id="conts">';
echo '<div id="page">';
/*
 * id = $_GET['id']
 */
$id = $_GET['id'];
$tablename = "pages";
$displaypages = new Display($tablename);
$PagesDataDisplay = $displaypages->getRecordByID($id);
echo '    
<h1>' . $PagesDataDisplay['page_name'] . '</h1>
<img style="max-width:300px; margin:20px 0;" src="app/' . $PagesDataDisplay['page_image'] . '">
<p>
    ' . $PagesDataDisplay['page_content'] . '
</p>
    
    ';
echo '</div>';
echo '</div>';
echo '</div>';
// footer.php
include 'site/footer.php';
开发者ID:web-slawek,项目名称:matnercars,代码行数:30,代码来源:page.php

示例3: Delete

 if (isset($_GET['action']) and $_GET['action'] == "delete") {
     try {
         $tablename = "sections";
         $id = $_GET['id'];
         $deSec = new Delete($tablename);
         $deSec->deletRecordByID($id);
     } catch (Exception $exc) {
         echo $exc->getMessage();
     }
 }
 // Edit:
 if (isset($_GET['action']) and $_GET['action'] == "edit") {
     $id = $_GET['id'];
     $tablename = "sections";
     $editSecDis = new Display($tablename);
     $recSecdata = $editSecDis->getRecordByID($id);
     include 'veiws/editSection.php';
 }
 if (isset($_POST['submit']) && $_POST['submit'] == "Edit") {
     //sections: id, sectionName, sectionStaus, sectionLocation, sectionDesc, sectionDate, username
     $SecDataedit['sectionName'] = $_POST['sectionName'];
     $SecDataedit['sectionStaus'] = $_POST['sectionStaus'];
     $SecDataedit['sectionLocation'] = $_POST['sectionLocation'];
     $SecDataedit['sectionDesc'] = $_POST['sectionDesc'];
     try {
         $tablename = "sections";
         $SecUpdate = new Update($SecDataedit, $tablename);
         $updtSec = $SecUpdate->editData($id);
         if ($updtSec) {
             echo '<script type="text/javascript"> alert("The Section was updated !"); history.back();</script>';
         }
开发者ID:web-slawek,项目名称:matnercars,代码行数:31,代码来源:C_Sections.php

示例4: Display

<h3>Banery</h3>
<?php 
include '../includes/init.php';
include '../includes/autoloader.php';
if ($_POST or @$_GET['action']) {
    // Delete:
    if (isset($_GET['action']) and $_GET['action'] == "delete") {
        try {
            $tablename = "banners";
            $id = $_GET['id'];
            // get the banner url via id
            $getbanner = new Display($tablename);
            $banner = $getbanner->getRecordByID($id);
            // delete the file
            $filesToDelete[] = $banner['bannerUrl'];
            $delete = new DeleteFile($filesToDelete);
            if ($delete == TRUE) {
                echo "Files successfuly deleted.";
            }
            // Delete from database banners table
            $debanner = new Delete($tablename);
            $debanner->deletRecordByID($id);
        } catch (Exception $exc) {
            echo $exc->getMessage();
        }
    }
    if (isset($_POST['submit']) && $_POST['submit'] == 'Upload') {
        if (isset($_FILES)) {
            try {
                $file = $_FILES['image'];
                $allowedExts = array('jpg', 'png');
开发者ID:web-slawek,项目名称:matnercars,代码行数:31,代码来源:C_Banners.php


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