Jump to content

prontik

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by prontik

  1. Because they always respond negatively to requests for code editing or advice. They will advise you how it works, but they won't advise you to edit it. It's also written in the support policy. 😪 I don't think what I would need would be too hard for someone who understands it.
  2. Bernd is probably not alone in having problems with this code. This is exactly what I need. This code is a form from Vik Rent Car component and more specifically this booking form. https://extensionsforjoomla.com/livedemo/vikrentcar/index.php/en/vrc-list/ford-focus It's about selecting a pickup time and dropoff time, where the goal is to set a fixed hour and minute for pickup and a different one for dropoff. And it will not be possible to select a different time (neither hours nor minutes). For example: The pickup time will be fixed at 15h and the minutes at 00 The hour of dropoff will be fixed at 11h and 00 minutes Thank you in advance for your help $hours = ""; $pickhdeftime = !empty($places[$indvrcplace]['defaulttime']) ? ((int)$places[$indvrcplace]['defaulttime'] / 3600) : ''; if (!($i < $j)) { while (intval($i) != (int)$j) { $sayi = $i < 10 ? "0".$i : $i; if ($nowtf != 'H:i') { $ampm = $i < 12 ? ' am' : ' pm'; $ampmh = $i > 12 ? ($i - 12) : $i; $sayh = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayh = $sayi; } $hours .= "<option value=\"" . (int)$i . "\"".($pickhdeftime == (int)$i ? ' selected="selected"' : '').">" . $sayh . "</option>\n"; $i++; $i = $i > 23 ? 0 : $i; } $sayi = $i < 10 ? "0".$i : $i; if ($nowtf != 'H:i') { $ampm = $i < 12 ? ' am' : ' pm'; $ampmh = $i > 12 ? ($i - 12) : $i; $sayh = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayh = $sayi; } $hours .= "<option value=\"" . (int)$i . "\">" . $sayh . "</option>\n"; } else { while ($i <= $j) { $sayi = $i < 10 ? "0".$i : $i; if ($nowtf != 'H:i') { $ampm = $i < 12 ? ' am' : ' pm'; $ampmh = $i > 12 ? ($i - 12) : $i; $sayh = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayh = $sayi; } $hours .= "<option value=\"" . (int)$i . "\"".($pickhdeftime == (int)$i ? ' selected="selected"' : '').">" . $sayh . "</option>\n"; $i++; } } // $hoursret = ""; //VRC 1.9 $drophdeftime = !empty($places[$indvrcreturnplace]['defaulttime']) ? ((int)$places[$indvrcreturnplace]['defaulttime'] / 3600) : ''; if (!($iret < $jret)) { while (intval($iret) != (int)$jret) { $sayiret = $iret < 10 ? "0".$iret : $iret; if ($nowtf != 'H:i') { $ampm = $iret < 12 ? ' am' : ' pm'; $ampmh = $iret > 12 ? ($iret - 12) : $iret; $sayhret = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayhret = $sayiret; } $hoursret .= "<option value=\"" . (int)$iret . "\"".($drophdeftime == (int)$iret ? ' selected="selected"' : '').">" . $sayhret . "</option>\n"; $iret++; $iret = $iret > 23 ? 0 : $iret; } $sayiret = $iret < 10 ? "0".$iret : $iret; if ($nowtf != 'H:i') { $ampm = $iret < 12 ? ' am' : ' pm'; $ampmh = $iret > 12 ? ($iret - 12) : $iret; $sayhret = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayhret = $sayiret; } $hoursret .= "<option value=\"" . (int)$iret . "\">" . $sayhret . "</option>\n"; } else { while ((int)$iret <= $jret) { $sayiret = $iret < 10 ? "0".$iret : $iret; if ($nowtf != 'H:i') { $ampm = $iret < 12 ? ' am' : ' pm'; $ampmh = $iret > 12 ? ($iret - 12) : $iret; $sayhret = $ampmh < 10 ? "0".$ampmh.$ampm : $ampmh.$ampm; } else { $sayhret = $sayiret; } $hoursret .= "<option value=\"" . (int)$iret . "\"".($drophdeftime == (int)$iret ? ' selected="selected"' : '').">" . $sayhret . "</option>\n"; $iret++; } } // $minutes = ""; for ($i = 0; $i < 60; $i += 15) { if ($i < 10) { $i = "0" . $i; } $minutes .= "<option value=\"" . (int)$i . "\"".((int)$i == $imin ? " selected=\"selected\"" : "").">" . $i . "</option>\n"; } $minutesret = ""; for ($iret = 0; $iret < 60; $iret += 15) { if ($iret < 10) { $iret = "0" . $iret; } $minutesret .= "<option value=\"" . (int)$iret . "\"".((int)$iret == $iminret ? " selected=\"selected\"" : "").">" . $iret . "</option>\n"; } $sval = $session->get('getDateFormat', ''); if (!empty($sval)) { $dateformat = $sval; } else { $q = "SELECT `setting` FROM `#__vikrentcar_config` WHERE `param`='dateformat';"; $dbo->setQuery($q); $dbo->execute(); if ($dbo->getNumRows() == 1) { $df = $dbo->loadAssocList(); $dateformat = $df[0]['setting']; } else{ $dateformat = "%d/%m/%Y"; } } if (true) { if ($dateformat == "%d/%m/%Y") { $juidf = 'dd/mm/yy'; } elseif ($dateformat == "%m/%d/%Y") { $juidf = 'mm/dd/yy'; } else { $juidf = 'yy/mm/dd'; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.