Modifying or deleting checked records###

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, based to some help from this great list , some
tuts , i´ve finlly make this php page, that shows
existing records on a database, with a checkbox each
record so users can check it to modify the record or
to check it to delete it.

Plus, as im using dreamweaver, i´ve downloaded an
extension , that makes a radio button to automatically
check all the existing records and another one to
unchecked all records.

The problem is, wich script can i use, so when users
check one record, or checked all of them, to delete
them.

And which script to use, to modify the selected
record.

Any hints, tut, or help???

This is my php code:

<?php require_once('Connections/server.php'); ?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 *
$maxRows_Recordset1;

mysql_select_db($database_server, $server);
$query_Recordset1 = "SELECT * FROM datos";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d",
$query_Recordset1, $startRow_Recordset1,
$maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1,
$server) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 =
$_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 =
mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 =
ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Cuaderno de llamadas</title>
<link  REL="StyleSheet" TYPE="text/css"
HREF="css/styles.css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for
(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n);
return x;
}

function flevToggleCheckboxes() { // v1.1
	// Copyright 2002, Marja Ribbers-de Vroed, FlevOOware
(www.flevooware.nl/dreamweaver/)
	var sF = arguments[0], bT = arguments[1], bC =
arguments[2], oF = MM_findObj(sF);
    for (var i=0; i<oF.length; i++) {
		if (oF[i].type == "checkbox") {if (bT)
{oF[i].checked = !oF[i].checked;} else {oF[i].checked
= bC;}}} 
}
//-->
</script>
</head>

<body>
<form action="" method="post" name="dataform"
id="dataform">
  <table width="780" border="0" cellspacing="0"
cellpadding="0">
    <tr>
      <td colspan="6"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
width="780" height="59">
        <param name="movie" value="barrallamadas.swf">
        <param name="quality" value="high">
        <embed src="barrallamadas.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer";
type="application/x-shockwave-flash" width="780"
height="59"></embed>
      </object></td>
    </tr>
    <tr>
      <td colspan="6" class="color"><table width="780"
border="0" align="center" cellpadding="0"
cellspacing="0">
        <tr>
          <td width="130" align="center">Ver llamadas
para : </td>
          <td width="650" align="center"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
width="100" height="20" align="left">
            <param name="movie" value="button9.swf">
            <param name="quality" value="high">
            <embed src="button9.swf" width="100"
height="20" align="left" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
type="application/x-shockwave-flash" ></embed>
          </object>
            <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
width="100" height="20" align="left">
              <param name="BGCOLOR" value="">
              <param name="movie" value="button5.swf">
              <param name="quality" value="high">
              <embed src="button5.swf" width="100"
height="20" align="left" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
type="application/x-shockwave-flash" ></embed>
            </object>
            <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
width="100" height="20" align="left">
              <param name="movie" value="button6.swf">
              <param name="quality" value="high">
              <embed src="button6.swf" width="100"
height="20" align="left" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
type="application/x-shockwave-flash" ></embed>
            </object>
            <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
width="100" height="20" align="left">
            <param name="movie" value="button7.swf">
            <param name="quality" value="high">
            <embed src="button7.swf" width="100"
height="20" align="left" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
type="application/x-shockwave-flash" ></embed>
          </object>
            <object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
width="100" height="20" align="left">
            <param name="movie" value="button8.swf">
            <param name="quality" value="high">
            <embed src="button8.swf" width="100"
height="20" align="left" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
type="application/x-shockwave-flash" ></embed>
          </object>            </td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td colspan="6"><table border="0" align="center"
cellpadding="1" cellspacing="0" >
        <tr height="19">
          <th colspan="3" align="left" valign="top"
class="azulado">Fecha</th>
          <th align="left" valign="top"
class="azulado">Hora</th>
          <th align="left" valign="top"
class="azulado">Receptor</th>
          <th align="left" valign="top"
class="azulado">Destinatario</th>
          <th align="left" valign="top"
class="azulado">Apellido</th>
          <th align="left" valign="top"
class="azulado">Nombre</th>
          <th align="left" valign="top">Telefo<span
class="azulado">n</span>o</th>
          <th align="left" valign="top"
class="azulado">Asunto</th>
        </tr>
        <?php do { ?>
        <tr>
          <td align="center">      
          <td class="color"><input type="checkbox"
name="checkbox" value="checkbox"></td>
          <td class="color"><?php echo
$row_Recordset1['dia'], "/", $row_Recordset1['mes'],
"/", $row_Recordset1['ano'] ; ?></td>
          <td class="color"><?php echo
$row_Recordset1['hora']; ?></td>
          <td class="color"><?php echo
$row_Recordset1['receptor']; ?></td>
          <td class="color"><?php echo
$row_Recordset1['destinatario']; ?></td>
          <td class="resaltado"><?php echo
$row_Recordset1['apellido']; ?></td>
          <td class="color"><?php echo
$row_Recordset1['nombre']; ?></td>
          <td class="color"><?php echo
$row_Recordset1['telefono']; ?></td>
          <td class="color"><?php echo
$row_Recordset1['asunto']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 =
mysql_fetch_assoc($Recordset1)); ?>
      </table></td>
    </tr>
	<tr>
      <td width="20" height="14"
class="divisorio"><input name="radiobutton"
type="radio"
onClick="flevToggleCheckboxes('dataform',false,true)"
value="radiobutton"></td>
      <td width="112" height="14"
class="description">Seleccionar todos </td>
      <td width="20" height="14"
class="divisorio"><input name="radiobutton"
type="radio"
onClick="flevToggleCheckboxes('dataform',false,false)"
value="radiobutton"></td>
	  <td width="217" height="14"
class="description">Deseleccionar todos </td>
	  <td width="106" height="14"
class="description"><input type="submit" name="Submit"
value="Modificar"></td>
	  <td width="695" height="14" align="left"
class="description"><input type="submit" name="Submit"
value="Archivar"></td>
	</tr>
  </table>
</form>
</body>
</html>




Thanks.
Juan


	

	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux