editable autofill

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
D Oliveira
Veteran Member
Posts: 51
Joined: 2018-03-04 09:30

editable autofill

Post by D Oliveira » 2018-03-06 12:35

can anyone shed some light on how to reproduce this feature?

https://www.youtube.com/watch?v=B0ZJNMX0Rwk

the author shared this code with me but cant really discern it

Code: Select all

<?php
// This script and data application were generated by AppGini 5.42
// Download AppGini for free from http://bigprof.com/appgini/download/

	$currDir=dirname(__FILE__);
	include("$currDir/defaultLang.php");
	include("$currDir/language.php");
	include("$currDir/lib.php");
	include_once("{$currDir}/cresenture/function_cresenture.php");

	header("Content-type: text/javascript; charset=UTF-8");

	$mfk=$_GET['mfk'];
	$id=makeSafe($_GET['id']);
	$rnd1=intval($_GET['rnd1']); if(!$rnd1) $rnd1='';

	if(!$mfk){
		die('// no js code available!');
	}

	switch($mfk){

		case 'nouse':
			if(!$id){
				?>
				$('work_extra_1<?php echo $rnd1; ?>').innerHTML='&nbsp;';
				<?php
				break;
			}
			$res = sql("SELECT `tbl_work_template_item`.`work_template_id` as 'work_template_id', IF(    CHAR_LENGTH(`tbl_category1`.`category_title`), CONCAT_WS('',   `tbl_category1`.`category_title`), '') as 'work_template_cat_id', `tbl_work_template_item`.`work_template_title` as 'work_template_title', `tbl_work_template_item`.`work_template_description` as 'work_template_description', `tbl_work_template_item`.`work_template_amt` as 'work_template_amt', if(`tbl_work_template_item`.`work_template_date_issued`,date_format(`tbl_work_template_item`.`work_template_date_issued`,'%d/%m/%Y'),'') as 'work_template_date_issued', `tbl_work_template_item`.`work_template_qty` as 'work_template_qty', `tbl_work_template_item`.`work_template_extra_1` as 'work_template_extra_1', `tbl_work_template_item`.`work_template_extra_2` as 'work_template_extra_2', `tbl_work_template_item`.`work_template_extra_3` as 'work_template_extra_3', `tbl_work_template_item`.`work_template_date_modified` as 'work_template_date_modified', `tbl_work_template_item`.`work_template_record_status` as 'work_template_record_status', `tbl_work_template_item`.`work_template_remarks` as 'work_template_remarks', `tbl_work_template_item`.`nouse` as 'nouse' FROM `tbl_work_template_item` LEFT JOIN `tbl_category` as tbl_category1 ON `tbl_category1`.`category_id`=`tbl_work_template_item`.`work_template_cat_id`  WHERE `tbl_work_template_item`.`work_template_id`='$id' limit 1", $eo);
			$row = db_fetch_assoc($res);
			$work_template_title = trim($row['work_template_title']);
			$work_template_description = pureHTML_TEXTAREA($row['work_template_description']);
			$work_template_amt = $row['work_template_amt'];
			$work_template_qty = $row['work_template_qty'];
			
			?>
			document.getElementById("work_title").value = "<?php echo $work_template_title;?>";
			document.getElementById("work_amt").value = "<?php echo $work_template_amt;?>";
			document.getElementById("work_qty").value = "<?php echo $work_template_qty;?>";
			tinymce.get('work_description').setContent("<?php echo $work_template_description;?>");
			<?php
			break;


	}

?>

User avatar
D Oliveira
Veteran Member
Posts: 51
Joined: 2018-03-04 09:30

Re: editable autofill

Post by D Oliveira » 2018-03-06 20:08

found the answer in the udemy course, if anyone is wondering the same go to section 10 lecture 26

Post Reply