Example #1
0
 public static function from_url($url)
 {
     $href = new Href($url);
     if (isset($_SERVER['QUERY_STRING'])) {
         $href->setQuery($_SERVER['QUERY_STRING']);
     }
     $href->un_set('_ac');
     return $href;
 }
Example #2
0
 /**
  * @covers Href::parse
  */
 public function testParse()
 {
     $this->assertSame("vmms/vineyard", $this->href->__toString());
 }
    </div>
    <div class="col-md-12">
        <div class="col-md-4">
            <p>Программист PHP</p>

            <ul>
                <li>Дата рождения:19 июля 1991 (24 года)</li>
                <li> Город: Запорожье</li>
                <li>Адрес: Орджоникидзевский район</li>
                <li>Телефон: 0505574125</li>
                <li>Эл. почта: zak.juliett@gmail.com</li>
            </ul>
            </div>
        <div class="col-md-2 ">
            <img class="img-responsive" src="<?php 
echo Href::a('img/res.jpg');
?>
" alt="">
        </div>

    </div>

    <div class="col-md-12">
        <h2 class="page-header">Цель</h2>
        <p>Самореализация, возможность карьерного роста и достойная оплата труда.</p>


        <h2 class="page-header">Образование</h2>
        <p>Высшее</p>
        <p>с 09.2008 по 06.2013</p>
        <p>Запорожский национальный университет, экономический факультет, экономическая кибернетика, Запорожье. ОКР магистр по специальности "Экономическая кибернетика " (диплом с отличием)</p>
<form class="form-signin" action="<?php 
echo Href::a('user/login');
?>
" method="POST">
    <?php 
if (isset($_GET['error'])) {
    ?>
        <h4  class="text-danger text-center">Вы не правильно ввели логин или пароль</h4>
    <?php 
}
?>
    <h2 class="form-signin-heading text-center">Авторизация</h2>
    <input type="text" class="input-block-level" placeholder="Login" name="login" id="name" required>
    <input type="password" class="input-block-level" placeholder="Password" name="pass" id="pass" required>
    <button class="btn btn-large btn-success" type="submit">Вход</button>
    <a class="btn btn-large  btn-warning btn_reg" href="<?echo Href::a('user/reg')?>">Регистрация</a>
</form>

<div class="row">
    <div class="col-md-12 text-center">
        <?php 
if (is_array($data['user'])) {
    ?>
        <h2>Вы вошли как <?php 
    echo $data['user']['fio'];
    ?>
</h2>
            <a href="<?php 
    echo Href::a('vk_auth/exit');
    ?>
"  class="btn btn-warning"> <i class="fa fa-sign-out"></i>Выйти </a>
        <?php 
} else {
    ?>
        <a href="<?php 
    echo Href::a('vk_auth');
    ?>
" class="btn btn-warning"> <i class="fa fa-vk"></i> Войти</a>
        <?php 
}
?>
    </div>
</div>
<div class="container content margin_bottom">
    <div class="col-md-9">
        <h1></h1>
        <hr>
        <h3>Страница которую вы ищете, не найдена.</h3>
    </div>
    <div class="col-md-3 margin_top">
        <h3>Направления работы</h3>
        <div class="list-group">
            <?foreach($data['categories'] as $category_item){?>
                <a href="<?echo Href::a('category/view/'.$category_item['id']);?>" class="list-group-item <? echo ($category_item["id"]==$data["id_cat"]?'active':'oop');?>">
                    <?php 
echo $category_item['title'];
?>
                </a>
            <?}?>

        </div>
    </div>
</div>
 Выйти</a></li>
                <?php 
}
?>
            </ul>

        </div><!--/.nav-collapse -->
    </div>
</nav>

<!-- Begin page content -->
<div class="container">
    <?php 
include 'application/views/' . $content_view;
?>
</div>

<footer class="footer">
    <div class="container">
        <p class="text-muted"></p>
    </div>
</footer>



<?php 
echo Href::script('bootstrap.min.js');
?>

</body>
</html>
<?php

if (isset($_GET['success'])) {
    ?>
    <h2  class="text-success text-center">Данные успешно изменены</h2>
<?php 
}
?>
<form class="form-signin form_update" action="<?php 
echo Href::a('user');
?>
" method="POST" enctype="multipart/form-data">

    <h2 class="form-signin-heading text-center">Редактирование профиля</h2>
    <input type="text" name="id" value="<?php 
