 
<?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://fonts.googleapis.com/css?family=Josefin Sans' rel='stylesheet'>
  <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;
    
    $outreachcoorname = DB::table('employee_master')->where('dist_code',$admindistcode)->where('state_code',$adminstatecode)->get();
    
    $artnames = DB::table('art_centre_master')->where('dist_code',$admindistcode)->where('state_code',$adminstatecode)->get();
    $subtypologys = DB::table('sub_typology_master')->get();
   
    $usersuppersec = DB::table('master_fields_table')->where('form_name','=','client_register')->where('status','=','1')->get();
    // print_r($usersuppersec); die();
    
    $usersconsent = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','Verbal_consent_status')->where('status','=','1')->get();
    
    $clientprofile = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','Client_Profile')->where('status','=','1')->get();
    
    $infopertaining = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','Information_pertaining')->where('status','=','1')->get();
    
    $riskprofile = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','Risk_profile')->where('status','=','1')->get();
    
    $riskprofilec2 = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','Risk_profile_c2')->where('status','=','1')->get();
    
    $hivtest = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','hiv_test_treatment_status')->where('status','=','1')->get();
    
    $matostservice = DB::table('master_fields_table')->where('form_name','=','client_register')->where('section_name','=','mat_ost_services')->where('status','=','1')->get();

    $sitenamelist = DB::table('client_register_form_entry')->select('sitename')->groupBy('sitename')->get();
    
    $itnamelist = DB::table('client_register_form_entry')->select('nameit')->groupBy('nameit')->get();
   
    $lastid = DB::table('client_register_form_entry')->orderBy('id', 'desc')->limit(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" style="font-family:'Josefin Sans';">
        <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(__('Client Registration Form')); ?></h5>
                            <span><?php echo e(__('EJAF')); ?></span>
                        </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 active" aria-current="page"><?php echo e(__('Client Registration Form')); ?></li>
                        </ol>
                    </nav>
                </div>
                <?php if(session()->has('message')): ?>
                    <div class="alert alert-success" style='margin-left: 1%;
    margin-top: 25px;'>
                        <?php echo e(session()->get('message')); ?>

                    </div>
                <?php endif; ?>
                <?php if(session()->has('errormsg')): ?>
                    <div class="alert alert-danger" style='margin-left: 1%;
    margin-top: 25px;'>
                        <?php echo e(session()->get('errormsg')); ?>

                    </div>
                <?php endif; ?>
            </div>
        </div>
       
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <!--<div class="card-header"><h3><?php echo e(__('Default form')); ?></h3></div>-->
                    <div class="card-body">
                        <form class="forms-sample" method='POST' <?php if(!empty($showdata) && $showdata[0]->formstatus == 'pending'): ?> action='<?php echo e(url('updateclientregister')); ?>' <?php elseif(!empty($showdata) && $showdata[0]->formstatus == 'success'): ?> action='<?php echo e(url('updateclientregistersuccess')); ?>' <?php else: ?> action='<?php echo e(url('loginregclient')); ?>' <?php endif; ?> name='clientregisterform'>
                            <?php echo csrf_field(); ?>
                            
                            
                            <?php if(!empty($showdata)): ?>
                            <input type='hidden' name='client_reg_id' value='<?php echo e($showdata[0]->id); ?>'>
                            <?php endif; ?>
                            
                            <div class="form-group">
                                <label for="outreachcoordinate"><?php echo $usersuppersec[0]->questions; ?></label>
                                <select name='outreachcoordinate' style="text-transform: uppercase" class='form-control' >
                                    <?php if(empty($showdata)): ?>
                                    <option value=''>Select Outreach Worker</option>
                                    <?php endif; ?>
                                    <?php $__currentLoopData = $outreachcoorname; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $outreachcoorn): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($outreachcoorn->emp_name); ?>" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->outreachcoordinate == $outreachcoorn->emp_name  ? 'selected' : ''); ?> <?php endif; ?>><?php echo e($outreachcoorn->emp_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                               
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="registerdate"><?php echo $usersuppersec[1]->questions; ?></label>
                                <div class='input-group date datetimepicker' >
                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->registerdate); ?>' <?php endif; ?> class="form-control" name="registerdate" id="registerdate"  placeholder="yyyy-mm-dd" />
                                <span class="input-group-addon">
                                  <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="note"><?php echo $usersuppersec[2]->questions; ?></label>
                            </div>  
                            <div class="form-group">
                                <table class="table table-bordered">
                                <tr>
                                    <th colspan="3"><?php echo e(__('A. Verbal consent status:
(All information about the program activities, benefits and risk (if any) has to be provided to the client before getting his/her 
consent and registration in the project.)')); ?></th>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[0]->number_order; ?></td>
                                    <td><?php echo $usersconsent[0]->questions; ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->clientname); ?>' <?php endif; ?> placeholder="Click or tap here to enter text." name="clientname"></td>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[1]->number_order; ?></td>
                                    <td><?php echo $usersconsent[1]->questions; ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->clientnickname); ?>' <?php endif; ?> placeholder="Click or tap here to enter text." name="clientnickname"></td>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[2]->number_order; ?></td>
                                    <td><?php echo $usersconsent[2]->questions; ?></td>
                                    <td><input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->contactprimary); ?>' <?php endif; ?> placeholder="" maxlength="10" onkeypress=" return isNumber(event)" id="primarymobileno" name="contactprimary" required>
                                    </td>
                                    <span id="check-mobile-status" style='color:red;font-weight: 600;font-size: 16px;'></span>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[3]->number_order; ?></td>
                                    <td><?php echo $usersconsent[3]->questions; ?></td>
                                    <td><input type='text' onkeypress=" return isNumber(event)" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->contactalternate); ?>' <?php endif; ?> placeholder="" maxlength="15" name="contactalternate" id="contactalternate"></td>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[4]->number_order; ?></td>
                                    <td><?php echo $usersconsent[4]->questions; ?></td>
                                    <td>
                                    <textarea style="text-transform: uppercase" name="address" rows="4" cols="60"  placeholder=''><?php if(!empty($showdata)): ?><?php echo e($showdata[0]->address); ?> <?php endif; ?></textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $usersconsent[5]->number_order; ?></td>
                                    <td><?php echo $usersconsent[5]->questions; ?></td>
                                    <?php $verbalconsents = explode('|',$usersconsent[5]->answer); ?>
                                    <td>
                                        <?php foreach($verbalconsents as $verbalconsent){ ?>
                                        <input type='radio' value="<?php echo $verbalconsent; ?>"  name="verbalconsent" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->verbalconsent == $verbalconsent)? "checked" : ""); ?> <?php endif; ?>><?php echo $verbalconsent; ?><br>
                                        <?php } ?>
                                        
                                    </td>
                                </tr>
                                <tr class='a5'>
                                    <td><?php echo $usersconsent[6]->number_order; ?></td>
                                    <td><?php echo $usersconsent[6]->questions; ?></td>
                                    <?php $refusals = explode('|',$usersconsent[6]->answer); ?>
                                    <td>
                                        <?php foreach($refusals as $refusal){ ?>
                                            <input type='radio' value="<?php echo $refusal; ?>" name="refusal"  <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->refusal == $refusal)? "checked" : ""); ?> <?php endif; ?>><?php echo $refusal; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='a5a' style='display:none'>
                                    <td><?php echo e(__('A5a')); ?></td>
                                    <td><?php echo e(__('Specify other…)')); ?></td>
                                    <td>
                                        <input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->a5aspecifyother); ?>' <?php endif; ?> placeholder="" id="a5aspecifyother" name="a5aspecifyother"><br>
                                    </td>
                                    
                                </tr>
                                <tr class='a6'>
                                    <td><?php echo e(__('A6')); ?></td>
                                    <td><?php echo e(__('Date of next follow up (if willing to participate later)')); ?></td>
                                    <td>
                                        <div class='input-group date datetimepickerfuture'>
                                        <input type='text' class="form-control" name="datenextfollowup" id="datenextfollowup" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->datenextfollowup); ?>' <?php endif; ?> placeholder="yyyy-mm-dd" />
                                        <span class="input-group-addon">
                                          <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                        </div>
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <!--<div class="form-group" style="text-align:center;">-->
                            <!--    <label for="note"><h5><?php echo e(__('(Once the verbal consent obtained the ID no. will be provided to the client)')); ?></h5></label>-->
                            <!--</div>    -->
                            <!--<div class="form-group">-->
                            <!--    <div class="col-md-2">-->
                            <!--        <div class="form-group" style='text-align:right;top-margin:2px;'>-->
                            <!--            <label><b><?php echo e(__('UID*')); ?></b></label>-->
                            <!--        </div>-->
                            <!--    </div>-->
                            <!--    <div class="col-md-10">-->
                            <!--        <div class="form-group">-->
                            <!--            <table class='table table-bordered'>-->
                            <!--                <tr>-->
                            <!--                    <td colspan='2'><?php if($adminuserid){ echo $adminstatecode; } ?></td>-->
                            <!--                    <td colspan='3'><?php if($adminuserid){ echo $admindistcode; } ?></td>-->
                            <!--            <td colspan='4'><?php if(!empty($showdata)){ ?> <?php echo e($showdata[0]->serialno); ?> <?php }else{ ?><span id='sno'></span><?php } ?></td>-->
                            <!--            <input type='hidden' <?php if(!empty($showdata)){ ?> value='<?php echo e($showdata[0]->serialno); ?>' <?php }else{ ?>id='serialno' value='' <?php } ?> name='serialno' >-->
                            <!--                </tr>-->
                            <!--            </table>-->
                            <!--        </div>-->
                            <!--    </div>-->
                            <!--</div>-->
                            <!--<div class="form-group">-->
                            <!--    <label for="uidregisterdate"><?php echo e(__('Date of Registration**')); ?></label>-->
                            <!--    <div class='input-group date uidregisterdatepicker'>-->
                            <!--    <input type='text' class="form-control" name="uidregisterdate" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->uidregisterdate); ?>' <?php endif; ?> placeholder="yyyy-mm-dd" />-->
                            <!--    <span class="input-group-addon">-->
                            <!--      <span class="glyphicon glyphicon-calendar"></span>-->
                            <!--    </span>-->
                            <!--    </div>-->
                            <!--</div>-->
                            <div class="form-group">
                                <table class="table table-bordered bsection">
                                <tr>
                                    <th colspan="3"><strong><?php echo e(__('B. Client Profile')); ?></strong></th>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[0]->number_order; ?></td>
                                    <td><?php echo $clientprofile[0]->questions; ?></td>
                                    <span id="check-num-age" style='color:red;'></span>
                                    <td><input type="number" id='numage'  maxlength="2" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->age); ?>' <?php endif; ?> name="age" ></td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[1]->number_order; ?></td>
                                    <td><?php echo $clientprofile[1]->questions; ?></td>
                                    <?php $genders = explode('|',$clientprofile[1]->answer); ?>
                                    <td>
                                        <?php foreach($genders as $gender){ ?>
                                            <input type='radio' value="<?php echo $gender; ?>" name="gender" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->gender == $gender)? "checked" : ""); ?> <?php endif; ?>><?php echo $gender; ?><br>
                                            
                                        <?php } ?>
                                        <span class='b2specifyother' style='display:none'>
                                        <?php echo e(__('Specify Other')); ?>

                                        <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->genderspecifyother); ?>' <?php endif; ?> style="text-transform: uppercase" name='genderspecifyother'>
                                        </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[2]->number_order; ?></td>
                                    <td><?php echo $clientprofile[2]->questions; ?></td>
                                    <td><input type='text' style="text-transform: uppercase" <?php if($adminname): ?> value="<?php echo e($adminstatecode); ?>" <?php endif; ?> name="state" id='statecode' readonly></td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[3]->number_order; ?></td>
                                    <td><?php echo $clientprofile[3]->questions; ?></td>
                                    <td><input type='text' style="text-transform: uppercase" <?php if($adminname): ?> value="<?php echo e($admindistcode); ?>" <?php endif; ?> name="district" id='distcode' readonly></td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[4]->number_order; ?></td>
                                    <td><?php echo $clientprofile[4]->questions; ?></td>
                                    <td>
                                        <input type='text' list="siteName" style="text-transform: uppercase" placeholder="Click or tap here to enter text" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->sitename); ?>' <?php endif; ?> name="sitename">
                                        <datalist id="siteName">
                                            <?php foreach($sitenamelist as $sitenl){ ?>
                                                <option value="<?php echo $sitenl->sitename; ?>" ><?php echo $sitenl->sitename; ?></option>
                                            <?php } ?>
                                        </datalist>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[5]->number_order; ?></td>
                                    <td><?php echo $clientprofile[5]->questions; ?></td>
                                    <?php $catprimarys = explode('|',$clientprofile[5]->answer); ?>
                                    <td>
                                        <?php foreach($catprimarys as $catprimary){ ?>
                                        <input type='radio' class='catpri' value="<?php echo $catprimary; ?>" name="catprimary" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->catprimary == $catprimary)? "checked" : ""); ?> <?php endif; ?>><?php echo $catprimary; ?><br>
                                        <?php } ?>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[6]->number_order; ?></td>
                                    <td><?php echo $clientprofile[6]->questions; ?></td>
                                    <td>
                                        <select name='subcat' class='form-control' id='b61subcat' style="text-transform: uppercase">
                                            <?php if(!empty($showdata)){ ?>
                                            <option  <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->subcat); ?>' <?php endif; ?>> <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->subcat); ?><?php endif; ?></option>
                                            <?php }else{ ?>
                                            <option> SELECT</option>
                                            <?php } ?>
                                       </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[7]->number_order; ?></td>
                                    <td><?php echo $clientprofile[7]->questions; ?></td>
                                    <?php $enrolleds = explode('|',$clientprofile[7]->answer); ?>
                                    <td>
                                        <?php foreach($enrolleds as $enrolled){ ?>
                                        <input type='radio' value="<?php echo $enrolled; ?>" name="enrollintarget" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->enrollintarget == $enrolled)? "checked" : ""); ?> <?php endif; ?>><?php echo $enrolled; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='b71'><span class='b71'><?php echo $clientprofile[8]->number_order; ?></span></td>
                                    <td class='b71'><span class='b71'><?php echo $clientprofile[8]->questions; ?></span></td>
                                    <td class='b71'><span class='b71'>
                                        <input type='text' list='itName' id='b71nameit' style="text-transform: uppercase"  placeholder="Click or tap here to enter text." name="nameit" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->nameit); ?>' <?php endif; ?>>
                                        <datalist id="itName">
                                            <?php foreach($itnamelist as $itnl){ ?>
                                                <option value="<?php echo $itnl->nameit; ?>" ><?php echo $itnl->nameit; ?></option>
                                            <?php } ?>
                                        </datalist>
                                    </span></td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[9]->number_order; ?></td>
                                    <td><?php echo $clientprofile[9]->questions; ?></td>
                                    <?php $edulevels = explode('|',$clientprofile[9]->answer); ?>
                                    <td>
                                        <?php foreach($edulevels as $edulevel){ ?>
                                            <input type='radio' value="<?php echo $edulevel; ?>" name="educationlevel" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->educationlevel == $edulevel)? "checked" : ""); ?> <?php endif; ?>><?php echo $edulevel; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[10]->number_order; ?></td>
                                    <td><?php echo $clientprofile[10]->questions; ?></td>
                                    <?php $empstatuss = explode('|',$clientprofile[10]->answer); ?>
                                    <td>
                                        <?php foreach($empstatuss as $empstatus){ ?>
                                        <input type='radio' value="<?php echo $empstatus; ?>" name="empleestatus" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->empleestatus == $empstatus)? "checked" : ""); ?> <?php endif; ?>><?php echo $empstatus; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                    <tr class='b91' style='display:none'>
                                        <td><?php echo e(__('B9.1')); ?></td>
                                        <td><?php echo e(__('Specify other')); ?></td>
                                        <td><input type='text' style="text-transform: uppercase"  <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b91specifyother); ?>' <?php endif; ?> name='b91specifyother'></td>
                                    </tr>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[11]->number_order; ?></td>
                                    <td><?php echo $clientprofile[11]->questions; ?></td>
                                    <?php $maritalstatuss = explode('|',$clientprofile[11]->answer); ?>
                                    <td>
                                        <?php foreach($maritalstatuss as $maritalstatus){ ?>
                                            <input type='radio' value="<?php echo $maritalstatus; ?>" name="materialstatus" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->materialstatus == $maritalstatus)? "checked" : ""); ?> <?php endif; ?>><?php echo $maritalstatus; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo $clientprofile[12]->number_order; ?></td>
                                    <td><?php echo $clientprofile[12]->questions; ?></td>
                                    <?php $regpartners = explode('|',$clientprofile[12]->answer); ?>
                                    <td>
                                        <?php foreach($regpartners as $regpartner){ ?>
                                            <input type='radio' value="<?php echo $regpartner; ?>" name="regpartner" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->regpartner == $regpartner)? "checked" : ""); ?> <?php endif; ?>><?php echo $regpartner; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='b12field'><?php echo $clientprofile[13]->number_order; ?></td>
                                    <td class='b12field'><?php echo $clientprofile[13]->questions; ?></td>
                                    <?php $livingwiths = explode('|',$clientprofile[13]->answer); ?>
                                    <td class='b12field'>
                                        <?php foreach($livingwiths as $livingwith){ ?>
                                        <input type='radio' value="<?php echo $livingwith; ?>" name="livingwith"  <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->livingwith == $livingwith)? "checked" : ""); ?> <?php endif; ?>><?php echo $livingwith; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <div class="form-group">
                                <table class="table table-bordered b13section">
                                <tr>
                                    <th colspan='3'><strong><?php echo e(__('B 13. Information pertaining to the regular sex partner/spouse')); ?></strong></th>
                                </tr>
                                
                                <!--<tr>-->
                                <!--    <td>Select Number of Spouse</td>-->
                                <!--    <select id='spousecount' style="text-transform: uppercase" class='form-control' >-->
                                <!--        <option value=''>Select No.</option>-->
                                <!--        <option value="0">0</option>-->
                                <!--        <option value="1">1</option>-->
                                <!--        <option value="2">2</option>-->
                                <!--        <option value="3">3</option>-->
                                <!--        <option value="4">4</option>-->
                                <!--    </select>-->
                                <!--</tr>-->
                                <tr>
                                    <td>Select Number of Spouse</td>
                                    <td>
                                        <select id='partner_count' style="text-transform: uppercase" class='form-control' name='partner_count' required>
                                            <option value="0" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->partner_count == 0  ? 'selected' : ''); ?> <?php endif; ?>>0</option>
                                            <option value="1" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->partner_count == 1  ? 'selected' : ''); ?> <?php endif; ?>>1</option>
                                            <option value="2" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->partner_count == 2  ? 'selected' : ''); ?> <?php endif; ?>>2</option>
                                            <option value="3" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->partner_count == 3  ? 'selected' : ''); ?> <?php endif; ?>>3</option>
                                            <option value="4" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->partner_count == 4  ? 'selected' : ''); ?> <?php endif; ?>>4</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td colspan='2'>Spouse</td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td><?php echo $infopertaining[0]->questions ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name="infopertainingname1" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingname1); ?>' <?php endif; ?> placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td><?php echo $infopertaining[1]->questions ?></td>
                                    <td><input type='text' maxlength="2" onkeypress=" return isNumber(event)" name="infopertainingage1" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingage1); ?>' <?php endif; ?> onblur="scorecompare(this);" placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td><?php echo $infopertaining[2]->questions ?></td>
                                    <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                    <td>
                                        <?php foreach($infopgenders as $infopgender){ ?>
                                            <input type='radio' value="<?php echo $infopgender; ?>" name="infopgender1" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->infopgender1 == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                            
                                        <?php } ?>
                                        <span class='b13g1specifyother' style='display:none'>
                                            <?php echo e(__('Specify Other')); ?>

                                            <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b13gender1); ?>' <?php endif; ?> name='b13gender1'>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td><?php echo $infopertaining[3]->questions ?></td>
                                    <?php $highriskscats = explode('|',$infopertaining[3]->answer); ?>
                                    <td>
                                        <?php foreach($highriskscats as $highriskscat){ ?>
                                            <input type='radio' value="<?php echo $highriskscat; ?>" name="highriskcat1" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->highriskcat1 == $highriskscat)? "checked" : ""); ?> <?php endif; ?>><?php echo $highriskscat; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk1'>
                                    <td><?php echo $infopertaining[4]->questions ?></td>
                                    <?php $cuseilms = explode('|',$infopertaining[4]->answer); ?>
                                    <td>
                                        <?php foreach($cuseilms as $cuseilm){ ?>
                                            <input type='radio' value="<?php echo $cuseilm; ?>" name="cuilm1" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->cuilm1 == $cuseilm)? "checked" : ""); ?> <?php endif; ?>><?php echo $cuseilm; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk1'><td colspan='2'>&nbsp;</td></tr>
                                <tr class='partnerk2'>
                                    <td colspan='2'>Partner1</td>
                                </tr>
                                <tr class='partnerk2'>
                                    <td><?php echo $infopertaining[0]->questions ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name="infopertainingname2" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingname2); ?>' <?php endif; ?> placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk2'>
                                    <td><?php echo $infopertaining[1]->questions ?></td>
                                    <td><input type='text' maxlength="2" onkeypress=" return isNumber(event)" name="infopertainingage2" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingage2); ?>' <?php endif; ?> onblur="scorecompare(this);" placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk2'>
                                    <td><?php echo $infopertaining[2]->questions ?></td>
                                    <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                    <td>
                                        <?php foreach($infopgenders as $infopgender){ ?>
                                            <input type='radio' value="<?php echo $infopgender; ?>" name="infopgender2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->infopgender2 == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                            
                                        <?php } ?>
                                        <span class='b13g2specifyother' style='display:none'>
                                            <?php echo e(__('Specify Other')); ?>

                                            <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b13gender2); ?>' <?php endif; ?> name='b13gender2'>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='partnerk2'>
                                    <td><?php echo $infopertaining[3]->questions ?></td>
                                    <?php $highriskscats = explode('|',$infopertaining[3]->answer); ?>
                                    <td>
                                        <?php foreach($highriskscats as $highriskscat){ ?>
                                            <input type='radio' value="<?php echo $highriskscat; ?>" name="highriskcat2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->highriskcat2 == $highriskscat)? "checked" : ""); ?> <?php endif; ?>><?php echo $highriskscat; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk2'>
                                    <td><?php echo $infopertaining[4]->questions ?></td>
                                    <?php $cuseilms = explode('|',$infopertaining[4]->answer); ?>
                                    <td>
                                        <?php foreach($cuseilms as $cuseilm){ ?>
                                            <input type='radio' value="<?php echo $cuseilm; ?>" name="cuilm2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->cuilm2 == $cuseilm)? "checked" : ""); ?> <?php endif; ?>><?php echo $cuseilm; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk2'><td colspan='2'>&nbsp;</td></tr>
                                <tr class='partnerk3'>
                                    <td colspan='2'>Partner2</td>
                                </tr>
                                <tr class='partnerk3'>
                                    <td><?php echo $infopertaining[0]->questions ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name="infopertainingname3" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingname3); ?>' <?php endif; ?> placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk3'>
                                    <td><?php echo $infopertaining[1]->questions ?></td>
                                    <td><input type='text' maxlength="2" onkeypress=" return isNumber(event)" name="infopertainingage3" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingage3); ?>' <?php endif; ?> onblur="scorecompare(this);" placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk3'>
                                    <td><?php echo $infopertaining[2]->questions ?></td>
                                    <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                    <td>
                                        <?php foreach($infopgenders as $infopgender){ ?>
                                            <input type='radio' value="<?php echo $infopgender; ?>" name="infopgender3" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->infopgender3 == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                            
                                        <?php } ?>
                                        <span class='b13g3specifyother' style='display:none'>
                                            <?php echo e(__('Specify Other')); ?>

                                            <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b13gender3); ?>' <?php endif; ?> name='b13gender3'>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='partnerk3'>
                                    <td><?php echo $infopertaining[3]->questions ?></td>
                                    <?php $highriskscats = explode('|',$infopertaining[3]->answer); ?>
                                    <td>
                                        <?php foreach($highriskscats as $highriskscat){ ?>
                                            <input type='radio' value="<?php echo $highriskscat; ?>" name="highriskcat3" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->highriskcat3 == $highriskscat)? "checked" : ""); ?> <?php endif; ?>><?php echo $highriskscat; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk3'>
                                    <td><?php echo $infopertaining[4]->questions ?></td>
                                    <?php $cuseilms = explode('|',$infopertaining[4]->answer); ?>
                                    <td>
                                        <?php foreach($cuseilms as $cuseilm){ ?>
                                            <input type='radio' value="<?php echo $cuseilm; ?>" name="cuilm3" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->cuilm3 == $cuseilm)? "checked" : ""); ?> <?php endif; ?>><?php echo $cuseilm; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk3'><td colspan='2'>&nbsp;</td></tr>
                                <tr class='partnerk4'>
                                    <td colspan='2'>Partner3</td>
                                </tr>
                                <tr class='partnerk4'>
                                    <td><?php echo $infopertaining[0]->questions ?></td>
                                    <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name="infopertainingname4" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingname4); ?>' <?php endif; ?> placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk4'>
                                    <td><?php echo $infopertaining[1]->questions ?></td>
                                    <td><input type='text' maxlength="2" onkeypress=" return isNumber(event)" name="infopertainingage4" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->infopertainingage4); ?>' <?php endif; ?> onblur="scorecompare(this);" placeholder='click or tap here to enter text'></td>
                                </tr>
                                <tr class='partnerk4'>
                                    <td><?php echo $infopertaining[2]->questions ?></td>
                                    <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                    <td>
                                        <?php foreach($infopgenders as $infopgender){ ?>
                                            <input type='radio' value="<?php echo $infopgender; ?>" name="infopgender4"  <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->infopgender4 == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                            
                                        <?php } ?>
                                        <span class='b13g4specifyother' style='display:none'>
                                            <?php echo e(__('Specify Other')); ?>

                                            <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b13gender4); ?>' <?php endif; ?> name='b13gender4'>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='partnerk4'>
                                    <td><?php echo $infopertaining[3]->questions ?></td>
                                    <?php $highriskscats = explode('|',$infopertaining[3]->answer); ?>
                                    <td>
                                        <?php foreach($highriskscats as $highriskscat){ ?>
                                            <input type='radio' value="<?php echo $highriskscat; ?>" name="highriskcat4" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->highriskcat4 == $highriskscat)? "checked" : ""); ?> <?php endif; ?>><?php echo $highriskscat; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='partnerk4'>
                                    <td><?php echo $infopertaining[4]->questions ?></td>
                                    <?php $cuseilms = explode('|',$infopertaining[4]->answer); ?>
                                    <td>
                                        <?php foreach($cuseilms as $cuseilm){ ?>
                                            <input type='radio' value="<?php echo $cuseilm; ?>" name="cuilm4" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->cuilm4 == $cuseilm)? "checked" : ""); ?> <?php endif; ?>><?php echo $cuseilm; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <div class="form-group">
                                <table class='table table-bordered b14section'>
                                    <tr>
                                        <th colspan='5'><strong><?php echo e(__('B.14: Children and their age (if applicable)')); ?></strong></th>
                                    </tr>
                                    <tr>
                                    <td>Select Number of Child</td>
                                        <td>
                                            <select id='child_count' style="text-transform: uppercase" class='form-control' name='child_count' required>
                                                <option value="0" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->child_count == 0  ? 'selected' : ''); ?> <?php endif; ?>>0</option>
                                                <option value="1" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->child_count == 1  ? 'selected' : ''); ?> <?php endif; ?>>1</option>
                                                <option value="2" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->child_count == 2  ? 'selected' : ''); ?> <?php endif; ?>>2</option>
                                                <option value="3" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->child_count == 3  ? 'selected' : ''); ?> <?php endif; ?>>3</option>
                                                <option value="4" <?php if(!empty($showdata)): ?> <?php echo e($showdata[0]->child_count == 4  ? 'selected' : ''); ?> <?php endif; ?>>4</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr class='childk1'>
                                        <td colspan='2'>Child 1</td>
                                    </tr>
                                    <tr class='childk1'>
                                        <td><?php echo e(__('Name')); ?></td>
                                        <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name='c1name' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c1name); ?>' <?php endif; ?>></td>
                                    </tr>
                                    <tr class='childk1'>
                                        <td><?php echo e(__('Gender')); ?></td>
                                        <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                        <td>
                                            <?php foreach($infopgenders as $infopgender){ ?>
                                                <input type='radio'  style="text-transform: uppercase" name='c1gender' value="<?php echo $infopgender; ?>" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->c1gender == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                                
                                            <?php } ?>
                                            <span class='b14g1specifyother' style='display:none'>
                                                <?php echo e(__('Specify Other')); ?>

                                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b14gender1); ?>' <?php endif; ?> name='b14gender1'>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr class='childk1'>
                                        <td><?php echo e(__('Age')); ?></td>
                                        <td><input type='number' id='numage1' maxlength="2" name='c1age' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c1age); ?>' <?php endif; ?>></td>
                                        <span id="check-num-age-child" style='color:red;'></span>
                                    </tr>
                                    <tr class='childk1'><td colspan='2'>&nbsp;</td></tr>
                                    <tr class='childk2'>
                                        <td colspan='2'>Child 2</td>
                                    </tr>
                                    <tr class='childk2'>
                                        <td><?php echo e(__('Name')); ?></td>
                                        <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name='c2name' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c2name); ?>' <?php endif; ?>></td>
                                    </tr>
                                    <tr class='childk2'>
                                        <td><?php echo e(__('Gender')); ?></td>
                                        <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                        <td>
                                            <?php foreach($infopgenders as $infopgender){ ?>
                                                <input type='radio'  style="text-transform: uppercase" name='c2gender' value="<?php echo $infopgender; ?>" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->c2gender == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                                
                                            <?php } ?>
                                            <span class='b14g2specifyother' style='display:none'>
                                                <?php echo e(__('Specify Other')); ?>

                                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b14gender2); ?>' <?php endif; ?> name='b14gender2'>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr class='childk2'>
                                        <td><?php echo e(__('Age')); ?></td>
                                        <td><input type='number' id='numage2' maxlength="2" onkeypress=" return isNumber(event)" name='c2age' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c2age); ?>' <?php endif; ?>></td>
                                        <span id="check-num-age-child" style='color:red;'></span>
                                    </tr>
                                    <tr class='childk2'><td colspan='2'>&nbsp;</td></tr>
                                    <tr class='childk3'>
                                        <td colspan='2'>Child 3</td>
                                    </tr>
                                    <tr class='childk3'>
                                        <td><?php echo e(__('Name')); ?></td>
                                        <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name='c3name' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c3name); ?>' <?php endif; ?>></td>
                                    </tr>
                                    <tr class='childk3'>
                                        <td><?php echo e(__('Gender')); ?></td>
                                        <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                        <td>
                                            <?php foreach($infopgenders as $infopgender){ ?>
                                                <input type='radio'  style="text-transform: uppercase" name='c3gender' value="<?php echo $infopgender; ?>" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->c3gender == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                                
                                            <?php } ?>
                                            <span class='b14g3specifyother' style='display:none'>
                                                <?php echo e(__('Specify Other')); ?>

                                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b14gender3); ?>' <?php endif; ?> name='b14gender3'>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr class='childk3'>
                                        <td><?php echo e(__('Age')); ?></td>
                                        <td><input type='number' id='numage3' maxlength="2" onkeypress=" return isNumber(event)" name='c3age' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c3age); ?>' <?php endif; ?>></td>
                                        <span id="check-num-age-child" style='color:red;'></span>
                                    </tr>
                                    <tr class='childk3'><td colspan='2'>&nbsp;</td></tr>
                                    <tr class='childk4'>
                                        <td colspan='2'>Child 4</td>
                                    </tr>
                                    <tr class='childk4'>
                                        <td><?php echo e(__('Name')); ?></td>
                                        <td><input type='text' pattern="^[a-zA-Z]+$" title="Enter only alpha letters" style="text-transform: uppercase" name='c4name' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c4name); ?>' <?php endif; ?>></td>
                                    </tr>
                                    
                                    <tr class='childk4'>
                                        <td><?php echo e(__('Gender')); ?></td>
                                        <?php $infopgenders = explode('|',$infopertaining[2]->answer); ?>
                                        <td>
                                            <?php foreach($infopgenders as $infopgender){ ?>
                                                <input type='radio'  style="text-transform: uppercase" name='c4gender' value="<?php echo $infopgender; ?>" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->c4gender == $infopgender)? "checked" : ""); ?> <?php endif; ?>><?php echo $infopgender; ?><br>
                                                
                                            <?php } ?>
                                            <span class='b14g4specifyother' style='display:none'>
                                                <?php echo e(__('Specify Other')); ?>

                                                <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->b14gender4); ?>' <?php endif; ?> name='b14gender4'>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr class='childk4'>
                                        <td><?php echo e(__('Age')); ?></td>
                                        <td><input type='number' id='numage4' maxlength="2" onkeypress=" return isNumber(event)" name='c4age' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->c4age); ?>' <?php endif; ?>></td>
                                        <span id="check-num-age-child" style='color:red;'></span>
                                    </tr>
                                </table>
                            </div>
                            <div class="form-group">
                                <table class="table table-bordered csection">
                                <tr>
                                    <th colspan='6'><strong><?php echo e(__('C. Risk profile')); ?></strong></th>
                                </tr>
                                <tr>
                                    <td colspan='3'><?php echo e(__('C1. The risk associated with unprotected sex')); ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo $riskprofile[0]->number_order ?></td>
                                    <td><?php echo $riskprofile[0]->questions ?></td>
                                    <?php $strmoneys = explode('|',$riskprofile[0]->answer); ?>
                                    <td>
                                        <?php foreach($strmoneys as $strmoney){ ?>
                                            <input type='radio' value="<?php echo $strmoney; ?>" name="strecmoney" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->strecmoney == $strmoney)? "checked" : ""); ?> <?php endif; ?>><?php echo $strmoney; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c11a'>
                                    <td class='c11a'><span class='c11a'><?php echo $riskprofile[1]->number_order ?></span></td>
                                    <td class='c11a'><span class='c11a'><?php echo $riskprofile[1]->questions ?></span></span></td>
                                    <td class='c11a'><span class='c11a'>
                                        1)<input type='number' pattern="[0-9]" title="Enter only numeric value" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hluisy); ?>' <?php endif; ?> name="hluisy">Year/s<br>
                                        2)<input type='number' pattern="^[0-9]*$" title="Enter only numeric value" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hluism); ?>' <?php endif; ?> name="hluism">Month/s (if less than one year)<br></span>
                                    </td>
                                </tr>
                                <tr class='c11b'>
                                    <td class='c11b'><span class='c11b'><?php echo $riskprofile[2]->number_order ?></span></td>
                                    <td class='c11b'><span class='c11b'><?php echo $riskprofile[2]->questions ?></span></td>
                                    <?php $lasttimeuhss = explode('|',$riskprofile[2]->answer); ?>
                                    <td class='c11b'><span class='c11b'>
                                        <?php foreach($lasttimeuhss as $lasttimeuhs){ ?>
                                            <input type='radio' value="<?php echo $lasttimeuhs; ?>" name="lasttuhs" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->lasttuhs == $lasttimeuhs)? "checked" : ""); ?> <?php endif; ?>><?php echo $lasttimeuhs; ?><br>
                                            
                                        <?php } ?>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='c12'>
                                    <td class='c12'><span class='c12'><?php echo $riskprofile[3]->number_order ?></span></td>
                                    <td class='c12'><span class='c12'><?php echo $riskprofile[3]->questions ?></span></td>
                                    <td class='c12'>
                                        <span class='c12'><input type='number' min="0" max="999" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->sactuhh); ?>' <?php endif; ?> name="sactuhh" id="sactuhh" placeholder="Click or tap here to enter number."></span>
                                    </td>
                                </tr>
                                <tr class='c13'>
                                    <td class='c13'><span class='c13'><?php echo $riskprofile[4]->number_order ?></span></td>
                                    <td class='c13'><span class='c13'><?php echo $riskprofile[4]->questions ?></span></td>
                                    <td class='c13'><span class='c13'>
                                        <input type='number' min="0" max="999" style="text-transform: uppercase" id="sacwithoutuhh" name="sacwithoutuhh" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->sacwithoutuhh); ?>' <?php endif; ?> placeholder="Click or tap here to enter number."></span>
                                    </td>
                                </tr>
                                <tr class='c14'>
                                    <td class='c14'><span class='c14'><?php echo $riskprofile[5]->number_order ?></span></td>
                                    <td class='c14'><span class='c14'><?php echo $riskprofile[5]->questions ?></span></td>
                                    <td class='c14'><span class='c14'>
                                        <input type='number' min="0" max="999" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->avgnos); ?>' <?php endif; ?> name="avgnos"  placeholder="Click or tap here to enter text." min="0"></span>
                                    </td>
                                </tr>
                                <tr class='c15'>
                                    <td class='c15'><span class='c15'><?php echo $riskprofile[6]->number_order ?></span></td>
                                    <td class='c15'><span class='c15'><?php echo $riskprofile[6]->questions ?></span></td>
                                    <?php $stisymptomss = explode('|',$riskprofile[6]->answer); ?>
                                    <td class='c15'><span class='c15'>
                                        <?php foreach($stisymptomss as $stisymptoms){ ?>
                                            <input type='radio' value="<?php echo $stisymptoms; ?>" name="stisymp" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->stisymp == $stisymptoms)? "checked" : ""); ?> <?php endif; ?>><?php echo $stisymptoms; ?><br>
                                            
                                        <?php } ?>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='c16'>
                                    <td class='c16'><span class='c16'><?php echo $riskprofile[7]->number_order ?></span></td>
                                    <td class='c16'><span class='c16'><?php echo $riskprofile[7]->questions ?></span></td>
                                    <?php $aootherds = explode('|',$riskprofile[7]->answer); ?>
                                    <td class='c16'><span class='c16'>
                                        <?php foreach($aootherds as $aootherd){ ?>
                                            <input type='radio' value="<?php echo $aootherd; ?>" name="aloother" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->aloother == $aootherd)? "checked" : ""); ?> <?php endif; ?>><?php echo $aootherd; ?><br>
                                            
                                        <?php } ?>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='c17'>
                                    <td class='c17'><span class='c17'><?php echo $riskprofile[8]->number_order ?></span></td>
                                    <td class='c17'><span class='c17'><?php echo $riskprofile[8]->questions ?></span></td>
                                    <?php $throughvios = explode('|',$riskprofile[8]->answer); ?>
                                    <td class='c17'><span class='c17'>
                                        <?php foreach($throughvios as $throughvio){ ?>
                                            <input type='radio' value="<?php echo $throughvio; ?>" name="throughvio" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->throughvio == $throughvio)? "checked" : ""); ?> <?php endif; ?>><?php echo $throughvio; ?><br>
                                            
                                        <?php } ?>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='c18'>
                                    <td class='c18'><span class='c18'><?php echo $riskprofile[9]->number_order ?></span></td>
                                    <td class='c18'><span class='c18'><?php echo $riskprofile[9]->questions ?></span></td>
                                    <?php $mobilityaps = explode('|',$riskprofile[9]->answer); ?>
                                    <td class='c18'><span class='c18'>
                                        <?php foreach($mobilityaps as $mobilityap){ ?>
                                            <input type='radio' value="<?php echo $mobilityap; ?>" name="mobilityapo" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->mobilityapo == $mobilityap)? "checked" : ""); ?> <?php endif; ?>><?php echo $mobilityap; ?><br>
                                            
                                        <?php } ?>
                                        </span>
                                    </td>
                                </tr>
                                <tr class='c18a'>
                                    <td class='c18a'><span class='c18a'><?php echo $riskprofile[10]->number_order ?></span></td>
                                    <td class='c18a'><span class='c18a'><?php echo $riskprofile[10]->questions ?></span></td>
                                    <td class='c18a'><span class='c18a'>
                                        <input type='number' min="0" max="999" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hmtmout); ?>' <?php endif; ?> name='hmtmout' placeholder='Click or tap here to enter number.' min="0"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan='3'><?php echo e(__('C2. The risk associated with injecting practice')); ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo $riskprofilec2[0]->number_order ?></td>
                                    <td><?php echo $riskprofilec2[0]->questions ?></td>
                                    <?php $strmoneyc2s = explode('|',$riskprofilec2[0]->answer); ?>
                                    <td>
                                        <?php foreach($strmoneyc2s as $strmoneyc2){ ?>
                                            <input type='radio' value="<?php echo $strmoneyc2; ?>" name="strmoneyc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->strmoneyc2 == $strmoneyc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $strmoneyc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='c21a'><?php echo $riskprofilec2[1]->number_order ?></td>
                                    <td class='c21a'><?php echo $riskprofilec2[1]->questions ?></td>
                                    <td class='c21a'>
                                        1)<input type='number' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hluisyc2); ?>' <?php endif; ?> name="hluisyc2">Year/s<br>
                                        2)<input type='number' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hluismc2); ?>' <?php endif; ?> name="hluismc2">Month/s (if less than one year)<br>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='c21b'><?php echo $riskprofilec2[2]->number_order ?></td>
                                    <td class='c21b'><?php echo $riskprofilec2[2]->questions ?></td>
                                    <?php $lasttimeuhsc2s = explode('|',$riskprofilec2[2]->answer); ?>
                                    <td class='c21b'>
                                        <?php foreach($lasttimeuhsc2s as $lasttimeuhsc2){ ?>
                                            <input type='radio' value="<?php echo $lasttimeuhsc2; ?>" name="lasttimeuhsc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->lasttimeuhsc2 == $lasttimeuhsc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $lasttimeuhsc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c22'>
                                    <td class='c22'><?php echo $riskprofilec2[3]->number_order ?></td>
                                    <td class='c22'><?php echo $riskprofilec2[3]->questions ?></td>
                                    <td class='c22'>
                                        <input type='number' min="0" max="999" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->sactuhhc2); ?>' <?php endif; ?> name="sactuhhc2" placeholder="Click or tap here to enter number.">
                                    </td>
                                </tr>
                                <tr class='c23'>
                                    <td class='c23'><?php echo $riskprofilec2[4]->number_order ?></td>
                                    <td class='c23'><?php echo $riskprofilec2[4]->questions ?></td>
                                    <?php $frequenctneedlc2s = explode('|',$riskprofilec2[4]->answer); ?>
                                    <td class='c23'>
                                        <?php foreach($frequenctneedlc2s as $frequenctneedlc2){ ?>
                                        <input type='radio' value="<?php echo $frequenctneedlc2; ?>" name="freneedlec2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->freneedlec2 == $frequenctneedlc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $frequenctneedlc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c24'>
                                    <td class='c24'><?php echo $riskprofilec2[5]->number_order ?></td>
                                    <td class='c24'><?php echo $riskprofilec2[5]->questions ?></td>
                                    <td class='c24'>
                                        <input type='number' min="0" max="999" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->avgnosc2); ?>' <?php endif; ?> name="avgnosc2" placeholder="Click or tap here to enter number.">
                                    </td>
                                </tr>
                                <tr class='c25'>
                                    <td class='c25'><?php echo $riskprofilec2[6]->number_order ?></td>
                                    <td class='c25'><?php echo $riskprofilec2[6]->questions ?></td>
                                    <?php $stisymptomsc2s = explode('|',$riskprofilec2[6]->answer); ?>
                                    <td class='c25'>
                                        <?php foreach($stisymptomsc2s as $stisymptomsc2){ ?>
                                            <input type='radio' value="<?php echo $stisymptomsc2; ?>" name="stisympc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->stisympc2 == $stisymptomsc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $stisymptomsc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c26'>
                                    <td class='c26'><?php echo $riskprofilec2[7]->number_order ?></td>
                                    <td class='c26'><?php echo $riskprofilec2[7]->questions ?></td>
                                    <?php $aootherdc2s = explode('|',$riskprofilec2[7]->answer); ?>
                                    <td class='c26'>
                                        <?php foreach($aootherdc2s as $aootherdc2){ ?>
                                            <input type='radio' value="<?php echo $aootherdc2; ?>" name="alootherc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->alootherc2 == $aootherdc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $aootherdc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c27'>
                                    <td class='c27'><?php echo $riskprofilec2[8]->number_order ?></td>
                                    <td class='c27'><?php echo $riskprofilec2[8]->questions ?></td>
                                    <?php $throughvioc2s = explode('|',$riskprofilec2[8]->answer); ?>
                                    <td class='c27'>
                                        <?php foreach($throughvioc2s as $throughvioc2){ ?>
                                            <input type='radio' value="<?php echo $throughvioc2; ?>" name="throughvioc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->throughvioc2 == $throughvioc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $throughvioc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c28'>
                                    <td class='c28'><?php echo $riskprofilec2[9]->number_order ?></td>
                                    <td class='c28'><?php echo $riskprofilec2[9]->questions ?></td>
                                    <?php $mobilityapc2s = explode('|',$riskprofilec2[9]->answer); ?>
                                    <td class='c28'>
                                        <?php foreach($mobilityapc2s as $mobilityapc2){ ?>
                                            <input type='radio' value="<?php echo $mobilityapc2; ?>" name="mobilityapoc2" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->mobilityapoc2 == $mobilityapc2)? "checked" : ""); ?> <?php endif; ?>><?php echo $mobilityapc2; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='c28a'>
                                    <td class='c28a'><?php echo $riskprofilec2[10]->number_order ?></td>
                                    <td class='c28a'><?php echo $riskprofilec2[10]->questions ?></td>
                                    <td class='c28a'>
                                        <input type='number' maxlength="3" style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->hmtmoutc2); ?>' <?php endif; ?> name='hmtmoutc2' placeholder='Click or tap here to enter text.'>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <div class="form-group">
                                <table class="table table-bordered dsection">
                                <tr>
                                    <th colspan=6><strong><?php echo e(__('D. HIV test and treatment status')); ?></strong></th>
                                </tr>
                                <tr>
                                    <td><?php echo $hivtest[0]->number_order ?></td>
                                    <td><?php echo $hivtest[0]->questions ?></td>
                                    <?php $testhivs = explode('|',$hivtest[0]->answer); ?>
                                    <td>
                                        <?php foreach($testhivs as $testhiv){ ?>
                                            <input type='radio' value="<?php echo $testhiv; ?>" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->hivtest == $testhiv)? "checked" : ""); ?> <?php endif; ?> name="hivtest"><?php echo $testhiv; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='d2'><?php echo $hivtest[1]->number_order ?></td>
                                    <td class='d2'><?php echo $hivtest[1]->questions ?></td>
                                    <?php $tdonelss = explode('|',$hivtest[1]->answer); ?>
                                    <td class='d2'>
                                        <?php foreach($tdonelss as $tdonels){ ?>
                                            <input type='radio' value="<?php echo $tdonels; ?>" name="donelstest" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->donelstest == $tdonels)? "checked" : ""); ?> <?php endif; ?>><?php echo $tdonels; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d3'>
                                    <td><?php echo $hivtest[2]->number_order ?></td>
                                    <td><?php echo $hivtest[2]->questions ?></td>
                                    <?php $testhivresults = explode('|',$hivtest[2]->answer); ?>
                                    <td>
                                        <?php foreach($testhivresults as $testhivresult){ ?>
                                            <input type='radio' value="<?php echo $testhivresult; ?>" name="hivtestresult" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->hivtestresult == $testhivresult)? "checked" : ""); ?> <?php endif; ?>><?php echo $testhivresult; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d4'>
                                    <td class='d4'><?php echo $hivtest[3]->number_order ?></td>
                                    <td class='d4'><?php echo $hivtest[3]->questions ?></td>
                                    <?php $wwthetestrs = explode('|',$hivtest[3]->answer); ?>
                                    <td class='d4'>
                                        <?php foreach($wwthetestrs as $wwthetestr){ ?>
                                            <input type='radio' value="<?php echo $wwthetestr; ?>" name="wwtestr" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->wwtestr == $wwthetestr)? "checked" : ""); ?> <?php endif; ?>><?php echo $wwthetestr; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d5'>
                                    <td><?php echo $hivtest[4]->number_order ?></td>
                                    <td><?php echo $hivtest[4]->questions ?></td>
                                    <?php $artcenters = explode('|',$hivtest[4]->answer); ?>
                                    <td>
                                        <?php foreach($artcenters as $artcenter){ ?>
                                            <input type='radio' value="<?php echo $artcenter; ?>" name="artcregis" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->artcregis == $artcenter)? "checked" : ""); ?> <?php endif; ?>><?php echo $artcenter; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d6'>
                                    <td class='d6'><?php echo $hivtest[5]->number_order ?></td>
                                    <td class='d6'><?php echo $hivtest[5]->questions ?></td>
                                    <td class='d6'>
                                        <select name='nameartc' style="text-transform: uppercase" class='form-control'>
                                        <?php if(empty($showdata)): ?>                       <option value=''>Select Status</option>
                                        <?php endif; ?>
                                            <?php $__currentLoopData = $artnames; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $artname): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value='<?php echo e($artname->name_of_artc); ?>' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->nameartc == $artname->name_of_artc ? 'selected' : ''); ?> <?php endif; ?>><?php echo e($artname->name_of_artc); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                        <!--<input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->nameartc); ?>' <?php endif; ?> placeholder='Click here to enter ARTC name.' name="nameartc">-->
                                    </td>
                                </tr>
                                <tr class='d7'>
                                    <td class='d7'><?php echo $hivtest[6]->number_order ?></td>
                                    <td class='d7'><?php echo $hivtest[6]->questions ?></td>
                                    <td class='d7'>
                                       <input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->preartno); ?>' <?php endif; ?> placeholder="Click here to enter Pre-ART no" name="preartno">
                                    </td>
                                </tr>
                                <tr class='d8'>
                                    <td class='d8'><?php echo $hivtest[7]->number_order ?></td>
                                    <td class='d8'><?php echo $hivtest[7]->questions ?></td>
                                    <td class='d8'>
                                        <div class='input-group date datetimepicker' >
                                        <input type='text' <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->dateartinitiation); ?>' <?php endif; ?> class="form-control" name="dateartinitiation" placeholder="yyyy-mm-dd" />
                                        <span class="input-group-addon">
                                          <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                        </div>
                                    </td>
                                </tr>
                                <tr class='d9'>
                                    <td><?php echo $hivtest[8]->number_order ?></td>
                                    <td><?php echo $hivtest[8]->questions ?></td>
                                    <td>
                                        <input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->artregno); ?>' <?php endif; ?> placeholder='Click here to enter ARTC name.' name="artregno">
                                    </td>
                                </tr>
                                <tr class='d10'>
                                    <td><?php echo $hivtest[9]->number_order ?></td>
                                    <td><?php echo $hivtest[9]->questions ?></td>
                                    <?php $hutakenarts = explode('|',$hivtest[9]->answer); ?>
                                    <td>
                                        <?php foreach($hutakenarts as $hutakenart){ ?>
                                            <input type='radio' value="<?php echo $hutakenart; ?>" name="arttakenlast" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->arttakenlast == $hutakenart)? "checked" : ""); ?> <?php endif; ?>><?php echo $hutakenart; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d11'>
                                    <td><?php echo $hivtest[10]->number_order ?></td>
                                    <td><?php echo $hivtest[10]->questions ?></td>
                                    <?php $completeviraltests = explode('|',$hivtest[10]->answer); ?>
                                    <td>
                                        <?php foreach($completeviraltests as $completeviraltest){ ?>
                                            <input type='radio'  value="<?php echo $completeviraltest; ?>" name="cviralload" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->cviralload == $completeviraltest)? "checked" : ""); ?> <?php endif; ?>><?php echo $completeviraltest; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d12'>
                                    <td class='d12'><?php echo $hivtest[11]->number_order ?></td>
                                    <td class='d12'><?php echo $hivtest[11]->questions ?></td>
                                    <td class='d12'>
                                        <div class='input-group date datetimepicker' >
                                        <input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->dateviraltest); ?>' <?php endif; ?> class="form-control" name="dateviraltest" placeholder="yyyy-mm-dd" />
                                        <span class="input-group-addon">
                                          <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                        </div>
                                    </td>
                                </tr>
                                <tr class='d13'>
                                    <td><?php echo $hivtest[12]->number_order ?></td>
                                    <td><?php echo $hivtest[12]->questions ?></td>
                                    <?php $statusoflviraltests = explode('|',$hivtest[12]->answer); ?>
                                    <td>
                                        <?php foreach($statusoflviraltests as $statusoflviraltest){ ?>
                                            <input type='radio' value="<?php echo $statusoflviraltest; ?>" name="statusovirall" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->statusovirall == $statusoflviraltest)? "checked" : ""); ?> <?php endif; ?>><?php echo $statusoflviraltest; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr class='d14'>
                                    <td><?php echo $hivtest[13]->number_order ?></td>
                                    <td><?php echo $hivtest[13]->questions ?></td>
                                    <?php $viralloads = explode('|',$hivtest[13]->answer); ?>
                                    <td>
                                        <?php foreach($viralloads as $viralload){ ?>
                                            <input type='radio' value="<?php echo $viralload; ?>" name="viralload" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->viralload == $viralload)? "checked" : ""); ?> <?php endif; ?>><?php echo $viralload; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <div class="form-group">
                                <table class='table table-bordered esection'>
                                <tr>
                                    <th colspan='6'><strong><?php echo e(__('E. MAT (OST) services (for PWIDs only, please skip to section G if not PWID)')); ?></strong></th>
                                </tr>
                                <tr>
                                    <td><?php echo $matostservice[0]->number_order ?></td>
                                    <td><?php echo $matostservice[0]->questions ?></td>
                                    <?php $initiatematosts = explode('|',$matostservice[0]->answer); ?>
                                    <td>
                                        <?php foreach($initiatematosts as $initiatematost){ ?>
                                            <input type='radio' value="<?php echo $initiatematost; ?>" name="ostmatini" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->ostmatini == $initiatematost)? "checked" : ""); ?> <?php endif; ?>><?php echo $initiatematost; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='e2'><?php echo $matostservice[1]->number_order ?></td>
                                    <td class='e2'><?php echo $matostservice[1]->questions ?></td>
                                    <td class='e2'>
                                        <input type='text' style="text-transform: uppercase" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->nameostcenter); ?>' <?php endif; ?> placeholder='Click here to enter the centre name.' name="nameostcenter">
                                    </td>
                                </tr>
                                <tr>
                                    <td class='e3'><?php echo $matostservice[2]->number_order ?></td>
                                    <td class='e3'><?php echo $matostservice[2]->questions ?></td>
                                    <?php $osttreatments = explode('|',$matostservice[2]->answer); ?>
                                    <td  class='e3' colspan='4'>
                                        <?php foreach($osttreatments as $osttreatment){ ?>
                                            <input type='radio' value="<?php echo $osttreatment; ?>" name="treatmentost" <?php if(!empty($showdata)): ?><?php echo e(($showdata[0]->treatmentost == $osttreatment)? "checked" : ""); ?> <?php endif; ?>><?php echo $osttreatment; ?><br>
                                            
                                        <?php } ?>
                                    </td>
                                </tr>
                            </table>
                            </div>
                            <div class="form-group">
                                <textarea id="w3review" style="text-transform: uppercase;width:99%;margin-left:2px;padding-bottom:0px" name="commentremark" rows="4" placeholder='Comments/Remarks:'><?php if(!empty($showdata)): ?><?php echo e($showdata[0]->commentremark); ?> <?php endif; ?></textarea>
                            </div>
                            <div class="form-group">
                                <label for="state_code"><?php echo e(__('Status')); ?></label>
                                <?php if(!empty($showdata) && $showdata[0]->formstatus == 'success'): ?>
                                <input type="hidden" name="formstatus" value="success">
                                <select name='formstatus' id='staffstatus' class='form-control' disabled="" required>
                                <?php else: ?>
                                <select name='formstatus' id='staffstatus' class='form-control' required>
                                <?php endif; ?>
                                    <option value=''>Select</option>
                                    <option value='pending' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->formstatus == 'pending' ? 'selected' : ''); ?> <?php endif; ?>><?php echo e(__('Pending')); ?></option>
                                    <option value='success' <?php if(!empty($showdata)): ?><?php echo e($showdata[0]->formstatus == 'success' ? 'selected' : ''); ?> <?php endif; ?>><?php echo e(__('Success')); ?></option>
                                     
                                </select>
                            </div>
                            
                            <div class="form-group serialno" style="text-align:center;">
                                <label for="note"><h5><?php echo e(__('(Once the verbal consent obtained the ID no. will be provided to the client)')); ?></h5></label>
                            </div>    
                            <div class="form-group serialno">
                                <div class="col-md-2">
                                    <div class="form-group" style='text-align:right;top-margin:2px;'>
                                        <label><b><?php echo e(__('UID*')); ?></b></label>
                                    </div>
                                </div>
                                <div class="col-md-10">
                                    <div class="form-group">
                                        <table class='table table-bordered'>
                                            <tr>
                                                <td colspan='2'><?php if($adminuserid){ echo $adminstatecode; } ?></td>
                                                <td colspan='3'><?php if($adminuserid){ echo $admindistcode; } ?></td>
                                                
                                                <td colspan='4'><?php if(!empty($showdata) && $showdata[0]->formstatus == 'success'){ ?> <?php echo e($showdata[0]->serialno); ?> <?php }else{ ?><span id='sno'></span><?php } ?></td>
                                                <input type='hidden' <?php if(!empty($showdata) && $showdata[0]->formstatus == 'success'){ ?> value='<?php echo e($showdata[0]->serialno); ?>' <?php }else{ ?>id='serialno' value='' <?php } ?> name='serialno' >
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group serialno">
                                <label for="uidregisterdate"><?php echo e(__('Date of Registration**')); ?></label>
                                <div class='input-group date uidregisterdatepicker'>
                                <input type='text' class="form-control" name="uidregisterdate" id="uidregisterdate" <?php if(!empty($showdata)): ?> value='<?php echo e($showdata[0]->uidregisterdate); ?>' <?php endif; ?> placeholder="yyyy-mm-dd" />
                                <span class="input-group-addon">
                                  <span class="glyphicon glyphicon-calendar"></span>
                                </span>
                                </div>
                            </div>
                            <br><br><br>
                            <button type="submit" name='regsubmit' id="regsubmit" class="btn btn-primary mr-2"><?php echo e(__('Save')); ?></button>
                            <?php if(!empty($showdata) && $showdata[0]->formstatus == 'success'): ?>
                            <a href="<?php echo e(url('client-register-data-success')); ?>" class="btn btn-light"><?php echo e(__('Cancel')); ?></a>
                            <?php else: ?>
                            <a href="<?php echo e(url('client-register-data')); ?>" 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 isNumber(evt)
    	{
            evt = (evt) ? evt : window.event;
            var charCode = (evt.which) ? evt.which : evt.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }
            return true; 
    	}
    
        $(function() {
            $(".serialno").hide();
            var default_date=  new Date();
            $('.datetimepicker').datetimepicker({  
               format: 'YYYY-MM-DD', 
                useCurrent:false, 
                maxDate: new Date(),
                defaultDate: default_date
            });
            
            $('.uidregisterdatepicker').datetimepicker({  
               format: 'YYYY-MM-DD', 
                useCurrent:false, 
                minDate: default_date,
                defaultDate: default_date
            });
            
            $('.datetimepickerfuture').datetimepicker({  
               format: 'YYYY-MM-DD', 
                useCurrent:false, 
                minDate: default_date,
                defaultDate: default_date
            });
        });
        
        
        $( "#primarymobileno" ).blur(function() { 
            var mobile = $('#primarymobileno').val();
            var length = mobile.length;
            if(length != 10)
            {
                alert('Primary Contact Number to be 10 Digits');
            }
            // alert(mobile);
            $.ajax({
                type: "POST",
                url: "<?php echo e(url('checkmobile')); ?>",
                data: {mobile:mobile, _token: '<?php echo e(csrf_token()); ?>' },
                dataType: "json",
                success: function(res) { 
                    console.log(res);
                    if(res.exists == true){
                        $('#check-mobile-status').text('Mobile number already exists');
                    }else{
                        $('#check-mobile-status').text('');
                    }
                },
                error: function (jqXHR, exception) {
    
                }
            });
        });
        
        $( "#contactalternate" ).blur(function() { 
            var p_mobile = $('#primarymobileno').val();
            var a_mobile = $('#contactalternate').val();
            if(a_mobile == p_mobile)
            {
                alert('Primary and Alternate Contact number cannot be same');
            }
        });
        
        $( "#staffstatus" ).change(function() { 
            var test = $(this).val();
            if(test == "success")
            {
                $(".serialno").show();
                $("input[name$='uidregisterdate']").attr('required', true);
            }
            else
            {
                $(".serialno").hide();
                $("input[name$='uidregisterdate']").attr('required', false);
            }
        });
        $("#regsubmit").click(function() {
            
            var registerdate = $('#registerdate').val();
            var uidregisterdate = $('#uidregisterdate').val();
            var catprimary = $("input[name$='catprimary']:checked").val();
            var mobile = $('#primarymobileno').val();
            var alternate = $('#contactalternate').val();
            var test = $('#staffstatus').val();
            var mobile_length = mobile.length;
            var alternate_length = alternate.length;
            
            if(mobile_length != 10)
            {
                alert('Primary Contact Number to be 10 Digits');
                return false;
            }
            if(alternate_length > 15)
            {
                alert('Primary Contact Number to be 15 Digits');
                return false;
            }
            
            if(test == "success")
            {
                if(catprimary == undefined)
                {
                    alert("Category is required field.");
                    return false;
                }
            }
            if(uidregisterdate != "")
            {
                if ((Date.parse(uidregisterdate) < Date.parse(registerdate))) {
                  alert("Date of Registration should be greater than Date of Contact for registration");
                  return false;
                }
            }
            else
            {
                if(test == "success")
                {
                    alert("Date of Registration is required field.");
                    return false;
                }
            }
            //return true;
        });
        $("input[name$='sactuhh']").blur(function() {
            var test = $(this).val();
            $("input[name$='sacwithoutuhh']").attr('max', test);
            $("input[name$='avgnos']").attr('max', test);
            // $("input[name$='sacwithoutuhh']").css('width','51%');
        });
        
        $("tr.childk1").hide();
        $("tr.childk2").hide();
        $("tr.childk3").hide();
        $("tr.childk4").hide();
                
        $("#child_count").change(function() {
            var child = $('#child_count').val();
            if(child == 0)
            {
                $("tr.childk1").hide();
                $("tr.childk2").hide();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 1)
            {
                $("tr.childk1").show();
                $("tr.childk2").hide();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 2)
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 3)
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").show();
                $("tr.childk4").hide();
            }
            else
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").show();
                $("tr.childk4").show();
            }
        });
        
        $("tr.partnerk1").hide();
        $("tr.partnerk2").hide();
        $("tr.partnerk3").hide();
        $("tr.partnerk4").hide();
                
        $("#partner_count").change(function() {
            var partner = $('#partner_count').val();
            if(partner == 0)
            {
                $("tr.partnerk1").hide();
                $("tr.partnerk2").hide();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 1)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").hide();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 2)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 3)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").show();
                $("tr.partnerk4").hide();
            }
            else
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").show();
                $("tr.partnerk4").show();
            }
            
        });
         $("#numage").change(function() {
             
             var age = $('#numage').val();
             $('#check-num-age').text('');
             //alert(age);
             if(age<18)
             {
                 $('#numage').val('');
                 //$('#erorrmsg').show();
                 $('#check-num-age').text('Age Should Be Greater Than 18 or equal to 18');
             }
             
         });
         $("#numage1").change(function() {
             var age1 = $('#numage1').val();
             $('#check-num-age-child').text('');
             if(age1>17)
             {
                 $('#numage1').val('');
                 $('#check-num-age-child').text('Age Should Be Less Than or equal to 17');
             }
         });
         $("#numage2").change(function() {
             var age2 = $('#numage2').val();
             $('#check-num-age-child').text('');
             if(age2>17)
             {
                 $('#numage2').val('');
                 $('#check-num-age-child').text('Age Should Be Greater Than or equal to 17');
             }
         });
         $("#numage3").change(function() {
             var age3 = $('#numage3').val();
             $('#check-num-age-child').text('');
             if(age3>17)
             {
                 $('#numage3').val('');
                 $('#check-num-age-child').text('Age Should Be Greater Than or equal to 17');
             }
         });
         $("#numage4").change(function() {
             var age4 = $('#numage4').val();
             $('#check-num-age-child').text('');
             if(age4>17)
             {
                 $('#numage4').val('');
                 $('#check-num-age-child').text('Age Should Be Greater Than or equal to 17');
             }
         });
         
         function scorecompare(idval) {
           var marksscored = idval;
        
           var totalmarkstoall = 15;
           if (parseInt(marksscored.value) < parseInt(totalmarkstoall)){
            alert("Please double check the Age Entered");
           } else {
        
           }
         }
        
        $(document).ready(function() {
            
            var statecode = $('#statecode').val();
            var distcode = $('#distcode').val();
           
            $.ajax({
                type: "POST",
                url: "<?php echo e(url('getserialnumber')); ?>",
                data: {statecode:statecode,distcode:distcode, _token: '<?php echo e(csrf_token()); ?>' },
                dataType: "json",
                success: function(data){
                    // console.log(data.likesnumber);
                    var sno = data.likesnumber;
                    $('#sno').text(sno);
                    $('#serialno').val(sno);
                },
                error: function (jqXHR, exception) {
    
                }
            });
            
            $('.catpri').on('change',function(){
                var catpri = $(this).val();
                if(catpri == "1) PWID")
                {
                    $("table.esection").show();
                }
                else
                {
                    $("table.esection").hide();
                }
                if(catpri){
                    $.ajax({
                        type:'POST',
                        url:"<?php echo e(url('getsubcatdata')); ?>",
                        data:{catpri:catpri, _token: '<?php echo e(csrf_token()); ?>' },
                        success:function(response){
                            var r = response;
                            $('#b61subcat').empty();
                            $("#b61subcat").append('<option>Select</option>');
                            for (var i in r)
                            {            
                            
                                
                                $('#b61subcat').append("<option value=\""+r[i].st_description+"\">"+r[i].st_description+"</option>");
                            }
                        }
                    }); 
                }
            });
            
            $("input[name$='verbalconsent']").click(function() {
                var test = $(this).val();
                if(test == '1) Yes'){
                    $("tr.a5").hide();
                    $("tr.a5a").hide();
                    $("tr.a6").hide();
                    $("table.bsection").show();
                    $("table.b13section").show();
                    $("table.b14section").show();
                    $("table.csection").show();
                    $("table.dsection").show();
                    $("table.esection").show();
                    $('#staffstatus option[value="pending"]').attr("selected",false);
                    $("#staffstatus").attr("disabled", false);
                    $("input[name$='refusal']").attr('checked', false);
                    $("#datenextfollowup").val("");
                }else{
                    $("tr.a5").show();
                    $("tr.a5a").hide();
                    $("tr.a6").show();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $('#staffstatus option[value="pending"]').attr("selected",true);
                    // $("#staffstatus").attr("disabled", true);
                }
            });
            
            $("input[name$='refusal']").click(function() {
                var test = $(this).val();
                if(test == '1) Not now, willing to participate later'){
                    $("#datenextfollowup").val("");
                    $("tr.a6").show();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("tr.a5a").hide();
                    $('#staffstatus option[value="pending"]').attr("selected",true);
                    $("#staffstatus").attr("disabled", false);
                
                }else if(test == '2) Concerned about the confidentiality' || test == '3) Unwilling to get services'){
                    $("tr.a6").hide();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("tr.a5a").hide();
                    $('#staffstatus option[value="pending"]').attr("selected",true);
                    $("#staffstatus").attr("disabled", false);
                }else if(test == '4) Other reason'){
                    $("tr.a6").hide();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("input[name$='a5aspecifyother']").val("");
                    $("tr.a5a").show();
                    $('#staffstatus option[value="pending"]').attr("selected",true);
                    $("#staffstatus").attr("disabled", false);   
                }
                else{
                    $("tr.a6").show();
                    $("tr.a5a").hide();
                    $("table.bsection").show();
                    $("table.b13section").show();
                    $("table.b14section").show();
                    $("table.csection").show();
                    $("table.dsection").show();
                    $("table.esection").show();
                    $('#staffstatus option[value="pending"]').attr("selected",false);
                    $("#staffstatus").attr("disabled", false);
                }
            });
            
            $("input[name$='gender']").click(function() {
                var test = $(this).val();
                if(test == 'Other'){
                    $("input[name$='genderspecifyother']").val("");
                    $("span.b2specifyother").show();
                }else{
                    $("span.b2specifyother").hide();
                }
            });
            
            $("input[name$='enrollintarget']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("span.b71").hide();
                    
                }else{
                    $("span.b71").show();
                    $('#b71nameit').val("");
                }
            });
            
            $("input[name$='empleestatus']").click(function() {
                var test = $(this).val();
                if(test == '8) Other'){
                    $("input[name$='b91specifyother']").val("");
                    $("tr.b91").show();
                }else{
                    $("tr.b91").hide();
                }
            });
            
            $("input[name$='infopgender1']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b13g1specifyother").show();
                }else{
                    $("span.b13g1specifyother").hide();
                }
            });
            
            $("input[name$='infopgender2']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b13g2specifyother").show();
                }else{
                    $("span.b13g2specifyother").hide();
                }
            });
            
            $("input[name$='infopgender3']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b13g3specifyother").show();
                }else{
                    $("span.b13g3specifyother").hide();
                }
            });
            
            $("input[name$='infopgender4']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b13g4specifyother").show();
                }else{
                    $("span.b13g4specifyother").hide();
                }
            });
            
             $("input[name$='c1gender']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b14g1specifyother").show();
                }else{
                    $("span.b14g1specifyother").hide();
                }
            });
            
            $("input[name$='c2gender']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b14g2specifyother").show();
                }else{
                    $("span.b14g2specifyother").hide();
                }
            });
            
            $("input[name$='c3gender']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b14g3specifyother").show();
                }else{
                    $("span.b14g3specifyother").hide();
                }
            });
            
            $("input[name$='c4gender']").click(function() {
                var test = $(this).val();
                if(test == '5) Other'){
                    $("span.b14g4specifyother").show();
                }else{
                    $("span.b14g4specifyother").hide();
                }
            });
            
            
            $("input[name$='regpartner']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.b12field").hide();
                    $("table.b13section").hide();
                    // $("table.b14section").hide();
                    $("input[name$='refusal']").attr('checked', false);
                    $("td.b12field").val("");
                    $("input[name$='livingwith']").attr('checked', false);
                    $("input[name$='infopertainingname1']").val("");
                    $("input[name$='infopertainingage1']").val("");
                    $("input[name$='infopgender1']").attr('checked', false);
                    $("input[name$='highriskcat1']").attr('checked', false);
                    $("input[name$='cuilm1']").attr('checked', false);
                    $("input[name$='infopertainingname2']").val("");
                    $("input[name$='infopertainingage2']").val("");
                    $("input[name$='infopgender2']").attr('checked', false);
                    $("input[name$='highriskcat2']").attr('checked', false);
                    $("input[name$='cuilm2']").attr('checked', false);
                    $("input[name$='infopertainingname3']").val("");
                    $("input[name$='infopertainingage3']").val("");
                    $("input[name$='infopgender3']").attr('checked', false);
                    $("input[name$='highriskcat3']").attr('checked', false);
                    $("input[name$='cuilm3']").attr('checked', false);
                    $("input[name$='infopertainingname4']").val("");
                    $("input[name$='infopertainingage4']").val("");
                    $("input[name$='infopgender4']").attr('checked', false);
                    $("input[name$='highriskcat4']").attr('checked', false);
                    $("input[name$='cuilm4']").attr('checked', false);
                    $("input[name$='c1name']").val("");
                    $("input[name$='c1age']").val("");
                    $("input[name$='c1gender']").attr('checked', false);
                    $("input[name$='c2name']").val("");
                    $("input[name$='c2age']").val("");
                    $("input[name$='c2gender']").attr('checked', false);
                    $("input[name$='c3name']").val("");
                    $("input[name$='c3age']").val("");
                    $("input[name$='c3gender']").attr('checked', false);
                    $("input[name$='c4name']").val("");
                    $("input[name$='c4age']").val("");
                    $("input[name$='c4gender']").attr('checked', false);
                    
                }else{
                    $("td.b12field").show();
                    $("table.b13section").show();
                    // $("table.b14section").show();
                }
            });
            $("input[name$='strecmoney']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.c11a").hide();
                    $("td.c11b").hide();
                    $("td.c12").hide();
                    $("td.c13").hide();
                    $("td.c14").hide();
                    $("td.c15").hide();
                    $("td.c16").hide();
                    $("td.c17").hide();
                    $("td.c18").hide();
                    $("td.c18a").hide();
                    $("input[name$='hluisy']").val("");
                    $("input[name$='hluism']").val("");
                    // $("input[name$='lasttuhs']").attr('checked', false);
                    $("input[name$='sactuhh']").val("");
                    $("input[name$='sacwithoutuhh']").val("");
                    $("input[name$='avgnos']").val("");
                    $("input[name$='stisymp']").attr('checked', false);
                    $("input[name$='aloother']").attr('checked', false);
                    $("input[name$='throughvio']").attr('checked', false);
                    $("input[name$='mobilityapo']").attr('checked', false);
                    $("input[name$='hmtmout']").val("");
                }else{
                    $("td.c11a").show();
                    $("td.c11b").show();
                    $("td.c12").show();
                    $("td.c13").show();
                    $("td.c14").show();
                    $("td.c15").show();
                    $("td.c16").show();
                    $("td.c17").show();
                    $("td.c18").show();
                    $("td.c18a").show();
                }
            });
            $("input[name$='strmoneyc2']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.c21a").hide();
                    $("td.c21b").hide();
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").hide();
                    $("td.c26").hide();
                    $("td.c27").hide();
                    $("td.c28").hide();
                    $("td.c28a").hide();
                    $("input[name$='hluisyc2']").val("");
                    $("input[name$='hluismc2']").val("");
                    $("input[name$='lasttimeuhsc2']").attr('checked', false);
                    $("input[name$='sactuhhc2']").val("");
                    $("input[name$='freneedlec2']").attr('checked', false);
                    $("input[name$='avgnosc2']").val("");
                    $("input[name$='stisympc2']").attr('checked', false);
                    $("input[name$='alootherc2']").attr('checked', false);
                    $("input[name$='throughvioc2']").attr('checked', false);
                    $("input[name$='mobilityapoc2']").attr('checked', false);
                    $("input[name$='hmtmoutc2']").val("");
                }else{
                    $("td.c21a").show();
                    $("td.c21b").show();
                    $("td.c22").show();
                    $("td.c23").show();
                    $("td.c24").show();
                    $("td.c25").show();
                    $("td.c26").show();
                    $("td.c27").show();
                    $("td.c28").show();
                    $("td.c28a").show();
                }
            });
            
            $("input[name$='lasttuhs']").click(function() {
                var test = $(this).val();
                // alert(test);
                if(test == '2) More than 1 mth to 3 mth ago'){
                    $("td.c12").hide();
                    $("td.c13").hide();
                    $("td.c14").hide();
                    $("td.c15").show();
                    $("td.c16").show();
                    $("td.c17").show();
                    $("td.c18").show();
                    $("td.c18a").show();
                    // $("input[name$='sactuhh']").val("");
                    // $("input[name$='sacwithoutuhh']").val("");
                    // $("input[name$='avgnos']").val("");
                    
                }else if(test == '3) More than 3 months to 6 months ago' || test == '4) More than 6 months to 1 year ago' || test == '5) More than 1 year ago' ){
                   
                    $("td.c12").hide();
                    $("td.c13").hide();
                    $("td.c14").hide();
                    $("td.c15").hide();
                    $("td.c16").hide();
                    $("td.c17").hide();
                    $("td.c18").hide();
                    $("td.c18a").hide();
                    // $("input[name$='hluisy']").val("");
                    // $("input[name$='hluism']").val("");
                    // $("input[name$='lasttuhs']").attr('checked', false);
                    $("input[name$='sactuhh']").val("");
                    $("input[name$='sacwithoutuhh']").val("");
                    $("input[name$='avgnos']").val("");
                    // $("input[name$='stisymp']").attr('checked', false);
                    // $("input[name$='aloother']").attr('checked', false);
                    // $("input[name$='throughvio']").attr('checked', false);
                    // $("input[name$='mobilityapo']").attr('checked', false);
                    // $("input[name$='hmtmout']").val("");
                }
                else{
                    $("td.c12").show();
                    $("td.c13").show();
                    $("td.c14").show();
                    $("td.c15").show();
                    $("td.c16").show();
                    $("td.c17").show();
                    $("td.c18").show();
                    $("td.c18a").show();
                }
            });
            
            $("input[name$='lasttimeuhsc2']").click(function() {
                var test = $(this).val();
                if(test == '2) More than 1 month to 3 months ago'){
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").show();
                    $("td.c26").show();
                    $("td.c27").show();
                    $("td.c28").show();
                    $("td.c28a").show();
                    $("input[name$='sactuhhc2']").val("");
                    $("input[name$='freneedlec2']").attr('checked', false);
                    $("input[name$='avgnosc2']").val("");
                    
                }else if(test == '3) More than 3 months to 6 months ago' || test == '4) More than 6 months to 1 year ago' || test == '5) More than 1 year ago' ){
                    
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").hide();
                    $("td.c26").hide();
                    $("td.c27").hide();
                    $("td.c28").hide();
                    $("td.c28a").hide();
                    $("input[name$='sactuhhc2']").val("");
                    $("input[name$='freneedlec2']").attr('checked', false);
                    $("input[name$='avgnosc2']").val("");
                    $("input[name$='stisympc2']").attr('checked', false);
                    $("input[name$='alootherc2']").attr('checked', false);
                    $("input[name$='throughvioc2']").attr('checked', false);
                    $("input[name$='mobilityapoc2']").attr('checked', false);
                    $("input[name$='hmtmoutc2']").val("");
                }
                else{
                    $("td.c22").show();
                    $("td.c23").show();
                    $("td.c24").show();
                    $("td.c25").show();
                    $("td.c26").show();
                    $("td.c27").show();
                    $("td.c28").show();
                    $("td.c28a").show();
                }
            });
            
            $("input[name$='statusovirall']").click(function() {
                var test = $(this).val();
                if(test == '1) Undetectable/ not detectable'){
                    $("tr.d14").hide();
                }
                else{
                    $("tr.d14").show();
                }
            });
            $("input[name$='stisympc2']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.c26").hide();
                    $("input[name$='alootherc2']").attr('checked', false);
                }else{
                    $("td.c26").show();
                }
            });
            
            $("input[name$='mobilityapo']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("span.c18a").hide();
                    $("input[name$='hmtmout']").val("");
                }else{
                    $("span.c18a").show();
                }
            });
            
            $("input[name$='mobilityapoc2']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.c28a").hide();
                    $("input[name$='hmtmoutc2']").val("");
                }else{
                    $("td.c28a").show();
                }
            });
            
            $("input[name$='hivtestresult']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.d4").hide();
                    $("tr.d5").hide();
                    $("tr.d6").hide();
                    $("tr.d7").hide();
                    $("tr.d8").hide();
                    $("tr.d9").hide();
                    $("tr.d10").hide();
                    $("tr.d11").hide();
                    $("tr.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("input[name$='wwtestr']").attr('checked', false);
                    $("input[name$='artcregis']").attr('checked', false);
                    $("input[name$='nameartc']").val('');
                    $("input[name$='preartno']").val("");
                    $("input[name$='dateartinitiation']").val("");
                    $("input[name$='artregno']").val("");
                    $("input[name$='arttakenlast']").attr('checked', false);
                    $("input[name$='cviralload']").attr('checked', false);
                    $("input[name$='dateviraltest']").val("");
                    $("input[name$='statusovirall']").attr('checked', false);
                    $("input[name$='viralload']").attr('checked', false);
                }else{
                    $("td.d4").show();
                    $("tr.d5").show();
                    $("tr.d6").show();
                    $("tr.d7").show();
                    $("tr.d8").show();
                    $("tr.d9").show();
                    $("tr.d10").show();
                    $("tr.d11").show();
                    $("tr.d12").show();
                    $("tr.d13").show();
                    $("tr.d14").show();
                }
            });
            $("input[name$='wwtestr']").click(function() {
                var test = $(this).val();
                if(test == '2) Negative'){
                    $("tr.d5").hide();
                    $("tr.d6").hide();
                    $("tr.d7").hide();
                    $("tr.d8").hide();
                    $("tr.d9").hide();
                    $("tr.d10").hide();
                    $("tr.d11").hide();
                    $("tr.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("input[name$='artcregis']").attr('checked', false);
                    $("input[name$='nameartc']").val('');
                    $("input[name$='preartno']").val("");
                    $("input[name$='dateartinitiation']").val("");
                    $("input[name$='artregno']").val("");
                    $("input[name$='arttakenlast']").attr('checked', false);
                    $("input[name$='cviralload']").attr('checked', false);
                    $("input[name$='dateviraltest']").val("");
                    $("input[name$='statusovirall']").attr('checked', false);
                    $("input[name$='viralload']").attr('checked', false);
                    
                }else{
                    $("tr.d5").show();
                    $("tr.d6").show();
                    $("tr.d7").show();
                    $("tr.d8").show();
                    $("tr.d9").show();
                    $("tr.d10").show();
                    $("tr.d11").show();
                    $("tr.d12").show();
                    $("tr.d13").show();
                    $("tr.d14").show();
                }
            });
            $("input[name$='artcregis']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.d6").hide();
                    $("tr.d7").hide();
                    $("tr.d8").hide();
                    $("tr.d9").hide();
                    $("tr.d10").hide();
                    $("tr.d11").hide();
                    $("tr.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("input[name$='nameartc']").val('');
                    $("input[name$='preartno']").val("");
                    $("input[name$='dateartinitiation']").val("");
                    $("input[name$='artregno']").val("");
                    // $("input[name$='arttakenlast']").attr('checked', false);
                    // $("input[name$='cviralload']").attr('checked', false);
                    $("input[name$='dateviraltest']").val("");
                    // $("input[name$='statusovirall']").attr('checked', false);
                    // $("input[name$='viralload']").attr('checked', false);
                    
                }else if(test == '3) Registered but not initiated ART'){
                    $("td.d8").hide();
                    $("tr.d9").hide();
                    $("tr.d10").hide();
                    $("tr.d11").hide();
                    $("tr.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("td.d6").show();
                    $("td.d7").show();
                    $("input[name$='dateartinitiation']").val("");
                    $("input[name$='artregno']").val("");
                    // $("input[name$='arttakenlast']").attr('checked', false);
                    // $("input[name$='cviralload']").attr('checked', false);
                    $("input[name$='dateviraltest']").val("");
                    // $("input[name$='statusovirall']").attr('checked', false);
                    // $("input[name$='viralload']").attr('checked', false);
                }
                else{
                    $("td.d6").show();
                    $("td.d8").show();
                    $("tr.d7").show();
                    $("tr.d9").show();
                    $("tr.d11").show();
                    $("tr.d13").show();
                    $("tr.d8").show();
                    $("tr.d10").show();
                    $("tr.d12").show();
                    $("tr.d14").show();
                }
                
            });
            $("input[name$='cviralload']").click(function() {
                var test = $(this).val();
                if(test == '2) No' || test == "3) Don't know"){
                    $("td.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("input[name$='dateviraltest']").val("");
                    // $("input[name$='statusovirall']").attr('checked', false);
                    // $("input[name$='viralload']").attr('checked', false);
                }else{
                    $("td.d12").show();
                    $("tr.d13").show();
                    $("tr.d14").show();
                }
            });
            
            $("input[name$='ostmatini']").click(function() {
                var test = $(this).val();
                if(test == '2) No'){
                    $("td.e2").hide();
                    $("td.e3").hide();
                    $("input[name$='nameostcenter']").val("");
                    $("input[name$='treatmentost']").attr('checked', false);
                    
                }else{
                    $("td.e2").show();
                    $("td.e3").show();
                }
            });
            
            $("input[name$='hivtest']").click(function() {
                var test = $(this).val();
                if(test == '2) No' || test == "3) Don't know"){
                    $("td.d2").hide();
                    $("tr.d3").hide();
                    $("tr.d4").hide();
                    $("tr.d5").hide();
                    $("tr.d6").hide();
                    $("tr.d7").hide();
                    $("tr.d8").hide();
                    $("tr.d9").hide();
                    $("tr.d10").hide();
                    $("tr.d11").hide();
                    $("tr.d12").hide();
                    $("tr.d13").hide();
                    $("tr.d14").hide();
                    $("input[name$='donelstest']").attr('checked', false);
                    $("input[name$='hivtestresult']").attr('checked', false);
                    $("input[name$='wwtestr']").attr('checked', false);
                    $("input[name$='artcregis']").attr('checked', false);
                    $("input[name$='nameartc']").val('');
                    $("input[name$='preartno']").val("");
                    $("input[name$='dateartinitiation']").val("");
                    $("input[name$='artregno']").val("");
                    $("input[name$='arttakenlast']").attr('checked', false);
                    $("input[name$='cviralload']").attr('checked', false);
                    $("input[name$='dateviraltest']").val("");
                    $("input[name$='statusovirall']").attr('checked', false);
                    $("input[name$='viralload']").attr('checked', false);
                }else{
                    $("td.d2").show();
                    $("tr.d3").show();
                    $("tr.d5").show();
                    $("tr.d7").show();
                    $("tr.d9").show();
                    $("tr.d11").show();
                    $("tr.d13").show();
                    $("tr.d4").show();
                    $("tr.d6").show();
                    $("tr.d8").show();
                    $("tr.d10").show();
                    $("tr.d12").show();
                    $("tr.d14").show();
                }
            });
        });
        
        $(window).load(function(){
            
            var child = $('#child_count').val();
            if(child == 0)
            {
                $("tr.childk1").hide();
                $("tr.childk2").hide();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 1)
            {
                $("tr.childk1").show();
                $("tr.childk2").hide();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 2)
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").hide();
                $("tr.childk4").hide();
            }
            else if(child == 3)
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").show();
                $("tr.childk4").hide();
            }
            else
            {
                $("tr.childk1").show();
                $("tr.childk2").show();
                $("tr.childk3").show();
                $("tr.childk4").show();
            }
            
            var partner = $('#partner_count').val();
            if(partner == 0)
            {
                $("tr.partnerk1").hide();
                $("tr.partnerk2").hide();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 1)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").hide();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 2)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").hide();
                $("tr.partnerk4").hide();
            }
            else if(partner == 3)
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").show();
                $("tr.partnerk4").hide();
            }
            else
            {
                $("tr.partnerk1").show();
                $("tr.partnerk2").show();
                $("tr.partnerk3").show();
                $("tr.partnerk4").show();
            }
            var test1 = $("input[name$='verbalconsent']:checked").val();
                if(test1 == '1) Yes'){
                    $("tr.a5").hide();
                    $("tr.a5a").hide();
                    $("tr.a6").hide();
                }
            
            var test = $("input[name$='statusovirall']:checked").val();
            if(test == '1) Undetectable/ not detectable'){
                $("tr.d14").hide();
            }
                
            var test2 = $("input[name$='refusal']:checked").val();
                if(test2 == '1) Not now, willing to participate later'){
                    $("tr.a6").show();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("tr.a5a").hide();
                
                }else if(test2 == '2) Concerned about the confidentiality' || test2 == '3) Unwilling to get services'){
                    $("tr.a6").hide();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("tr.a5a").hide();
                }else if(test2 == '4) Other reason'){
                    $("tr.a6").hide();
                    $("table.bsection").hide();
                    $("table.b13section").hide();
                    $("table.b14section").hide();
                    $("table.csection").hide();
                    $("table.dsection").hide();
                    $("table.esection").hide();
                    $("tr.a5a").show();
                }
            
            var test3 = $("input[name$='enrollintarget']:checked").val();
                if(test3 == '2) No'){
                    $("span.b71").hide();
                    
                }
            
            var test4 = $("input[name$='regpartner']:checked").val();
                if(test4 == '2) No'){
                    $("td.b12field").hide();
                    $("table.b13section").hide();
                    // $("table.b14section").hide();
                    
                    
                }
            
            var test5 = $("input[name$='strecmoney']:checked").val();
            
                if(test5 == 'No'){
                    $("span.c11a").hide();
                    $("span.c11b").hide();
                    $("span.c12").hide();
                    $("span.c13").hide();
                    $("span.c14").hide();
                    $("span.c15").hide();
                    $("span.c16").hide();
                    $("span.c17").hide();
                    $("span.c18").hide();
                    $("span.c18a").hide();
                }
            
            var test6 = $("input[name$='strmoneyc2']:checked").val();
                if(test6 == '2) No'){
                    $("td.c21a").hide();
                    $("td.c21b").hide();
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").hide();
                    $("td.c26").hide();
                    $("td.c27").hide();
                    $("td.c28").hide();
                    $("td.c28a").hide();
                }
            
            var test7 = $("input[name$='lasttuhs']:checked").val();
                if(test7 == 'More than 1 mth to 3 mth ago.'){
                    $("span.c12").hide();
                    $("span.c13").hide();
                    $("span.c14").hide();
                    $("span.c15").show();
                    $("span.c16").show();
                    $("span.c17").show();
                    $("span.c18").show();
                    $("span.c18a").show();
                    
                }else if(test7 == '3) More than 3 months to 6 months ago.' || test7 == '4) More than 6 months to 1 year ago.' || test7 == '  5) More than 1 year ago. ' ){
                   
                    $("td.c12").hide();
                    $("td.c13").hide();
                    $("td.c14").hide();
                    $("td.c15").hide();
                    $("td.c16").hide();
                    $("td.c17").hide();
                    $("td.c18").hide();
                    $("td.c18a").hide();
                    
                }
                
            var test8 = $("input[name$='lasttimeuhsc2']:checked").val();
                if(test8 == '2) More than 1 month to 3 months ago'){
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").show();
                    $("td.c26").show();
                    $("td.c27").show();
                    $("td.c28").show();
                    $("td.c28a").show();
                    
                }else if(test8 == '3) More than 3 months to 6 months ago' || test8 == '4) More than 6 months to 1 year ago' || test8 == '5) More than 1 year ago' ){
                    
                    $("td.c22").hide();
                    $("td.c23").hide();
                    $("td.c24").hide();
                    $("td.c25").hide();
                    $("td.c26").hide();
                    $("td.c27").hide();
                    $("td.c28").hide();
                    $("td.c28a").hide();
                }
                
            var test9 = $("input[name$='stisympc2']:checked").val();
                if(test9 == '2) No'){
                    $("td.c26").hide();
                    
                }
            
            var test10 = $("input[name$='mobilityapo']:checked").val();
                if(test10 == '2) No'){
                    $("td.c18a").hide();
                    
                }
            
            var test11 = $("input[name$='mobilityapoc2']:checked").val();
                if(test11 == '2) No'){
                    $("td.c28a").hide();
                    
                }
            
            var test12 = $("input[name$='hivtestresult']:checked").val();
                if(test12 == '2) No'){
                    $("td.d4").hide();
                    $("tr.d5d6").hide();
                    $("tr.d7d8").hide();
                    $("tr.d9d10").hide();
                    $("tr.d11d12").hide();
                    $("tr.d13d14").hide();
                    
                }
            
            var test13 = $("input[name$='wwtestr']:checked").val();
                if(test13 == '2) Negative'){
                    $("tr.d5d6").hide();
                    $("tr.d7d8").hide();
                    $("tr.d9d10").hide();
                    $("tr.d11d12").hide();
                    $("tr.d13d14").hide();
                    
                }
            
            var test14 = $("input[name$='artcregis']:checked").val();
                if(test14 == '2) No'){
                    $("td.d6").hide();
                    $("tr.d7d8").hide();
                    $("tr.d9d10").hide();
                    $("tr.d11d12").hide();
                    $("tr.d13d14").hide();
                    
                }else if(test14 == '3) Registered but not initiated ART'){
                    $("td.d8").hide();
                    $("tr.d9d10").hide();
                    $("tr.d11d12").hide();
                    $("tr.d13d14").hide();
                    $("td.d6").show();
                    $("td.d7").show();
                }
            
            var test15 = $("input[name$='cviralload']:checked").val();
                if(test15 == '2) No' || test15 == "3) Don't know"){
                    $("td.d12").hide();
                    $("tr.d13d14").hide();
                    
                }
            
            var test16 = $("input[name$='ostmatini']:checked").val();
                if(test16 == '2) No'){
                    $("td.e2").hide();
                    $("td.e3").hide();
                    
                }
            
            var test17 = $("input[name$='hivtest']:checked").val();
                if(test17 == '2) No' || test17 == "3) Don't know"){
                    $("td.d2").hide();
                    $("tr.d3d4").hide();
                    $("tr.d5d6").hide();
                    $("tr.d7d8").hide();
                    $("tr.d9d10").hide();
                    $("tr.d11d12").hide();
                    $("tr.d13d14").hide();
                    
                }
                
            var test18 = $("input[name$='gender']:checked").val();
                if(test18 == '5) Other'){
                     $("span.b2specifyother").show();
                }
            var test19 = $("input[name$='empleestatus']:checked").val();
                if(test19 == '8) Other'){
                     $("tr.b91").show();
                }
                
            var test20 = $("input[name$='infopgender1']:checked").val();
                if(test20 == '5) Other'){
                     $("span.b13g1specifyother").show();
                }
            var test21 = $("input[name$='infopgender2']:checked").val();
                if(test21 == '5) Other'){
                     $("span.b13g2specifyother").show();
                }
            var test22 = $("input[name$='infopgender3']:checked").val();
                if(test22 == '5) Other'){
                     $("span.b13g3specifyother").show();
                }
            var test23 = $("input[name$='infopgender4']:checked").val();
                if(test23 == '5) Other'){
                    $("span.b13g4specifyother").show();
                }
            
            var test24 = $("input[name$='c1gender']:checked").val();
                if(test24 == '5) Other'){
                     $("span.b14g1specifyother").show();
                }
            var test25 = $("input[name$='c2gender']:checked").val();
                if(test25 == '5) Other'){
                     $("span.b14g2specifyother").show();
                }
            var test26 = $("input[name$='c3gender']:checked").val();
                if(test26 == '5) Other'){
                     $("span.b14g3specifyother").show();
                }
            var test27 = $("input[name$='c4gender']:checked").val();
                if(test27 == '5) Other'){
                    $("span.b14g4specifyother").show();
                }
                
        });
        
        
    </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/client-register.blade.php ENDPATH**/ ?>