-
Notifications
You must be signed in to change notification settings - Fork 0
/
chileatiende-form-config.php
86 lines (84 loc) · 4.38 KB
/
chileatiende-form-config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<div id="message" class="<?=$msj_class?>"><?=$msj?></div>
<div class="wrap">
<h2>Configuración despliegue Fichas Chileatiende</h2>
<ul class="pasos">
<li>Primero debes ingresar tu Código de acceso (access_token) y guardar</li>
<li>A continuación, debes seleccionar el Servicio del cual deseas obtener las fichas.</li>
<li>En el campo Fichas, debes ingresar las fichas que SOLO deseas que aparezcan, si deseas que aparezcan todas deja este campo en blanco</li>
<li>El campo Número de fichas define cuantas fichas se mostraran, este filtro se anulará si el campo Fichas tiene datos</li>
<li>Finalmente copia y pega el siguiente código en tu template <code><?= chileatiende_fichasportada() ?></code></li>
</ul>
<form method="post" name="elFormulario" action="">
<?= settings_fields('chileatiende_options'); ?>
<h3>Configuración General</h3>
<table class="form-table">
<tr>
<th scope="row">Código de acceso (access_token)</th>
<td>
<fieldset>
<legend class="screen-reader-text"><span>Código de acceso (access_token)</span></legend>
<label for="cha_access_token">
<input type="text" name="cha_access_token" id="cha_access_token" value="<?php echo (get_option('cha_access_token')) ? get_option('cha_access_token') : '' ?>" />
<a href="https://www.chileatiende.cl/desarrolladores/access_token">Puedes solicitar tu código de acceso desde acá</a>
</label>
</fieldset>
</td>
</tr>
<?php
if (get_option('cha_access_token')) {
$aData = chileatiende_getServicios(get_option('cha_access_token'));
$aServicios = $aData->servicios->items->servicio;
?>
<tr>
<th scope="row">Servicios</th>
<td>
<fieldset>
<legend class="screen-reader-text"><span>Servicio</span></legend>
<label for="cha_servicios">
<select name="cha_servicio" id="cha_servicio">
<option value="0">Seleccione el Servicio</option>
<?php
foreach( $aServicios as $servicio ) {
$selected = (get_option('cha_servicio') == $servicio->id) ? 'selected="selected"' : '';
?>
<option value="<?=$servicio->id?>" <?=$selected?>><?=$servicio->nombre?></option>
<?php
}
?>
</select>
</label>
</fieldset>
</td>
</tr>
<tr>
<th scope="row">Fichas</th>
<td>
<fieldset>
<legend class="screen-reader-text"><span>Fichas</span></legend>
<label for="cha_fichas">
<input type="text" name="cha_fichas" id="cha_fichas" placeholder="Ingrese los ID de fichas separadas por coma" value="<?= (get_option('cha_fichas')) ? get_option('cha_fichas') : ''; ?>" size="74" />
<p class="description">por ejemplo: 11488,13110,1,20</p>
</label>
</fieldset>
</td>
</tr>
<tr>
<th scope="row">Nro de fichas a desplegar</th>
<td>
<fieldset>
<legend class="screen-reader-text">Número de fichas a desplegar</legend>
<label for="cha_nrofichas">
<input type="text" size="3" name="cha_nrofichas" id="cha_nrofichas" value="<?= (get_option('cha_nrofichas')) ? get_option('cha_nrofichas') : 0; ?>" />
<span>0 para mostrar todas las fichas</span>
</label>
</fieldset>
</td>
</tr>
<?php
}
?>
</table>
<?php submit_button(); ?>
<input type="hidden" name="chileatiende_update" value="true" />
</form>
</div>