Example #1
0
 /**
  * get Entries from a collection and converts ID and applies a dummyData field for easy export and remove
  * @param type $type 
  * @param type $where 
  * @return type
  */
 public static function listOption($arrayOption, $chaine, $first, $name_id, $father = "")
 {
     $i = 1;
     foreach ($arrayOption as $key => $value) {
         //if(is_array($value))
         if (empty($value["value"]) && empty($value["label"])) {
             //var_dump($value);
             $chaine = $chaine . '<li><strong class="btn-drop bold" >' . $key . '</strong></li>';
             $otherfather = $father . "." . $key;
             if ($first == true && $i == 1) {
                 $chaine = CityOpenData::listOption($value, $chaine, true, $name_id, $otherfather);
             } else {
                 $chaine = CityOpenData::listOption($value, $chaine, false, $name_id, $otherfather);
             }
         } else {
             if ($first == true && $i == 1) {
                 $list = '<li>
                         <a class="btn-drop optionBtn" data-name="' . $father . '.' . $key . '">
                             <input type="checkbox" id="' . $name_id . $father . '.' . $key . '" name="' . $name_id . 'optionCheckbox" value="' . $father . '.' . $key . '" checked/>
                             <label for="' . $name_id . $father . '.' . $key . '" >' . $value["label"] . '</label>
                         </a>
                       </li>';
             } else {
                 $list = '<li>
                         <a class="btn-drop optionBtn" data-name="' . $father . '.' . $key . '">
                             <input type="checkbox" id="' . $name_id . $father . '.' . $key . '" name="' . $name_id . 'optionCheckbox" value="' . $father . '.' . $key . '"/>
                             <label for="' . $name_id . $father . '.' . $key . '" >' . $value["label"] . '</label>
                         </a>
                       </li>';
             }
             $chaine = $chaine . $list;
             // var_dump($chaine);
             $i++;
         }
     }
     return $chaine;
 }
Example #2
0
						<span id="label-option"> Total </span><span class="caret"></span>
					</a>

					<ul role="menu" class="dropdown-menu pull-right" id="filterGraph">
						<?php 
$where = array("insee" => $_GET['insee'], $typeData => array('$exists' => 1));
$fields = array($typeData);
$option = City::getWhereData($where, $fields);
$chaine = "";
foreach ($option as $key => $value) {
    foreach ($value as $k => $v) {
        if ($k == $typeData) {
            if (isset($optionData)) {
                $chaine = CityOpenData::listOptionWithOptionChecked($v, $chaine, $name_id, $optionData);
            } else {
                $chaine = CityOpenData::listOption($v, $chaine, true, $name_id);
            }
        }
    }
}
echo $chaine;
?>

					</ul>
				</div>
			</li>			
		</ul>
	</div>
	<div class="panel-heading border-light divline">
		<ul  class="panel-heading-tabs border-light ulline">
			<li>