Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $response = array($query_license,$query_estate,$result_license);
- if ($this->request->is('ajax')) {
- echo json_encode($response);
- die();
- }
- $.ajax({
- type: 'GET',
- async: true,
- cache: false,
- url: license,
- dataType: 'json',
- data:{id_user_license:id_user_license,id_evaluation:id_evaluation},
- success: function (data){
- $.each(data,function(i,s){
- if(s[0].cantidad_pendiente === 0){
- $("#message_license").html('<p>Usted no cuenta con licensias disponibles</p>');
- $("#modal_report__footer").html('<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>');
- }else if(s[0].estado === 3){
- $("#message_license").html('<p>Usted cuenta con '+ s[0].cantidad_pendiente +'</p>');
- $("#message_consumed").html('<p>Esta evaluacion ya consumio licencia</p>');
- $("#modal_report__footer").html('<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>');
- }else{
- $("#message_license").html('<p>Usted cuenta con '+ s.indexOf(3).cantidad_pendiente +'</p>');
- $("#modal_report__footer").html('<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button> <button type="submit" class="btn btn-danger">Consumir</button>');
- }
- });
- }
- });
- console.log(s[0].cantidad_pendiente);
- 5
- undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement