OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?

VehicleManager component support

Go to bottom Favoured: 0

ISSUE_YEAR descending

redmac (Visitor)
Posts: 0
graphgraph
User Offline
ISSUE_YEAR descending 10 Years, 11 Months ago
Karma: 0  
Hi,

I would like to have the ISSUE_YEAR descending. I'm not up to date with php but I guess I have to make a change here:

Code:


        <?php
        echo "<option value=''>";
        echo _VEHICLE_MANAGER_OPTION_SELECT;
        echo "</option>";
        $num = 1990;
        for ($i = 0; $num <= date('Y'); $i++) {
            echo "<option value="";
            echo $num;
            echo """;
            if ($num == $row->year)
            {
                echo " selected= "true" ";
            }
            echo ">";
            echo $num;
            echo "</option>";
            $num++;
        }
        ?>



Am I right? Can you tell me what to change?

Thanks.
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8367
graph
User Offline Click here to see the profile of this user
Re:ISSUE_YEAR descending 10 Years, 11 Months ago
Karma: 102  
Hello,

You need in below code write some like that:

Code:


        <?php
        echo "<option value=''>";
        echo _VEHICLE_MANAGER_OPTION_SELECT;
        echo "</option>";
        $num =  date('Y');
        for ($i = 0; $num >= 1990 ; $i++) {
            echo "<option value="";
            echo $num;
            echo """;
            if ($num == $row->year)
            {
                echo " selected= "true" ";
            }
            echo ">";
            echo $num;
            echo "</option>";
            $num--;
        }
        ?>



Please backup your file first

Thanks,
OrdaSoft team
Logged Logged
Last Edit: 2014/01/08 09:57 By admin.
The administrator has disabled public write access.
redmac (Visitor)
Posts: 0
graphgraph
User Offline
Re:ISSUE_YEAR descending 10 Years, 11 Months ago
Karma: 0  
Thanks, this works.
Logged Logged
The administrator has disabled public write access.
01system (User)
Senior Boarder
Posts: 47
graphgraph
User Offline Click here to see the profile of this user
Re:ISSUE_YEAR descending 8 Years, 8 Months ago
Karma: 0  
I have a similar request and want to see first recent year, not 1900 as first option.
I have latest version of the component.

Moreover, where do i have to edit in order to add/remove years?

Now the code is:

Code:


      <?php
      echo "<option value=''>";
      echo _VEHICLE_MANAGER_OPTION_SELECT;
      echo "</option>";
      $num = 1900;
      for ($i = 0; $num <= date('Y'); $i++) {
          echo "<option value="";
          echo $num;
          echo """;
          if ($num == $row->year)
          {
              echo " selected= "true" ";
          }
          echo ">";
          echo $num;
          echo "</option>";
          $num++;
      }
      ?>



Thanks
Logged Logged
Last Edit: 2016/04/09 08:27 By 01system.
The administrator has disabled public write access.
redmac (Visitor)
Posts: 0
graphgraph
User Offline
Re:ISSUE_YEAR descending 8 Years, 8 Months ago
Karma: 0  
Hi 01system,

You can change the start date in the components/com_vehiclemanager/views/show_search_vehicle/tmpl/layout2.php

search for:
Code:

<span class="col_02"><?php echo _VEHICLE_MANAGER_LABEL_PRICE_FROM;?></span>
<input type="text" id="yearlist"  name="yearfrom" value="1990"/>



And change the year to 1900

Best regards,

Redmac
Logged Logged
The administrator has disabled public write access.
01system (User)
Senior Boarder
Posts: 47
graphgraph
User Offline Click here to see the profile of this user
Re:ISSUE_YEAR descending 8 Years, 8 Months ago
Karma: 0  
Thanks but that was not the request. I don't need to change start date.

I need to reverse the order and see current year as first option and 1900 as last option.
Logged Logged
The administrator has disabled public write access.
Go to top
»