	<?php
	
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
  
  	include("configi.php");


  $theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string($conn, $theValue) : mysqli_escape_string($conn, $theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

	 include 'configi.php';	

	$phx_result = "";
	$new_item_amount = 0;

	
	$prod_uid 				=  $_REQUEST['prod_uid'];
	$action					=  $_REQUEST['action'];

	
	$result = '';
	
	$cart_id	= 0;
	
	 include 'configi.php';

	$phxcrmuserid = $_COOKIE['phxcrmuserid'];
	
	
	if ($action == "addpick"){



		$queryupd1="insert into ".$_COOKIE['phxcrmclient_id']."_prodserv_quickpick(qp_prodserv_uid, qp_order) values (".$prod_uid.",1)";
	
		$resultupd1=mysqli_query($conn, $queryupd1);
		
		$phx_result = "";
		
	
	}else if ($action == "rempick"){



		$querydelitem="delete from ".$_COOKIE['phxcrmclient_id']."_prodserv_quickpick where qp_prodserv_uid = " . $prod_uid;
	
		//	echo $querydelitem;
		$resultdelitem=mysqli_query($conn, $querydelitem);

		
		$phx_result = "";		
	
	}
	
	$outputarray = array('phx_result' => $phx_result, 'new_item_amount' => $new_item_amount);

//		echo $outputarray;
		

	$output2 = json_encode($outputarray);
	
	echo $output2;

	exit;
	
			
			?>