/**
  * test findAllWithSiteId
  *
  * @param string $siteId
  * @param int    $expectedGroupCount
  *
  * @dataProvider provideSiteId
  */
 public function testFindAllWithSiteId($siteId, $expectedGroupCount)
 {
     $site = $this->siteRepository->findOneBySiteId($siteId);
     $groups = $this->repository->findAllWithSiteId($site->getId());
     $this->assertCount($expectedGroupCount, $groups);
 }
Beispiel #2
0
<?php

require_once 'function.php';
require 'classes.php';
require 'repo.php';
$link = getDbConnect();
$id = $_GET['id'];
$param = $_GET['name'];
switch ($param) {
    case 'site':
        if (SiteRepository::delete($link, $id)) {
            header("location: sites.php");
        }
        break;
    case 'keyword':
        if (WordpairRepository::delete($link, $id)) {
            header("location: wordpairs.php");
        }
        break;
    case 'person':
        if (PersonRepository::delete($link, $id)) {
            header("location: persons.php");
        }
        break;
    default:
        header("location: index.php");
}
Beispiel #3
0
<?php

require_once 'function.php';
require 'classes.php';
require 'repo.php';
$link = getDbConnect();
$title = "Общая статистика";
$pids = [];
$ranks = [];
$error = false;
$all_sites = SiteRepository::loadAll($link);
$all_persons = PersonRepository::loadAll($link);
if (isset($_POST['submit'])) {
    $site_id = $_POST['sites'];
    if ($site_id != 0) {
        $site_page = PageRepository::selectAllBySiteID($link, $site_id);
        //массив объектов страниц
        foreach ($site_page as $ids) {
            $pid = $ids->getId();
            $pids[] = $pid;
        }
        $site = SiteRepository::load($link, $site_id);
        $site_name = $site->getName();
    } else {
        $error = true;
    }
}
include 'view/header.php';
include 'view/v_static-all.php';
include 'view/footer.php';
Beispiel #4
0
<?php

require_once 'function.php';
require 'classes.php';
require 'repo.php';
$link = getDbConnect();
$title = "Сайты: Редактирование";
$site_id = $_GET['id'];
$site = SiteRepository::load($link, $site_id);
$site_name = $site->getName();
if (isset($_POST['submit'])) {
    $site_name = $_POST['name'];
    if (SiteRepository::edit($link, $site_id, $site_name)) {
        header("location: sites.php");
    }
}
include 'view/header.php';
include 'view/v_edit_site.php';
include 'view/footer.php';
Beispiel #5
0
<?php

require_once 'function.php';
require 'classes.php';
require 'repo.php';
$link = getDbConnect();
$title = "Справочник: Сайты";
$all_sites = SiteRepository::loadAll($link);
include 'view/header.php';
include 'view/v_sites.php';
include 'view/footer.php';
Beispiel #6
0
<?php

require_once 'function.php';
require 'classes.php';
require 'repo.php';
$link = getDbConnect();
$title = "Сайты: Добавить";
$error = false;
if (isset($_POST['submit'])) {
    $name = trim($_POST['name']);
    if ($name != '') {
        if (SiteRepository::add($link, $name)) {
            header("location: sites.php");
        }
    } else {
        $error = true;
    }
}
include 'view/header.php';
include 'view/v_new_site.php';
include 'view/footer.php';