<?php
include("../include/session.php");
include("../include/db.php");
	
		
	if (isset($_GET['new_button']) )
	   {
		 $action='repWiz0.php';
	   }
		 
	if (isset($_GET['finish_button']) )
	  {
		$action='repList.php';
	  }
	
	
	$d = date("d");
	$m = date("m");
	$y = date("Y");
	$modDate=date('Y-m-d');
	$active="1";
		
	
	$account = $_SESSION['company'];
	$last_name = $_SESSION['name'];
	$first_name = $_SESSION['first_name'];
	$designation = $_SESSION['designation'];
	$cell = $_SESSION['cell'];
	$id_number = $_SESSION['idNo'] ;
	$notes = $_SESSION['RemarksText'];
	
	$entered_by = $_SESSION['username'];
	$entry_date = date("Y-m-d");
	
	
		$tocotexQuery = "INSERT INTO nam_rad_representatives (  account, last_name, first_name, designation, cell, id_number, notes) VALUES ( '".$account."', '".$last_name."', '".$first_name."' ,'".$designation."', '".$cell."', '".$id_number."', '".$notes."')"  ;
	echo $tocotexQuery;	
		
	 	execsql($tocotexQuery);
		
		
	
	$actionQuery = "INSERT INTO nam_action_tracking (entry_date, user, action, details) VALUES ('".$entry_date."' ,'".$entered_by."','New Rep:' ,'".$last_name."' )";
	execsql($actionQuery);
	echo $actionQuery;
	
?>
<?php
    $_SESSION['name'] ="";
	 $_SESSION['first_name'] ="";
	 $_SESSION['designation'] ="";
	 $_SESSION['company'] ="";
	 $_SESSION['cell'] ="";
	 $_SESSION['idNo'] ="";
	 $_SESSION['RemarksText'] = "";
	 
     
	 $_SESSION['p'] = 1;
	 $_SESSION['error']=0;
?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="<?php echo $action ?> ";
        -->
       </script>

