<?php
include('./conexion.php');


date_default_timezone_set('America/Mazatlan');
$user= $_SESSION['nom_admin'];
$idu = $_SESSION['id_user'];
$codigo = $_POST['codigo'];
$des = $_POST['des'];
$tot = $_POST['tot'];
$suc = $_POST['suc'];
$tipeg = $_POST['tipeg'];
$tipo = 2;
$fecha = date('Y-m-d H:i:s');
$fechap = date('Y-m-d');



/*
$codigo= 1234;
$nombre= jose;
$rfc= 1234;
$rs= 1234;
$calle= 1234;
$ne= 1234;
$ni= 1234;
$cp= 1234;
$col= 1234;
$ciu= 1234;
$edo= 1234;
$cor= 1234;
$tel= 1234;
$cel= 1234;
$fecha= date(d-m-Y);

nombre LIKE '%$dato%' OR idremitente LIKE '%$dato%'
*/$n = mysqli_query($conexion,"SELECT * FROM Clientes WHERE Nombre = '$nombre'");
	$r = mysqli_query($conexion,"SELECT * FROM Remitente WHERE RFC = '$rfc'");
	$rsc = mysqli_query($conexion,"SELECT * FROM Remitente WHERE RazonSocial = '$rs'");
	if(mysqli_num_rows($n)>0){
		echo '2';
	}else{
	mysqli_query($conexion,"INSERT INTO Movimientos VALUES(DEFAULT,NULL,NULL,'$des','$tipo','$fecha','$tot',NULL,NULL,'$idu','$suc',1,'$fechap',0,$tipeg); ");
	
	echo '1';
	}


?>