{{Session::get('success')}}
                    </div>
                @endif
                @if(Session::has('fails'))
                    <div class="alert alert-success alert-dismissable">
                        <i class="fa fa-ban"></i>
                        <b>Alert!</b> Fail.
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                        {{Session::get('fails')}}
                    </div>
                @endif
            <!-- -->    
<div class="box">
    <div class="box-header">
   <?php 
$id = App\Model\helpdesk\Form\Forms::where('id', $id)->first();
?>
    <h3 class="box-title">{!! Lang::get('lang.form_name') !!} : {!! $id->formname !!}</h3>
 
    </div>
        <div class="box-body">
<?php 
$i = $id->id;
$values = App\Model\helpdesk\Form\Fields::where('forms_id', '=', $i)->get();
foreach ($values as $value) {
    if ($value->type == "select") {
        $data = $value->value;
        $value = explode(',', $data);
        echo '<select class="form-control">';
        foreach ($value as $option) {
            echo '<option>' . $option . '</option>';
                        {!! Lang::get('lang.forms') !!}
                    </div>
                    <a href="{!! url('forms/create') !!}" class="pull-right"><button class="btn btn-primary">{!! Lang::get('lang.create_form') !!}</button></a> 
                </div>
                <div class="box-body">

                   <table id="example2" class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>{!! Lang::get('lang.form_name') !!}</th>
                                <th>{!! Lang::get('lang.action') !!}</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
$forms = App\Model\helpdesk\Form\Forms::all();
?>
                            @foreach($forms as $form)
                               
                            <tr>
                                
                                <td>{!! $form->formname !!}</td>

                                
                                 <td>{!! link_to_route('forms.show', Lang::get('lang.view_this_form') ,[$form->id],['id'=>'View','class'=>'btn btn-primary btn-sm']) !!}
                                                            <button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#{{$form->id}}delete">{!! Lang::get('lang.delete_from') !!}</button>
                                                            
                                                            <div class="modal fade" id="{{$form->id}}delete">
                                                                <div class="modal-dialog">
                                                                    <div class="modal-content">
                                                                        <div class="modal-header">
<?php 
$encrypter = app('Illuminate\\Encryption\\Encrypter');
$encrypted_token = $encrypter->encrypt(csrf_token());
?>
<input id="token" type="hidden" value="{{$encrypted_token}}">
{!! Form::open(['action'=>'Client\helpdesk\FormController@postedForm','method'=>'post']) !!}
<div>
    <div class="content-header">
        <h4>{!! Lang::get('lang.ticket') !!} {!! Form::submit(Lang::get('lang.send'),['class'=>'form-group btn btn-info pull-right'])!!}</h4>
    </div>
    <div class="row col-md-12">
        <div class="col-md-12 form-group {{ $errors->has('help_topic') ? 'has-error' : '' }}">
            {!! Form::label('help_topic', Lang::get('lang.choose_a_help_topic')) !!} 
            {!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
<?php 
$forms = App\Model\helpdesk\Form\Forms::get();
$helptopic = App\Model\helpdesk\Manage\Help_topic::get();
?>
                  
            <select name="helptopic" class="form-control" id="selectid">
            <?php 
$system_default_department = App\Model\helpdesk\Settings\System::where('id', '=', 1)->first();
if ($system_default_department->department) {
    $department_relation_helptopic = App\Model\helpdesk\Manage\Help_topic::where('department', '=', $system_default_department->department)->first();
    $default_helptopic = $department_relation_helptopic->id;
} else {
    $default_helptopic = 0;
}
?>
  
                <option value="{!! $default_helptopic !!}">Default</option>