All pastes #911035 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-20 13:02 UTC
rendered paste body
<?php require_once('../Connections/szvvweb.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $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_szvvweb, $szvvweb);
$query_bestuur = "SELECT id_bestuur, sort_bestuur, groep_bestuur, functie_bestuur, naam_bestuur, email_bestuur, adres_bestuur, pc_bestuur, plaats_bestuur, tel_bestuur FROM bestuur ORDER BY sort_bestuur ASC";
$bestuur = mysql_query($query_bestuur, $szvvweb) or die(mysql_error());
$row_bestuur = mysql_fetch_assoc($bestuur);
$totalRows_bestuur = mysql_num_rows($bestuur);

// Include Projax class and intialize it
include ("../includes/projax/projax.php");
$projax= new Projax();

//our controlling variable
$task=isset($_GET['task'])?$_GET['task']:'view';

if( $task == 'ajax' ) 
{
	//The ajax output
	print_r($_POST['list']);
	return;
}
?>
<head>
<link rel='stylesheet' type='text/css' media='all' href='../includes/projax/style.css' />
<!--Include the Javascripts -->
<script src="../includes/projax/js/prototype.js" type="text/javascript"></script>
<script src="../includes/projax/js/scriptaculous.js" type="text/javascript"></script>
</head>
<body>
Drag and drop items to reorder!<br />
<ul id="list">
  <?php do { ?>
    <li id="item_<?php echo $row_bestuur['sort_bestuur']; ?>">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><strong><?php echo $row_bestuur['functie_bestuur']; ?></strong></td>
        </tr>
        <tr>
          <td><?php 
// Show IF Conditional region4 
if (@$row_bestuur['naam_bestuur'] != "") {
?>
              <?php echo $row_bestuur['naam_bestuur']; ?>
              <?php } 
// endif Conditional region4
?></td>
        </tr>
      </table>
    </li>
    <?php } while ($row_bestuur = mysql_fetch_assoc($bestuur)); ?>
</ul>
<p id="list-info">bla</p>
<!-- Make the list sortable -->
<?=$projax->sortabe_element('list',array('update'=>'list-info','complete'=>$projax->visual_effect('highlight','list') , 'url'=>'sortbestuur.php?task=ajax'));?>
<script type="text/javascript">
            Sortable.create('sortabe_element');
        </script>
</body>
<?php
mysql_free_result($bestuur);
?>