
@extends('layouts.admin')
@section('pageTitle', 'Vega Soft')
@section('page-content')

<div id="form-div">
<input type="hidden" id="hidden_status" value="0">
<input type="hidden" id="row_id" value="0">


<div class="page-header form-header" >
  <h3 class="page-title text-white"> Customer Form </h3>
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
      
        <li class="breadcrumb-item text-white  icon-md " aria-current="page"><i class="icon-list slide1"></i> </li>
      </ol>
    </nav>
    

    <input type="hidden" id="table_settings_field" branch_id="" branch_name=""  column_heading="<?= $rows->column_heading;?>" column_width="<?= $rows->column_width;?>" column_alighn="<?= $rows->column_alighn;?>"  column_conversion="<?= $rows->column_conversion;?>" settings_row_id="<?= $id;?>" sp_date_picker="<?= $rows->sp_date_picker;?>"  header_from_date="<?=date('d-m-Y', strtotime('-7 days')); ?>"   header_till_date="<?=date('d-m-Y'); ?>"  sp_sort="<?= $rows->menu_id; ?>"   >
    @if ($rows->sedp != "")
  @foreach(explode(',', $rows->sedp) as  $z=>$info) 
     @if ($info == "1" && $z==1)
       <input type="hidden" class="additional_btns" btn_text="Edit" btn_click_function="call_edit_modal" btn_class="btn btn-success btn-sm btn-dtbl" col_width="30" >
     @endif 
     @if ($info == "1" && $z==2)
        <input type="hidden" class="additional_btns" btn_text="Remove" btn_click_function="call_remove_modal" btn_class="btn btn-danger btn-sm btn-dtbl" col_width="40"  >
     @endif 
     @if ($info == "1" && $z==3)
          <input type="hidden" class="additional_btns" btn_text="Print" btn_click_function="call_print_function2" btn_class="btn btn-info btn-sm btn-dtbl" col_width="40"  >
     @endif
  @endforeach
@endif
</div>
<div class="card">
    <div class="card-body">
    	<form class="forms-sample" autocomplete="off">
<div class="row">
  <div class="col-md-4">
    <div class="form-group row">
      <label class="col-sm-3 form-label">Customer</label>
      <div class="col-sm-9">
        <input type="text" class="form-control">
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="form-group row ">
      <label class="col-sm-4 form-label">Last Name</label>
      <div class="col-sm-8">
        <input type="text" class="form-control">
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="form-group row ">
      <label class="col-sm-4 form-label">Last Name</label>
      <div class="col-sm-8">
        <input type="text" class="form-control">
      </div>
    </div>
  </div>
</div>


<div id="jstree_demo_div"></div>

<div id="token_body1">

<ul>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>

</ul>
</div>



                      <div class="template-demo">
                        
                     <button id="save_btn" type="button" class="btn btn-success btn-icon-text save_btn btn-sm" >
                            <i class="icon-doc btn-icon-prepend"></i> Submit </button>
                        
                     <button id="edit_btn" type="button" class="btn btn-primary btn-icon-text save_btn btn-sm" >
                            <i class="icon-doc btn-icon-prepend"></i> Edit </button>


                      <button type="reset" class="btn btn-danger btn-icon-text reset_btn btn-sm"  >
                            <i class="icon-reload btn-icon-prepend"></i> Reset </button>
                            <input type="hidden" id="row_id" value="0">
                          </div>
                    </form>
    </div>
</div>
</div>

<div id="table-div">
<div class="page-header form-header" >
  <h3 class="page-title text-white">  Customer List </h3>
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
      
        <li class="breadcrumb-item text-white  icon-md " aria-current="page"><i class="icon-plus slide2"></i> </li>
      </ol>
    </nav>
</div>

  

<div class="card">
  


    <div class="col-lg-12 col-sm-12 col-md-12" id="table_result">
                                            
                                            </div>


    
    
</div>
</div>





<script type="text/javascript">





$("#token_body1").slimScroll({
    height: '300px', 
    width:'200px',
    color: 'rgb(176, 180, 185) none repeat scroll 0% 0%'
  });



  set_date();
  function  show_form(){
    $("#form-div").show(500);
$("#table-div").hide();
}

 
function set_edit_form(row_id){
  show_form();
$('#hidden_status' ).val("1");
$('#row_id' ).val(row_id);
$("#edit_btn").show();
$("#save_btn").hide();




}




  function Save_form() {

           $.ajax({
          url: "/create_event",
          type: "POST",
          data:{
             '_token': "{{ csrf_token() }}",
              ev_name:$.trim($('#ev_name').val()),
              location:$.trim($('#location').val()),
              from_date:$.trim($('#from_date').val()),
              to_date:$.trim($('#to_date').val()),
              ev_des:$.trim($('#ev_des').val()),
              ev_contact_name:$.trim($('#ev_contact_name').val()),
              ev_contact_phone:$.trim($('#ev_contact_phone').val())
          },
          success:function(response){
            console.log(response);
            if (response) {
              alert(response.success);
              $('#success-message').text(response.success);
              $(".forms-sample")[0].reset();
            }else{

            }
          },
          error: function(response) {
          }
         });
  }
</script>
@endsection