File: /home/ednermusika/ednergranados.com/admin/testimonios_altas.php
<?php require_once('../Connections/con_edner.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
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;
}
}
mysql_select_db($database_con_edner, $con_edner);
$query_MAXIMO = "SELECT IFNULL(MAX(tes_consecutivo),0)+1 as MAXIMO, DATE_FORMAT(CURDATE(), '%d/%m/%Y') as FECHA_HOY FROM testimonio";
$MAXIMO = mysql_query($query_MAXIMO, $con_edner) or die(mysql_error());
$row_MAXIMO = mysql_fetch_assoc($MAXIMO);
$totalRows_MAXIMO = mysql_num_rows($MAXIMO);
?><!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<link href="css/calendario.css" rel="stylesheet" type="text/css" />
<script src="calendario/mootools.v1.1.js" type="text/javascript"></script>
<script src="calendario/calendario.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="editor/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,|,insertdate,inserttime,preview",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,
// Example word content CSS (should be your site CSS) this one removes paragraph margins
content_css : "../css/interiores.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h1>Testimonios</h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="testimonios_admin.php" class="ligas_menu_interiores">« Regresar</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><hr class="hr_principal" /></td>
</tr>
</table>
<blockquote>
<blockquote>
<form action="testimonios_guardar.php" method="POST" enctype="multipart/form-data" name="form1" id="form1">
<table width="913">
<tr valign="baseline">
<td colspan="2" nowrap="nowrap"><h3>Nuevo testimonio</h3></td>
</tr>
<tr valign="baseline">
<td width="122" nowrap="nowrap"><h6> </h6></td>
<td width="779"><input name="tes_consecutivo" type="hidden" id="tes_consecutivo" value="<?php echo $row_MAXIMO['MAXIMO']; ?>" size="32" />
<input type="hidden" name="usu_consecutivo" value="<?php echo $_SESSION['USUARIO'] ?>" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"></td>
<td><p> </p></td>
</tr>
<tr valign="baseline">
<td height="123" valign="top" nowrap="nowrap"><h4>Descripción:</h4></td>
<td><textarea name="tes_descripcion" cols="100" rows="7" id="tes_descripcion"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Autor:</h4></td>
<td><input name="tes_autor" type="text" id="tes_autor" value="" size="100" maxlength="200" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Puesto:</h4></td>
<td><input name="tes_puesto" type="text" id="tes_puesto" value="" size="100" maxlength="200" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Imagen:</h4></td>
<td><input name="tes_imagen" type="file" id="tes_imagen" value="" size="100" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h4>Orden:</h4></td>
<td><input name="tes_orden" type="text" id="tes_orden" value="" size="10" maxlength="5" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h6>
<input name="tes_ruta" type="hidden" id="tes_ruta" value="testimonios" size="32" />
</h6></td>
<td><input name="tes_activo" type="hidden" id="tes_activo" value="1" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"><h6>
<input name="accion" type="hidden" id="accion" value="A" />
</h6></td>
<td><input name="guardar" type="button" class="boton_panel" id="guardar" onclick="MM_callJS('f_enviar();')" value="Guardar" />
<input name="limpiar" type="reset" class="boton_panel" id="limpiar" value="Limpiar" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap"> </td>
<td> </td>
</tr>
</table>
</form>
</blockquote>
<p> </p>
</blockquote>
</body>
<script type="text/javascript">
function f_validar ( )
{
var retorno = true;
with ( document.form1 )
{
if ( tes_imagen.value == '' )
{
alert ( 'Por favor proporcione la imagen' );
tes_imagen.focus ( );
retorno = false;
}
else if ( tes_autor.value == '' )
{
alert ( 'Por favor proporcione el autor' );
tes_autor.focus ( );
retorno = false;
}
}
return retorno
}
function f_enviar()
{
with (document.form1)
{
if ( f_validar ( ) )
{
submit ( );
}
}
}
</script>
</html>
<?php
mysql_free_result($MAXIMO);
?>