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.220.7.116


Current Path : /proc/thread-self/root/var/www/misc/public_html/live100/src/
Upload File :
Current File : //proc/thread-self/root/var/www/misc/public_html/live100/src/export_import_setup.php

<?php
//Export Details
function GetExportDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
#Export
$get_export_details="select lim.table_name,ifnull(storage_path,'') as storage_path,
					if(ets.table_name is null,0,1) as checked,ifnull(is_zip,0) as is_zip
					from logisys_import_tables lim 
					left join export_table_setup ets on ets.table_name=lim.table_name order by storage_path desc";
$lobj_export_details = $aobj_context->mobj_db->GetAll($get_export_details); 					

$export_colums.="<table align='center' cellspacing='0' cellpadding='0' border='0' width='50%'>";
$export_colums.=" <tr><td class='act_txtclr' colspan='7' style='background-color:#3D83CC; color:#fff; font-weight:700; width:222px; padding:3px 6px; letter-spacing:0.5pt;'>Export Table SetUp</td></tr>";
$export_colums.="<tr style='background-image:url(../jqGrid3/themes/tarka/images/grid-blue-hd.gif);border-bottom:1px solid #CBC7B8; color:#000; font-weight:700; padding:3px 6px; letter-spacing:0.5pt;'>";
$export_colums.="<td align='center' style='padding:2px; width:50px; border-left:1px solid #ccc; border-right:1px solid #ccc;'>Table</td>";
$export_colums.="<td align='center'  style='padding:2px; width:25px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Select</td>";
$export_colums.="</tr>";
$id=0;
$k=0;
foreach($lobj_export_details as $key=> $value)
  {
	if($k%2==0)
	$class='tbl_row';
	else	
	$class='tbl_row1';	
	
	$is_checked='';		
	
	if($value[checked]==1)
	$is_checked='checked';		
	
	$export_colums.="<tr class={$class} >";
	$export_colums.="<td style='border-left:1px solid #ccc; padding:2px;' id='export_table_setup_table_name_{$id}' style='width: 50px;'>{$value[table_name]}</td>";
	$export_colums.="<td align='center'><input {$is_checked} id='export_table_setup_row_select_{$id}' value='' type='checkbox' style='width: 20px;'></td>";
	$id++;
    $k++;
   }
$export_colums.="</table>";	  
$arr['export_html']=$export_colums;
$arr['export_data']=$lobj_export_details;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
}

function saveExportTablesSetupDetails($aobj_context)
{
include_once("/JSON.php"); 
$json = new Services_JSON();
$export_setup_storage_path= (trim($aobj_context->mobj_data["export_setup_storage_path"]));
$is_zip_check= (trim($aobj_context->mobj_data["is_zip_check"]));
$lstr_param = stripslashes($aobj_context->mobj_data["export_setup_data"]);
$mobj_jsondata = $json->decode($lstr_param);
$larr_export_setup_data = get_object_vars($mobj_jsondata);
 
$truncate_data="truncate export_table_setup";
$lobj_truncate_data = $aobj_context->mobj_db->Execute($truncate_data);				

for( $i = 0; $i < count($larr_export_setup_data); $i++ )
	{
		if($larr_export_setup_data[$i]->export_table_setup_row_select=='1')
		{
		$insert_export_setup_details="insert into export_table_setup(
					storage_path,
					table_name,
					is_zip) values
					(		
					 '".    ($aobj_context->mobj_data["export_setup_storage_path"]) ."',
					'{$larr_export_setup_data[$i]->export_table_setup_table_name}',
					'{$is_zip_check}'
				 	)";					
		 		   
	    $lobj_insert_export_setup_details = $aobj_context->mobj_db->Execute($insert_export_setup_details);				
		}
	}
		if($lobj_insert_export_setup_details)
			{
				$rdata = "Export Table Setup Details inserted Successfully.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
				return $rdata;
			 }
			else
			{
				$rdata = "insertion Failed.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
				return $rdata;			
			}    			   

}

