Ejemplo n.º 1
0
    $stmt->closeCursor();
    return $origin['origin'];
}
$categories = array('cars' => 'legkovie', 'trucks' => 'kommercheskie', 'moto' => 'moto', 'water' => 'vodniy', 'air' => 'vozdushniy');
$categoryToBodytypes = array('cars' => array('внедорожник/кроссовер', 'лимузин', 'минивэн/фургон/пикап', 'седан', 'универсал', 'хетчбек', 'купе', 'кабриолет/родстер/гоночный'), 'trucks' => array('автобус', 'автодом', 'voennaya-tehnika', 'грузовик', 'коммунальная техника', 'легкий коммерческий', 'микроавтобус', 'прицеп', 'сельхоз-техника', 'строительная техника'), 'moto' => array('квадроцикл', 'мотоцикл', 'скутер/мопед/минибайк', 'снегоход/багги/карт'), 'water' => array('гидроцикл', 'катер/лодка', 'яхта/катамаран'), 'air' => array('самолет/вертолет'));
$result = array();
$models = array();
foreach ($categories as $category => &$dirName) {
    $dirPath = PHP_FILES_PATH . $dirName;
    if (file_exists($dirPath)) {
        $files = scandir($dirPath);
        foreach ($files as &$file) {
            if ($file !== '.' && $file !== '..' && strpos($file, '_popular.php') === false) {
                $maker = str_replace('.php', '', $file);
                if (!isset($result[$maker]['categories'][$category])) {
                    $bodyTypes = $categoryToBodytypes[$category];
                    $ids = getIds($maker, $bodyTypes);
                    $models = getModels($ids);
                    if (!empty($models)) {
                        if (!isset($result[$maker]['origin'])) {
                            $result[$maker]['origin'] = getOrigin($maker);
                        }
                        $result[$maker]['categories'][$category] = $models;
                    }
                }
            }
        }
    }
}
$content = '<?php return ' . var_export($result, true) . ';';
$res = file_put_contents(PHP_FILES_PATH . 'home/maker_models.php', $content);
Ejemplo n.º 2
0
            $prevlink = $page > 1 ? '<a href="?action=surveys&page=1" title="First page">&laquo;</a> <a href="?action=surveys&page=' . ($page - 1) . '" title="Previous page">&lsaquo;</a>' : '<span class="disabled">&laquo;</span> <span class="disabled">&lsaquo;</span>';
            // The "forward" link
            $nextlink = $page < $pages ? '<a href="?action=surveys&page=' . ($page + 1) . '" title="Next page">&rsaquo;</a> <a href="?action=surveys&page=' . $pages . '" title="Last page">&raquo;</a>' : '<span class="disabled">&rsaquo;</span> <span class="disabled">&raquo;</span>';
            // Return an iteration from the samples table.
            $samples = getSamplesNew($limit, $offset);
            // Do we have any results?
            if ($samples) {
                foreach ($samples as $row) {
                    ?>

                <form class="form-inline" action="?action=confirmation" method="POST">

              <?php 
                    $questions = getQuestions();
                    $brand_name = getBrand($row['brandID']);
                    $origin_type = getOrigin($row['originID']);
                    ?>

                  <div class="form-group col-sm-12">
                    <h3><?php 
                    print $page . ". " . $brand_name['brandName'] . ' - ' . $origin_type['type'];
                    ?>
 </h3>
                      <?php 
                    foreach ($questions as $question) {
                        ?>
                        <p><?php 
                        print $question['questionText'];
                        ?>
</p>
                          <input type="radio" name="<?php 
Ejemplo n.º 3
0
              <div class="col-sm-2">
                <input name="action" type="hidden" value="createSample">
                <button type="submit" formaction="." class="btn btn-default">Save sample</button>
              </div>
            </div>

          </form> <!-- end inline form -->


          <div class="createdSamples">
            <ul class="list-group">
             <?php 
    $samples = getSamples();
    foreach ($samples as $sample) {
        $brand_name = getBrand($sample['brandID']);
        $origin_type = getOrigin($sample['originID']);
        ?>
               
                  <li class="list-group-item"><?php 
        print $brand_name['brandName'] . ' | ' . $origin_type['type'] . ' | ' . $sample['batch'];
        ?>
</li>
               <?php 
    }
    ?>
          </ul>
          </div>
            
        
      </div> <!-- end col-12 -->
    </div> <!-- end row div -->
Ejemplo n.º 4
0
     echo clearCommands();
     break;
 case "getCommands":
     echo getCommands();
     break;
 case "getLastModifiedTime":
     echo getLastModifiedTime();
     break;
 case "getPhysicalGridSize":
     echo getPhysicalGridSize();
     break;
 case "getLogicalGridSize":
     echo getLogicalGridSize();
     break;
 case "getOrigin":
     echo getOrigin();
     break;
 case "setOrigin":
     echo setOrigin($input);
     break;
 case "getNotesForKeys":
     echo getNotesForKeys();
     break;
 case "getTick":
     echo getTick();
     break;
 case "setTick":
     echo setTick($input);
     break;
 case "getTickInterval":
     echo getTickInterval();
Ejemplo n.º 5
0
    die;
} else {
    $result = array();
}
$new = array();
// Iterate through each item
foreach ($backpack_items['items'] as $ind => $backpack_items) {
    // Store all of the item's information in separate variables
    $id = $backpack_items['id'];
    $defindex = $backpack_items['defindex'];
    $image_url = "";
    $name = getItemName($schema_items, $defindex, $image_url);
    $level = $backpack_items['level'];
    $quantity = $backpack_items['quantity'];
    $origin = $backpack_items['origin'];
    $origin = getOrigin($origin);
    $flag_cannot_trade = array_key_exists('flag_cannot_trade', $backpack_items) ? $backpack_items['flag_cannot_trade'] : false;
    $flag_cannot_craft = array_key_exists('flag_cannot_craft', $backpack_items) ? $backpack_items['flag_cannot_craft'] : false;
    $inventory = $backpack_items['inventory'];
    // The inventory value is stored just like all of the others
    $position = $inventory & 65535;
    // You can directly perform bitwise operations on the value. PHP understands that you mean this to be a number
    $equipped = array_key_exists('equipped', $backpack_items);
    //$equipped = ($inventory >> 16) & 1023; // More bitwise operations to get the equipped number
    //$equippedString = getEquipped($equipped); // Convert the equipped number into a string
    $quality = $backpack_items['quality'];
    $quality = getQuality($quality);
    $qualidade = $quality[0];
    $cor1 = $quality[1];
    $cor2 = $quality[2];
    if ($qualidade == "Unusual") {