DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Query Manager and Recordset Wizard  
DwZone Forum Index -> Query Manager and Recordset Wizard
.
Moderators: Administrators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 1 to 10 of 41 (Total: 41) First |  Prev |  Next |  Last  
 Subject Author Date  
   mysqliInsert not working with Tinymce  
View this persons public profile  MartinDocherty   3:48 10 Apr 2020  
   Extensions not loaded  
View this persons public profile  Valter   8:01 16 Jul 2018  
   Re: Extensions not loaded  
View this persons public profile  Gianluigi   10:05 16 Jul 2018  
   Any Plans to add a Dynamic Checkbox?  
View this persons public profile  Jim   21:32 13 Jul 2018  
    Nested Repeat Region  
View this persons public profile  Jim   8:30 1 Jul 2018  
 
Is it possible to do a nested repeat? Here is my code. Every thing works until I try to do the second repeat. What do I need to change or is it possible?



?php require_once('../../Connections/LEPCEMA.php'); ?>
<?php
if (!function_exists("GetSQLiValueString")) {
function GetSQLiValueString($theConnection, $theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string($theConnection, $theValue) : mysqli_escape_string($theConnection, $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;
}
}
?>
<?php
//**************************
// ProfRecWiz - MySqli
// http://www.dwzone-it.com
// Version: 1.0.17
//**************************
mysqli_select_db($LEPCEMA, $database_LEPCEMA);
$mysqli_RiskFacilities_query = "SELECT LocalBusinesses.RiskFacilityID, LocalBusinesses.RiskFacilityName, LocalBusinesses.Latitude, LocalBusinesses.longitude, LocalBusinesses.EstimatedPeople FROM LocalBusinesses ORDER BY LocalBusinesses.RiskFacilityName Asc";
$RiskFacilities = mysqli_query($LEPCEMA, $mysqli_RiskFacilities_query) or die(mysqli_error($LEPCEMA));
$row_RiskFacilities = mysqli_fetch_assoc($RiskFacilities);
$totalRows_RiskFacilities = mysqli_num_rows($RiskFacilities);
//**************************
// ProfRecWiz - MySqli
//**************************
?>

<?php
//**************************
// ProfRecWiz - MySqli
// http://www.dwzone-it.com
// Version: 1.0.17
//**************************
mysqli_select_db($LEPCEMA, $database_LEPCEMA);
$mysqli_facilities_query = "SELECT TierIIFacilities.*, TierIIFacilities.FacilityID, TierIIFacilities.FcilltiyName FROM TierIIFacilities ORDER BY TierIIFacilities.FcilltiyName Asc";
$facilities = mysqli_query($LEPCEMA, $mysqli_facilities_query) or die(mysqli_error($LEPCEMA));
$row_facilities = mysqli_fetch_assoc($facilities);
$totalRows_facilities = mysqli_num_rows($facilities);
//**************************
// ProfRecWiz - MySqli
//**************************
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type="text/css">
<!-- -->
</style>
</head>

<body>
<table border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"></td>
</tr>
<tr>
<td width="322" height="45"><b>Tier II Facility</b></td>
<td width="326" height="45"><b>Facilities At Risk</b></td>
</tr>
<tr>
<?php
//*****************************
// ProfRecWiz
// Repeat Region
// Before Selection Instance
//*****************************
$dwz_loop = 0;
$dwzLoopName = "Repeat1";
$dwzMaxRec = "-1";
do{
$dwz_loop += 1;
//End Repeat region
?>
<td width="322" height="45"><?php echo dwzGetRecValue('facilities','FcilltiyName'); ?></td>
<td width="326" height="45">



<?php
//*****************************
// ProfRecWiz
// Repeat Region
// Before Selection Instance
//*****************************
$dwz_loop = 0;
$dwzLoopName = "Repeat3";
$dwzMaxRec = "-1";
do{
$dwz_loop += 1;
//End Repeat region
?>
<?php
//**************************
// http://www.DwZone-it.com
// CONDITIONAL REGION
// Version: 1.0.8
//**************************



$lat1= dwzGetRecValue('facilities','Latitude');
$lng1= dwzGetRecValue('facilities','Longitude') ;
$lat2 = dwzGetRecValue('RiskFacilities','Latitude');
$lng2 = dwzGetRecValue('RiskFacilities','longitude');
$driven_distance = getDistance($lat1,$lng1,$lat2,$lng2,$unit);


if(($driven_distance) < (2)) { echo dwzGetRecValue('RiskFacilities','RiskFacilityName'), " ", $driven_distance, " miles"
?><br>
<?php
//**************************
// CONDITIONAL REGION
//**************************
} ?>
<?php
//*****************************
// ProfRecWiz
// Repeat Region
// After Selection Instance
//*****************************
$dwzLoopName = "Repeat3";
if($dwzMaxRec != "" && $dwzMaxRec != "-1"){
if(intval($dwz_loop) >= intval($dwzMaxRec)){
break;
}
}
}while($row_RiskFacilities = mysqli_fetch_assoc($RiskFacilities));
//End Repeat region
?>






</td>
<?php
//*****************************
// ProfRecWiz
// Repeat Region
// After Selection Instance
//*****************************
$dwzLoopName = "Repeat1";
if($dwzMaxRec != "" && $dwzMaxRec != "-1"){
if(intval($dwz_loop) >= intval($dwzMaxRec)){
break;
}
}
}while($row_facilities = mysqli_fetch_assoc($facilities));
//End Repeat region
?>
</tr>
<tr>
<td width="322" height="45"> </td>
<td width="326" height="45"> </td>
</tr>
<tr>
<td width="322" height="45">
<p><b><span style="font-size: 13.0pt">-</span></b>
</p>
</td>
<td width="326" height="45" bgcolor="#ffffff"> </td>
</tr>
<tr>
<td height="45"></td>
<td height="45"></td>
</tr>
<tr>
<td width="322" height="45"> </td>
<td width="326" height="45"> </td>
</tr>
<tr>
<td height="45"> </td>
<td height="45"> </td>
</tr>
<tr>
<td height="45"></td>
<td height="45"></td>
</tr>
<tr>
<td width="322" height="45"> </td>
<td width="326" height="45"> </td>
</tr>
</table>
</body>
</html>
<?php
//**************************
// ProfRecWiz - MySqli
//**************************
mysqli_free_result($RiskFacilities);
//**************************
// ProfRecWiz - MySqli
//**************************
?>
<?php
//**************************
// ProfRecWiz - MySqli
//**************************
mysqli_free_result($facilities);
//**************************
// ProfRecWiz - MySqli
//**************************
?>
<?php
//**************************
// ProfRecWiz
//**************************
function dwzGetRecValue($rec, $field){
if(isset($GLOBALS['row_'.$rec])){
return $GLOBALS['row_'.$rec][$field];
}else{
return $rec .'.' .$field;
}
}
//**************************
// ProfRecWiz
//**************************
?>
<?php
function getDistance($latitude1, $longitude1,
$latitude2, $longitude2, $unit = 'Mi')
{
$theta = $longitude1 - $longitude2;
$distance = (sin(deg2rad($latitude1)) *
sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) *
cos(deg2rad($latitude2)) * cos(deg2rad($theta)));
$distance = acos($distance);
$distance = rad2deg($distance);
$distance = $distance * 60 * 1.1515;
switch($unit)
{
case 'm': break;
case 'K' : $distance = $distance *1.609344;
}
return (round($distance,2));
}

?>
 
Reply to this current thread  View this persons public profile  Send Private Message
   Re: Nested Repeat Region  
View this persons public profile  Gianluigi   8:35 1 Jul 2018  
   Error when using Professionnal query  
View this persons public profile  Laurent   4:13 25 May 2018  
   How to use "Criteria" to select specific records  
View this persons public profile  JarrellHill   8:01 4 May 2018  
   Re: How to use "Criteria" to select specific records  
View this persons public profile  Gianluigi   9:49 4 May 2018  
   Re: How to use "Criteria" to select specific records  
View this persons public profile  JarrellHill   12:21 4 May 2018  
Last Visit: Thursday 23 Sep, 2021 8:34 pm First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-2

Jump to: