Custom page template with custom fields

Create a Page_YourCustomName.php .
copy page.php content to your new file.
add the following code to first Line :

<?php /* Template Name: Your Custom Name */ ?>

Once you upload the file to your theme’s folder , go to the Page > Edit screen in your admin dashboard.

On the right hand side under attributes you’ll see template. This is where users are able to access your page templates.

then you would add metabox to your page/post in admin panel for use it to your template .
please read this link to (
How to create metabox and use it )