?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Master/ |
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/Master/templates_old.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php $this->load->view('header'); ?> <script type="text/javascript"> $(document).ready(function(){ //Display Loading Image loadtemplate(); }); function loadtemplate() { Display_Load(); $("#templatediv").load("<?= site_url('master/ajaxload/viewtemplate/template') ?>"); } function addtemplate() { Display_Load(); $("#templatediv").load("<?= site_url('master/ajaxload/addtemplate/template') ?>"); } var counterText = 1; var counterRadioButton = 1; var counterCheckBox = 1; var counterTextArea = 1; var counterComboBox = 1; function addAllInputs(divName, inputType){ var newdiv = document.createElement('li'); switch(inputType) { case 'text': var idname="mytext"+counterText; newdiv.innerHTML = "<label id='txt"+idname+"' ondblclick=\"updatelabel(this.id)\">Entry</label><input type='hidden' name='fieldtype[]' value='"+inputType+"'><input type='text' readonly name='myInputs"+counterText+"'><img class='clickimage' src='<?=base_url()?>/assets/images/x-icon.png' onClick=\"removeElement('"+divName+"','"+idname+"')\"/>"; counterText++; break; case 'textarea': var idname="mytextarea"+counterTextArea; newdiv.innerHTML ="<label id='txtarea"+idname+"' ondblclick=\"updatelabel(this.id)\">Entry</label><input type='hidden' name='fieldtype[]' value='"+inputType+"'><textarea readonly name='myTextAreas"+counterTextArea+"'>type here...</textarea><img class='clickimage' src='<?=base_url()?>/assets/images/x-icon.png' onClick=\"removeElement('"+divName+"','"+idname+"')\"/>"; counterTextArea++; break; case 'combobox': var idname="mycombo"+counterComboBox; newdiv.innerHTML = "<label id='combo"+idname+"' ondblclick=\"updatelabel(this.id)\">Entry</label><input type='hidden' name='fieldtype[]' value='"+inputType+"'><select id='myComboBox"+idname+"' name='myComboBox"+idname+"[]'></select><img class='clickimage' src='<?=base_url()?>/assets/images/x-icon.png' onClick=\"removeElement('"+divName+"','"+idname+"')\"/><input type='text' name='txtCombo"+idname+"' id='txtCombo"+idname+"'/> <input type='button' onclick=\"addCombo('txtCombo"+idname+"','combotext"+counterComboBox+"','myComboBox"+idname+"')\" alt='' class='clickimage' value='Create'/><input type='hidden' id='combotext"+counterComboBox+"' name='combotext"+counterComboBox+"'/>"; counterComboBox++; break; } newdiv.setAttribute('id',idname); document.getElementById(divName).appendChild(newdiv); } function removeElement(parentDiv,childDiv){ if (childDiv == parentDiv) { alert("The parent div cannot be removed."); } else if (document.getElementById(childDiv)) { var child = document.getElementById(childDiv); var parent = document.getElementById(parentDiv); parent.removeChild(child); } else { alert("Child div has already been removed or does not exist."); return false; } } function updatelabel(id) { //var OrigTextval; // alert("hasi"+id); $('label').removeClass("selected"); // OrigTextval = $("#"+id).html(); // alert(OrigTextval); $("#"+id).addClass("selected").html('<input type="text" id="labelname" name="labelname[]" class="edit" value="Entry">'); } function addCombo(txtcmb,txthid,cmb) { var textb = $("input#"+txtcmb).val(); var comboval = $("input#"+txthid).val(); //var combo = document.getElementById("'"+cmb+"'"); var combo = document.getElementById(cmb); var option = document.createElement("option"); option.text = textb; option.value = textb; comboval+=textb+"/"; $("input#"+txthid).val(comboval); try { combo.add(option, null); //Standard }catch(error) { combo.add(option); // IE only } $("input#"+txtcmb).val(""); } </script> <body> <div id="main"> <?php $this->load->view('menu'); ?> <div id="middle"> <?php $this->load->view('leftbar'); ?> <div id="center-column"> <?php $this->load->view('topbar'); ?> <div class="table"> <div id="successdiv" align="center"></div> <p> </p> <div id="templatediv"> </div> <div id="loading" align="center"></div> </div> </div> </div> <?php $this->load->view('footer'); ?> </div> </body> </html>