Osclass forums

Development => Plugins => Topic started by: mmcsus on May 25, 2013, 01:25:33 am

Title: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: mmcsus on May 25, 2013, 01:25:33 am
This plugin is based on cars attributes plugin.

version 1.0   Built with Osclass 3.1.2

Update:

1. Added auto switching of style based on theme selection.

2. Added color input field.

This plugin is designed to work with all themes in the market.

Known problems:

1. Can not delete makes and models from admin (This problem existed in cars attributes plugin.)

###########################################################################

Motorcycles Attributes

Author: mmcsus_Osclass
 
Motorcycles attributes

Version 1.1

Changes:

1. Corrected "Makes" delete function.

2. Corrected "Models" delete function.

3. Corrected "Motorcycle types" delete function.

4. Changed vehicle types in admin to Motorcycle types.

5. Changed style of "Edit button".

6. Kept style of delete button for Makes, Models, and Motorcycle types by using span tag.

Reference:

https://github.com/faosclass/osclass-plugins/commit/af70b0b718a2513506b8a429bc62d1089a58ab5c (https://github.com/faosclass/osclass-plugins/commit/af70b0b718a2513506b8a429bc62d1089a58ab5c)

Please check it out and let me know what can make it better.

July 16, 2013

Version 1.2

Updated to work with Osclass >= 3.2

Corrected problem with display of color attribute

July 17, 2013

Corrections to makes and models display in admin

Corrections to config

Tested in Osclass 3.02 --> 3.2RC

#########################

version 1.2.1
Update: Sept. 10, 2013
Motorcycles attributes

1. Corrected search

2. Corrected edited item

3. Corrected admin edit listing style for bender themes

##############################################

version 1.2.2
Update: Sep. 11, 2013
Motorcycles attributes

1. Corrected conflict with cars plugin when searching "make", "model" and "type".

Tested in Osclass 3.2.1 bender 1.0

David

Title: Re: [PLUGIN] Motorcycles attributes
Post by: Aficionado on May 25, 2013, 02:37:40 am

This plugin is based on cars attributes plugin.


1. Can not delete makes and models from admin (This problem existed in cars attributes plugin.)


I have opened an issue for the Car plugin on github a week ago.

Title: Re: [PLUGIN] Motorcycles attributes
Post by: Aficionado on May 25, 2013, 04:04:07 am

This plugin is based on cars attributes plugin.



Hi,

Could i ask why this plugin and the cars plugin do not support Color ? Isn't that a very very important feature of cars/motos ?

Title: Re: [PLUGIN] Motorcycles attributes
Post by: mmcsus on May 25, 2013, 04:14:47 am
Hi Aficionado,

Quote
Could i ask why this plugin and the cars plugin do not support Color?

In the case of the cars plugin I'm not sure why it was left out.

In my case it was to be but I got side tracked on another project and neglected to include it.

I will try and include it on the next update which should be very soon.

My goal is to have one plugin that will match all themes styles.





Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mmcsus on May 25, 2013, 11:22:06 pm

Now works with all themes.

version 1.0

Update:

1. Added auto switching of style based on theme selection.

2. Added color input field.

This plugin is designed to work with all themes in the market.
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: potoco on May 27, 2013, 05:50:37 pm

Now works with all themes.

version 1.0

Update:

1. Added auto switching of style based on theme selection.

2. Added color input field.

This plugin is designed to work with all themes in the market.

All plugins in the market should be compatible with all themes in the market, this feature should be an standard in OSClass.

Goo job mmcsus... !!!
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: Aficionado on May 27, 2013, 07:41:04 pm

Now works with all themes.

version 1.0

Update:

1. Added auto switching of style based on theme selection.

2. Added color input field.

This plugin is designed to work with all themes in the market.

I guess the "delete" problem is unsolved ?

Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: potoco on May 27, 2013, 08:26:48 pm
I guess the "delete" problem is unsolved ?

What do you mean with "delete" problem?, uninstalling?
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: Aficionado on May 27, 2013, 08:29:42 pm
I guess the "delete" problem is unsolved ?

What do you mean with "delete" problem?, uninstalling?

It is in the first post:

This plugin is designed to work with all themes in the market.

Known problems:

