<?php echo $header; ?>
<br>
<?php if ($error_warning) { ?>
<?php echo p3html::tb_alert('error', $error_warning, true, 'warning'); ?>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1><i class="icon-dollar"></i> <?php echo $heading_title; ?></h1>
    <div class="buttons form-actions form-actions-top">
				<?php echo p3html::tb_form_button_save($button_save); ?>
				<?php echo p3html::tb_form_button_cancel($button_cancel, $cancel); ?>
			</div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
	Configure a <b>Notificao instantania de pagamento</b> para receber atualizacoes automaticas de seus pedidos <a href="https://www.mercadopago.com/mlb/ferramentas/notificacoes" target="_blank">Clique aqui para configurar</a><br />
      <table class="form">  
          <tr>
          <td><br /><?php echo $entry_status; ?><br /><br /></td>
          <td><br /><select name="mercadopago2_status">
              <?php if ($mercadopago2_status) { ?>
              <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
              <option value="0"><?php echo $text_disabled; ?></option>
              <?php } else { ?>
              <option value="1"><?php echo $text_enabled; ?></option>
              <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
              <?php } ?>
            </select><br /><br /></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_client_id; ?><br /><br /></td>
          <td><input type="text" name="mercadopago2_client_id" value="<?php echo $mercadopago2_client_id; ?>" />
            <?php if (isset($error_client_id)) { ?>
            <span class="error"><?php echo $error_client_id; ?></span>
            <?php } ?><br /><br /></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_client_secret; ?><br /><br /></td>
          <td><input type="text" name="mercadopago2_client_secret" value="<?php echo $mercadopago2_client_secret; ?>" />
            <?php if (isset($error_client_secret)) { ?>
            <span class="error"><?php echo $error_client_secret; ?></span>
            <?php } ?><br /><br /></td>
        </tr>
        
          <tr>
          <td><span class="required">*</span> <?php echo $entry_url; ?><br /><br /></td>
          <td><input type="text" name="mercadopago2_url" value="<?php echo $mercadopago2_url; ?>" />
            <?php if (isset($error_mercadopago2_url)) { ?>
            <span class="error"><?php echo $error_mercadopago2_url; ?></span>
            <?php } ?><br /><br /></td>
        </tr>
        
        
          <tr>
          <td><span class="required"></span> <?php echo $entry_debug; ?><br /><br /></td>
          <td><select name="mercadopago2_debug">
              <?php if ($mercadopago2_debug) { ?>
              <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
              <option value="0"><?php echo $text_disabled; ?></option>
              <?php } else { ?>
              <option value="1"><?php echo $text_enabled; ?></option>
              <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
              <?php } ?>
            </select><br /><br /></td>
        </tr>
        
        
        
        <tr>
          <td><?php echo $entry_order_status; ?><br /><br /></td>
          <td><select name="mercadopago2_order_status_id">
              <?php foreach ($order_statuses as $order_status) { ?>
              <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id) { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select><br /><br /></td>
        </tr>
        
       
        
        <tr>
          <td><?php echo $entry_country; ?><br /><br /></td>
          <td><select name="mercadopago2_country" id="country">
              <?php foreach ($countries as $country) { ?>
              <?php if ($country['id'] == $mercadopago2_country) { ?>
              <option value="<?php echo $country['id']; ?>" selected="selected" id="<?php echo $country['id']; ?>"><?php echo $country['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $country['id']; ?>" id="<?php echo $country['id']; ?>"><?php echo $country['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select><br /><br /></td>
        </tr>
        <tr>
          <td><?php echo $entry_installments; ?><br /><br /></td>
          <td><select name="mercadopago2_installments" id="country">
              <?php foreach ($installments as $installment) { ?>
              <?php if ($installment['id'] == $mercadopago2_installments) { ?>
              <option value="<?php echo $installment['id']; ?>" selected="selected" id="<?php echo $installment['id']; ?>"><?php echo $installment['value']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $installment['id']; ?>" id="<?php echo $installment['id']; ?>"><?php echo $installment['value']; ?></option>
              <?php } ?>
              <?php } ?>
            </select><br /><br /></td>
        </tr>
        <?php if(isset($methods)){?>
          <tr>
          <td><?php echo $entry_payments_not_accept; ?><br /><br /></td>
          <td>
          
          <table>         
          <?php foreach ($methods as $method) : ?>
          <?php if($method['id'] != 'account_money'){ ?>
          <?php if($mercadopago2_methods != null && in_array($method['id'], $mercadopago2_methods)){ ?>
          <tr><td><label><?php echo $method['name'];?></td><td><input name="mercadopago2_methods[]" type="checkbox" checked="yes" value="<?php echo $method['id'];?>"></label></td></tr>    
          <?php } else { ?>
          <tr><td><label><?php echo $method['name'];?></td><td><input name="mercadopago2_methods[]" type="checkbox" value="<?php echo $method['id'];?>"></label></td></tr>       
          <?php }} endforeach; ?>
          </table>
          
          </td>
          </tr>
        <?php ;} ?>
       <tr> 
          <td><?php echo $entry_sort_order; ?><br /><br /></td>
          <td><input type="text" name="mercadopago2_sort_order" value="<?php echo $mercadopago2_sort_order; ?>" size="1" /><br /><br /></td>
        </tr>
        <tr>
        <td><?php echo $entry_order_status_completed; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_completed">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_completed) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                
                <tr>
                  <td><?php echo $entry_order_status_pending; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_pending">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_pending) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                 <tr>
                  <td><?php echo $entry_order_status_canceled; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_canceled">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_canceled) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                 <tr>
                  <td><?php echo $entry_order_status_in_process; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_in_process">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_in_process) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                 <tr>
                  <td><?php echo $entry_order_status_rejected; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_rejected">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_rejected) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                 <tr>
                  <td><?php echo $entry_order_status_refunded; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_refunded">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_refunded) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                 <tr>
                  <td><?php echo $entry_order_status_in_mediation; ?><br /><br /></td>
                  <td><select name="mercadopago2_order_status_id_in_mediation">
                      <?php foreach ($order_statuses as $order_status) { ?>
                      <?php if ($order_status['order_status_id'] == $mercadopago2_order_status_id_in_mediation) { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                      <?php } else { ?>
                      <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                      <?php } ?>
                      <?php } ?>
                    </select><br /><br /></td>
                </tr>
                
                 
               
               
           
      </table>
    </form>
  </div>
</div>
<br /><br /><br /><br /><br /><br /><br />

<?php echo $footer; ?>