?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Policies/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Policies/loadtemplateform.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <script type="text/javascript"> jQuery(document).ready(function () { $('.one').datepick({dateFormat: 'dd-mm-yyyy'}); covername= document.getElementById('cover_hidden').value; insuredname= document.getElementById('insured_hidden').value; policyno= document.getElementById('policyno_hidden').value; policyperiod= document.getElementById('policyperiodid').value; estsuminsured= document.getElementById('estsuminsured_hidden').value; insurancecompany_id=document.getElementById('insurance_company_id').value; brokerage_policy=document.getElementById('brokerage_policy').value; $("input#insured").val(insuredname); $("input#cover").val(covername); $("input#policyno").val(policyno); $("input#policyperiod").val(policyperiod); if(document.getElementById('estimatedsuminsured')) { $("input#estimatedsuminsured").val(estsuminsured); } else { $("input#estimatedturnover").val(estsuminsured); } if(document.getElementById('brokerage')) { $("input#brokerage").val(brokerage_policy); } }); function showcheckdiv(div) { $(".clickimage1").colorbox({width:"47%",height:"40%", inline:true, href:"#"+ div}); } function usecheckvalue(checkname,textareaid) { var checkedval=""; var ckval=document.getElementsByName(checkname); for(j=0;j<ckval.length;j++) { if(ckval[j].checked) { ckval[j].value = ckval[j].value.replace("~", "'"); if(j<ckval.length-1) { checkedval = checkedval +ckval[j].value+'~'+'\n'; } else { checkedval = checkedval +ckval[j].value; } } } $("textarea#"+textareaid).val(checkedval.substring(0, checkedval.length)); $.fn.colorbox.close(); } </script> <script type="text/javascript" src="<?=base_url()?>/assets/js/jquery.textarea-expander.js"></script> <?php foreach($viewinfo as $updata) { $cover_id=$updata['cover_id']; $name=$updata['name']; $templatetype_id=$updata['template_type']; $template_id=$updata['id']; } $templatetype=$this->mastermodel->get_data_srow('template_type',$templatetype_id,'id'); $templateform=$this->mastermodel->get_data('template_form',$template_id,'template_id'); $templatetype_full=$this->mastermodel->getdatas('template_type'); $currency_type=$this->mastermodel->getdatas('country'); $counterText=1; $counterTextArea=1; $counterComboBox=1; $counterstatic=1; $countercheckbox=1; foreach($templateform as $tform) { switch ($tform['fieldtype']) { case 'text': $idname="mytext".$counterText; echo "<li id='$idname'><input type='hidden' id='labelname' name='labelname[]' class='edit' value='$tform[labelname]'><label>$tform[labelname]</label><input type='hidden' name='fieldtype[]' value='text'><input type='text' style='width:250px;' value='$tform[value]' name='myInputs$counterText'><input type='hidden' name='textorder[]' value='$counterText'><img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('templateform','$idname')\" /></li>"; $counterText++; break; case 'textarea': $idname="mytextarea".$counterTextArea; echo "<li id='$idname'><input type='hidden' id='labelname' name='labelname[]' class='edit' value='$tform[labelname]'><label>$tform[labelname]</label><input type='hidden' name='fieldtype[]' value='textarea'><textarea class='expand' name='myTextAreas$counterTextArea'>$tform[value]</textarea><input type='hidden' name='areaorder[]' value='$counterTextArea'><img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('templateform','$idname')\" /></li>"; $counterTextArea++; break; case 'combobox': $idname="mycombo".$counterComboBox; // $cmb=$this->mastermodel->get_data('combobox_value',$tform['id'],'template_form_id'); $namecombo="myComboBox".$counterComboBox."[]"; $namecheck="mycheckbox".$countercheckbox."[]"; echo "<li id='$idname'><input type='hidden' id='labelname' name='labelname[]' class='edit' value='$tform[labelname]'><label>$tform[labelname]</label><input type='hidden' name='fieldtype[]' value='combobox'>"; if(!empty($tform['value'])) { echo "<select id='myComboBox$counterComboBox' MULTIPLE SIZE=3 name='$namecombo'>"; $cmb=explode('~',$tform['value']); for($k=0;$k<sizeof($cmb)-1;$k++) { echo "<option value=''>".$cmb[$k]."</option>"; } echo "</select>"; } else { switch($tform['labelname']) { case 'Conditions': echo '<textarea id="txtcondition" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'conditioncheckdiv\')" />'; echo "<div style='display:none'><div id='conditioncheckdiv' >"; $conditions=$this->mastermodel->get_data('conditions',$cover_id,'cover_id'); foreach($conditions as $cnd) { echo "<div><input type='checkbox' name='$namecheck' value='".$cnd['conditions']."'>".$cnd['conditions']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtcondition')\" class='clickimage' value='Use'/></div></div>"; break; case 'Special conditions': echo '<textarea id="txtscondition" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample2" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'sconditioncheckdiv\')" />'; echo "<div style='display:none'><div id='sconditioncheckdiv' >"; $spconditions=$this->mastermodel->get_data('specialconditions',$cover_id,'cover_id'); foreach($spconditions as $scnd) { echo "<div><input type='checkbox' name='$namecheck' value='".$scnd['specialcondition']."'>".$scnd['specialcondition']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtscondition')\" class='clickimage' value='Use'/></div></div>"; break; case 'Extension': echo '<textarea id="txtextension" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'extensioncheckdiv\')" />'; echo "<div style='display:none'><div id='extensioncheckdiv' >"; $extension=$this->mastermodel->get_data('extension',$cover_id,'cover_id'); foreach($extension as $ext) { echo "<div><input type='checkbox' name='$namecheck' value='".$ext['extension']."'>".$ext['extension']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtextension')\" class='clickimage' value='Use'/></div></div>"; break; case 'Exclusion': echo '<textarea id="txtexclusion" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'exclusioncheckdiv\')" />'; echo "<div style='display:none'><div id='exclusioncheckdiv' >"; $exclusion=$this->mastermodel->get_data('exclusion',$cover_id,'cover_id'); foreach($exclusion as $excl) { echo "<div><input type='checkbox' name='$namecheck' value='".$excl['exclusion']."'>".$excl['exclusion']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtexclusion')\" class='clickimage' value='Use'/></div></div>"; break; case 'Deductible': echo '<textarea id="txtdeductible" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'deductiblecheckdiv\')" />'; echo "<div style='display:none'><div id='deductiblecheckdiv' >"; $deductible=$this->mastermodel->get_data('deductible',$cover_id,'cover_id'); foreach($deductible as $deduct) { echo "<div><input type='checkbox' name='$namecheck' value='".$deduct['deductible']."'>".$deduct['deductible']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtdeductible')\" class='clickimage' value='Use'/></div></div>"; break; case 'Excess': echo '<textarea id="txtexcess" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'excesscheckdiv\')" />'; echo "<div style='display:none'><div id='excesscheckdiv' >"; $excess=$this->mastermodel->get_data('excess',$cover_id,'cover_id'); foreach($excess as $exc) { echo "<div><input type='checkbox' name='$namecheck' value='".$exc['excess']."'>".$exc['excess']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtexcess')\" class='clickimage' value='Use'/></div></div>"; break; case 'Warranty': echo '<textarea id="txtwarranty" name="'.$namecombo.'" class="expand"></textarea><img id="inliexample1" src="'.base_url().'/assets/images/button-search.png" title="Search" class="clickimage1" onclick="showcheckdiv(\'warrantycheckdiv\')" />'; echo "<div style='display:none'><div id='warrantycheckdiv' >"; $warranty=$this->mastermodel->get_data('warranty',$cover_id,'cover_id'); foreach($warranty as $wrnt) { echo "<div><input type='checkbox' name='$namecheck' value='".$wrnt['warranty']."'>".$wrnt['warranty']."</div>"; } echo "<input type='button' onclick=\"usecheckvalue('$namecheck','txtwarranty')\" class='clickimage' value='Use'/></div></div>"; break; } } echo "<img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('templateform','$idname')\"/><input type='hidden' name='comboorder[]' value='$counterComboBox'>"; echo "<input type='hidden' id='combotext$counterComboBox' value='".$tform['value']."' name='combotext$counterComboBox'/>"; $counterComboBox++; $countercheckbox++; echo "<li></li>"; break; case 'suminsured': $idname="mysuminsured"; echo "<li id='$idname'><input type='hidden' id='labelname' name='labelname[]' class='edit' value='$tform[labelname]'><label>$tform[labelname]</label> <input type='hidden' name='fieldtype[]' value='suminsured'> <table border=0> <tbody> <tr><th>Section</th><th>Title</th></tr> <tr><td> <textarea class='expand' name='section_st' id='section_st' style='width:250px;'></textarea></td><td><textarea class='expand' style='width:250px;' name='section_title_st' id='section_title_st'></textarea></td> <td><input type='button' style='cursor:pointer;' onclick=\"addsection(document.getElementById('section_st').value,document.getElementById('section_title_st').value)\" value=\"Add\"/> </td></tr> <tr> <th><input type='text' style='width:250px;' name='desctitle' value='Description'></th> <th><input type='text' style='width:250px;' name='suminsuredtitle' value='Sum Insured'></th><th></th></tr><tr><td> <textarea class='expand' name='description' id='description' style='width:250px;'></textarea></td><td><input type='text' name='amt' id='amt' > <input type='button' id='send' onclick=\"addsuminsured(document.getElementById('description').value,document.getElementById('amt').value)\" class=\"clickimage\" value=\"Add\"/> <img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('templateform','$idname')\" /> </td> </tr> <table border=0> <div id=\"sumdetid\" > </div> </table> <table border=0 id='totalamtdiv'><label> </label> <tr><td> </td></tr> <tr> <td width=\"155px\">Total:</td> <td ><input type=\"text\" id=\"totamt\" value=''> <img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('$idname','totalamtdiv')\" /> </td> <td> <div class='lasttotalbox' style='display:none'> <input type='hidden' style='width:50px;' id='sec' class='lastsecbox' > <input type='hidden' style='width:50px;' id='coun' class='lastcountbox' > </div> </td> </tr> </table> <table border=0 id='totalsumamtdiv'><label> </label> <tr><td> </td></tr> <tr> <td width=\"155px\"><input type=\"text\" name='totalsumtitle' id=\"totalsumtitle\" value='Total Sum Insured'></td> <td ><input type=\"text\" name='total_sumtitle_amount' value='0'> <img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('$idname','totalsumamtdiv')\" /> </td></tr></table> </li><li> </li><li> </li>"; break; case 'insured': echo '<li id="insured_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="insured">'; $data = array( 'name' => 'insured', 'id' => 'insured', 'value' => '', 'style' =>'width:250px;', 'readonly'=>'readonly' ); echo form_input($data).form_error($data); echo ' <span id="insuredInfo" class="red_bold">*</span> </li>'; break; case 'business': echo ' <li id="business_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="business"> <input type="text" name="business" id="business" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'business_txt\')" /></li>'; break; case 'premium': echo ' <li id="premium_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="premium">'; echo '<table><tr><td><select name="currencytype" id="currencytype"> <option value="0" selected >Select Currency</option>'; foreach ($currency_type as $key => $list) { echo "<option value='". $list['id'] . "'>" . $list['currencycode'] . "</option>"; } echo '</select></td><td> <input type="text" name="premium" id="premium" style="width:250px;"> <img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'premium_txt\')" /> <span id="currencytypeInfo" class="red_bold">*</span> </td></tr></table></li><li></li>'; break; case 'brokerage': echo ' <li id="brokerage_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="brokerage"> <input type="text" name="brokerage" id="brokerage" style="width:250px;">%<img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'brokerage_txt\')" /></li>'; break; case 'periodofinsurance': echo ' <li id="periodofinsurance_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="periodofinsurance"> <input type="text" name="periodofinsurance" id="periodofinsurance" style="width:250px;" value="" ><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'periodofinsurance_txt\')" /></li>'; break; case 'rate': echo " <li id='rate_txt'> <input type='hidden' id='labelname' name='labelname[]' class='edit' value='$tform[labelname]'><label>$tform[labelname]</label> <input type='hidden' name='fieldtype[]' value='rate'> <table border=0> <tbody> <tr><td> <textarea class='expand' name='rate_section' id='rate_section' style='width:250px;'></textarea></td><td><input type='text' name='rate_amount' id='rate_amount'/></td> <td><input type='button' style='cursor:pointer;' onclick=\"addratesection(document.getElementById('rate_section').value,document.getElementById('rate_amount').value)\" value=\"Add\"/> <img class='clickimage' src='".base_url()."/assets/images/x-icon.png' onClick=\"removeElement('templateform','rate_txt')\" /> </td></tr></tbody></table>"; echo "<table border=0> <div id=\"ratedetid\" > </div> </table> <table border=0 id='totalamtdiv'><label> </label> <tr><td> </td></tr> <tr> <td> <div class='lasttotalbox' style='display:none'></div> </td> </tr> </table> </li> "; break; case 'policyno': echo ' <li id="policyno_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="policyno"> <input type="text" name="policyno" id="policyno" style="width:250px;" ><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'policyno_txt\')" /></li>'; break; case 'certificaterefno': echo ' <li id="certificaterefno_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="certificaterefno"> <input type="text" name="certificaterefno" id="certificaterefno" style="width:250px;" value="--Auto Generated--" readonly><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'certificaterefno_txt\')" /></li>'; break; case 'modeofconveyance': echo '<li id="modeofconveyance_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="modeofconveyance"> <input type="text" id="modeofconv" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'modeofconveyance_txt\')" /> <input type="button" onclick="addmodeofconveyance(document.getElementById(\'modeofconv\').value)" class="clickimage" value="Add"/> </li> <div id="modeaddmore"></div> '; break; case 'voyage': echo '<li id="voyage_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="voyage"> <input type="text" id="voyageid" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'voyage_txt\')" /> <input type="button" onclick="addvoyage(document.getElementById(\'voyageid\').value)" class="clickimage" value="Add"/> </li> <div id="voyageaddmore"></div> '; break; case 'projectperiod': echo ' <li id="projectperiod_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="projectperiod"> <table border=0><tr><td><input type="text" name="frmprojdate" style="background-image: url(../../../../assets/images/datefocus.gif);" class="one" id="frmprojdate" value="'.date("d-m-Y").'" readonly></td> <td><label style="width:30px;">To</label> </td><td><input type="text" name="toprojdate" style="background-image: url(../../../../assets/images/datefocus.gif);" class="one" id="toprojdate" value="'.date("d-m-Y").'" readonly></td><td> <img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'projectperiod_txt\')" /></td></tr></table></li><li></li>'; break; case 'cover': echo ' <li id="cover_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="cover"> <input type="text" name="cover" id="cover" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'cover_txt\')" /></li>'; break; case 'policyperiod': echo ' <li id="policyperiod_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="policyperiod"> <input type="text" name="policyperiod" id="policyperiod" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'policyperiod_txt\')" /></li>'; break; case 'certificateno': echo ' <li id="certificateno_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="certificateno"> <input type="text" name="certificateno" id="certificateno" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'certificateno_txt\')" /></li>'; break; case 'estimatedsuminsured': echo ' <li id="estimatedsuminsured_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="estimatedsuminsured"> <input type="text" name="estimatedsuminsured" id="estimatedsuminsured" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'estimatedsuminsured_txt\')" /></li>'; break; case 'estimatedturnover': echo ' <li id="estimatedturnover_txt"> <input type="hidden" id="labelname" name="labelname[]" value="'.$tform['labelname'].'"><label>'.$tform['labelname'].'</label> <input type="hidden" name="fieldtype[]" value="estimatedturnover"> <input type="text" name="estimatedturnover" id="estimatedturnover" style="width:250px;"><img class=\'clickimage\' src="'.base_url().'/assets/images/x-icon.png" onClick="removeElement(\'templateform\',\'estimatedturnover_txt\')" /></li>'; break; } } ?>