Example #1
0
function c2r_getHtmlSelectTimezones($selected = null)
{
    $array = c2r_getTimeZonesArray();
    return c2r_getHtmlSelect('timezone', $array, 'name', $selected);
}
/* Open CarPool is free software published under GPLv3 license, see license.txt for details. (C) 2009-2014 Oliver Pintat, Clemens Rath */
require_once '../../functions/functions.php';
$lid = $_GET['lid'];
$pid = $_GET['pid'];
$points = c2r_pickuppoints_get(0, $lid);
$key_array_used = array();
foreach ($points as $key => $point) {
    if ($pid != $point->id) {
        $key_array_used[$point->key] = $point->key;
    }
}
$free_keys = array();
for ($i = 1; $i < 100; $i++) {
    if (!in_array($i, $key_array_used)) {
        $obj = null;
        $obj->name = sprintf('%02d', $i);
        $free_keys[sprintf('%02d', $i)] = $obj;
    }
}
$selected = null;
if ($pid) {
    $xpoint = $points[$pid];
    $xkey = $xpoint->key;
    // select if route is in this location
    if ($lid == $xpoint->lid) {
        $selected = $xkey;
    }
}
echo c2r_getHtmlSelect('key', $free_keys, 'name', $selected, 'class="form-control"');
Example #3
0
/* Open CarPool is free software published under GPLv3 license, see license.txt for details. (C) 2009-2014 Oliver Pintat, Clemens Rath */
require_once '../../functions/functions.php';
$lid = $_GET['lid'];
$routes = c2r_routes_get(0, $lid, 0, true, 0, $_GET['onlyforuser'] ? $user->id : 0);
// Sort Array by Route Name
usort($routes, "sort_by_route_names");
function sort_by_route_names($a, $b)
{
    if ($a->name == $b->name) {
        return 0;
    }
    return $a->name < $b->name ? -1 : 1;
}
$r2 = array();
foreach ($routes as $r) {
    $r2[$r->id] = $r;
}
$routes = $r2;
foreach ($routes as $key => $r) {
    $rps = c2r_route_points_get($r->id);
    $rp1 = array_shift($rps);
    $rp2 = array_pop($rps);
    $p1 = c2r_pickuppoints_get($rp1->point_id);
    $p2 = c2r_pickuppoints_get($rp2->point_id);
    $routes[$key]->name .= " (" . $p1->name . " - " . $p2->name . ")";
    $routes[$key]->name = "#" . $r->key . " " . $routes[$key]->name;
}
$oc = ($_GET['add_map'] = 1) ? 'onchange="loadmap()"' : '';
echo c2r_getHtmlSelect('route_id', $routes, 'name', null, $oc . ' class="form-control"');
echo '<script>loadmap();</script>';
    function content_567155fa67f9a2_40716562($_smarty_tpl)
    {
        ?>
<div class="form-group<?php 
        if (isset($_smarty_tpl->tpl_vars['error']->value) && $_smarty_tpl->tpl_vars['error']->value) {
            ?>
 has-error<?php 
        }
        ?>
">
  <label class="col-lg-2 control-label" for="<?php 
        echo $_smarty_tpl->tpl_vars['name']->value;
        ?>
">
    <?php 
        echo $_smarty_tpl->tpl_vars['description']->value;
        ?>

  </label>

  <div class="col-lg-4<?php 
        if (isset($_smarty_tpl->tpl_vars['class']->value) && $_smarty_tpl->tpl_vars['class']->value) {
            ?>
 <?php 
            echo $_smarty_tpl->tpl_vars['class']->value;
        }
        ?>
"<?php 
        if (isset($_smarty_tpl->tpl_vars['id']->value) && $_smarty_tpl->tpl_vars['id']->value) {
            ?>
 id="<?php 
            echo $_smarty_tpl->tpl_vars['id']->value;
            ?>
"<?php 
        }
        ?>
>
    <?php 
        if (isset($_smarty_tpl->tpl_vars['static']->value) && $_smarty_tpl->tpl_vars['static']->value) {
            ?>
        <p class="form-control-static">
            <strong><?php 
            echo $_smarty_tpl->tpl_vars['value']->value;
            ?>
</strong>
        </p>
    <?php 
        } elseif (isset($_smarty_tpl->tpl_vars['select']->value) && $_smarty_tpl->tpl_vars['select']->value) {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["extra2"] = new Smarty_variable('', null, 0);
            if (isset($_smarty_tpl->tpl_vars['extra']->value) && $_smarty_tpl->tpl_vars['extra']->value) {
                $_smarty_tpl->tpl_vars["extra2"] = new Smarty_variable($_smarty_tpl->tpl_vars['extra']->value, null, 0);
            }
            ?>
        <?php 
            echo c2r_getHtmlSelect($_smarty_tpl->tpl_vars['name']->value, $_smarty_tpl->tpl_vars['values']->value, 'name', $_smarty_tpl->tpl_vars['value']->value, "class=\"form-control\" " . (string) $_smarty_tpl->tpl_vars['extra2']->value);
            ?>

    <?php 
        } elseif (isset($_smarty_tpl->tpl_vars['radio']->value) && $_smarty_tpl->tpl_vars['radio']->value) {
            ?>
        <input type="radio" name="default" value="<?php 
            echo $_smarty_tpl->tpl_vars['un']->value->id;
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['un']->value->is_default) {
                ?>
checked="checked"<?php 
            }
            ?>
 />
        <?php 
            echo $_smarty_tpl->tpl_vars['un']->value->number;
            ?>
  
        <?php 
            if (!$_smarty_tpl->tpl_vars['un']->value->is_default) {
                ?>
            <a href="profile.php?number_delete=<?php 
                echo $_smarty_tpl->tpl_vars['un']->value->id;
                if ($_smarty_tpl->tpl_vars['admin_view']->value) {
                    ?>
&amp;uid=<?php 
                    echo $_smarty_tpl->tpl_vars['uid']->value;
                }
                ?>
">
                <span class="glyphicon glyphicon-trash"></span>
            </a>
        <?php 
            }
            ?>
    <?php 
        } elseif (isset($_smarty_tpl->tpl_vars['image']->value) && $_smarty_tpl->tpl_vars['image']->value) {
            ?>
        <img class="gravatar" src="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value;
            ?>
" alt="" />
    <?php 
        } else {
            ?>
        <?php 
            if (isset($_smarty_tpl->tpl_vars['date']->value) && $_smarty_tpl->tpl_vars['date']->value) {
                ?>
          <div class="input-group date" id="dp_<?php 
                echo $_smarty_tpl->tpl_vars['name']->value;
                ?>
" data-date="<?php 
                echo $_smarty_tpl->tpl_vars['value']->value;
                ?>
" data-date-format="yyyy-mm-dd"> 
            <input class="form-control" type="text" readonly="" value="<?php 
                echo $_smarty_tpl->tpl_vars['value']->value;
                ?>
" name="<?php 
                echo $_smarty_tpl->tpl_vars['name']->value;
                ?>
"> 
            <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> 
          </div>
          <script type="text/javascript">
          	  $(function() {
        	  	  $('#dp_<?php 
                echo $_smarty_tpl->tpl_vars['name']->value;
                ?>
').datepicker({
                todayBtn: "linked",
                autoclose: true,
                todayHighlight: true
              });
        	});
          </script>
        <?php 
            } else {
                ?>
          <input<?php 
                if (isset($_smarty_tpl->tpl_vars['type']->value) && $_smarty_tpl->tpl_vars['type']->value) {
                    ?>
 type="<?php 
                    echo $_smarty_tpl->tpl_vars['type']->value;
                    ?>
"<?php 
                }
                ?>
 name="<?php 
                echo $_smarty_tpl->tpl_vars['name']->value;
                ?>
" class="form-control" id="<?php 
                echo $_smarty_tpl->tpl_vars['name']->value;
                ?>
" placeholder="<?php 
                echo $_smarty_tpl->tpl_vars['placeholder']->value;
                ?>
" value="<?php 
                echo $_smarty_tpl->tpl_vars['value']->value;
                ?>
">
        <?php 
            }
            ?>
    <?php 
        }
        ?>
    <?php 
        if (isset($_smarty_tpl->tpl_vars['helpblock']->value) && $_smarty_tpl->tpl_vars['helpblock']->value) {
            ?>
        <p class="help-block"><?php 
            echo $_smarty_tpl->tpl_vars['helpblock']->value;
            ?>
</p>
    <?php 
        }
        ?>
    <?php 
        if (isset($_smarty_tpl->tpl_vars['error']->value) && $_smarty_tpl->tpl_vars['error']->value) {
            ?>
        <span class="help-block"><?php 
            echo $_smarty_tpl->tpl_vars['error']->value;
            ?>
</span>
    <?php 
        }
        ?>
  </div>
  <?php 
        if (isset($_smarty_tpl->tpl_vars['info']->value) && $_smarty_tpl->tpl_vars['info']->value) {
            ?>
      <?php 
            echo $_smarty_tpl->getSubTemplate("parts/info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('info' => $_smarty_tpl->tpl_vars['info']->value), 0);
            ?>

  <?php 
        }
        ?>
  
  <?php 
        if (isset($_smarty_tpl->tpl_vars['text']->value) && $_smarty_tpl->tpl_vars['text']->value) {
            ?>
      <p class="form-control-static">
        <?php 
            echo $_smarty_tpl->tpl_vars['text']->value;
            ?>

      </p>
  <?php 
        }
        ?>
</div><?php 
    }
Example #5
0
	<ol>
	
	<li>	
	<label for="user_number_id">{t t='Phone number'}</label>
	<?php 
global $user;
echo c2r_getHmtlSelectUserNumbers($user->id);
?>
<br/>
	</li>
	
	<li>
	<label for="location_id">{t t='Location'}</label>
	<?php 
$locations = c2r_locations_get();
echo c2r_getHtmlSelect("location_id", $locations, 'name', null, 'onchange="changed_location()"');
?>
	</li>

	<li>
	<label for="time_earliest">{t t='Earliest departure time'}</label>
	<input type="text" name="time_earliest" /> (hh:mm)
	</li>
	
	<li>
	<label for="time_latest">{t t='Latest departure time}</label> 
	<input type="text" name="time_latest" /> (hh:mm)
	</li>
	
	<li>
	<label for="start_date">{t t='Departure date'}</label>