@extends('layouts.app')
<?php
    use App\Models\NationalStatus; $times = array();
    $request = request();
    $posturl = url("indicator/processnationalstatus");
    $successurl = url("indicator/nationalstatus");
    $successurlnxt = url('indicator/nationalstatus');
    $gotosuccess = true;
    $id = "";  $successmessage = $failureurl = $name = $code = $notes ="";
    if(!empty($request->id)){
        $id = $request->id;
        $posturl = url("indicator/updatenationalstatus");
        $successurl = url("indicator/nationalstatus");
        $successurlnxt = url('indicator/nationalstatus');
        $gotosuccess = true;
        $times = NationalStatus::where('id', $id)->get();
        foreach ($times as $time) {
            $name = $time['name'];
            $notes = $time['notes'];
        }
    }
?>
@section('content')
<div class="pcoded-content">
    <div class="pcoded-inner-content">

        <div class="main-body">
            <div class="page-wrapper">
                <!-- Page-header start -->
                <div class="page-header card page-body">
                    <div class="row align-items-end">
                        <div class="col-lg-8">
                            <div class="page-header-title">
                                <a href="<?php echo url('indicator/list?tab=time'); ?>"><i class="icofont icofont icofont icofont-file-document bg-c-pink"></i></a>
                                <div class="d-inline">
                                    <h4>National Status</h4>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="page-header-breadcrumb">
                                <ul class="breadcrumb-title">
                                    <li class="breadcrumb-item">
                                        <a href="index.html">
                                            <i class="icofont icofont-home"></i>
                                        </a>
                                    </li>
                                    <li class="breadcrumb-item"><a href="#!">Indicators</a>
                                    </li>
                                    <li class="breadcrumb-item"><a href="#!">National Status</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                        <hr>
                        <div class="row">
                            <div class="col-sm-12">
                                <form id="indexform" class="form-horizontal" method="POST" action="<?php echo $posturl; ?>">
                                    @csrf
                                    <input name="entityname" id="entityname" type="hidden" value="MaritalStatus" />
                                    <input type="hidden" id="action" name="action"value="" />
                                    <input type="hidden" id="id" name="id" value="<?php echo $id; ?>" />
                                    <input name="successmessage" id="successmessage" type="hidden" value="<?php echo $successmessage; ?>" />  
                                    <input type="hidden" id="<?php echo "SUCCESS_MESSAGE"; ?>" name="<?php echo "SUCCESS_MESSAGE"; ?>" value="<?php echo $successmessage; ?>" /> 
                                    <input type="hidden" id="<?php echo "URL_SUCCESS"; ?>" name="successurl" value="<?php echo base64_encode($successurl); ?>" /> 
                                    <input type="hidden" id="<?php echo "URL_FAILURE"; ?>" name="failureurl" value="<?php echo base64_encode($failureurl); ?>" />
                                    <div class="form-group row">
                                        <label class="col-sm-2 col-form-label">Name</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="name" placeholder="National Status" required="required" value="<?php echo $name; ?>">
                                        </div>
                                        <div class="col-sm-4">
                                            <button type="submit" class="col-sm-4 btn btn-primary">Submit</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    
                </div>
                <!-- Page-header end -->
            </div>
        </div>
        <div id="styleSelector">

        </div>
    </div>
</div>
@endsection
