<?php include "../../includes/start_ajax.php";



$this_url="mod/customer_page/index.php";
$tab_key_id="cus_id";


if($_REQUEST["tab"]=="")
{
	$tab_selected=1;
}
else
{
	$tab_selected=$_REQUEST["tab"];
}

//---------------------------------------------------



$query_tab_main="SELECT *  
			
			FROM 
			t_".$key_table_prefix."_customer ";
$query_tab_main=$query_tab_main." WHERE $tab_key_id = '".$_REQUEST[$tab_key_id]."';";
$result_tab_main=mysqli_query($dbconn, $query_tab_main)or die("Get Data failed- Err msg  ". mysqli_error($dbconn));
if($line_tab_main=mysqli_fetch_array($result_tab_main,MYSQLI_ASSOC))
{

	include "tab_config.php";

	//part 1: information:--------------------------

	echo "<div class='profile_info_panel' >";
	
	
		echo "<div style='width:50px;height:70px;text-align:center;float:left;margin:5px;background:#fff;border:0px solid #2C3E50;border-radius:5px 5px;color:#000;'>";
			echo '<span class="fa fa-male fa-3x " ></span>';
		echo "</div>";
	//	echo "<br>";
		
	
		echo "<font size=2 color=#1fbad6 ><b>". $line_tab_main["cus_code"]."</b></font><br>";
		echo "<font size=4><b>". $line_tab_main["cus_name"]."</b></font><br>";
		
		
	echo "</div>";


	//part 2: tabs:--------------------------
	echo "<div class='profile_tab_panel' >";



		for($t=1;$t<=count($tab_name);$t++)
		{

		  	if($t==$tab_selected)
		 	{
				echo "<div class='profile_tab_active' onclick=\"mon_send_get('$this_url','?time=".date("H:m:s")."&tab=".$t."".$tab_extra_url."&".$tab_key_id."=".$_REQUEST[$tab_key_id]."','div_main')\">";
				echo "".$tab_name[$t]."";
				echo "</div>";


			}
			else
			{
				echo "<div class='profile_tab_inactive'  onclick=\"mon_send_get('$this_url','?time=".date("H:m:s")."&tab=".$t."".$tab_extra_url."&".$tab_key_id."=".$_REQUEST[$tab_key_id]."','div_main')\">";
				echo "".$tab_name[$t]."";
				echo "</div>";
			}

		}

	echo "</div>";






	//part 3: tabs:--------------------------
	echo "<div class='profile_content_panel' >";

		$tab_extra_url="&".$tab_key_id."=".$_REQUEST[$tab_key_id]."&tab=".$tab_selected."";

		if($_REQUEST[$tab_key_id]=="")
		{
			echo "Error Occur for this Panel, Try to open this account again.";
		}
		else
		{
			include $tab_link[$tab_selected];
		}
	echo "</div>";









}

?>
<?php include "../../includes/end_ajax.php"; ?>
