<?php require_once('../Connections/conexion_pelislatino.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO tblpelicula (strNombre, intCategoria, strImagen, strSinopsis, strInfo, strLinks) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['strNombre'], "text"),
GetSQLValueString($_POST['intCategoria'], "int"),
GetSQLValueString($_POST['strImagen'], "text"),
GetSQLValueString($_POST['strSinopsis'], "text"),
GetSQLValueString($_POST['strInfo'], "text"),
GetSQLValueString($_POST['strLinks'], "text"));
$insertGoTo = "peliculas_lista.php";
if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ?
"&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING'];
}
}
$query_consulta_categorias = "SELECT * FROM tblcategoria ORDER BY tblcategoria.strDescripcion ASC";
$totalRows_consulta_categorias = mysql_num_rows($consulta_categorias); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/baseadmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>admin</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<link href="../estilo/baseadmin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
<div class="header"><!-- end .header -->
<p><img src="http://www.forosdelweb.com/f18/images/diseño/foto%20principal%20web.JPG" width="943" height="201" alt="logo" /></p>
</div>
<div class="sidebar1">
<?php include("../includes/cabeceraadmin.php");
?>
<ul class="nav">
<li></li></ul>
<!-- end .sidebar1 --></div>
<div class="content">
<h1><!-- InstanceBeginEditable name="encabezado" -->añadir pelicula<!-- InstanceEndEditable --></h1>
<!-- InstanceBeginEditable name="contenido" -->
<script>
function subirimagen()
{
self.name = 'opener';
remote = open('gestionimagen.php', 'remote',
'width=400,heighht=150,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,fullscreen=no, status=yes');
remote.focus();
}
</script>
<p> </p>
<p> </p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td width="86" align="right" nowrap="nowrap">Nombre:</td>
<td width="271"><span id="sprytextfield1">
<input type="text" name="strNombre" value="" size="32" />
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Imagen:</td>
<td><label for="strImagen"></label>
<span id="sprytextfield2">
<input type="text" name="strImagen" id="strImagen" />
<span class="textfieldRequiredMsg">Se necesita un valor.</span></span> <input type="button" name="button" id="button" value="subir imagen" onclick="javascript:subirimagen();"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Categoria:</td>
<td><label for="intCategoria[]"></label>
<select name="intCategoria[]" size="1" multiple="MULTIPLE" id="intCategoria[]">
<?php $cates = (isset($_POST["intCategoria"])) ?
"categoria='".implode(",", $_POST["intCategoria"])."'," : "";
$sql "update $tabla set $cates otrosCampos='$otrosValores' ...";
?>
<?php
do {
?>
<option value="<?php echo $row_consulta_categorias['idCategoria']?>"><?php echo $row_consulta_categorias['strDescripcion']?></option>
<?php
if($rows > 0) {
}
?>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Sinopsis:</td>
<td><label for="strInfo"></label>
<input type="text" name="strSinopsis" id="strSinopsis" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Info:</td>
<td><label for="strInfo"></label>
<label for="strInfo"></label>
<textarea name="strInfo" id="strInfo" cols="45" rows="5"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Links:</td>
<td><label for="strLinks"></label>
<input type="text" name="strLinks" id="strLinks" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insertar pelicula" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
</script>
<!-- InstanceEndEditable --><!-- end .content --></div>
<div class="footer">
<p>administracion de pelis latino</p>
<!-- end .footer --></div>
<!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
?>