<?php

echo "<div class='form_panel' align=left >";
	echo "<div class='form_panel_title'>";
	
					
	
	
	
		
		echo "<div class='fa-stack fa-lg'  style='cursor:pointer;float:right;'  onclick=\"document.".$this_form_name.".ui_action.value='';mon_submit_form('".$this_form_name."','".$this_url."')\" >";
			echo "<i class='fa fa-square fa-stack-2x color_red'  ></i><i class='fa fa-times fa-stack-1x color_white' ></i>";
		echo "</div>";

	
	
	
	echo "</div>";
	echo "<div class='form_panel_content'>";
		
		
		
		
			
		echo "<div style='width:96%;padding:1%;margin:1%;box-shadow:0px 0px 3px #888;background:#ECF0F1;'>";
			echo "<b>Search Reversed Transaction: </b>";
			echo "<input type=text class='textbox textbox-l' name='pick_st_reverse_search' value='".$_REQUEST["pick_st_reverse_search"]."' >";
			echo "<div class='fa-stack fa-lg'  style='cursor:pointer;'  onclick=\"document.".$this_form_name.".ui_action.value='PICK_REVERSE';mon_submit_form('".$this_form_name."','".$this_url."')\" >";
				echo "<i class='fa fa-square fa-stack-2x color_grey'  ></i><i class='fa fa-search fa-stack-1x color_white' ></i>";
			echo "</div>";
		
		echo "</div>";
		
		echo "<div style='width:100%;height:400px;overflow:auto;float:left;'>";
		
		
			
		
		
		
		$query_draft = " select * 
					from t_".$key_table_prefix."_stock_transaction_header
					where sth_status = 'DRAFT'
					and sth_module = 'STOCK_TRANSFER'
					";
		if($_REQUEST["pick_st_reverse_search"]!="")
		{
			$query_draft=$query_draft." and (
											sth_doc_no like '%".$_REQUEST["pick_st_reverse_search"]."%'
											or
											sth_date like '%".$_REQUEST["pick_st_reverse_search"]."%'
											
											or
											sth_customer_name like '%".$_REQUEST["pick_st_reverse_search"]."%'
											
											or
											sth_vendor_name like '%".$_REQUEST["pick_st_reverse_search"]."%'
											
											
											or
											sth_reference_no like '%".$_REQUEST["pick_st_reverse_search"]."%'
											or
											sth_remark like '%".$_REQUEST["pick_st_reverse_search"]."%'
											
											
											) ";	
		}
		$query_draft=$query_draft." order by sth_date desc  ";
		
		
		$result_draft = mysqli_query($dbconn,$query_draft);
		while($line_draft = mysqli_fetch_array($result_draft,MYSQLI_ASSOC))
		{
			echo "<div style='width:96%;padding:1%;margin:1%;box-shadow:0px 0px 3px #888;'
			     onclick=\"document.".$this_form_name.".ui_action.value='PICK_REVERSE_DONE';document.".$this_form_name.".load_document_id.value='".$line_draft["sth_id"]."';mon_submit_form('".$this_form_name."','".$this_url."')\"
				>";
				
				//show balance:
				//echo "<span style='float:right;text-align:right;'>";
					//echo "<font size=1 color=#BDC3C7 >".$line_po["poh_date"]."</font>";
				//echo "</span>";
				
				
				//show info:	
				echo "<b>".$line_draft["sth_doc_no"]."</b><br>";
				echo "Date : ".$line_draft["sth_date"]."<br>";
				echo "Customer: ".$line_draft["sth_customer_code"]." ".$line_draft["sth_customer_name"]."<br>";
				echo "Vendor: ".$line_draft["sth_vendor_code"]." ".$line_draft["sth_vendor_name"]."<br>";
				echo "Reference No.: ".$line_draft["sth_reference_no"]."<br>";
				echo "Remark: ".$line_draft["sth_remark"]."<br>";
				
			
			
			
			
			
			echo "</div>";
			
			
		}
		echo "</div>";
		
		
	 
	
	
	echo "</div>";
echo "</div>";

?>