//#######################################Import Details################################################
function GetImportDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$get_import_details="select lim.table_name,ifnull(storage_path,'') as storage_path,
					ifnull(is_delete,0) as is_delete ,if(its.table_name is null,0,1) as checked 
					from logisys_import_tables lim 
					left join import_table_setup its on its.table_name=lim.table_name
					order by storage_path desc;";
$lobj_import_details = $aobj_context->mobj_db->GetAll($get_import_details); 					

$import_colums.="<table align='center' cellspacing='0' cellpadding='0' border='0' width='50%'>";
$import_colums.=" <tr><td class='act_txtclr' colspan='7' style='background-color:#3D83CC; color:#fff; font-weight:700; width:222px; padding:3px 6px; letter-spacing:0.5pt;'>Export Table SetUp</td></tr>";
$import_colums.="<tr style='background-image:url(../jqGrid3/themes/tarka/images/grid-blue-hd.gif);border-bottom:1px solid #CBC7B8; color:#000; font-weight:700; padding:3px 6px; letter-spacing:0.5pt;'>";
$import_colums.="<td align='center' style='padding:2px; width:50px; border-left:1px solid #ccc; border-right:1px solid #ccc;'>Table</td>";
$import_colums.="<td align='center'  style='padding:2px; width:25px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Select</td>";
$import_colums.="<td align='center'  style='padding:2px; width:25px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Delete</td>";
$import_colums.="</tr>";
$id=0;
$k=0;
foreach($lobj_import_details as $key=> $value)
  {
	if($k%2==0)
	$class='tbl_row';
	else	
	$class='tbl_row1';	
	
	$is_select_checked='';		
	$is_delete_checked='';	
	
	if($value[checked]==1)
	$is_select_checked='checked';	    		
	if($value[is_delete]==1)
	$is_delete_checked='checked';	
	
	$import_colums.="<tr class={$class} >";
	$import_colums.="<td style='border-left:1px solid #ccc; padding:2px;' id='import_table_setup_table_name_{$id}' style='width: 50px;'>{$value[table_name]}</td>";
	$import_colums.="<td align='center'><input {$is_select_checked} id='import_table_setup_row_select_{$id}' value='' type='checkbox' style='width: 20px;'></td>";
	$import_colums.="<td align='center'><input {$is_delete_checked} id='import_table_setup_row_delete_{$id}' value='' type='checkbox' style='width: 20px;'></td>";
	$id++;
    $k++;
   }
$import_colums.="</table>";	  
$arr['import_html']=$import_colums;
$arr['import_data']=$lobj_import_details;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");

}
function saveImportTablesSetupDetails($aobj_context)
{
include_once("/JSON.php"); 
$json = new Services_JSON();
$import_setup_storage_path= (trim($aobj_context->mobj_data["import_setup_storage_path"]));
$lstr_param = stripslashes($aobj_context->mobj_data["import_setup_data"]);
$mobj_jsondata = $json->decode($lstr_param);
$larr_import_setup_data = get_object_vars($mobj_jsondata);
 
$truncate_data="truncate import_table_setup";
$lobj_truncate_data = $aobj_context->mobj_db->Execute($truncate_data);				

for( $i = 0; $i < count($larr_import_setup_data); $i++ )
	{
		if($larr_import_setup_data[$i]->import_table_setup_row_select=='1')
		{
		$insert_import_setup_details="insert into import_table_setup(
					storage_path,
					table_name,
					is_delete) values
					(		
					 '{$import_setup_storage_path}',
					'{$larr_import_setup_data[$i]->import_table_setup_table_name}',
					'{$larr_import_setup_data[$i]->import_table_setup_row_delete}' 
				 	)";					
	 //echo $insert_report_setup_details; die();		   
	    $lobj_insert_import_setup_details = $aobj_context->mobj_db->Execute($insert_import_setup_details);				
		}
	}
		if($lobj_insert_import_setup_details)
			{
				$rdata = "Import Table Setup Details inserted Successfully.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
				return $rdata;
			 }
			else
			{
				$rdata = "insertion Failed.";
				print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
				return $rdata;			
			}    			   

}
function appendSlash($path) 
{
	$path_p=substr($path,-1);
	if($path_p!="\\")
	$full_path=$path."\\";
	return $full_path;
	
}
?>