%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/portal.tjamich.gob.mx/sisofi/modules/forms/
Upload File :
Create Path :
Current File : /home/tjamichg/portal.tjamich.gob.mx/sisofi/modules/forms/masive.config.php

<?php
$token = $_GET['token'];

if(isset($_POST['artic']))
{
	$token = $_GET['token'];
    $arti = $_GET['artic'];
	$result = mysql_query("SELECT idform, nform, SUBSTR(nform,1,2) AS nart, SUBSTR(nform, locate('-',nform,1)+1,locate('-',nform,4)-4) AS Fraccion, tabla, tempo FROM formatos WHERE SUBSTR(nform,1,2)='$arti'");
	$row_cnt = mysql_num_rows($result);
	if($result)
	{
		$j=1;
		while($j <= $row_cnt)
		{
			$SelForm = mysql_fetch_array($result);
			$IdForm = $SelForm['idform'];
    		$ApForm = $SelForm['nform'];
			$nArt = $SelForm['nart'];
			$Frac = $SelForm['Fraccion'];
    		$tabForm = $SelForm['tabla'];
			$temForm = $SelForm['tempo'];
			$total = 0;
			$total = mysql_num_rows(mysql_query("SELECT * FROM c_forms WHERE tabla ='$tabForm'"));
			if($total==0){
				$InyForm = mysql_query("INSERT INTO c_forms (idform, nform, idley, nart, fraxn, tabla, tempo) VALUES ('$IdForm','$ApForm',1,'$nArt','$Frac','$tabForm','$temForm')");
				
			}
			$j++;
		}
			echo "<div class='msg'>Se han configurado todos los formularios exitosamente</div>";
			echo "<script> window.location.href = 'index.php?token=".$token."&load=cformats&mod=pload'; </script>";
	} 
	else 
	{
    	echo  "<div class='msg'>No fué posible configurar todos los formatos del artículo ".$arti .". Favor de contactar al administrador del sistema</div>";

     }
}
if(isset($_GET['artic'])){
    $artc = $_GET['artic'];
}
?>
<br />
<div class="content">
    <div class="titulo">Configuración Masiva de Formatos</div><br />
    <div>
        <form name="config" method="post" action="">
            <div class="fcampo">
                <select name="artic" id="artic" onchange="window.location.href=this.value" >
                    <option value="">- SELECCIONA UN ARTÍCULO -</option>
                    <?php
                    $asen = mysql_query("SELECT DISTINCT SUBSTR(nform,1,2)AS Art FROM formatos ");
                    while($artic = mysql_fetch_array($asen))
					{
                    ?>
					<option value="index.php?token=<?php echo $token; ?>&mod=massConfig&artic=<?php echo $artic['Art']; ?>" 
					<?php 
					if(isset($artc))
					{ 
						if($artc == $artic['Art'])
						{
							echo "selected"; 
						
						}
					} ?>><?php echo $artic['Art']; ?></option>

                    <?php 
					} 
					?>
                </select>
			</div>
            <div class="fcampo"><input type="submit" value="Configurar" /></div>
        </form>
    </div>
</div>

Zerion Mini Shell 1.0