/application/views/admin/actividades_prospecto_view.bakRaul.php
PHP | 426 lines | 393 code | 32 blank | 1 comment | 22 complexity | de20367bb047239e95ab4b69e59eb483 MD5 | raw file
- <script type="text/javascript">
- jQuery(document).ready(
- function($){
- var open = false;
- speed = 500;
- $(".hideForm").hide();
-
- $(".shContent").click(
- function(){
- if(!open){
- $(".hideForm").show(speed);
- open = true;
- } else{
- $(".hideForm").hide(speed);
- open = false;
- }
- }
- );
-
- //Jquery validations
- $( ".datepicker" ).datepicker();
- jQuery("#newUser").validationEngine(
- 'attach',
- {
-
- onValidationComplete: function(form, status){
- if (status == true) {
- return true;
- }
- }
- }
- );
-
- $(".deleteRow").live(
- 'click',
- function(e){
- e.preventDefault();
- var thisID = $(this).attr('href');
- noty({
- text: 'Realmente desea eliminar este registro? Se eliminará todo lo relacionado con el mismo.',
- type: 'alert',
- dismissQueue: true,
- layout: 'center',
- theme: 'default',
- buttons: [
- {addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {
- $noty.close();
- $.ajax({
- url : '<?=base_url()?>admin/prospecto/eliminar_actividad',
- type : 'POST',
- dataType : 'json',
- data : 'idHojaActividad=' + thisID + '&tipo=deleted',
- success: function(data){
- if(data.response == 'true'){
- $("#" + thisID).stop().hide('slow');
- }
- else {
- noty({
- text : 'OCURRIÓ UN ERROR AL ELIMINAR EL REGISTRO. INTÉNTE NUEVAMENTE.',
- type : 'error',
- dismissQueue: true,
- layout: 'top',
- theme: 'default',
- timeout: 4000
- });
- }
- }
- })
-
- }
- },
- {addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
- $noty.close();
- return false
- }
- }
- ]
- });
- }
- );
-
-
- $(".updateEstado").live(
- 'click',
- function(e){
- e.preventDefault();
- var thisID = $(this).attr('href');
- noty({
- text: 'Realmente desea terminar esta actividad?',
- type: 'alert',
- dismissQueue: true,
- layout: 'center',
- theme: 'default',
- buttons: [
- {addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {
- $noty.close();
- $.ajax({
- url : '<?=base_url()?>admin/prospecto/editar_estado_actividad',
- type : 'POST',
- dataType : 'json',
- data : 'idHojaActividad=' + thisID,
- success: function(data){
- if(data.response == 'true'){
- $("#" + thisID).stop().hide('slow');
- }
- else {
- noty({
- text : 'OCURRIÓ UN ERROR AL ELIMINAR EL REGISTRO. INTÉNTE NUEVAMENTE.',
- type : 'error',
- dismissQueue: true,
- layout: 'top',
- theme: 'default',
- timeout: 4000
- });
- }
- }
- })
-
- }
- },
- {addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
- $noty.close();
- return false
- }
- }
- ]
- });
- }
- );
-
- $("tr.hideMessages").slideUp(1);
-
- $("tr.showMessages").click(
- function(){
- var speed = 250;
- var thisID = $(this).attr('id');
- $("tr.hideMessages").slideUp();
- $("#" + thisID + "_messages").slideDown();
- $("tr.addMessagetr").hide(1);
- }
- );
-
- $("tr.addMessagetr").slideUp(1);
-
- $("a.addMessage").click(
- function(e){
- e.preventDefault();
- $("tr.addMessagetr").hide(1);
- var thisID = $(this).attr('href');
- $("#" + thisID + "_addMessage").fadeIn(250);
- }
- );
-
- $(".addMessageForm").submit(
- function(e){
- e.preventDefault();
- var formID = $(this).attr('id');
- var commentID = $(this).attr('data-rel');
- console.log(formID);
- console.log(commentID);
- $("#" + commentID + "_messages").before('<tr class="strong hideMessages"><td></td><td colspan="2">La neta está bien chido DE AJAX</td><td colspan="2">Pedro 2012-09-09 23:00:03</td></tr>');
-
- }
- );
-
- }
- );
- </script>
- <div id="contentUsers">
- <form class="niceform">
- <input type="button" value="Nueva Actividad" class="shContent" />
- <input type="button" value="Calendario" class="floatRight" style="margin: 0 10px 0 0; cursor: pointer;" />
- </form>
- <br />
- <div id="newUserContainer" class="hideForm">
- <form id="newUser" name="newUser" method="post" class="niceform" action="<?=base_url()?>admin/prospecto/nueva_actividad_do" enctype="multipart/form-data">
- <input type="hidden" name="idHojaVida" value="<?=$this_prospecto->idHojaVida?>" />
- <?=form_fieldset('Nueva Actividad'); ?>
- <table>
- <tr>
- <td align="right">
- <label for="nombreActividad">Actividad:</label>
- </td>
-
- <td>
- <div class="divhojadd">
- <select name="nombreActividad" id="nombreActividad" class="validate[required]">
- <option value="" > - - - - </option>
- <option value="1" >Llamada</option>
- <option value="2" >Cita</option>
- <option value="3" >Email</option>
- <option value="4" >Firma de contrato</option>
- <option value="5" >Pago de apartado</option>
- <option value="6" >Cancelación</option>
- <option value="7" >Seguimiento post-venta</option>
- <option value="8" >Atención a queja</option>
- <option value="9" >Seguimiento a cobranza</option>
- <option value="10">Entrega de casa</option>
- <option value="11">Firma de escritura</option>
- <option value="12">Otra</option>
- </select>
- </div>
- </td>
- <td align="right">
- <label for="fechaInico">Fecha:</label>
- </td>
-
- <td>
- <div class="divhojadd">
- <input type="text" name="fechaInicio" id="fechaInicio" readonly="readonly" class="validate[required] text-input datepicker" />
- </div>
- </td>
- </tr>
-
- <tr>
- <td align="right">
- <label for="horaInicio">Hora:</label>
- </td>
-
- <td>
- <select name="horaInicio" id="horaInicio">
- <?php for($i = 0; $i<=24; $i++):
- $showHour = $i;
- if($i < 10):
- $showHour = '0'.$i;
- endif; ?>
- <option value="<?=$showHour?>"><?=$showHour?></option>
- <?php endfor; ?>
- </select>
- </td>
-
- <td align="right">
- <label for="minutoInicio">Minuto inicio:</label>
- </td>
-
- <td>
- <select name="minutoInicio" id="minutoInicio">
- <?php for($i = 0; $i<=59; $i++):
- $showHour = $i;
- if($i < 10):
- $showHour = '0'.$i;
- endif; ?>
- <option value="<?=$showHour?>"><?=$showHour?></option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
-
- <tr>
- <td align="right">
- <label for="archivo">Archivo:</label>
- </td>
-
- <td>
- <input type="file" name="archivo" id="archivo" />
- </td>
-
- <td align="right">
- <label for="descripcion">Descripcion:</label>
- </td>
-
- <td>
- <div class="divhojadd">
- <textarea name="descripcion" id="descripcion" class="validate[required] text-input"></textarea>
- </div>
- </td>
- </tr>
-
- <tr>
- <td align="right" colspan="3"><label> </label></td>
- <td><input type="submit" value="Agregar Actividad" id="agregar" /></td>
- </tr>
- </table>
- <?=form_fieldset_close(); ?>
- </form>
- </div>
-
- <table id="usersTable" class="resultTable">
- <thead>
- <tr>
- <th>Actividad</th> <th>Fecha Inicio</th> <th>Descripción</th> <th>Documento</th> <th>Acciones</th>
- </tr>
- </thead>
- <tbody id="newUserBody">
- <?php
- $strong = true;
- $class = 'strong';
-
- if($actividades != null):
- foreach ($actividades as $key):
- $stringActividad = '';
- switch($key->nombreActividad):
- case '1':
- $stringActividad = 'Llamada';
- break;
- case '2':
- $stringActividad = 'Cita';
- break;
- case '3':
- $stringActividad = 'Email';
- break;
- case '4':
- $stringActividad = 'Firma de contrato';
- break;
- case '5':
- $stringActividad = 'Pago de apartado';
- break;
- case '6':
- $stringActividad = 'Cancelación';
- break;
- case '7':
- $stringActividad = 'Seguimiento post-venta';
- break;
- case '8':
- $stringActividad = 'Atención a queja';
- break;
- case '9':
- $stringActividad = 'Seguimiento cobranza';
- break;
- case '10':
- $stringActividad = 'Entrega de casa';
- break;
- case '11':
- $stringActividad = 'Firma de escritura';
- break;
- case '12':
- $stringActividad = 'Otro';
- break;
- default:
- $stringActividad = 'Otro';
- break;
- endswitch;
- if($strong):
- $class = 'strong';
- $strong = false;
- elseif(!$strong):
- $class = 'light';
- $strong = true;
- endif; ?>
- <tr id="<?=$key->idHojaActividad?>" class="<?=$class?> showMessages" style="cursor: pointer;">
- <td> <?=$stringActividad?> </td>
- <td> <?=$key->fechaInicio?> </td>
- <td> <?=$key->descripcion?> </td>
- <td align="center" style="text-align: center !important;">
- <?php if($key->adjunto != null): ?>
- <a href="<?=base_url()?>docs/actividades/<?=$key->adjunto?>" target="_new" title="Ver Adjunto">
- <img src="<?=base_url()?>img/attachment.png" alr="Un dato adjunto" />
- </a>
- <?php endif; ?>
- </td>
- <td>
- <?php
- if($key->statusActividad == 3) :
- ?>
- <span> <img src="<?=base_url()?>img/green.png" alt="Estado" title="Realizada" /> </span>
-
- <?php
- elseif($key->estado == 'yellow') :
- ?>
- <a href="<?=base_url()?>admin/prospecto/editar_estado_actividad/<?=$key->idHojaActividad?>/<?=$this_prospecto->idHojaVida?>" title="Pendiente">
- <img src="<?=base_url()?>img/yellow.png" alt="Estado" /> </span>
- </a>
-
- <?php
- elseif($key->estado == 'red') :
- ?>
- <a href="<?=base_url()?>admin/prospecto/editar_estado_actividad/<?=$key->idHojaActividad?>/<?=$this_prospecto->idHojaVida?>" title="Vencida">
- <img src="<?=base_url()?>img/red.png" alt="Estado" />
- </a>
-
- <?php
- endif;
- ?>
- <!-- <a href="<?=$key->idHojaActividad?>">
- <img src="<?=base_url()?>img/comments.png" alt="Comentarios" />
- </a>
- -->
- <a href="<?=base_url()?>admin/prospecto/editar_actividad/<?=$key->idHojaActividad?>">
- <img src="<?=base_url()?>img/edit_row.png" alt="Editar" />
- </a>
-
- <a id="deleteRow<?=$key->idHojaActividad?>" href="<?=$key->idHojaActividad?>" class="deleteRow">
- <img src="<?=base_url()?>img/delete_row.png" alt="Eliminar" />
- </a>
- </td>
- </tr>
- <tr id="<?=$key->idHojaActividad?>_messages" class="<?=$class?> hideMessages">
- <td style="text-align: right !important">
- <a href="<?=$key->idHojaActividad?>" class="addMessage" title="Agregar Comentario">
- <img src="<?=base_url()?>img/add_message.png" />
- </a>
- </td>
- <td colspan="2">
- La neta está bien chido
- </td>
- <td colspan="2">
- Pedro 2012-09-09 23:00:03
- </td>
- </tr>
- <tr id="<?=$key->idHojaActividad?>_addMessage" class="<?=$class?> addMessagetr">
- <td colspan="5" style="vertical-align: middle !important;">
- <form id="formMessage<?=$key->idHojaActividad?>" action="<?=base_url()?>admin/prospecto/nuevo_mensaje_do/<?=$key->idHojaVida?>" data-rel="<?=$key->idHojaActividad?>" class="niceform addMessageForm">
- Comentario: <textarea name="nuevoComment" id="nuevoComment" style="width: 735px !important; height: 50px !important"></textarea>
- <br />
- <br />
- <input type="submit" value="Agregar comentario" />
- <br />
-
- </form>
- </td>
- </tr>
- <?php
- endforeach;
- else: ?>
- <tr class="<?=$class?>">
- <td colspan="5"> AÚN NO SE HAN AGENDADO ACTIVIDADES PARA ESTE PROSPECTO </td>
- </tr>
- <?endif;
- ?>
- </tbody>
- </table>
- </div>