<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
include("DF30000.inc");
require_once("DF80000.php");
require_once("RG16100_CL.php");//Clase Dietas
require_once("RG00000_CL.php");//Clase Conexion Inventario
require_once("RG12200_CL.php");//Clase Animales
require_once("RG30000_CL.php");//Clase Dieta Animal,Medicina Animal

if(isset($_POST['gc'])){
		$selRancho=$_POST['ir'];
		$selCorral=$_POST['sc'];
		@$sq_corrales = mysqli_query($con ,$sq="SELECT rgdetran.*,rgcorrales.des_corral FROM rgdetran LEFT JOIN rgcorrales ON rgcorrales.id_corral=rgdetran.id_ope WHERE rgdetran.id_ranchos='$selRancho' ORDER BY rgcorrales.des_corral");
		echo '<table border="0" width="190">';
		echo "
		<tr>
			<td colspan=\"2\" class=\"footCorr\"><input type=\"button\" value=\"Aceptar\" onclick=\"devCheCorr()\"></td>
		</tr>";		

		echo "
		<tr>
			<td class=\"encCorr\" width=\"50\"><input type=\"checkbox\" value=\"\" onclick=\"checkAllBox(this.checked)\">Sel.</td>
			<td class=\"encCorr\" width=\"134\">Descripcion</td>
		</tr>";

		while($dt_corrales=mysqli_fetch_array($sq_corrales)){
			if(strpos($selCorral,"|".$dt_corrales['id_dedran']."|")!==false){
				$checked='checked';
			}else{
				$checked="";
			}
			echo "
			<tr>
				<td><input type=\"checkbox\" value=\"$dt_corrales['id_dedran']\" name=\"checorr\" $checked></td>
				<td>$dt_corrales['des_corral']</td>
			</tr>";			
		}
		echo "</table>";
}
?>
