示例#1
0
    <!-- Новости -->
    <div class = "boardedHeader">
        <h2><?php 
echo $currentNews['header'];
?>
</h2>
    </div>
    <div class = "newsDiv">
        <?php 
echo $currentNews['text'];
?>
    </div>
    <div class = "commentsDate">
        <?php 
echo reverseDate($currentNews['date'], "-");
?>
    </div>
    
    <!-- Комментарии -->
    <h3>Комментарии</h3>
    <?php 
$comments = getComments($newsId);
foreach ($comments as $comment) {
    ?>
        <div class = "commentsDiv">
            <i><?php 
    echo getNicknameById($comment['user']) . ":";
    ?>
</i>
            <?php 
示例#2
0
	if(!empty($_GET['year2'])){$year2 = $_GET['year2'];}
	if(!empty($_GET['year3'])){$year3 = $_GET['year3'];}
	if(!empty($_GET['year4'])){$year4 = $_GET['year4'];}
	if(!empty($_GET['year5'])){$year5 = $_GET['year5'];}
//почивен ден
	if(!empty($_GET['rest_day'])){$rest1 = reverseDate($_GET['rest_day']);}
	if(!empty($_GET['rest_day2'])){$rest2 = reverseDate($_GET['rest_day2']);}
	if(!empty($_GET['rest_day3'])){$rest3 = reverseDate($_GET['rest_day3']);}
	if(!empty($_GET['rest_day4'])){$rest4 = reverseDate($_GET['rest_day4']);}
	if(!empty($_GET['rest_day5'])){$rest5 = reverseDate($_GET['rest_day5']);}
//работен ден
	if(!empty($_GET['work_day'])){$work1 = reverseDate($_GET['work_day']);}
	if(!empty($_GET['work_day2'])){$work2 = reverseDate($_GET['work_day2']);}
	if(!empty($_GET['work_day3'])){$work3 = reverseDate($_GET['work_day3']);}
	if(!empty($_GET['work_day4'])){$work4 = reverseDate($_GET['work_day4']);}
	if(!empty($_GET['work_day5'])){$work5 = reverseDate($_GET['work_day5']);}
//основание
	if(!empty($_GET['reason'])){$reason1 = $_GET['reason'];}
	if(!empty($_GET['reason2'])){$reason2 = $_GET['reason2'];}
	if(!empty($_GET['reason3'])){$reason3 = $_GET['reason3'];}
	if(!empty($_GET['reason4'])){$reason4 = $_GET['reason4'];}
	if(!empty($_GET['reason5'])){$reason5 = $_GET['reason5'];}

	$sql = "INSERT INTO calendar(year, extra_work_day, extra_not_work_day, reason)";
	if($_GET['check1'] == 1){$sql .= " VALUES('$year1','$work1','$rest1','" . urldecode($reason1) . "')";}
	if($_GET['check2'] == 2){$sql .= ", ('$year2','$work2','$rest2','" . urldecode($reason2) . "')";}
	if($_GET['check3'] == 3){$sql .= ", ('$year3','$work3','$rest3','" . urldecode($reason3) . "')";}
	if($_GET['check4'] == 4){$sql .= ", ('$year4','$work4','$rest4','" . urldecode($reason4) . "')";}
	if($_GET['check5'] == 5){$sql .= ", ('$year5','$work5','$rest5','" . urldecode($reason5) . "')";}

示例#3
0
function formatdatemon($strdate)
{
    if ($strdate) {
        $strdate = reverseDate($strdate);
        $strdate = date('d-M-Y', strtotime($strdate));
    }
    return $strdate;
}
示例#4
0
<?php

include_once 'procedures.php';
$echoAnswer = "";
if (!isAdmin()) {
    echo "Нет полномочий";
    exit;
}
$newsId = intval($_POST['newsId']);
$date = reverseDate($_POST['date'], "/");
if (isset($_POST['createNews'])) {
    $answer = createNews($_POST['header'], $_POST['text'], $date);
    switch ($answer) {
        case 0:
            $echoAnswer = "Новость успешно создана!";
            break;
        case 1:
            $echoAnswer = "Произошла ошибка при создании новости!";
            break;
        case 2:
            $echoAnswer = "Не удалось подключиться к БД!";
            break;
    }
} else {
    if (isset($_POST['updateNews'])) {
        $answer = updateNews($newsId, $_POST['header'], $_POST['text'], $date);
        switch ($answer) {
            case 0:
                $echoAnswer = "Новость успешно обновлена!";
                break;
            case 1:
示例#5
0
foreach ($news as $data) {
    ?>
            <div class = "boardedHeader">
                <h2><?php 
    echo $data['header'];
    ?>
</h2>
            </div>
            <div class = "newsDiv">
                <?php 
    echo $data['text'];
    ?>
            </div>
            <div class = "commentsDate">
                <?php 
    echo reverseDate($data['date'], "-");
    ?>
            </div>
            <div>
                <a href="comments.php?news=<?php 
    echo $data['id'];
    ?>
">Comments (<?php 
    echo getCommentsCount($data['id']);
    ?>
)</a>
            </div>
        <?php 
}
?>
示例#6
0
 public function toFormDate()
 {
     return reverseDate(date('Y-m-d', $this->unixTime));
 }
示例#7
0
 }
 echo "\nPage {$pg}/{$pages} with {$current} items: ";
 for ($i = 0; $i < $current; $i++) {
     $internalid = $matches[1][$i];
     $regyear = $matches[2][$i];
     $regnumber = $matches[3][$i];
     $year = $matches[4][$i];
     $yearnumber = $matches[5][$i];
     if ($yearnumber == "") {
         $yearnumber = 0;
     }
     $category = $matches[6][$i];
     $subcategory = $matches[7][$i];
     $subject = $matches[8][$i];
     $publishedfrom = reverseDate($matches[9][$i]);
     $publishedto = reverseDate($matches[10][$i]);
     $url = "http://trasparenza.comune.latina.it/web/trasparenza/papca-ap/-/papca/display/{$internalid}";
     if (!$stmt->execute()) {
         if (preg_match("/^Duplicate entry '[0-9]+' for key 'PRIMARY'/", $stmt->error)) {
             echo "D";
         } else {
             echo "\nError on item {$i} : " . $stmt->error . "\n";
         }
     } else {
         $detailpage = getURL($url);
         preg_match_all('$<tr.*?<td><span class="label label-info">([^<]+)</span></td>.*?<td><span>([^<]+)</span></td>.*?</tr>$sm', $detailpage, $m);
         foreach ($m[1] as $idx => $v) {
             $dbid = -1;
             // TODO: ottimizzare, caricare in memoria questa lista
             $stmt1 = $db->prepare("SELECT idattributo FROM atti_attributi_testo WHERE attributo=?");
             $stmt1->bind_param("s", trim($v));