 
<?php $__env->startSection('title', 'Form Components'); ?>
<?php $__env->startSection('content'); ?>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css"/>  
  <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">  
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
<?php
    $adminuserid = auth()->user()->id;
    $adminstatecode = auth()->user()->state_code;
    $admindistcode = auth()->user()->dist_code;
    $adminname = auth()->user()->name;
    $adminserialno = auth()->user()->serial_number;
    
    $matformdata = DB::table('master_fields_table')->where('form_name','=','mat_form_monthly')->where('section_name','=','main_section')->where('status','=','1')->get();
    
?>
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css">
    
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-edit bg-blue"></i>
                        <div class="d-inline">
                            <h5><?php echo e(__('Mat Form2 Master')); ?></h5>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('dashboard')); ?>"><i class="ik ik-home"></i></a>
                            </li>
                            <li class="breadcrumb-item"><a href="#"><?php echo e(__('Forms')); ?></a></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header"><h3><?php echo e(__('Mat Form2')); ?></h3></div>
                    <div class="card-body">
                        <form class="forms-sample" method='POST' <?php if(!empty($showdata)): ?> action='<?php echo e(url('updatemat2')); ?>' <?php else: ?> action='<?php echo e(url('matinsert2')); ?>' <?php endif; ?> name='matmaster'>
                            <?php echo csrf_field(); ?>
                            
                            <?php if(!empty($showdata)): ?>
                            <input type='hidden' name='matformid2' value='<?php echo e($showdata[0]->id); ?>'>
                            <?php endif; ?>
                            
                            <div class="form-group">
                                <label for="dateofentry"><?php echo e($matformdata[0]->questions); ?></label>
                                <div class='input-group date datetimepicker' >
                                    <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->dateofentry); ?>' <?php endif; ?> class="form-control" name="dateofentry" placeholder="yyyy-mm-dd" />
                                    <span class="input-group-addon">
                                      <span class="glyphicon glyphicon-calendar"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="uidnum"><?php echo e($matformdata[1]->questions); ?></label>
                                <input type="text" class="form-control" id="uidnum" name='uidnum' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->uidnum); ?>' <?php } ?> placeholder="Enter UID No" required>
                            </div>
                            <div class="form-group">
                                <label for="clientname"><?php echo e($matformdata[2]->questions); ?></label>
                                <input type="text" class="form-control" id="clientname" name='clientname' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->clientname); ?>' <?php } ?> placeholder="Enter Client Name" required>
                            </div>
                            <div class="form-group">
                                <label for="ostregno"><?php echo e($matformdata[3]->questions); ?></label>
                                <input type="text" class="form-control" id="ostregno" name='ostregno' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->ostregno); ?>' <?php } ?>  required>
                            </div>
                            <div class="form-group">
                                <label for="nameostc"><?php echo e($matformdata[4]->questions); ?></label>
                                <select name='nameostc'  class='form-control' value=''>
                                    <option>Select Current OST Center</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="typemedicine"><?php echo e($matformdata[5]->answer); ?></label>
                                <select name='typemedicine'  class='form-control' value='Select Option'>
                                    <option>Select State Code</option>
                                    <?php 
                                        $namemedicines = explode('|',$matformdata[5]->answer);
                                    foreach($namemedicines as $namemedicine){ ?>
                                     <option value='<?php echo $namemedicine; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->namemedicine == $namemedicine ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $namemedicine; ?></option>
                                     <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="oststatus"><?php echo e($matformdata[6]->questions); ?></label>
                                <select name='oststatus' class='form-control' value='Select Option'>
                                    <option>Select State Code</option>
                                    <?php 
                                        $oststatuss = explode('|',$matformdata[6]->answer);
                                    foreach($oststatuss as $oststatus){ ?>
                                     <option value='<?php echo $oststatus; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->oststatus == $oststatus ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $oststatus; ?></option>
                                     <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="commentoststatus"><?php echo e($matformdata[7]->questions); ?></label>
                                <input type="text" class="form-control" id="commentoststatus" name='commentoststatus' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->commentoststatus); ?>' <?php } ?>>
                            </div>
                            <div class="form-group">
                                <label for="daterestartost"><?php echo e($matformdata[8]->questions); ?></label>
                                <div class='input-group date datetimepicker' >
                                    <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->daterestartost); ?>' <?php endif; ?> class="form-control" name="daterestartost" placeholder="yyyy-mm-dd" />
                                    <span class="input-group-addon">
                                      <span class="glyphicon glyphicon-calendar"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="receivehomeost"><?php echo e($matformdata[9]->questions); ?></label>
                                <select name='receivehomeost'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $receivehomeosts = explode('|',$matformdata[9]->answer); ?>
                                    
                                    <?php foreach($receivehomeosts as $receivehomeost){ ?>
                                            <option value='<?php echo $receivehomeost; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->receivehomeost == $receivehomeost ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $receivehomeost; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="totaldaysost"><?php echo e($matformdata[10]->questions); ?></label>
                                <input type="text" class="form-control" id="totaldaysost" name='totaldaysost' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->totaldaysost); ?>' <?php } ?>  required>
                            </div>
                            <div class="form-group">
                                <label for="clinicalcond"><?php echo e($matformdata[11]->questions); ?></label>
                                <select name='clinicalcond'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $clinicalconds = explode('|',$matformdata[11]->answer); ?>
                                    
                                    <?php foreach($clinicalconds as $clinicalcond){ ?>
                                            <option value='<?php echo $clinicalcond; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->clinicalcond == $clinicalcond ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $clinicalcond; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="clinicalcond2"><?php echo e($matformdata[12]->questions); ?></label>
                                <select name='clinicalcond2'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $clinicalconds2 = explode('|',$matformdata[12]->answer); ?>
                                    
                                    <?php foreach($clinicalconds2 as $clinicalcond2){ ?>
                                            <option value='<?php echo $clinicalcond2; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->clinicalcond2 == $clinicalcond2 ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $clinicalcond2; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="clinicalcond3"><?php echo e($matformdata[13]->questions); ?></label>
                                <select name='clinicalcond3'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $clinicalconds3 = explode('|',$matformdata[13]->answer); ?>
                                    
                                    <?php foreach($clinicalconds3 as $clinicalcond3){ ?>
                                            <option value='<?php echo $clinicalcond3; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->clinicalcond3 == $clinicalcond3 ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $clinicalcond3; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="otherclinicalcond"><?php echo e($matformdata[14]->questions); ?></label>
                                <input type="text" class="form-control" id="otherclinicalcond" name='otherclinicalcond' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->otherclinicalcond); ?>' <?php } ?>  required>
                            </div>
                            <div class="form-group">
                                <label for="commonclinicalissue"><?php echo e($matformdata[15]->questions); ?></label>
                                <select name='commonclinicalissue'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $commonclinicalissues = explode('|',$matformdata[15]->answer); ?>
                                    
                                    <?php foreach($commonclinicalissues as $commonclinicalissue){ ?>
                                            <option value='<?php echo $commonclinicalissue; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->commonclinicalissue == $commonclinicalissue ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $commonclinicalissue; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="otherclinicalissue"><?php echo e($matformdata[16]->questions); ?></label>
                                <input type="text" class="form-control" id="otherclinicalissue" name='otherclinicalissue' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->otherclinicalissue); ?>' <?php } ?>  required>
                            </div>
                            <div class="form-group">
                                <label for="creferedformedical"><?php echo e($matformdata[17]->questions); ?></label>
                                <select name='creferedformedical'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $creferedformedicals = explode('|',$matformdata[17]->answer); ?>
                                    
                                    <?php foreach($creferedformedicals as $creferedformedical){ ?>
                                            <option value='<?php echo $creferedformedical; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->creferedformedical == $creferedformedical ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $creferedformedical; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="otherharmreduction"><?php echo e($matformdata[18]->questions); ?></label>
                                <select name='otherharmreduction'  class='form-control' value=''>
                                    <option>Select State Code</option>
                                    <?php $otherharmreductions = explode('|',$matformdata[18]->answer); ?>
                                    
                                    <?php foreach($otherharmreductions as $otherharmreduction){ ?>
                                            <option value='<?php echo $otherharmreduction; ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->otherharmreduction == $otherharmreduction ? 'selected' : ''); ?> <?php endif; ?> ><?php echo $otherharmreduction; ?></option>
                                            
                                        <?php } ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="remarks"><?php echo e($matformdata[19]->questions); ?></label>
                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->remarks); ?>' <?php endif; ?> class="form-control" name="remarks" />
                            </div>
                            
                            
                            <br><br>
                            <button type="submit" class="btn btn-primary mr-2"><?php echo e(__('Submit')); ?></button>
                            <?php if(empty($showdata)): ?>
                            <a href='<?php echo e('mat-form2'); ?>' class="btn btn-light"><?php echo e(__('Cancel')); ?></a>
                            <?php endif; ?>
                          </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>

    <script type="text/javascript">
        $(function() {
            var default_date=  new Date();
            $('.datetimepicker').datetimepicker({  
               format: 'YYYY-MM-DD', 
                useCurrent:false, 
                maxDate: new Date(),
                defaultDate: default_date
            });
        });
    </script> 
    
    <!-- push external js -->
    <?php $__env->startPush('script'); ?>
        <script src="<?php echo e(asset('js/form-components.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/viruxyz/public_html/ejaf/resources/views/pages/mat-form2.blade.php ENDPATH**/ ?>