0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.117.93.183


Current Path : /var/www/oasis/js_old/
Upload File :
Current File : /var/www/oasis/js_old/openPopUp.js

$g_clicked_id_system_name="";
$all_data_obj=new Object();
function calingScript($aint_module_code,$txt_id,$astr_ref_module_name)
{	
	var clicked_txt_id='details_'+$txt_id;
	$g_clicked_id_system_name=array_flip($html_id_arr)[clicked_txt_id];
	$all_data_obj=new Object();
	jQuery.each($html_id_arr,function (ak,av){
	$all_data_obj[ak]=new Object();
	$all_data_obj[ak]=$('#'+av).val();
	});	
	$all_data_obj = JSON.stringify($all_data_obj); 
	if("#txt_ref_schema_666" !="#txt_ref_schema_"+$txt_id) //reference field in  indents to order
	{
		if($("#txt_ref_schema_"+$txt_id).attr("readonly") == false)
		{	
			window.$g_ref_module_code = $aint_module_code;
			window.$g_ref_module_name = $astr_ref_module_name;
			window.$g_txt_ref_schema_code = $txt_id;
			window.$flag = 0;
				showpopup();
			var s = $("#txt_ref_schema_"+$txt_id).position();	
			var Left = s.left;
			if(Left>500)
			{
			Left=Left-(425-$("#txt_ref_schema_"+$txt_id).width());
			}
			var Top = s.top+100;
			//alert(Top);

			$('#dialog').dialog('open');
			$("#dialog").data("width.dialog", 522);
			$("#dialog").data("position",[Top,Left]);
			var ref_module_name=window.$g_ref_module_name.replace(/~/g," ");
			$('#ui-dialog-title-dialog').html(ref_module_name);
		}
	}
	//$("#jq_grid_head_div").hide();

	//$("#dialog").css({position: 'absolute',left: Left,top: Top});
	//$("#dialog").data("left",Left);
	//$("#dialog").data("top",Top);
	//$('#dialog').css( {position: 'absolute',left: Left,top: Top} );	
	/*$('#window').show();
	$astr_ref_module_name = $astr_ref_module_name.replace(/~/g, " ");
	$('#windowTopContent').html($astr_ref_module_name);
	
	$('#windowContent').width(430);
	$('#window').width(455); */
}

function calingScriptGroup($aint_module_code,$txt_id,$id)
{
window.$g_ref_s_ref_field_value=trim(document.getElementById("txt_ref_schema_"+$id).value);
	window.$g_ref_module_code = $aint_module_code;
	window.$g_txt_ref_schema_code = $txt_id;
	window.$g_txt_ref_schema_code_with_out_table_name = $id;
	window.$flag = 1;	
}

function showpopup()
{
	$.ajax({
	     type: "POST",
		 async: false,
		  url: $host_url+"getRefModuleColumnName.demo",
		   data:"internal_code="+window.$g_ref_module_code+'&html_field_id='+window.$g_txt_ref_schema_code,
	       success: getRefModuleColumnResponse
		});
	
	} 
function getRefModuleColumnResponse($responce)
	{
		$responce = eval('(' + $responce + ')');
		if($responce.error_code==0)
		{
			$g_ref_data_arr=$responce ;
			$search_ref_module_db_field=0;
			 $search_ref_module_value="";
			 $pop_up_data=$responce.data.pop_up_data; 
			if($responce.data.filter_data!="")
			{
				  $search_ref_module_db_field=$responce.data.filter_data.db_field;
				 
				if($responce.data.filter_data.ref_module_code_ref_field_on>0)
					{
						  $search_ref_module_value=$("#details_"+$responce.data.filter_data.ref_module_code_ref_field_on).val();
					}
					else
					{
						  $search_ref_module_value=$responce.data.filter_data.ref_module_code_ref_field_const;
						 $search_ref_module_value=  $search_ref_module_value.replace(/ /g, "~")
					}
			}
			 
			
		}
		 getGridForUserSchemaPopUPs();
		
	}

$host_url= getCookie('host_url');
$image_path= getCookie('image_path');
var $g_ref_data_arr='';
var $search_ref_module_db_field=0;
var $search_ref_module_value=0;
function  getGridForUserSchemaPopUPs()
{
document.getElementById('dialog').innerHTML="";
$main="";
var file_name="pop_up_module_"+window.$g_ref_module_code+".js";
$main="<table id='table_grid1' class='scroll'   ondblclick='addPopUpElement();'></table> <div id='sub_grid_div1' class='scroll' style='text-align:center;'></div>";
	document.getElementById('dialog').innerHTML=$main+"<div><span id='open_popup_value'> </span><div>";
var th = document.getElementsByTagName('head')[0];
var s = document.createElement('script');
s.setAttribute('type','text/javascript');
s.setAttribute('src','grid_display_files/'+file_name);
th.appendChild(s); 

 //$("#tarka_jq_grid_head_div_"+$g_str_module_id+"_"+$g_ref_module_code).hide();
}
function openNewWindow($aint_module_code,$astr_module_name)
{
	getModulesDetailsNewWindow($astr_module_name,$aint_module_code,'Add',$g_display_module_name);
}
function getKeyData(event)
{
var kC  = (event.which) ? event.which : event.keyCode;
alert(kC);
}
function addPopUpElement()
{
	var id=jQuery("#table_grid1").getGridParam('selrow'); 
	if(id > 0) 
	{ 
	AssignPopUPvalueToTextBox(id);
	$('#dialog').dialog('close');
	} 
	else
	{ 
		alert("Please select row"); return;
	}
}

function  DisplayPopUpDetailsValues(id)
{
var data=jQuery("#table_grid1").getRowData(id);
var pop_up_data="";
	jQuery.each(data, function(k, v) {	
			pop_up_data+=$pop_up_data[k]+" : "+v+"<br>";
			 
			});
	$("#open_popup_value").html(pop_up_data);		
}

/* document.onkeydown = function(evt){

 var charCode = (evt.which) ? evt.which : event.keyCode;

if(charCode=='13')
addPopUpElement()
} */
 
function GetPopUpelementValue()
{
 var gsr = jQuery("#table_grid1").getGridParam('selrow');
 if(gsr){ 
 addPopUpElement(); 
 } else { alert("Please select Row") } 
 }