/** * Main function to insert radios in the database. Call auxiliary functions * to format the data that is going to be inserted for each radio. * * @param array $data radio data from the csv file * @return void */ function insertRadio(array $data) { global $row; //remove white spaces from the end and beggining of the strings $data = array_map('trim', $data); if (!empty($data[0])) { $name = addslashes($data[0]); } else { die("Mandatory field 'name' is empty in line {$row}\n"); } $address = addslashes($data[1]); $city = addslashes($data[2]); $state = formatState($data[3]); $city_code = getCityCode($data[2], $state); $license = formatLicense($data[4]); list($latitude, $longitude) = formatCoordinates($data[5]); list($channel, $frequency) = formatChannelAndFrequency($data[6]); $identifier = $data[7]; if (!empty($latitude) && !empty($longitude)) { $visible = 1; } else { $visible = 0; } $time = time(); query("INSERT INTO radios_comunitarias (razao_social, endereco, cod_municipio, municipio, uf, latitude, longitude, canal, frequencia, indicador, visivel, licenca, created)\n\t\tVALUES ('{$name}', '{$address}', '{$city_code}', '{$city}', '{$state}', '{$latitude}', '{$longitude}', '{$channel}', '{$frequency}', '{$identifier}', '{$visible}', '{$license}', FROM_UNIXTIME({$time}))"); }
<br> <div class='h1'>:: Informacion de la VM id: <?php echo $vmid; ?>  ::</div> <br><br> <table class="list" style="width:100%;margin-left: 0px;"> <tbody> <tr> <td style="width:10px;background:#777;"><img src="images/icon_state.png"></td> <th style="width:90px; background:#777;padding-left:0px;">State</th> <td colspan="3" style="text-align:left; padding-left:20px; font-weight:bold;background:#CCC;"><?php echo formatState($radl_tokens['state']); ?> </td> </tr> <tr> <td style="width:10px;background:#777;"><img src="images/icon_deploy.png"></td> <th style="width:90px; background:#777;padding-left:0px;">Deployment</th> <td colspan="3" style="text-align:left; padding-left:20px;font-weight:bold;background:#CCC;"><?php echo formatCloud($radl_tokens); ?> </td> </tr> <tr> <td style="width:10px;background:#777;"><img src="images/icon_ip.png"></td> <th style="width:90px; background:#777;padding-left:0px;">IPs</th>
<th style="font-style:italic;">    Delete</th> <th style="font-style:italic;">    Add Resources</th> </tr> </thead> <tbody> <?php foreach ($res as $inf) { $vm_list = GetInfrastructureInfo($im_host, $im_port, $inf); if (is_string($vm_list) || count($vm_list) == 0) { $vm_list = array("N/A"); } $state = GetInfrastructureState($im_host, $im_port, $inf); $status = "N/A"; if (!(is_string($state) && strpos($state, "Error") !== false)) { $status = formatState($state); } ?> <tr> <td> <?php echo $inf; ?> </td> <td> <?php foreach ($vm_list as $vm) { if ($vm !== "N/A") { echo "<a href='getvminfo.php?id=" . $inf . "&vmid=" . $vm . "' alt='VM Info' title='VM Info'>" . $vm . "<br>"; } else { echo "N/A";