<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <div class="page-titles">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="javascript:void(0)">Settings</a></li>
            <li class="breadcrumb-item active"><a href="<?php echo e(URL::to('/organisation')); ?>">Organisation</a></li>
        </ol>
    </div>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-primary">
                    <div class="card-header">
                        Show Organisation
                    </div>
                    <div class="card-body">
                        <!-- form start -->
                        <form id="organisation_form" class="form-horizontal" action="<?php echo e(URL::to('/show_organisation_post')); ?>" method="post" onsubmit="return validation();" autocomplete="off" enctype="multipart/form-data">
                            <?php echo e(csrf_field()); ?>

                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label>Organisation Name</label>
                                    <input type="text" class="form-control" id="organisation_name" name="organisation_name" placeholder="Enter Organisation Name" required value="<?php echo e($organisations->organisation_name); ?>" maxlength="500">
                                    <input type="hidden" name="organisation_id" id="organisation_id" value="<?php echo e($organisations->id); ?>">
                                </div>
                                <div class="form-group col-md-6">
                                    <label>Short Code</label>
                                    <input type="text" class="form-control" id="short_code" name="short_code" placeholder="Enter Short Code" required value="<?php echo e($organisations->short_code); ?>" maxlength="150">
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label>Address 1 </label>
                                    <textarea class="form-control" rows="4" id="address1" name="address1" placeholder="Enter Address 1" required> <?php echo e($organisations->address1); ?></textarea>
                                </div >
                                <div class="form-group col-md-6">
                                    <label>Address 2 </label>
                                    <textarea class="form-control" rows="4" id="address2" name="address2" placeholder="Enter Address 2" required> <?php echo e($organisations->address2); ?></textarea>
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label>City</label>
                                    <input type="text" class="form-control" id="city_name" name="city_name" placeholder="Enter City Name" required value="<?php echo e($organisations->city); ?>">
                                </div>
                                <div class="form-group col-md-3">
                                    <label>State</label>
                                    <select id="state_name" name="state_name" class="form-control" required>
                                        <option value="">Choose State</option>
                                        <?php $__currentLoopData = $states; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($state->id); ?>" <?php echo e($state->id == $organisations->state ? 'selected' : ''); ?>><?php echo e($state->state_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                                <div class="form-group col-md-3">
                                    <label>Pincode</label>
                                    <input type="text" class="form-control" id="pincode" name="pincode" placeholder="Enter Pincode" required maxlength="6" minlength="6" pattern="[0-9]{6}" value="<?php echo e($organisations->pincode); ?>" onkeypress="return isNumber(event);">
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label>Phone Number</label>
                                    <input type="text" class="form-control" id="phone_number" name="phone_number" placeholder="Enter Phone Number" required maxlength="12" minlength="10" value="<?php echo e($organisations->phone_number); ?>">
                                </div>
                                <div class="form-group col-md-6">
                                    <label>Email ID</label>
                                    <input type="text" class="form-control" id="email_id" name="email_id" placeholder="Enter Email ID" required value="<?php echo e($organisations->email_id); ?>" onchange="validateEmail(this,'Email');">
                                </div>
                            </div>
                            <div class="form-row">
                                <div class="form-group col-md-6">
                                    <label>Website Address</label>
                                    <input type="text" class="form-control" id="website_address" name="website_address" placeholder="Enter Website Address" required value="<?php echo e($organisations->website_address); ?>">
                                </div>      
                                <div class="form-group col-md-6">
                                    <label>Remarks</label>
                                    <input type="text" class="form-control input-default" id="remarks" name="remarks" placeholder="Enter Remarks" value="<?php echo e($organisations->remarks); ?>">
                                </div>
                            </div>
                            <div class="card-footer">
                                <button type="submit" class="btn btn-primary">Submit</button>
                                <a href="<?php echo e(URL::to('/organisation')); ?>" title="View Facility" class="btn btn-warning">Back</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    /////////validate integer fields in phone ///////////////////////////
        function isNumber_phone(evt) 
        {
          evt = (evt) ? evt : window.event;
          var charCode = (evt.which) ? evt.which : evt.keyCode;
          if (!((charCode == 43) || (charCode == 45) || (charCode >= 48 && charCode <= 57)))
          //if ((charCode!=43 ) && (charCode < 48 || charCode > 57)) 
          {
            return false;
          }

          return true;
        }
        function ValidateNo(phoneNo,field) 
        {
            if (phoneNo.value == "" || phoneNo.value == null) 
            {
                sweetAlert("Oops...", "Please Enter Your Phone Number", "error");
                phoneNo.focus();
                return false;
            }
            //alert(phoneNo.name);
            /////mobile number//////////////
            if(phoneNo.name == 'phone_number')
            {
                inputString = phoneNo.value;
                if(phoneNo.value!='')
                {
                    //var newStr = inputString.match(/^(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?[6789]\d{9}$/);
                    var newStr = inputString.match(/^(?:(\s*[\-]\s*)?|[0]?)?\d{10}$/);
                    if(!newStr)
                    {
                        sweetAlert("Oops...", "Phone Number Is Not Valid. Please Enter Correct Phone Number", "error");
                        phoneNo.value="";
                        phoneNo.focus();
                        return false;       
                    }
                }
                if (phoneNo.value.length < 10 || phoneNo.value.length > 10) 
                {
                    sweetAlert("Oops...", "Phone Number Is Not Valid. Please Enter Correct Phone Number", "error");
                    phoneNo.focus();
                    return false;
                }
                if (phoneNo.value.length >= 10) 
                {
                    document.getElementById(errfield).innerHTML="";
                    phoneNo.focus();
                    return false;
                }
            }
            return true;
        }
        /////////validate integer fields///////////////////////////
        function isNumber(evt) 
        {
          evt = (evt) ? evt : window.event;
          var charCode = (evt.which) ? evt.which : evt.keyCode;
          if (charCode > 31 && (charCode < 48 || charCode > 57)) 
          {
            //alert("Please enter only Numbers.");
            return false;
          }

          return true;
        }
        function validateEmail(emailField, fieldname)
        {
            var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

            if (reg.test(emailField.value) == false) 
            {
                sweetAlert(" ", "Please enter correct email ID", "error");
                emailField.value="";
                emailField.focus();
                return false;
            }
        }
        $(document).ready(function() {
            toastr.options.timeOut = 10000;
            <?php if(Session::has('error')): ?>
                toastr.error('<?php echo e(Session::get('error')); ?>');
            <?php elseif(Session::has('success')): ?>
                toastr.success('<?php echo e(Session::get('success')); ?>');
            <?php endif; ?>
        });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ksstmprod/resources/views/Admin/Settings/show_organisation.blade.php ENDPATH**/ ?>