1. Can not delete makes and models from admin (This problem existed in cars attributes plugin.)

Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: potoco on May 27, 2013, 08:52:33 pm
Ok, I think something occur with the car attribute plugin, I guess the same happens with motorcycle plugin, the thing is that is the only one plugin I can't install in mi site. I tried with a clean installation of OSClass and I can't. I can install or uninstall any plugin from market except these ones...
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mmcsus on May 27, 2013, 08:58:26 pm
Hi potoco,

That's strange.

Can you turn on php debug and see errors?
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mmcsus on May 27, 2013, 09:05:05 pm
@Aficionado,


Quote
I guess the "delete" problem is unsolved ?

I have only checked the syntax and found one minor typo.

I think github is the best way but know answer yet ...

Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: potoco on May 27, 2013, 10:02:27 pm
Plugin could not be installed because: Error importSQL::Modelmotorcycles
motorcycles_attributes/basic_data.sql
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mmcsus on May 27, 2013, 10:31:03 pm
Hi potoco,

I think you have some left over tables in your database.

Can you look at your database again?

I made sure the latest update of this plugin removes all tables when uninstalled.

You must have some left over tables for car and motorcycle.


Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: potoco on May 27, 2013, 11:01:31 pm
Hi mmcsus,

Both plugins left four tables into database, then I delete them manually....
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mortaza2006 on May 28, 2013, 12:10:34 am
hi mmcsus

Sorry I can't speak good English

Quote
Known problems:

1. Can not delete makes and models from admin (This problem existed in cars attributes plugin.)

Please check it it out and let me know what can make it better.

To fix this problem
You do

open file conf.php

and changes this lines
Code: [Select]
                                                        echo '<li><input name="make[' . $make['pk_i_id'] . ']" id="' . $make['pk_i_id'] . '" type="text" value="' . $make['s_name'] . '" /> <a href="' . osc_admin_base_url(true) . '?page=plugins&action=renderplugin&file=motorcycles_attributes/conf.php?section=makes&plugin_action=make_delete&id=' . $make['pk_i_id'] . '" ><button class="benderbtn">' . __('Delete', 'motorcycles_attributes') . '</button></a> </li>';   

to

Code: [Select]
                                                        echo '<li><input name="make[' . $make['pk_i_id'] . ']" id="' . $make['pk_i_id'] . '" type="text" value="' . $make['s_name'] . '" /> <a class="benderbtn" href="' . osc_admin_base_url(true) . '?page=plugins&action=renderplugin&file=motorcycles_attributes/conf.php?section=makes&plugin_action=make_delete&id=' . $make['pk_i_id'] . '" >' . __('Delete', 'motorcycles_attributes') . '</a> </li>';


in fact
delete <button> in codes

Code: [Select]
<button class="benderbtn">' . __('Delete', 'motorcycles_attributes') . '</button>

Change your

Code: [Select]
' . __('Delete', 'motorcycles_attributes') . '

Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: mmcsus on May 28, 2013, 12:21:54 am
Hi mortaza2006,

Thanks

https://github.com/osclass/osclass-plugins/pull/153/files#diff-0 (https://github.com/osclass/osclass-plugins/pull/153/files#diff-0)
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: Aficionado on May 28, 2013, 02:17:03 am
The above bug fix from Mortaza solves the delete in Car Makes and Car Model Types.

But the 3rd option (Vehicle Type) still has the delete problem.

Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: mmcsus on May 28, 2013, 06:57:56 am
Motorcycles Attributes

Author: mmcsus_Osclass

version 1.1
Update:
Motorcycles attributes

Version 1.1

Changes:

1. Corrected "Makes" delete function.

2. Corrected "Models" delete function.

3. Corrected "Motorcycle types" delete function.

4. Changed vehicle types in admin to Motorcycle types.

5. Changed style of "Edit button".

6. Kept style of delete button for Makes, Models, and Motorcycle types by using span tag.

Reference:

https://github.com/faosclass/osclass-plugins/commit/af70b0b718a2513506b8a429bc62d1089a58ab5c

Download from first post.


Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: mmcsus on May 28, 2013, 06:33:52 pm
@potoco

Quote
Both plugins left four tables into database, then I delete them manually....


I would like to run a little experiment, if your willing?

Find attached potocos_attributes plugin.

This is nothing more than motorcycles_attributes just without the name.

