Esempio n. 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $account = Models\Account::find($id);
     $groups = Models\Group::all();
     $data = ['account' => $account, 'header' => 'Edit Nama Perkiraan', 'method' => 'POST', 'hidden' => method_field('PUT'), 'action' => '/accounts/' . $id, 'groups' => $groups, 'disable' => 'disabled'];
     return view('accounts.edit', $data);
 }
/**
 * Recursive function to output the html we need
 * @param $comments
 * @param $post
 */
function displayComments($comments, $post)
{
    foreach ($comments as $comment) {
        echo '<div class="well">';
        echo '<div>';
        echo $comment->text . '-' . $comment->user->name . '</div>';
        echo '<div>';
        if (Auth::check()) {
            if (Auth::user()->admin) {
                echo "<form action='/comment/" . $comment->id . "/delete' method='POST'>";
                echo csrf_field();
                echo method_field('DELETE');
                echo "<button type='submit' id='delete-comment-" . $comment->id . "' class='btn btn-danger btn-xs'>";
                echo "<i class='fa fa-btn fa-trash'></i> Delete Comment";
                echo "</button>";
                echo "</form>";
                echo "<br>";
            }
            echo '<button id="/comment/' . $post->id . '/' . $comment->id . '" class="btn btn-primary btn-xs"><i class="fa fa-reply"></i> Reply</button> ';
            echo '<button id="/commend/' . $comment->id . '" class="btn btn-success btn-xs"><i class="fa fa-thumbs-up"></i> Commend (' . $comment->voteCount . ')</button> ';
            if (Auth::user()->admin) {
                echo "<a href=" . route('confirmBan', ['userId' => $comment->user->id]) . " class='btn btn-danger btn-xs'><i class='fa fa-ban'></i> Ban User</a> ";
            }
        }
        if ($comment->replies) {
            displayComments($comment->replies, $post);
        }
        echo '</div>';
        echo '</div>';
    }
}
<ul class="action">
    <li>
        <form action="<?php 
echo e(url('admin/team/delete/' . $tim->id));
?>
" method="POST">
            <?php 
echo e(csrf_field());
?>

            <?php 
echo e(method_field('DELETE'));
?>

            <button class="btn btn-danger">
                Hapus
            </button>
        </form>
    </li>
    <li>
        <a href="<?php 
echo e(url('admin/team/edit/' . $tim->id));
?>
">
            <button class="btn btn-warning">
                Edit
            </button>
        </a>
    </li>
    <li>
        <a href="<?php 
						<div class="col-md-6 col-md-offset-4">
							<button type="submit" class="btn btn-primary">
								Update
							</button>
						</div>
					</div>
				</form>
				<hr>
				<form class="form-horizontal" role="form" method="post" action="<?php 
echo e(action('SettingsController@postDelete'));
?>
" onsubmit="return confirm('Are you sure?')">
					<?php 
echo csrf_field();
?>

					<?php 
echo method_field('DELETE');
?>

					<button type="submit" class="btn btn-danger">
						Delete My Account
					</button>
				</form>
			</div>
		</div>
	</div>
</div>
<?php 
$__env->stopSection();
echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render();
Esempio n. 5
0
@extends('layout/index')
@section('title', 'Profile')
@section('content')
    <h2>@yield('title')</h2>
    <form action="<?php 
echo route('auth.updateprofile');
?>
" method="post" accept-charset="utf-8"
          autocomplete="off">
        <?php 
echo csrf_field();
?>
        <?php 
echo method_field('put');
?>
        @include('_errors')
        <div class="row">
            <div class="six columns">
                <label for="lName">Your Name</label>
                <input name="name" id="lName" type="text" class="u-full-width" placeholder="Name"
                       value="<?php 
echo old('name', $user->name);
?>
">
            </div>
            <div class="six columns">
                <label for="lEmail">Your Email</label>
                <input name="email" id="lEmail" type="text" class="u-full-width" placeholder="Email"
                       value="<?php 
