<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
//
$CM=V($_GET['C']);
$P1=V($_GET['P1']);
$P2=V($_GET['P2']);
$P3=V($_GET['P3']);
$P4=V($_GET['P4']);
$P5=V($_GET['P5']);
$P6=V($_GET['P6']);
$P7=V($_GET['P7']);	
//
if($CM=="VV"){
	$D=gn("id_comprobante","comprobantes","com_nombre='$P1'");;
	$S=vbval($P2);
	$N=vbval($P3);
	$I=gn("id_venta","ventas","id_com=$D AND iser=$S AND inum=$N");	
	if($I==0){
		echo "NR";
	}else{
		$A=gs("anu","ventas","id_venta=$I");
		if($A=="S"){
			echo "AN";
		}else{
			$C=gn("ven_id_ven","ventas","id_venta=$I");
			if($C>0){
				echo "CO";
			}else{
				$DES=gs("ven_desc","ventas","id_venta=$I");
				if($DES==1){
					echo "D_SI";
				}else{
					echo "D_NO";
				}
			}
		}
	}
}
?>