Code Duplication    Length = 37-43 lines in 2 locations

programs/utilit/entry.class.php 1 location

@@ 546-582 (lines=37) @@
543
			$babDB->db_query($req);
544
545
546
		} else {
547
548
			$babDB->db_query("
549
				INSERT INTO absences_entries
550
				(
551
					id_user,
552
					date_begin,
553
					date_end,
554
					comment,
555
					`createdOn`,
556
					`date`,
557
					idfai,
558
					status,
559
					comment2,
560
					id_approver,
561
					folder,
562
					creation_type
563
				)
564
				VALUES
565
				(
566
					".$babDB->quote($this->id_user).",
567
					".$babDB->quote($this->date_begin).",
568
					".$babDB->quote($this->date_end).",
569
					".$babDB->quote($this->comment).",
570
					".$babDB->quote($this->createdOn).",
571
					".$babDB->quote($this->date).",
572
					".$babDB->quote($this->idfai).",
573
					".$babDB->quote($this->status).",
574
					".$babDB->quote($this->comment2).",
575
					".$babDB->quote($this->id_approver).",
576
					".$babDB->quote($this->folder).",
577
					".$babDB->quote($this->creation_type)."
578
				)
579
			");
580
581
			$this->id = $babDB->db_insert_id();
582
		}
583
584
585
	}

programs/utilit/movement.class.php 1 location

@@ 312-354 (lines=43) @@
309
		}
310
	
311
	
312
		if (isset($this->id))
313
		{
314
	
315
			$babDB->db_query("
316
				UPDATE absences_movement
317
				SET
318
					comment	=".$babDB->quote($this->comment)." 
319
				WHERE
320
					id=".$babDB->quote($this->id)."
321
			");
322
	
323
	
324
		} else {
325
	
326
			$babDB->db_query("
327
				INSERT INTO absences_movement
328
				(
329
					id_user,
330
					id_right,
331
					id_request,
332
					request_class,
333
					id_author,
334
					comment,
335
					createdOn,
336
					message,
337
			        status
338
				)
339
				VALUES
340
					(
341
					".$babDB->quote($this->id_user).",
342
					".$babDB->quote($this->id_right).",
343
					".$babDB->quote($this->id_request).",
344
					".$babDB->quote($this->request_class).",
345
					".$babDB->quote($this->id_author).",
346
					".$babDB->quote($this->comment).",
347
					".$babDB->quote($this->createdOn).",
348
					".$babDB->quote($this->message).",
349
			        ".$babDB->quoteOrNull($this->status)."
350
				)
351
			");
352
	
353
			$this->id = $babDB->db_insert_id();
354
		}
355
	}
356
}
357