本文整理汇总了PHP中Website::getAllWebsites方法的典型用法代码示例。如果您正苦于以下问题:PHP Website::getAllWebsites方法的具体用法?PHP Website::getAllWebsites怎么用?PHP Website::getAllWebsites使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Website
的用法示例。
在下文中一共展示了Website::getAllWebsites方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllWebsiteCategoriesDT
function getAllWebsiteCategoriesDT()
{
global $bdd, $_TABLES;
if (!is_null($bdd) && !is_null($_TABLES)) {
$content = '<thead>';
$content .= '<tr>';
$content .= '<th>Id</th>';
$content .= '<th>Category</th>';
$content .= '<th>Website</th>';
$content .= '<th>Website Category</th>';
$content .= '<th>Url</th>';
$content .= '<th>Use Url</th>';
$content .= '<th>Url Pagination</th>';
$content .= '<th>Use Pagination</th>';
$content .= '<th>Action</th>';
$content .= '</tr>';
$content .= '</thead>';
$content .= '<tbody>';
$objWebsiteCategory = new WebsiteCategory($bdd, $_TABLES);
$items = $objWebsiteCategory->getAllWebsiteCategories();
if ($items) {
foreach ($items as $key => $item) {
$content .= '<tr website_category_id=' . $item->id . '>';
$content .= '<td>' . $item->id . '</td>';
$content .= '<td><select class="select_dt select_dt_category_id">';
$objCategory = new Category($bdd, $_TABLES);
$categories_items = $objCategory->getAllCategories();
if ($categories_items) {
foreach ($categories_items as $key_c => $category_item) {
$temp_content = '';
$temp_content .= '<option value="' . $category_item->id . '" ';
if ($category_item->id == $item->category_id) {
$temp_content .= 'selected>';
} else {
$temp_content .= '>';
}
$temp_content .= $category_item->category . '</option>';
$content .= $temp_content;
}
}
$content .= '</select></td>';
$content .= '<td><select class="select_dt select_dt_website_id">';
$objWebsite = new Website($bdd, $_TABLES);
$websites_items = $objWebsite->getAllWebsites();
if ($websites_items) {
foreach ($websites_items as $key_w => $website_item) {
$temp_content = '';
$temp_content .= '<option value="' . $website_item->id . '" ';
if ($website_item->id == $item->website_id) {
$temp_content .= 'selected>';
} else {
$temp_content .= '>';
}
$temp_content .= $website_item->website . '</option>';
$content .= $temp_content;
}
}
$content .= '</select></td>';
$content .= '<td><input type="text" class="input_dt input_dt_website_category" value="' . $item->category . '" /></td>';
$content .= '<td><input type="text" class="input_dt input_dt_url" value="' . $item->url . '" /></td>';
$content .= '<td><input type="checkbox" class="input_dt input_dt_use_url" value="' . $item->use_url . '"></input></td>';
$content .= '<td><input type="text" class="input_dt input_dt_url_pagination" value="' . $item->url_pagination . '" /></td>';
$content .= '<td><input type="checkbox" class="input_dt input_dt_use_pagination" value="' . $item->use_pagination . '"></input></td>';
$content .= "<td><input type='button' class='edit edit_website_category_dt' value='Save' />\n\t\t\t\t <input type='button' class='delete delete_website_category_dt' value='Supprimer' /></td>";
$content .= '</tr>';
}
}
$content .= '</tbody>';
return $content;
} else {
error_log("BDD ERROR : " . json_encode($bdd));
error_log("TABLES ERROR : " . json_encode($_TABLES));
}
}
示例2: echoSite
include_once $_SERVER['DOCUMENT_ROOT'] . "/engine.php";
if (!isset($_GET['web-id']) && !isset($_GET['start-id'])) {
echo "Nothing given :(";
exit;
}
if (isset($_GET['web-id'])) {
function echoSite(Website $site)
{
echo $site->getName() . ":\r\n";
echo $site->update() . "\r\n";
}
$webId = $_GET['web-id'];
if ($webId == "-1") {
// Update all
foreach (Website::getAllWebsites() as $site) {
echoSite($site);
}
} else {
// Update single site
QueryBuilder::create(SQL::getConnection())->withQuery("SELECT display_name, folder_name FROM websites WHERE id = ?")->withParam($webId, QueryBuilder::PARAM_TYPE_INT)->build()->forEachResult(function ($row) {
$site = new Website(0, $row['display_name'], $row['folder_name']);
echoSite($site);
});
}
} else {
function echoStart(Startables $starter)
{
echo $starter->getName() . ":\r\n";
echo $starter->start() . "\r\n";
}
示例3: dirname
<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
require_once dirname(dirname(__FILE__)) . "/common/php/class/class.website.php";
global $bdd;
global $_TABLES;
$content = "";
$view = new Template(dirname(__FILE__) . '/html/website.html');
if (!is_null($bdd) && !is_null($_TABLES)) {
$objWebsite = new Website($bdd, $_TABLES);
$websites = $objWebsite->getAllWebsites();
if (!is_null($websites)) {
foreach ($websites as $key => $value) {
if (isset($_COOKIE['media_preference'])) {
$website_preference = json_decode(stripcslashes($_COOKIE['media_preference']), true);
if (!is_null($website_preference) && !empty($website_preference)) {
$checked = in_array($value->id, $website_preference) == true ? 'checked="true"' : '';
} else {
$checked = '';
}
} else {
$checked = 'checked="true"';
}
$content .= $view->getView(array("website_id" => $value->id, "website_name" => mb_strtoupper($value->website, 'UTF-8'), "checked" => $checked));
}
echo $content;
} else {
// 404
echo "404 Not Found";
示例4: getAllWebsiteSubscriptionsDT
function getAllWebsiteSubscriptionsDT()
{
global $bdd, $_TABLES;
if (!is_null($bdd) && !is_null($_TABLES)) {
$content = '<thead>';
$content .= '<tr>';
$content .= '<th>Id</th>';
$content .= '<th>User</th>';
$content .= '<th>Website</th>';
$content .= '<th>Action</th>';
$content .= '</tr>';
$content .= '</thead>';
$content .= '<tbody>';
$objWebsiteSubscription = new WebsiteSubscription($bdd, $_TABLES);
$website_subscriptions = $objWebsiteSubscription->getAllWebsiteSubscriptions();
if ($website_subscriptions) {
foreach ($website_subscriptions as $key => $website_subscription) {
$content .= '<tr website_subscription_id=' . $website_subscription->id . '>';
$content .= '<td>' . $website_subscription->id . '</td>';
$content .= '<td><select class="select_dt select_dt_user_id">';
$objUser = new User($bdd, $_TABLES);
$users_items = $objUser->getAllUsers();
if ($users_items) {
foreach ($users_items as $key_u => $user_item) {
$temp_content = '';
$temp_content .= '<option value="' . $user_item->id . '" ';
if ($user_item->id == $website_subscription->user_id) {
$temp_content .= 'selected>';
} else {
$temp_content .= '>';
}
$temp_content .= $user_item->name . '</option>';
$content .= $temp_content;
}
}
$content .= '</select></td>';
$content .= '<td><select class="select_dt select_dt_website_id">';
$objWebsite = new Website($bdd, $_TABLES);
$websites_items = $objWebsite->getAllWebsites();
if ($websites_items) {
foreach ($websites_items as $key_w => $website_item) {
$temp_content = '';
$temp_content .= '<option value="' . $website_item->id . '" ';
if ($website_item->id == $website_subscription->website_id) {
$temp_content .= 'selected>';
} else {
$temp_content .= '>';
}
$temp_content .= $website_item->website . '</option>';
$content .= $temp_content;
}
}
$content .= '</select></td>';
$content .= "<td><input type='button' class='edit edit_website_subscription_dt' value='Save' />\n\t\t\t\t <input type='button' class='delete delete_website_subscription_dt' value='Supprimer' /></td>";
$content .= '</tr>';
}
}
$content .= '</tbody>';
return $content;
} else {
error_log("BDD ERROR : " . json_encode($bdd));
error_log("TABLES ERROR : " . json_encode($_TABLES));
}
}
示例5: getAllWebsitesDT
function getAllWebsitesDT()
{
global $bdd, $_TABLES;
if (!is_null($bdd) && !is_null($_TABLES)) {
$content = '<thead>';
$content .= '<tr>';
$content .= '<th>Id</th>';
$content .= '<th>Website</th>';
$content .= '<th>Url</th>';
$content .= '<th>Logo</th>';
$content .= '<th>File</th>';
$content .= '<th>Scrap</th>';
$content .= '<th>Action</th>';
$content .= '</tr>';
$content .= '</thead>';
$content .= '<tbody>';
$objWebsite = new Website($bdd, $_TABLES);
$items = $objWebsite->getAllWebsites();
if ($items) {
foreach ($items as $key => $item) {
$content .= '<tr websiteId=' . $item->id . '>';
$content .= '<td>' . $item->id . '</td>';
$content .= '<td><input type="text" class="input_dt input_dt_website" value="' . $item->website . '" /></td>';
$content .= '<td><input type="text" class="input_dt input_dt_url" value="' . $item->url . '" /></td>';
$content .= '<td><input type="text" class="input_dt input_dt_logo" value="' . $item->logo . '" /></td>';
$content .= '<td><input type="text" class="input_dt input_dt_file" value="' . $item->file . '" /></td>';
$content .= '<td><input type="checkbox" class="input_dt input_dt_scrap" value="' . $item->scrap . '"></input></td>';
$content .= "<td><input type='button' class='edit edit_website_dt' value='Save' />\n\t\t\t\t <input type='button' class='delete delete_website_dt' value='Supprimer' /></td>";
$content .= '</tr>';
}
}
$content .= '</tbody>';
return $content;
} else {
error_log("BDD ERROR : " . json_encode($bdd));
error_log("TABLES ERROR : " . json_encode($_TABLES));
}
}