I would like for you to install it on your system and tell me if it works.

I have checked to make sure when you uninstall it the tables will be removed from mysql.

Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: Aficionado on May 28, 2013, 06:42:37 pm
Apparently something IS wrong with uninstall. Because i can't install the 1.1 after uninstalling the plugin.

And i see 4 tables in the db that i had to manually delete ..

just FYI,
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: Aficionado on May 28, 2013, 06:44:59 pm
I also see that there is a limit of 10 Vehicle types (as with car plugin) and that is a problem for localized osclass installations.

For one language 10 is ok, for two languages it is not.

(still i can't find any 10 items limitation in the code ....)

Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: mmcsus on May 29, 2013, 05:57:37 am
Hi Aficionado,

Sorry for the late reply.

Quote
(still i can't find any 10 items limitation in the code ....)

There is no limitation in the code.

The problem is once  motorcycle types gets to 10  mysql starts over and you git DUPLICATE KEY errors.

So now you know the issue, I'am not a mysql Guru but I thought I was.  ;D

We all have a lot to learn.

Isn't that's what it's all about?


Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: Aficionado on May 29, 2013, 06:01:02 am
Hi Aficionado,

Sorry for the late reply.

Quote
(still i can't find any 10 items limitation in the code ....)

There is no limitation in the code.

The problem is once  motorcycle types gets to 10  mysql starts over and you git DUPLICATE KEY errors.

So now you know the issue, I'am not a mysql Guru but I thought I was.  ;D

We all have a lot to learn.

Isn't that's what it's all about?

Hi there !

You mean this is a bug of the Car Attributes plugin ? Why start over after 10 ?

You see i'm neither a mysql or php expert ...
 :-[ :-[
Title: Re: [PLUGIN] Motorcycles attributes (UPDATED)
Post by: Aficionado on May 29, 2013, 06:32:55 am
Plugin could not be installed because: Error importSQL::Modelmotorcycles
motorcycles_attributes/basic_data.sql

ok, i found the problem with install (after uninstall) fails.

If you DISABLE the plugin and THEN uninstall, some tables are left and you can't install it again.

If you UNINSTALL the plugin while ENABLED everything is cleared.

Not sure why this happens. With Cars also.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: potoco on May 29, 2013, 08:15:07 am
@potoco

Quote
Both plugins left four tables into database, then I delete them manually....


I would like to run a little experiment, if your willing?

Find attached potocos_attributes plugin.

This is nothing more than motorcycles_attributes just without the name.

I would like for you to install it on your system and tell me if it works.

I have checked to make sure when you uninstall it the tables will be removed from mysql.

Hi mmcsus, this plugin has failed, sorry, I don't find the option to switch on the php debug so I don't know what to do to switch it. I am on an vserver, will be the reason?

I had to delete the four tables in the database again...
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: mmcsus on May 29, 2013, 02:23:35 pm
Quote
I had to delete the four tables in the database again...

Hi potoco,

Quote
I am on an vserver

Pardon my ignorance but what is a vserver?

I do not have these problems. I would like to understand what's going on.

I'm on a VPS server. (Unmanaged)

I would like to set up an account for you on my server. ( for testing only of course)

Let me see what I can do ...




Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: mmcsus on May 29, 2013, 04:07:46 pm

Quote
I would like to set up an account for you on my server. ( for testing only of course)

Let me see what I can do ...


... done!
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: potoco on May 29, 2013, 06:40:27 pm
Pardon my ignorance but what is a vserver?

The vserver is an virtual server, shared server, maybe something like yours, don't worry about it, I have a phisycal server too, so when I can I will move an OSClass installation in order to make more test. I don't have time this week so we keep in touch.

Thank you so much for your concern.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1
Post by: Hostingames on June 18, 2013, 04:08:14 pm
hi
the plugin t there before I install bug

thank you
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1 (Updated)
Post by: mmcsus on July 16, 2013, 03:46:42 pm

Updated to work with Osclass => 3.2

Please see first post.

Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1 (Updated)
Post by: Aficionado on July 16, 2013, 04:42:10 pm

Updated to work with Osclass => 3.2

Please see first post.

David thanks.

This has been fixed also in the Cars plugin, did you include this in your module ?

https://github.com/osclass/osclass-plugins/issues/154


Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.1 (Updated)
Post by: mmcsus on July 16, 2013, 05:02:34 pm
Hi Aficionado,

Thank you, no I was not informed which is strange because I'm on the list. Probably my own fault, I just missed it.

I will look into it and update the plugin if needed.

There are a lot of "big" changes in Osclass 3.2 that will break a lot sites if the admins are not informed.

I trust that Osclass team will handle these matters before the release.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2 (Updated)
Post by: mmcsus on July 17, 2013, 12:18:09 am
Anyone that downloaded the plugin today may want to download again.

Version 1.2 in first post.

Modified to work with Osclass 3.2

Corrected display of color attribute.

July 17, 2013

Corrections to makes and models display in admin

Corrections to config

Tested in Osclass 3.02 --> 3.2RC

Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2 Tested in Osclass 3.02 --> 3.2RC
Post by: lexosc on August 09, 2013, 06:01:27 pm
Plugin doesn't work any more. neither car attributes works
When you search it doesn't bring you any results
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2 Tested in Osclass 3.02 --> 3.2RC
Post by: lexosc on August 10, 2013, 06:05:07 pm
The plugin is interfering with CAR attributes!!!! if you have both installed then neither of those 2 will work you can't search it will not give any results, as soon i uninstalled motorcycle attributes, car attributes was working! please fix this!!!!
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2 Tested in Osclass 3.02 --> 3.2RC
Post by: lexosc on September 04, 2013, 05:50:43 pm
Sorry for bumping but can someone make this work with car attributes too please?
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2 Tested in Osclass 3.02 --> 3.2RC
Post by: ptkoder on September 10, 2013, 02:50:50 pm
Hi, the plugin don't work when edit the article. Any solution?
Tks,
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: mmcsus on September 10, 2013, 10:26:17 pm

version 1.2.1
Update: Sept. 10, 2013
Motorcycles attributes

1. Corrected search

2. Corrected edited item

3. Corrected admin edit listing style for bender themes

Tested in Osclass 3.2.1 bender 1.0

Download from first post.

David
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: lexosc on September 11, 2013, 04:53:17 am
hi mmcus, Thanks for the update!

i still have the issue, the search still doesn't show anything:
i have added 1 ad with motorcycle and 1 ad with car plugin
motorcycle is lets say make: bimota    car make : bmw
when you search for bmw it will not show any results neither for bimota on motorcycles
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: mmcsus on September 11, 2013, 11:47:29 am
Hi alexgr,

By default Osclass searches "title" and "description".

Minimum characters is "4". So if your searching for BMW no results will be displayed.

Example: The title of the ad is "BMW for sale" and the user searches for "BMW sale" returns everything with "sale" in it.

I have just checked with cars plugin and motorcycles plugin installed and search works as expected.

Hope that helps,

David
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: lexosc on September 11, 2013, 05:24:20 pm
no i don't mean the text field search!! :)

i mean when you select the drop down " make" , "model" it doesn't bring any results but if i uninstall car attributes it will show the make that i selected in dropdown it has nothing to do with title
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: mmcsus on September 11, 2013, 08:19:03 pm
Hi alexgr,

I would like to thank you for your persistence.

Please check the plugin on the first post and if everything looks good I will update "Yachts" plugin asap.

version 1.2.2
Update: Sep. 11, 2013
Motorcycles attributes

1. Corrected conflict with cars plugin when searching "make", "model" and "type".

Download from first post.

David
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: lexosc on September 11, 2013, 08:28:38 pm
Super!! it works now thanks million times!
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: ptkoder on September 17, 2013, 02:04:03 pm
Tks. Good Work.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: gnoe on December 27, 2013, 01:54:58 pm
 :D Great job. Thanks.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: kweku on May 21, 2014, 09:35:06 pm
Who has the car plugin.????  and it shows detail on item???   I NEED IT>
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: chewyluke on May 21, 2014, 09:52:40 pm
Have you checked the market? It's right there.
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: fezanna on October 06, 2014, 07:10:14 pm
Hi, I have2 question:
1._ when I change the search from car to motorcycles, the make remains the value of research of the car.
2._ when I do a search for motorcycles does not maintain brand - model - type of the previous search

Someone has already encountered this problem and could help me?
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: Bla Bla Annunci on May 19, 2015, 05:10:55 pm
I have a problem with the models
During the insert ads I'm going to select the Make.
You do not see models
somebody help me
thanks
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.1 Update: Sept. 10, 2013
Post by: martymcgivern77 on July 16, 2015, 01:47:33 am
Hi alexgr,

I would like to thank you for your persistence.

Please check the plugin on the first post and if everything looks good I will update "Yachts" plugin asap.

version 1.2.2
Update: Sep. 11, 2013
Motorcycles attributes

1. Corrected conflict with cars plugin when searching "make", "model" and "type".

Download from first post.

David

Hi mmcsus, I know this is an old post but did you get round to doing a yachts plugin? If not, is there much involved in me modifying motorcycles plugin myself?

Thanks
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: arcsales on October 18, 2015, 11:10:53 am
Plugin couldn't be installed because of: Error importSQL::Modelmotorcycles
motorcycles_attributes/basic_data.sql

Any help?
Im using 3.5.9 version
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: Loriby87 on May 22, 2016, 03:45:56 am
Hi i tryed to install so many times i deleted all the for tabbles from the database and i dont know why is failing to install this plugin.Please help me to solve this problem first time if i trying to install the plugin is have problem with basic data sql and after if i trying again it have problem with struct sql
i tryed to import the struct sql file in database but i got this error Error
SQL query:

CREATE TABLE /*TABLE_PREFIX*/t_item_motorcycle_motorcycle_type_attr(

pk_i_id INT( 2 ) UNSIGNED NOT NULL ,
fk_c_locale_codeCHAR( 5 ) NOT NULL ,
s_name VARCHAR( 255 ) ,
PRIMARY KEY ( pk_i_id, fk_c_locale_code ) ,
FOREIGN KEY ( fk_c_locale_code ) REFERENCES /*TABLE_PREFIX*/t_locale(
pk_c_code
)
) ENGINE = INNODB DEFAULT CHARACTER SET  'UTF8' COLLATE  'UTF8_GENERAL_CI';

MySQL said: Documentation

#1005 - Can't create table 'petfinde_gsale.t_item_motorcycle_motorcycle_type_attr' (errno: 150)
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: ysalim on June 17, 2016, 07:28:57 pm
I installed and it worked, only however, I really do need to be able to search by year min and max, can anyone please help ?
Title: Re: [PLUGIN] Motorcycles attributes Ver. 1.2.2 Update: Sept. 11, 2013
Post by: BC-TEAM on June 17, 2016, 07:50:22 pm
index:

Code: [Select]
switch($key) {
    ...
    case 'min_year':
        if (is_numeric($value)) {
            Search::newInstance()->addConditions(sprintf("%st_item_motorcycle_attr.i_year >= %d", DB_TABLE_PREFIX, $value));
            $has_conditions = true;
        }
        break;
    case 'max_year':
        if (is_numeric($value)) {
            Search::newInstance()->addConditions(sprintf("%st_item_motorcycle_attr.i_year <= %d", DB_TABLE_PREFIX, $value));
            $has_conditions = true;
        }
        break;
    default:
    break;
}

form:

Code: [Select]
<div class="row one_input">
    <h6><?php _e('Year''motorcycles_attributes'); ?></h6>
    <select name="min_year" id="min_year">
        <option value=""><?php _e('Min Year''motorcycles_attributes'); ?></option>
        <?php
            
            $minYr 
= array();
            for (
$a 2016$a 1970$a--) {
                
$minYr['id'] = $a;
                
$minYr['name'] = $a;
            
?>

            <option value="<?php echo $minYr['id']; ?>" <?php if ($min_yr == $minYr['id']) { echo 'selected'; } ?>><?php echo $minYr['name'?></option>
        <?php ?>
    </select>
    <select name="max_year" id="max_year">
        <option value=""><?php _e('Max Year''motorcycles_attributes'); ?></option>
        <?php
                
            $maxYr 
= array();
            for (
$b 2016$b 1970$b--) {
                
$maxYr['id'] = $b;
                
$maxYr['name'] = $b;
            
?>

            <option value="<?php echo $maxYr['id']; ?>" <?php if ($max_yr == $maxYr['id']) { echo 'selected'; } ?>><?php echo $maxYr['name'?></option>
        <?php ?>
    </select>
</div>