Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Update: disable memo on issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nozomu-y committed Dec 8, 2021
1 parent 9466f03 commit aa86e18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions app/Http/Controllers/TicketsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ function post_confirm_issue(Request $request, $event_id)
$data[] = array(
'ticket_id' => $ticket->ticket_id,
'seat' => $ticket->seat,
'price' => $ticket->price
'price' => $ticket->price,
'memo' => $ticket->memo
);
}
if (count($data) === 0) {
Expand All @@ -118,7 +119,6 @@ function post_confirm_issue(Request $request, $event_id)
function post_issue(Request $request, $event_id)
{
$event = Events::where('event_id', $event_id)->get()->first();
$memo = $request['memo'];
$data = array();

// check whether the tickets are already issued
Expand All @@ -138,9 +138,8 @@ function post_issue(Request $request, $event_id)
break;
}
$ticket->is_issued = 1;
$ticket->memo = $memo;
$ticket->save();
$data[] = array($ticket->ticket_id, $ticket->token);
$data[] = array($ticket->ticket_id, $ticket->seat, $ticket->token);
}

// if a ticket was already issued
Expand Down
7 changes: 2 additions & 5 deletions resources/views/tickets/confirm_issue.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<th class="text-nowrap">{{ __('ticket_no') }}</th>
<th class="text-nowrap">{{ __('seat_no') }}</th>
<th class="text-nowrap">{{ __('price') }}</th>
<th class="text-nowrap">{{ __('memo') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -58,16 +59,12 @@
</td>
<td class="text-nowrap">{{ $ticket['seat'] }}</td>
<td class="text-nowrap">{{ Common::format_price($ticket['price']) }}</td>
<td>{{ $ticket['memo'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="form-group" id="memo_form_group">
<label for="memo">{{ __('ticket_memo') }}</label>
<input id="memo" type="text" class="form-control" name="memo" value="{{ old('memo') }}"
placeholder="{{ __('message.tickets.issue.memo_placeholder') }}">
</div>
<button type="submit" class="btn btn-primary" id="submit_button">{{ __('issue_tickets_abbrev') }}</button>
</form>
</div>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/tickets/issue.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<th class="text-nowrap">{{ __('ticket_no') }}</th>
<th class="text-nowrap">{{ __('seat_no') }}</th>
<th class="text-nowrap">{{ __('price') }}</th>
<th class="text-nowrap">{{ __('memo') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -57,6 +58,7 @@
<td class="text-nowrap">{{ sprintf('%06d', $ticket->ticket_id) }}</td>
<td class="text-nowrap">{{ $ticket->seat }}</td>
<td class="text-nowrap">{{ Common::format_price($ticket->price) }}</td>
<td>{{ $ticket->memo }}</td>
</tr>
@endif
@endforeach
Expand Down
3 changes: 2 additions & 1 deletion resources/views/tickets/links.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
$links = '';
foreach ($data as $link) {
$links .= __('ticket_no') . '' . $link[0] . "\n";
$links .= config('app.url') . '/' . $event->event_id . '/' . $link[0] . '/' . $link[1] . "\n\n";
$links .= __('seat_no') . '' . $link[1] . "\n";
$links .= config('app.url') . '/' . $event->event_id . '/' . $link[0] . '/' . $link[2] . "\n\n";
}
?>
<div class="form-group">
Expand Down

0 comments on commit aa86e18

Please sign in to comment.