@extends('backend.header')
@section('index-content')
<style>
    .form-control {
        height: 40px;
    }
    @media (min-width: 768px){
        .form-horizontal .control-label {
            padding-top: 7px;
            margin-bottom: 0;
            text-align: right;
        }
    }
</style>
<?php
function convertToUnicodeNumber($input) {

    $standard_numsets = array("0","1","2","3","4","5","6","7","8","9");
    $devanagari_numsets = array("०","१","२","३","४","५","६","७","८","९");
    
    return str_replace($standard_numsets, $devanagari_numsets, $input);
}
?>
<section role="main" class="content-body">
     <header class="page-header">
        <h2>Edit CCMS</h2>
    </header>
        <div class="row">
          <div class="col-xs-12">
            <div class="right-wrapper">
              <ol class="breadcrumbs">
                <li>
                  <a href="{{url('index')}}">
                    <i class="fa fa-home"></i>
                </a>
            </li>
            <li><span class="active">CCMS</span></li>
            <li><span class="active">CCMS List </span></li>
        </ol>
        </div>
        </div>
    </div>



<!-- allot user code here -->
<div class="row" id="userallotform">
  <div class="col-md-12">
   @if(session('error'))
   <div class="alert alert-danger">{{session('error')}}</div>
   @endif
    @if(session('success'))
   <div class="alert alert-success">{{session('success')}}</div>
    @endif


   <section class="panel mt-2">
    <header class="panel-heading">
        <h4 class="my-0">District Wise Search</h4>  
        <div class="back-btn-div">
            <button class="btn btn-primary back-btn" onclick="window.history.back()">Back</button>
        </div>

  </header>
  <form action="{{url('ccmstypes_update')}}/{{$ccms_info->id}}" method="post" class="form-horizontal" enctype="multipart/form-data">
      @csrf
      <div class="panel-body mb-4">

        <div class="row px-3">
            <div class="form-group">
                <label class="col-sm-2 control-label">District Name</label>
                <div class="col-sm-10">
                    <select name="jilla_id" class="h40 w-100" id="jilla_id" required>
                        <option value="">Select District</option>
                        @foreach($jilla as $j)
                        <option value="{{$j->id}}" @if($ccms_info->jilla_id==$j->id) Selected @endif>{{$j->area_name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
           <div class="form-group">
                <label class="col-sm-2 control-label">Phase Name</label>
                <div class="col-sm-10">
                   <select name="phase_name" class="h40 w-100" >
                    <option value="{{$ccms_info->phase_name}}" >{{$ccms_info->phase_name}}</option>
                     <option value="1-ph">1 ph</option>
                    <option value="2-ph">2 ph </option>
                    <option value="3-ph">3 ph</option>
                    <option value="4-ph">4 ph</option>
                    <option value="5-ph">5 ph</option>
                </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Number</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  name="invoice_number"  value="{{$ccms_info->invoice_number}}" class="form-control">
                    </div>
                </div>
            </div>
          
           
            <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Date</label>
                <div class="col-sm-10">
                    <div>
                        <input type="date" name="invoice_date" value="{{$ccms_info->invoice_date}}"class="form-control">
                    </div>
                </div>
            </div> 
            <div class="form-group">
                <label class="col-sm-2 control-label">Received Date</label>
                <div class="col-sm-10">
                    <div>
                        <input type="date" name="date_of_receiving"  value="{{$ccms_info->date_of_receiving}}"class="form-control">
                    </div>
                </div>
            </div>
           
            
              <!-- <div class="form-group">
                <label class="col-sm-2 control-label">Aluminium Cable</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  name="aluminium_cable" class="form-control">
                    </div>
                </div>
            </div> -->
            <div class="form-group">
                <label class="col-sm-2 control-label">Description</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  value="{{$ccms_info->description}}"  name="description" class="form-control">
                    </div>
                </div>
            </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">Received Cable(*if Any)</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" value="{{$ccms_info->received_cable}}"  name="received_cable" class="form-control">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Files</label>
                <div class="col-sm-7">
                    <div>
                        <input type="file" name="files" value="{{$ccms_info->files}}" class="form-control" multiple="multiple">
                    </div>
                </div>
                 <div class="col-sm-3">

                        <a target="_blank" href="{{URL::asset('storage/app/'.$ccms_info['files'])}}"                            class="btn btn-primary btn-sm">view</a>

                    </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Remarks</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="remarks" value="{{$ccms_info->remarks}}" class="form-control">
                    </div>
                </div>
            </div>


             <div class="form-group">
                <label class="col-sm-12 control-label text-center mt-4">CCMS PH Quantity</label>
            </div>


             <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Qunatity</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  name="ccms_ph_invoice_quantity" value="{{$ccms_info->ccms_ph_invoice_quantity}}" class="form-control">
                    </div>
                </div>
            </div>
             <div class="form-group">
                <label class="col-sm-2 control-label">Received Quantity</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  name="ccms_ph_receive_quantity" value="{{$ccms_info->ccms_ph_receive_quantity}}" class="form-control">
                    </div>
                </div>
            </div>
          

        </div>
        <div class="row mt-3">
            <div class="col-12 px-3">
                <div class="text-right pr-2">
                    <input type="submit" class="btn btn-success" value="Submit">
                </div>
            </div>
        </div>

    </div>
</form>
</div>

</div>

</section>
@stop
