| 1 | <script language="javascript">
|
|---|
| 2 |
|
|---|
| 3 | var ctr;
|
|---|
| 4 |
|
|---|
| 5 | function clearNode(node){
|
|---|
| 6 | var child = node.childNodes[0];
|
|---|
| 7 | while(child != null)
|
|---|
| 8 | {
|
|---|
| 9 | node.removeChild(child);
|
|---|
| 10 | child = node.childNodes[0];
|
|---|
| 11 | }
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | function addRow(table){
|
|---|
| 15 | var targetView = table;
|
|---|
| 16 | var cctr=$('.dataTable tr').length;
|
|---|
| 17 | ctr=cctr+1;
|
|---|
| 18 | // CREATE ELEMENT
|
|---|
| 19 | var newtr = document.createElement("tr");
|
|---|
| 20 | newtr.setAttribute("class","tr");
|
|---|
| 21 | var newtd_c1 = document.createElement("td");
|
|---|
| 22 | newtd_c1.setAttribute("width","147");
|
|---|
| 23 | newtd_c1.setAttribute("align","center");
|
|---|
| 24 | newtd_c1.appendChild(
|
|---|
| 25 | input_data = document.createElement("input"),
|
|---|
| 26 | input_data.setAttribute("type","time"),
|
|---|
| 27 | input_data.setAttribute("size","10"),
|
|---|
| 28 | input_data.setAttribute("autofocus","true"),
|
|---|
| 29 | input_data.setAttribute("hidden","true")
|
|---|
| 30 | );
|
|---|
| 31 | var newtd_c2 = document.createElement("td");
|
|---|
| 32 | newtd_c2.setAttribute("width","138");
|
|---|
| 33 | newtd_c2.setAttribute("align","center");
|
|---|
| 34 | newtd_c2.appendChild(
|
|---|
| 35 | select = document.createElement("select"),
|
|---|
| 36 | select.setAttribute("class","measure"),
|
|---|
| 37 | $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
|
|---|
| 38 | type:"post",
|
|---|
| 39 | url:"Transaction/measurement.php",
|
|---|
| 40 | success:function(data){
|
|---|
| 41 | var obj=$.parseJSON(data);
|
|---|
| 42 | $.each(obj,function(){
|
|---|
| 43 | select.appendChild(
|
|---|
| 44 | option = document.createElement("option"),
|
|---|
| 45 | option.setAttribute('value',this['fMeasurementKey']),
|
|---|
| 46 | option.appendChild(document.createTextNode(this['fMeasurement']))
|
|---|
| 47 | )
|
|---|
| 48 | })
|
|---|
| 49 | }
|
|---|
| 50 | }) // End of retrieving
|
|---|
| 51 | );
|
|---|
| 52 | newtd_c2.setAttribute("width","115");
|
|---|
| 53 | newtd_c2.setAttribute("align","center");
|
|---|
| 54 | newtd_c2.appendChild(
|
|---|
| 55 | input_data = document.createElement("input"),
|
|---|
| 56 | input_data.setAttribute("type","button"),
|
|---|
| 57 | input_data.setAttribute("value","+"),
|
|---|
| 58 | input_data.onclick = function(){ return addRow(newtr);
|
|---|
| 59 | ctr++;
|
|---|
| 60 | }
|
|---|
| 61 | );
|
|---|
| 62 | var newtd_c3 = document.createElement("td");
|
|---|
| 63 | newtd_c3.setAttribute("width","98");
|
|---|
| 64 | newtd_c3.setAttribute("align","center");
|
|---|
| 65 | newtd_c3.appendChild(
|
|---|
| 66 | selection = document.createElement("select"),
|
|---|
| 67 | selection.setAttribute("class","source"),
|
|---|
| 68 | $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
|
|---|
| 69 | type:"post",
|
|---|
| 70 | url:"Transaction/source.php",
|
|---|
| 71 | success:function(data)
|
|---|
| 72 | {
|
|---|
| 73 | var obj = $.parseJSON(data);
|
|---|
| 74 | $.each(obj,function(){
|
|---|
| 75 | selection.appendChild(
|
|---|
| 76 | option=document.createElement('option'),
|
|---|
| 77 | option.setAttribute('value',this['fSourceKEY']),
|
|---|
| 78 | option.appendChild(document.createTextNode(this['fSourceName']))
|
|---|
| 79 | )
|
|---|
| 80 | });
|
|---|
| 81 | }
|
|---|
| 82 | }) // End of retrieving
|
|---|
| 83 | );
|
|---|
| 84 | var newtd_c4 = document.createElement("td");
|
|---|
| 85 | newtd_c4.setAttribute("width","119");
|
|---|
| 86 | newtd_c4.setAttribute("align","center");
|
|---|
| 87 | newtd_c4.appendChild(
|
|---|
| 88 | input_data = document.createElement("input"),
|
|---|
| 89 | input_data.setAttribute("type","text"),
|
|---|
| 90 | input_data.setAttribute("class","selected"),
|
|---|
| 91 | input_data.setAttribute("size","12"),
|
|---|
| 92 | input_data.setAttribute("placeholder","Value")
|
|---|
| 93 | );
|
|---|
| 94 | var newtd_c5 = document.createElement("td");
|
|---|
| 95 | newtd_c5.setAttribute("width","115");
|
|---|
| 96 | newtd_c5.setAttribute("align","center");
|
|---|
| 97 | newtd_c5.appendChild(
|
|---|
| 98 | input_data = document.createElement("input"),
|
|---|
| 99 | input_data.setAttribute("type","button"),
|
|---|
| 100 | input_data.setAttribute("value","Delete"),
|
|---|
| 101 | input_data.onclick = function(){ return clearNode(newtr); }
|
|---|
| 102 | );
|
|---|
| 103 |
|
|---|
| 104 | newtr.appendChild(newtd_c2);
|
|---|
| 105 | newtr.appendChild(newtd_c3);
|
|---|
| 106 | newtr.appendChild(newtd_c4);
|
|---|
| 107 | newtr.appendChild(newtd_c5);
|
|---|
| 108 |
|
|---|
| 109 | $(targetView).after(newtr);
|
|---|
| 110 | }
|
|---|
| 111 | function deleteRow(tableID){
|
|---|
| 112 | try{
|
|---|
| 113 | var table = document.getElementById(tableID);
|
|---|
| 114 | var rowCount = table.rows.length;
|
|---|
| 115 |
|
|---|
| 116 | for(var i = 0; i < rowCount; i++){
|
|---|
| 117 | var row = table.rows[i];
|
|---|
| 118 | var chkbox = row.cells[0].childNodes[0];
|
|---|
| 119 | if(null != chkbox && true == chkbox.checked){
|
|---|
| 120 | if(rowCount <= 1){
|
|---|
| 121 | alert("Cannot delete all the rows.");
|
|---|
| 122 | break;
|
|---|
| 123 | }
|
|---|
| 124 | table.deleteRow(i);
|
|---|
| 125 | rowCount--;
|
|---|
| 126 | i--;
|
|---|
| 127 | }
|
|---|
| 128 | }
|
|---|
| 129 | }catch(e){
|
|---|
| 130 | alert(e);
|
|---|
| 131 | }
|
|---|
| 132 | }
|
|---|
| 133 |
|
|---|
| 134 | <?php
|
|---|
| 135 | $cnt=0;
|
|---|
| 136 | if(isset($_GET['days']))
|
|---|
| 137 | {
|
|---|
| 138 | $day = $_GET['days'];
|
|---|
| 139 | }
|
|---|
| 140 | else
|
|---|
| 141 | {
|
|---|
| 142 | $day =date("Y-m-d");
|
|---|
| 143 | }
|
|---|
| 144 |
|
|---|
| 145 | // $day=$_GET['days'];
|
|---|
| 146 | $days = Date('Y-m-d',strtotime($day));
|
|---|
| 147 | $prev_time = array();
|
|---|
| 148 | ?>
|
|---|
| 149 | function addRowClone1(nextrow){
|
|---|
| 150 | var targetView = document.getElementById("Data");
|
|---|
| 151 | // CREATE ELEMENT
|
|---|
| 152 | // COUNT LIST
|
|---|
| 153 | var list = $(".datalisting").length;
|
|---|
| 154 | var newlist = list+1;
|
|---|
| 155 | var cctr=$('.dataTable tr').length;
|
|---|
| 156 | ctr=cctr+1;
|
|---|
| 157 | var newdiv = document.createElement("div");
|
|---|
| 158 | newdiv.setAttribute("id","list_"+newlist);
|
|---|
| 159 | newdiv.setAttribute("class","datalisting");
|
|---|
| 160 | newdiv.setAttribute("style","margin:5px 0;");
|
|---|
| 161 | var newtable = document.createElement("table");
|
|---|
| 162 | newtable.setAttribute("class","dataTable");
|
|---|
| 163 | newtable.setAttribute("width","100%");
|
|---|
| 164 | newtable.setAttribute("border","1");
|
|---|
| 165 | newtable.setAttribute("cellspacing","0");
|
|---|
| 166 | newtable.setAttribute("cellpadding","0");
|
|---|
| 167 | var newInnertable = document.createElement("table");
|
|---|
| 168 | newInnertable.setAttribute("class","dataTable");
|
|---|
| 169 | newInnertable.setAttribute("width","100%");
|
|---|
| 170 | newInnertable.setAttribute("border","1");
|
|---|
| 171 |
|
|---|
| 172 | newInnertable.setAttribute("cellspacing","0");
|
|---|
| 173 | newInnertable.setAttribute("cellpadding","0");
|
|---|
| 174 |
|
|---|
| 175 | var newtr = document.createElement("tr");
|
|---|
| 176 | newtr.setAttribute('class','tr');
|
|---|
| 177 | var newtd_c1 = document.createElement("td");
|
|---|
| 178 | newtd_c1.setAttribute("width","200");
|
|---|
| 179 | newtd_c1.setAttribute("align","center");
|
|---|
| 180 | newtd_c1.appendChild(
|
|---|
| 181 | input_data = document.createElement("input"),
|
|---|
| 182 | input_data.setAttribute("type","time"),
|
|---|
| 183 | input_data.setAttribute("class","time"),
|
|---|
| 184 | input_data.setAttribute("size","10"),
|
|---|
| 185 | input_data.setAttribute("autofocus","true")
|
|---|
| 186 | );
|
|---|
| 187 | newtd_c1.appendChild(
|
|---|
| 188 | input_data = document.createElement("input"),
|
|---|
| 189 | input_data.setAttribute("type","button"),
|
|---|
| 190 | input_data.setAttribute("value","+"),
|
|---|
| 191 | input_data.onclick = function(){
|
|---|
| 192 | addRowClone1("list_"+newlist);
|
|---|
| 193 | }
|
|---|
| 194 | );
|
|---|
| 195 | var newtd_c2 = document.createElement("td");
|
|---|
| 196 |
|
|---|
| 197 | newtd_c2.setAttribute("width","138");
|
|---|
| 198 | newtd_c2.setAttribute("align","center");
|
|---|
| 199 | newtd_c2.appendChild(
|
|---|
| 200 | select = document.createElement("select"),
|
|---|
| 201 | select.setAttribute("class","measure"),
|
|---|
| 202 | $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
|
|---|
| 203 | type:"post",
|
|---|
| 204 | url:"Transaction/measurement.php",
|
|---|
| 205 | success:function(data){
|
|---|
| 206 | var obj=$.parseJSON(data);
|
|---|
| 207 | $.each(obj,function(){
|
|---|
| 208 | select.appendChild(
|
|---|
| 209 | option = document.createElement("option"),
|
|---|
| 210 | option.setAttribute('value',this['fMeasurementKey']),
|
|---|
| 211 | option.appendChild(document.createTextNode(this['fMeasurement']))
|
|---|
| 212 | )
|
|---|
| 213 | })
|
|---|
| 214 |
|
|---|
| 215 | }
|
|---|
| 216 | }) // End of retrieving
|
|---|
| 217 |
|
|---|
| 218 | );
|
|---|
| 219 | newtd_c2.setAttribute("width","115");
|
|---|
| 220 | newtd_c2.setAttribute("align","center");
|
|---|
| 221 | newtd_c2.appendChild(
|
|---|
| 222 | input_data = document.createElement("input"),
|
|---|
| 223 | input_data.setAttribute("type","button"),
|
|---|
| 224 | input_data.setAttribute("value","+"),
|
|---|
| 225 | input_data.onclick = function(){
|
|---|
| 226 | return addRow(newtr);
|
|---|
| 227 | ctr++;
|
|---|
| 228 | });
|
|---|
| 229 | var newtd_c3 = document.createElement("td");
|
|---|
| 230 | newtd_c3.setAttribute("width","98");
|
|---|
| 231 | newtd_c3.setAttribute("align","center");
|
|---|
| 232 | newtd_c3.appendChild(
|
|---|
| 233 | selection = document.createElement("select"),
|
|---|
| 234 | selection.setAttribute("class","source"),
|
|---|
| 235 | $.ajax({ //Retrieving Measurement name and id in Database september 13,2013 modify by Jaypee Tanio
|
|---|
| 236 | type:"post",
|
|---|
| 237 | url:"Transaction/source.php",
|
|---|
| 238 | success:function(data)
|
|---|
| 239 | {
|
|---|
| 240 | var obj = $.parseJSON(data);
|
|---|
| 241 | $.each(obj,function(){
|
|---|
| 242 | selection.appendChild(
|
|---|
| 243 | option=document.createElement('option'),
|
|---|
| 244 | option.setAttribute('value',this['fSourceKEY']),
|
|---|
| 245 | option.appendChild(document.createTextNode(this['fSourceName']))
|
|---|
| 246 | )
|
|---|
| 247 | });
|
|---|
| 248 | }
|
|---|
| 249 | }) // End of retrieving
|
|---|
| 250 | );
|
|---|
| 251 | var newtd_c4 = document.createElement("td");
|
|---|
| 252 | newtd_c4.setAttribute("width","119");
|
|---|
| 253 | newtd_c4.setAttribute("align","center");
|
|---|
| 254 | newtd_c4.appendChild(
|
|---|
| 255 | input_data = document.createElement("input"),
|
|---|
| 256 | input_data.setAttribute("type","text"),
|
|---|
| 257 | input_data.setAttribute("class","selected"),
|
|---|
| 258 | input_data.setAttribute("size","12"),
|
|---|
| 259 | input_data.setAttribute("placeholder","Value")
|
|---|
| 260 | );
|
|---|
| 261 | var newtd_c5 = document.createElement("td");
|
|---|
| 262 | newtd_c5.setAttribute("width","115");
|
|---|
| 263 | newtd_c5.setAttribute("align","center");
|
|---|
| 264 | newtd_c5.setAttribute("width","115");
|
|---|
| 265 | newtd_c5.setAttribute("align","center");
|
|---|
| 266 | newtd_c5.appendChild(
|
|---|
| 267 | input_data = document.createElement("input"),
|
|---|
| 268 | input_data.setAttribute("type","button"),
|
|---|
| 269 | input_data.setAttribute("value","Delete"),
|
|---|
| 270 | input_data.onclick = function(){ return clearNode(newtr);
|
|---|
| 271 | }
|
|---|
| 272 | );
|
|---|
| 273 | newtr.appendChild(newtd_c2);
|
|---|
| 274 | newtr.appendChild(newtd_c3);
|
|---|
| 275 | newtr.appendChild(newtd_c4);
|
|---|
| 276 | newtr.appendChild(newtd_c5);
|
|---|
| 277 | newInnertable.appendChild(newtr);
|
|---|
| 278 | var newtd_c6 = document.createElement("td");
|
|---|
| 279 | newtd_c6.appendChild(newInnertable);
|
|---|
| 280 |
|
|---|
| 281 | var newtd_c7 = document.createElement("td");
|
|---|
| 282 | newtd_c7.setAttribute("width","115");
|
|---|
| 283 | newtd_c7.setAttribute("align","center");
|
|---|
| 284 | newtd_c7.appendChild(
|
|---|
| 285 | input_data = document.createElement("input"),
|
|---|
| 286 | input_data.setAttribute("type","button"),
|
|---|
| 287 | input_data.setAttribute("value","Delete Main"),
|
|---|
| 288 | input_data.onclick = function(){ return clearNode(newdiv); }
|
|---|
| 289 | );
|
|---|
| 290 |
|
|---|
| 291 | var newOutertr = document.createElement("tr");
|
|---|
| 292 |
|
|---|
| 293 | newtable.appendChild(newtd_c1);
|
|---|
| 294 | newtable.appendChild(newtd_c6);
|
|---|
| 295 | newtable.appendChild(newtd_c7);
|
|---|
| 296 |
|
|---|
| 297 | newdiv.appendChild(newtable);
|
|---|
| 298 |
|
|---|
| 299 | if(nextrow != null){
|
|---|
| 300 | var doc = document.getElementById(nextrow);
|
|---|
| 301 | $(doc).after(newdiv);
|
|---|
| 302 | }else{
|
|---|
| 303 | targetView.appendChild(newdiv);
|
|---|
| 304 | }
|
|---|
| 305 | }
|
|---|
| 306 |
|
|---|
| 307 | function addRowClone(nextrow){
|
|---|
| 308 | <?php
|
|---|
| 309 | $fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart) = '$days' ORDER BY fScheduleID ASC, fMeasurementID ASC") or die(mysql_error());
|
|---|
| 310 | $cnt3=0;
|
|---|
| 311 | $cnt2=0;
|
|---|
| 312 | $cnt4 = 0;
|
|---|
| 313 | $cnt5 = 0;
|
|---|
| 314 | //$data = array();
|
|---|
| 315 | //$counter=0;
|
|---|
| 316 | $prevtimestamp = 0;
|
|---|
| 317 |
|
|---|
| 318 | while($rows = mysql_fetch_array($fetch))
|
|---|
| 319 | {
|
|---|
| 320 | $scheduleId = $rows['fScheduleID'];
|
|---|
| 321 | $timestamp=strtotime($rows['fStart']);
|
|---|
| 322 | $timestamp2 = date('Y-m-d',$timestamp);
|
|---|
| 323 | $date_time = date('H:i:s',$timestamp);
|
|---|
| 324 | $prev_time[$cnt3]= $date_time;
|
|---|
| 325 | ?>
|
|---|
| 326 | $('#save').attr('value','UPDATE');
|
|---|
| 327 | var targetView = document.getElementById("Data");
|
|---|
| 328 | // CREATE ELEMENT
|
|---|
| 329 | // COUNT LIST
|
|---|
| 330 | var list = $(".datalisting").length;
|
|---|
| 331 | var newlist = list+1;
|
|---|
| 332 |
|
|---|
| 333 | var cctr=$('.dataTable tr').length;
|
|---|
| 334 | ctr=cctr+1;
|
|---|
| 335 |
|
|---|
| 336 | var newdiv = document.createElement("div");
|
|---|
| 337 | newdiv.setAttribute("id","list_"+newlist);
|
|---|
| 338 | newdiv.setAttribute("class","datalisting");
|
|---|
| 339 | newdiv.setAttribute("style","margin:5px 0;");
|
|---|
| 340 |
|
|---|
| 341 | var newtable = document.createElement("table");
|
|---|
| 342 | newtable.setAttribute("class","dataTable");
|
|---|
| 343 | newtable.setAttribute("width","100%");
|
|---|
| 344 | newtable.setAttribute("border","1");
|
|---|
| 345 | newtable.setAttribute("cellspacing","0");
|
|---|
| 346 | newtable.setAttribute("cellpadding","0");
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 | var newInnertable = document.createElement("table");
|
|---|
| 350 | newInnertable.setAttribute("class","dataTable");
|
|---|
| 351 | newInnertable.setAttribute("width","100%");
|
|---|
| 352 | newInnertable.setAttribute("border","1");
|
|---|
| 353 |
|
|---|
| 354 | newInnertable.setAttribute("cellspacing","0");
|
|---|
| 355 | newInnertable.setAttribute("cellpadding","0");
|
|---|
| 356 |
|
|---|
| 357 | var newtd_c1 = document.createElement("td");
|
|---|
| 358 | newtd_c1.setAttribute("width","200");
|
|---|
| 359 | newtd_c1.setAttribute("align","center");
|
|---|
| 360 | newtd_c1.appendChild(
|
|---|
| 361 | input_data = document.createElement("input"),
|
|---|
| 362 | input_data.setAttribute("type","time"),
|
|---|
| 363 | input_data.setAttribute("class","time"),
|
|---|
| 364 | input_data.setAttribute("size","10"),
|
|---|
| 365 | input_data.setAttribute("value","<?php echo $date_time; ?>"),
|
|---|
| 366 | input_data.setAttribute("autofocus","true")
|
|---|
| 367 | );
|
|---|
| 368 | newtd_c1.appendChild(
|
|---|
| 369 | input_data = document.createElement("input"),
|
|---|
| 370 | input_data.setAttribute("type","button"),
|
|---|
| 371 | input_data.setAttribute("value","+"),
|
|---|
| 372 | input_data.onclick = function(){
|
|---|
| 373 | addRowClone1("list_<?php echo $cnt+1; ?>");
|
|---|
| 374 | }
|
|---|
| 375 | );
|
|---|
| 376 |
|
|---|
| 377 | var newtr<?php echo $cnt; ?> = document.createElement("tr");
|
|---|
| 378 | newtr<?php echo $cnt; ?>.setAttribute('class','tr');
|
|---|
| 379 |
|
|---|
| 380 | var newtd_c2 = document.createElement("td");
|
|---|
| 381 | newtd_c2.setAttribute("width","138");
|
|---|
| 382 | newtd_c2.setAttribute("align","center");
|
|---|
| 383 | newtd_c2.appendChild(
|
|---|
| 384 | selection = document.createElement("select"),
|
|---|
| 385 | <?php
|
|---|
| 386 | $selectm = mysql_query("SELECT * FROM measurement");
|
|---|
| 387 | while($rowmeasure = mysql_fetch_array($selectm))
|
|---|
| 388 | {
|
|---|
| 389 | ?>
|
|---|
| 390 | selection.appendChild(
|
|---|
| 391 | option = document.createElement("option"),
|
|---|
| 392 | option.setAttribute("value","<?php echo $rowmeasure['fMeasurementKey']; ?>"),
|
|---|
| 393 | <?php if($rows['fMeasurementTypeKey']==$rowmeasure['fMeasurementKey']){ echo "option.setAttribute('selected',true),";} ?>
|
|---|
| 394 | option.appendChild(document.createTextNode("<?php echo $rowmeasure['fMeasurement']; ?>"))
|
|---|
| 395 | ),
|
|---|
| 396 | <?php
|
|---|
| 397 | }
|
|---|
| 398 | ?>
|
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 | selection.setAttribute('id','measure'),
|
|---|
| 402 | selection.setAttribute('class','measure')
|
|---|
| 403 | );
|
|---|
| 404 | newtd_c2.setAttribute("width","115");
|
|---|
| 405 | newtd_c2.setAttribute("align","center");
|
|---|
| 406 | newtd_c2.appendChild(
|
|---|
| 407 | input_data = document.createElement("input"),
|
|---|
| 408 | input_data.setAttribute("type","button"),
|
|---|
| 409 | input_data.setAttribute("value","+"),
|
|---|
| 410 | input_data.onclick = function(){
|
|---|
| 411 | return addRow(newtr<?php echo $cnt; ?>);
|
|---|
| 412 | ctr++;
|
|---|
| 413 | });
|
|---|
| 414 | var newtd_c3 = document.createElement("td");
|
|---|
| 415 | newtd_c3.setAttribute("width","98");
|
|---|
| 416 | newtd_c3.setAttribute("align","center");
|
|---|
| 417 | newtd_c3.appendChild(
|
|---|
| 418 | selection = document.createElement("select"),
|
|---|
| 419 | <?php
|
|---|
| 420 | $select = mysql_query("SELECT * FROM source");
|
|---|
| 421 | while($rowsource = mysql_fetch_array($select))
|
|---|
| 422 | {
|
|---|
| 423 | ?>
|
|---|
| 424 | selection.appendChild(
|
|---|
| 425 | option = document.createElement("option"),
|
|---|
| 426 | option.setAttribute('value','<?php echo $rowsource['fSourceKEY']; ?>'),
|
|---|
| 427 | <?php if($rows['fSourceKey'] == $rowsource['fSourceKEY']){ echo "option.setAttribute('selected',true),"; } ?>
|
|---|
| 428 | option.appendChild(document.createTextNode("<?php echo $rowsource['fSourceName']; ?>"))
|
|---|
| 429 | ),
|
|---|
| 430 | <?php
|
|---|
| 431 | }
|
|---|
| 432 | ?>
|
|---|
| 433 |
|
|---|
| 434 | selection.setAttribute('id','source'), // End of retrieving
|
|---|
| 435 | selection.setAttribute('class','source') // End of retrieving
|
|---|
| 436 | );
|
|---|
| 437 | var newtd_c4 = document.createElement("td");
|
|---|
| 438 | newtd_c4.setAttribute("width","119");
|
|---|
| 439 | newtd_c4.setAttribute("align","center");
|
|---|
| 440 | newtd_c4.appendChild(
|
|---|
| 441 | input_data = document.createElement("input"),
|
|---|
| 442 | input_data.setAttribute("type","text"),
|
|---|
| 443 | input_data.setAttribute("class","selected"),
|
|---|
| 444 | input_data.setAttribute("size","12"),
|
|---|
| 445 | input_data.setAttribute("value","<?php echo $rows['fData']; ?>"),
|
|---|
| 446 | input_data.setAttribute("placeholder","Value")
|
|---|
| 447 | );
|
|---|
| 448 | var newtd_c5 = document.createElement("td");
|
|---|
| 449 | newtd_c5.setAttribute("width","115");
|
|---|
| 450 | newtd_c5.setAttribute("align","center");
|
|---|
| 451 | newtd_c5.setAttribute("width","115");
|
|---|
| 452 | newtd_c5.setAttribute("align","center");
|
|---|
| 453 | newtd_c5.appendChild(
|
|---|
| 454 | input_data = document.createElement("input"),
|
|---|
| 455 | input_data.setAttribute("type","button"),
|
|---|
| 456 | input_data.setAttribute("value","Delete"),
|
|---|
| 457 | input_data.onclick = function(){ return clearNode(newtr<?php echo $cnt; ?>);
|
|---|
| 458 | }
|
|---|
| 459 | );
|
|---|
| 460 |
|
|---|
| 461 | newtr<?php echo $cnt; ?>.appendChild(newtd_c2);
|
|---|
| 462 | newtr<?php echo $cnt; ?>.appendChild(newtd_c3);
|
|---|
| 463 | newtr<?php echo $cnt; ?>.appendChild(newtd_c4);
|
|---|
| 464 | newtr<?php echo $cnt; ?>.appendChild(newtd_c5);
|
|---|
| 465 | newInnertable.appendChild(newtr<?php echo $cnt; ?>);
|
|---|
| 466 |
|
|---|
| 467 | var newtd_c6 = document.createElement("td");
|
|---|
| 468 | newtd_c6.appendChild(newInnertable);
|
|---|
| 469 |
|
|---|
| 470 | var newtd_c7 = document.createElement("td");
|
|---|
| 471 | newtd_c7.setAttribute("width","115");
|
|---|
| 472 | newtd_c7.setAttribute("align","center");
|
|---|
| 473 | newtd_c7.appendChild(
|
|---|
| 474 | input_data = document.createElement("input"),
|
|---|
| 475 | input_data.setAttribute("type","button"),
|
|---|
| 476 | input_data.setAttribute("value","Delete Main"),
|
|---|
| 477 | input_data.onclick = function(){ return clearNode(newdiv); }
|
|---|
| 478 | );
|
|---|
| 479 |
|
|---|
| 480 | var newOutertr = document.createElement("tr");
|
|---|
| 481 |
|
|---|
| 482 | newtable.appendChild(newtd_c1);
|
|---|
| 483 | newtable.appendChild(newtd_c6);
|
|---|
| 484 | newtable.appendChild(newtd_c7);
|
|---|
| 485 |
|
|---|
| 486 | newdiv.appendChild(newtable);
|
|---|
| 487 |
|
|---|
| 488 | if(nextrow != null){
|
|---|
| 489 | var doc = document.getElementById(nextrow);
|
|---|
| 490 | $(doc).after(newdiv);
|
|---|
| 491 | } else {
|
|---|
| 492 | targetView.appendChild(newdiv);
|
|---|
| 493 | //$(targetView).after(newtr<?php echo $cnt; ?>);
|
|---|
| 494 | }
|
|---|
| 495 | <?php
|
|---|
| 496 | //$rows = mysql_fetch_array($fetch);
|
|---|
| 497 |
|
|---|
| 498 | $cnt++;
|
|---|
| 499 | $prevtimestamp = $timestamp;
|
|---|
| 500 | }
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 | if(mysql_num_rows($fetch)<1)
|
|---|
| 504 | {
|
|---|
| 505 | ?>
|
|---|
| 506 | $('#save').attr('value','SAVE');
|
|---|
| 507 | addRowClone1();
|
|---|
| 508 | <?php
|
|---|
| 509 | }
|
|---|
| 510 |
|
|---|
| 511 | ?>
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 | }
|
|---|
| 515 | </script>
|
|---|
| 516 |
|
|---|