/////////////////////////////////////////////////////////// ///////////////variables globales /* if ($_POST[n1]) { $n1 = $_POST[n1]; } elseif ($_GET[n1]) { $n1 = $_GET[n1]; } if ($_POST[n3]) { $n3 = $_POST[n3]; } elseif ($_GET[n3]) { $n3 = $_GET[n3]; } */ ////////////////////////////////// ////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ////////////////post $chk_cat = $_POST[chk_cat]; $id_prod = $_POST[id_prod]; $nombre_prod = $_POST[nombre_prod]; $crea1 = $_POST[crea1]; /**/ /////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ////////////////get $e = $_GET[e];/* $proy = $_GET[proy]; $keyyy = $_GET[keyyy]; */ /////////////////// ///////////////////////////////////////////////////////// if(!$f) { $a = $_SERVER['PHP_SELF']; $ar = split('/',$a); $i = count($ar); $i=$i-1; $f=''; for($x=1; $x<$i; $x++){ $f.= "../"; } } require ($f."contabilidad/permiso.php"); require ($f."contabilidad/cook.php"); $stp=1; require ($f."contabilidad/conex/webcatalog.php"); if(isset($e)) { $id_prod = substr($e, 32); $accion = substr($e, 0, 32); if ($accion == md5("editar")) { $result = mysql_query("select * from categoria where id_categoria = '".$id_prod."'"); if ($row = mysql_fetch_array($result)) { $nom_cat=$row["descripcion"]; } } } if (!$id_prod && $nombre_prod) { $result = mysql_query("select * from categoria where descripcion = '".$nombre_prod."'"); if (mysql_num_rows($result)==0) { $xxsql = "insert into categoria (descripcion) values ('".$nombre_prod."')"; $result=mysql_query($xxsql) or die(mysql_error().' consulta: '.$xxsql); $id_prod = mysql_insert_id(); } } if ($nombre_prod && $id_prod && !$crea1) { $nombre_prod=str_replace("'","",$nombre_prod); $xxsql = "update categoria set descripcion = '".$nombre_prod."' where id_categoria = '".$id_prod."'"; $result=mysql_query($xxsql) or die(mysql_error().' consulta: '.$xxsql); mysql_query("Delete from categ_categclasif where id_categ = '".$id_prod."'") or die("
| include($f."contabilidad/img/footer.php"); ?> |