echo old('email', $user->email);
?>
Esempio n. 6
0
 /**
  * Snippet for for outputting html for delete forms
  *
  * @param string $action
  * @param string $text
  * @param string $input
  * @param bool $specific
  * @param string $icon
  * @return string
  */
 public function deleteForm($action, $text, $input = '', $specific = false, $icon = 'icon-trash')
 {
     return sprintf('<form action="%s" method="POST" class="' . ($specific ? 'delete-form-specific' : 'delete-form') . '">' . method_field('DELETE') . csrf_field() . '%s<button class="option-delete" type="submit">
             <i class="%s"></i>%s
         </button></form>', $action, $input, $icon, $text);
 }
Esempio n. 7
0
 /**
  * Snippet for displaying node option forms
  *
  * @param string $action
  * @param string $icon
  * @param string $text
  * @return string
  */
 function nodeOptionForm($action, $icon, $text)
 {
     return sprintf('<form action="%s" method="POST">' . method_field('PUT') . csrf_field() . '<button type="submit">
             <i class="%s"></i>%s
         </button></form>', $action, $icon, trans($text));
 }
Esempio n. 8
0
 /**
  * 按校区列出可选课程
  * 2016-05-12:应教务处要求,添加公体选课类别名称
  * 2016-09-01:应教务处要求,添加公体选课人数
  * @author FuRongxin
  * @date    2016-09-01
  * @version 2.1.2
  * @param   string $type 课程类型
  * @param   string $campus 校区号
  * @return  JSON 可选课程列表
  */
 public function listing($type, $campus)
 {
     $courses = Mjcourse::ofType($type)->selectable($campus)->get();
     $datatable = Datatables::of($courses)->addColumn('action', function ($course) use($type) {
         $same = Selcourse::whereXh(Auth::user()->xh)->whereNd(session('year'))->whereXq(session('term'))->whereKch($course->kch)->where('kcxh', '<>', $course->kcxh)->exists();
         $exists = Selcourse::whereXh(Auth::user()->xh)->whereNd(session('year'))->whereXq(session('term'))->whereKcxh($course->kcxh)->exists();
         if ($exists) {
             return '<form name="deleteForm" action="' . route('selcourse.destroy', $course->kcxh) . '" method="post" role="form" data-id="' . $course->kcxh . '" data-name="' . $course->kcmc . '">' . method_field('delete') . csrf_field() . '<button type="submit" class="btn btn-danger">退课</button></form>';
         } elseif ($same) {
             return '<div class="text-danger">已选同号课程</div>';
         } elseif (Prior::failed($course->kch, Auth::user())->exists()) {
             return '<div class="text-danger">前修课未修读</div>';
         } elseif ($course->rs >= $course->zrs) {
             return '<div class="text-danger">人数已满</div>';
         } else {
             return '<form name="createForm" action="' . route('selcourse.store') . '" method="post" role="form" data-id="' . $course->kcxh . '" data-name="' . $course->kcmc . '">' . csrf_field() . '<button type="submit" class="btn btn-primary">选课</button><input type="hidden" name="kcxh" value="' . $course->kcxh . '"><input type="hidden" name="type" value="' . $type . '"></form>';
         }
     })->editColumn('kcmc', function ($course) use($type) {
         // 列出公体项目名称
         if ('pubsport' == $type) {
             $sport = Pubsport::whereNd(session('year'))->whereXq(session('term'))->whereKcxh($course->kcxh)->first();
             if (is_object($sport)) {
                 return $course->kcmc . '-' . $sport->xm;
             }
         }
         return $course->kcmc;
     })->editColumn('rs', function ($course) use($type) {
         // 显示公体已选人数
         if ('pubsport' == $type) {
             $count = Count::whereKcxh($course->kcxh)->first();
             if (is_object($count)) {
                 return $count->rs;
             }
         }
         return $course->rs;
     });
     for ($i = 1; $i <= 7; ++$i) {
         $datatable = $datatable->addColumn($this->_weeks[$i], function ($course) use($i) {
             $info = '';
             foreach (array_keys(explode(',', $course->zcs), $i) as $pos) {
                 $ksz = array_get(explode(',', $course->kszs), $pos);
                 $jsz = array_get(explode(',', $course->jszs), $pos);
                 $ksj = array_get(explode(',', $course->ksjs), $pos);
                 $jsj = array_get(explode(',', $course->jsjs), $pos);
                 $jsxm = array_get(explode(',', $course->jsxms), $pos);
                 $info .= '<p><div>第 ';
                 $info .= $ksz === $jsz ? $ksz : $ksz . ' ~ ' . $jsz;
                 $info .= ' 周</div><div class="text-danger">第 ';
                 $info .= $ksj === $jsj ? $ksj : $ksj . ' ~ ' . $jsj;
                 $info .= ' 节</div><div class="text-info">';
                 $info .= empty($jsxm) ? '未知老师' : $jsxm;
                 $info .= '</div></p>';
             }
             return $info;
         });
     }
     return $datatable->make(true);
 }