echo $_SESSION['user']['id'];
?>
" style="display: none;" id="id_h">
    <input type="text" class="input-block-level" placeholder="Имя" name="name" id="name" value="<?php 
echo $_SESSION['user']['name'];
?>
">
    <input type="text" class="input-block-level" placeholder="Фамилия" name="surname" id="surname" value="<?php 
echo $_SESSION['user']['surname'];
?>
">
    <input type="text" class="input-block-level" placeholder="Login" name="login" id="login" value="<?php 
echo $_SESSION['user']['login'];
?>
">
    <input type="password" class="input-block-level" placeholder="Пароль" name="pass" id="pass" >
</td>
                </tr>
                <tr>
                    <td>Дата регистрации</td>
                    <td><?php 
    echo $_SESSION['user']['date_create'];
    ?>
</td>
                </tr>
                <tr>
                    <td>Фото профиля</td>
                    <td><img class="photo_profile" src="<?php 
    echo Href::a('img/people/' . $image);
    ?>
"></td>
                </tr>
            </table>
            <a href="<?php 
    echo Href::a('user');
    ?>
" class="btn btn-success btn_edit">Редактировать профиль</a><br>
            <a href="<?php 
    echo Href::a('user/delete');
    ?>
" class="btn btn-success margin_top" onclick="return confirm('Подтвердите удаление');">Удалить  профиль</a>
        </div>
    </div>
    <?php 
}
?>
</div>
Example #10
0
 public function __construct($title)
 {
     parent::__construct("button");
     $this->title = $title;
     $this->href = Href::current();
 }
<!-- Page Heading/Breadcrumbs -->
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Контакты
        </h1>
        <ol class="breadcrumb">
            <li><a href="<?php 
echo Href::a('');
?>
">Главная</a>
            </li>
            <li class="active">Контакты</li>
        </ol>
    </div>
</div>
<!-- /.row -->

<!-- Intro Content -->
<div class="row">
    <div class="col-md-6">
        <h3>Контактные данные</h3>
        <p><i class="fa fa-phone"></i>
            <abbr title="Phone">P</abbr>: (050) 557-41-25</p>
        <p><i class="fa fa-envelope-o"></i>
            <abbr title="Email">E</abbr>: <a href="mailto:zak.juliett@gmail.com">zak.juliett@gmail.com</a>
        </p>



    </div>
Example #12
0
 private function showRecordsPerPage()
 {
     $numbers = array(Config::getInstance()->getInt("tablePaging/rowsPerPage", 10), 50, 100, 200);
     if ($this->getPaging()->getTotalRows() < $numbers[0]) {
         return;
     }
     $body = "Show:";
     foreach ($numbers as $number) {
         if ($number == $this->getPaging()->getRecordsPerPage()) {
             $recordsNumber = new HTMLElement("span");
             $recordsNumber->setBody($number);
         } else {
             $recordsNumber = new Link(Href::current());
             $recordsNumber->setParam(PagingInfoPrefs::getPageNumberParamName($this->getName()), floor($this->getPaging()->getFirstRecord() / $number));
             $recordsNumber->setTitle($number)->setParam(PagingInfoPrefs::getRecordsPerPageParamName($this->getName()), $number);
         }
         $body .= $recordsNumber;
         if ($this->getPaging()->getTotalRows() < $number) {
             break;
         }
     }
     $recordsPerPageSpan = new HTMLElement("span");
     $recordsPerPageSpan->set("class", "recordsPerPage");
     $recordsPerPageSpan->setBody($body);
     echo $recordsPerPageSpan;
 }
