コード例 #1
0
ファイル: Reviews.php プロジェクト: svetlinyotov/SSFrameWork
 public function hasCurrentUserReviewed($product_id)
 {
     if (Auth::user() !== false) {
         return (bool) $this->sql("SELECT id FROM reviews WHERE product_id = ? AND user_id = ?", [$product_id, Auth::user()->id])->getAffectedRows();
     }
     return false;
 }
コード例 #2
0
ファイル: main.php プロジェクト: svetlinyotov/SSFrameWork
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    <a href="<?php 
echo asset('/products');
?>
">Products</a>
                </li>
                <li>
                    <a href="<?php 
echo asset('/cart');
?>
">Cart</a>
                </li>
                <?php 
if (Auth::user() == false) {
    ?>
                    <li>
                        <a href="<?php 
    echo asset('/login');
    ?>
">Login</a>
                    </li>
                    <li>
                        <a href="<?php 
    echo asset('/register');
    ?>
">Register</a>
                    </li>
                <?php 
} else {
コード例 #3
0
        <div class="modal-content">
            Are you sure you want to delete the category?

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <a href="#" id="delete_button" class="btn btn-danger">Delete</a>
        </div>

    </div>
</div>
<?php 
}
?>
 

<?php 
if (Auth::user()->role < 3 && Auth::user()) {
    ?>
<script type="text/javascript">
    $('#cat_edit').on('show.bs.modal', function (event) {
        var button = $(event.relatedTarget);
        var id = button.data('id');
        var title = button.data('title');
        var description = button.data('description');

        var modal = $(this);
        modal.find('#input-title').val(title);
        modal.find('#input-description').val(description);
        modal.find('form').attr('action', '<?php 
    echo asset('/category');
    ?>
/' + id);
コード例 #4
0
ファイル: main.php プロジェクト: svetlinyotov/SSFrameWork
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">My Shop Admin</a>
        </div>
        <!-- Top Menu Items -->
        <ul class="nav navbar-right top-nav">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?php 
echo Auth::user()->email;
?>
 <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li>
                        <a href="/"><i class="fa fa-arrow-circle-o-left"></i> Back</a>
                    </li>
                </ul>
            </li>
        </ul>
        <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav side-nav">
                <li>
                    <a href="<?php 
echo asset('/admin/users');
コード例 #5
0
ファイル: checkout.php プロジェクト: svetlinyotov/SSFrameWork
echo Form::csrf();
?>
    <div class="form-group">
        <?php 
echo Form::label('names', 'Names');
?>
        <?php 
echo Form::text('names', $input['names'] ?: Auth::user()->names, ['class' => 'form-control']);
?>
    </div>
    <div class="form-group">
        <?php 
echo Form::label('email', 'Email');
?>
        <?php 
echo Form::email('email', $input['email'] ?: Auth::user()->email, ['class' => 'form-control']);
?>
    </div>
    <div class="form-group">
        <?php 
echo Form::label('mobile', 'Mobile');
?>
        <?php 
echo Form::text('mobile', $input['mobile'] ?: null, ['class' => 'form-control']);
?>
    </div>
    <div class="form-group">
        <?php 
echo Form::label('address', 'Address');
?>
        <?php 
コード例 #6
0
ファイル: Cart.php プロジェクト: svetlinyotov/SSFrameWork
 public function checkout($names, $email, $mobile, $address)
 {
     return $this->sql("INSERT INTO checkouts (user_id, email, `names`, mobile, address) VALUES (?,?,?,?,?)", [Auth::user()->id, $email, $names, $mobile, $address])->getLastInsertId();
 }