Example #13
0
 /**
  * Write the links to the various pages, including the 'prev' and 'next'
  * links.
  */
 protected function writePageLinks()
 {
     $linksCount = Config::getInstance()->getInt("tablePaging/maxLinksCount", 10);
     $pageNumParamName = PagingInfoPrefs::getPageNumberParamName($this->getName());
     $recordsPerPageParamName = PagingInfoPrefs::getRecordsPerPageParamName($this->getName());
     $pageLink = new Link(Href::current());
     $pageLink->set("class", "pageNumber");
     $arrowLink = new Link(Href::current());
     $arrowLink->set("class", "arrows");
     $totalPages = $this->pagingInfo->getTotalPages();
     $lastLinkablePage = min($totalPages, $this->pagingInfo->getPageNumber() + $linksCount);
     $lastLinkIsShown = $lastLinkablePage == $totalPages;
     $i = max($this->pagingInfo->getPageNumber() - $linksCount, 0);
     $firstLinkIsShown = $i == 0;
     if (!$firstLinkIsShown) {
         echo $arrowLink->setTitle("First")->setParam($pageNumParamName, 0);
         echo "&nbsp;|&nbsp;";
     }
     if ($this->pagingInfo->getPageNumber() > 0) {
         echo $arrowLink->setTitle("Previous")->setParam($pageNumParamName, $this->pagingInfo->getPageNumber() - 1);
         echo " ";
     }
     if (!$firstLinkIsShown) {
         echo "...&nbsp;";
     }
     // If there's only one page available, don't write anything
     if ($i == $lastLinkablePage - 1) {
         echo "&nbsp;";
         return;
     }
     while ($i < $lastLinkablePage) {
         if ($i == $this->pagingInfo->getPageNumber()) {
             // Write current page number (not a link)
             $currentPageSpan = new HTMLElement("span");
             $currentPageSpan->set("class", "currentPage");
             $currentPageSpan->setBody($i + 1);
             echo $currentPageSpan;
         } else {
             // Write a link to this page
             $pageLink->setParam($pageNumParamName, $i);
             $pageLink->setTitle($i + 1);
             echo $pageLink;
         }
         echo "&nbsp;";
         $i++;
     }
     if (!$lastLinkIsShown) {
         echo "...";
     }
     //echo ($this->pagingInfo->getFirstRecord()+1) . " - " . ($this->pagingInfo->getFirstRecord() + $this->rowCount) . " of " . $this->pagingInfo->getTotalRows();
     if (!$this->pagingInfo->isLastPage()) {
         echo " ";
         echo $arrowLink->setTitle("Next")->setParam($pageNumParamName, $this->pagingInfo->getPageNumber() + 1);
     }
     if (!$lastLinkIsShown) {
         echo "&nbsp;|&nbsp;";
         echo $arrowLink->setTitle("Last")->setParam($pageNumParamName, $totalPages - 1);
     }
 }
            }else{
                if (pass.length<=5 || pass.length > 17) {
                    $("#error_pass").text(" должен состоять из не менее 6 и не более 16 символов").delay(3000).fadeOut(300);
                     $("#pass").addClass("error").show();
                    $("#pass").delay(5000).removeClass("error").addClass("der").show();
                }
                else {
                    if (!(/\d{3}-\d{7}/.test(phone))){
                        $("#error_phone").text(" неверный формат").delay(3000).fadeOut(300);
                        //$("#phone").addClass("error").show();
                        //$("#phone").addClass("error").show();
                    }else {
                    $.ajax({
                        type: 'POST',
                        url: '<?php 
echo Href::a("user/reg");
?>
',
                        data: {name: name,surname: surname, login: login, pass:pass, email:email,birth_date: birth_date, phone:phone, code:code },
                        success: function (data) {
                            if (data == 555){
                                changeVisibility('form',1);
                                changeVisibility('formSucss',0);
                            }else {
                                if (data== 666){
                                    $("#error_login").text("Такой пользователь уже существует").delay(5000).fadeOut(500);
                                }else {
                                    if(data = 444) {
                                        $("#error_code").text("Вы неверно ввесли код с картинки").delay(3000).fadeOut(500);
                                    }
                                }
                    <button type="submit" class="btn btn-warning" id="send_mes">Отправить</button>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="modal fade in" id="modal_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Редактирование сообщения</h4>
            </div>
            <div class="modal-body" >
                <form action="<?php 
echo Href::a('message/edit');
?>
" method="post">
                    <input name="id" value="" style="display: none" id="modal_mes_edit">
                    <div class="form-group">
                        <textarea class="form-control text_mes_edit" rows="3" name="message" required></textarea>
                    </div>

            </div>
            <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">закрыть</button>
                    <button type="submit" class="btn btn-warning" id="send_mes_edit">Отправить</button>
                </form>
            </div>
        </div>
    </div>
Example #16
0
 /**
  * Set the fragment identifier (i.e: the value following a '#' at the end of the URL).
  *
  * @param String $anchor
  */
 public function setAnchor($anchor)
 {
     $this->href->setAnchor($anchor);
     return $this;
 }