<?= form_open_multipart('prospectos/nuevo/upload',array('novalidate' => 'novalidate','id' => 'frm_prospecto','name' => 'frm_prospecto','class' => 'form-horizontal','role' => 'form','onsubmit' => 'if(confirm(\'Revisa si vas a necesitar DOCUMENTACIÓN DIGITAL\n\n¿Está seguro que desea guardar?\'))if(xajax_guardar(xajax.getFormValues(\'frm_prospecto\')))this.form.submit();return false;')); ?>
<ul id="myTabs" class="nav nav-tabs" role="tablist">
	<li role="presentation" class='nav-item'><a href="#info_per" id="info_per-tab" role="tab" data-toggle="tab" aria-controls="info_per" class='nav-link active'>Datos Personales</a></li>
	<li role="presentation" class='nav-item'><a href="#inv_cli" role="tab" id="inv_cli-tab" data-toggle="tab" aria-controls="inv_cli" class='nav-link'>Inventario Cliente</a></li>
	<li role="presentation" class='nav-item'><a href="#solicita" role="tab" id="solicita-tab" data-toggle="tab" aria-controls="solicita" class='nav-link'>Equipo Solicitado</a></li>
	<li role="presentation" class='nav-item'><a href="#refaccion" role="tab" id="refaccion-tab" data-toggle="tab" aria-controls="refaccion" class='nav-link'>Refacción</a></li>
	<li role="presentation" class='nav-item'><a href="#servicio" role="tab" id="servicio-tab" data-toggle="tab" aria-controls="servicio" class='nav-link'>Servicio</a></li>
	<li role="presentation" class='nav-item'><a href="#localizacion" role="tab" id="localizacion-tab" data-toggle="tab" aria-controls="localizacion" class='nav-link'>Localizaciones Adicionales</a></li>
	<li role="presentation" class='nav-item'><a href="#doc_dig" role="tab" id="doc_dig-tab" data-toggle="tab" aria-controls="doc_dig" class='nav-link'>Documentación Digital</a></li>
    <!-- <li role="presentation" class="dropdown">
    	<a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown" aria-controls="myTabDrop1-contents">Dropdown <span class="caret"></span></a>
        <ul class="dropdown-menu" aria-labelledby="myTabDrop1" id="myTabDrop1-contents">
        	<li><a href="#dropdown1" role="tab" id="dropdown1-tab" data-toggle="tab" aria-controls="dropdown1">@fat</a></li>
        	<li><a href="#dropdown2" role="tab" id="dropdown2-tab" data-toggle="tab" aria-controls="dropdown2">@mdo</a></li>
        </ul>
	</li> -->
</ul>
<div id="myTabContent" class="tab-content">
	<div role="tabpanel" class="tab-pane fade show active" id="info_per" aria-labelledBy="info_per-tab">
		<p>
			<center>
				<?= form_label('Selecciona una opción:') ?>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<?= form_label(
					form_radio('rbtn_persona','PF',FALSE,'onclick="$(\'#div_PF\').fadeIn(\'slow\');
																	$(\'#div_PM\').fadeOut(\'fast\');
																	$(\'#txt_razon_social\').val(\'\');
																	$(\'#txt_rfc_pm\').val(\'\');
																	$(\'#txt_contacto\').val(\'\');"').' Persona Física',
					'') ?>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<?= form_label(
					form_radio('rbtn_persona','PM',FALSE,'onclick="$(\'#div_PM\').fadeIn(\'slow\');
																	$(\'#div_PF\').fadeOut(\'fast\');
																	$(\'#txt_nombre\').val(\'\');
																	$(\'#txt_rfc_pf\').val(\'\');"').' Persona Moral',
					'') ?>
			</center>
			<div class='form-group row' id='div_PF' style='display:none'>
				<?= form_label('Nombre: ','lbl_nombre',array('class' => 'col-sm-1 control-label')) ?>
				<div class='col-sm-5'>
					<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_nombre','id' => 'txt_nombre','required' => 'required','title' => 'Necesario Escribir un Nombre','placeholder' => 'Nuevo Nombre Completo')) ?>
				</div>
				<?= form_label('RFC: ','lbl_rfc',array('class' => 'col-sm-1 control-label')) ?>
				<div class='col-sm-5'>
					<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_rfc_pf','id' => 'txt_rfc_pf','required' => 'required','title' => 'Necesario Escribir un RFC','placeholder' => 'Nuevo RFC')) ?>
				</div>
			</div>
			<div id='div_PM' style='display:none'>
				<div class='form-group row'>
					<?= form_label('Razón Social: ','lbl_rs',array('class' => 'col-sm-1 control-label')) ?>
					<div class='col-sm-3'>
						<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_razon_social','id' => 'txt_razon_social','required' => 'required','title' => 'Necesario Escribir una Razón Social','placeholder' => 'Nueva Razón Social')) ?>
					</div>
					<?= form_label('RFC: ','lbl_rfc',array('class' => 'col-sm-1 control-label')) ?>
					<div class='col-sm-3'>
						<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_rfc_pm','id' => 'txt_rfc_pm','required' => 'required','title' => 'Necesario Escribir un RFC','placeholder' => 'Nuevo RFC')) ?>
					</div>
						<?= form_label('Contacto: ','lbl_contacto',array('class' => 'col-sm-1 control-label')) ?>
					<div class='col-sm-3'>
						<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_contacto','id' => 'txt_contacto','required' => 'required','title' => 'Necesario Escribir un Contacto','placeholder' => 'Nuevo Contacto')) ?>
					</div>
				</div>
			</div>
			<?= cat_generales($pendiente); ?>
			
		</p>
    </div>
    <div role="tabpanel" class="tab-pane fade" id="inv_cli" aria-labelledBy="inv_cli-tab">
    	<p>
	    	<div id="div_ic0">
		    	<center>
		    		<?= anchor('#','<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-plus-fill" viewBox="0 0 16 16">
									  <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM8.5 7v1.5H10a.5.5 0 0 1 0 1H8.5V11a.5.5 0 0 1-1 0V9.5H6a.5.5 0 0 1 0-1h1.5V7a.5.5 0 0 1 1 0z"/>
									</svg> Equipo / Implemento','onclick="xajax_add_ic(\'1\');return false;"') ?>
		    	</center>
	    	</div>
			
		</p>
	</div>
	<?= form_input(array('type' => 'hidden','name' => 'h_num_ic','id' => 'h_num_ic','value' => 0)) ?>
	<div role="tabpanel" class="tab-pane fade" id="solicita" aria-labelledBy="solicita-tab">
		<p>
			<div id="div_es0">
				<center>
		    		<?= anchor('#','<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-plus-fill" viewBox="0 0 16 16">
								  <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM8.5 7v1.5H10a.5.5 0 0 1 0 1H8.5V11a.5.5 0 0 1-1 0V9.5H6a.5.5 0 0 1 0-1h1.5V7a.5.5 0 0 1 1 0z"/>
								</svg> Equipo / Implemento','onclick="xajax_add_es(\'1\');return false;"') ?>
				</center>
	    	</div>
			
		</p>
	</div>
	<?= form_input(array('type' => 'hidden','name' => 'h_num_es','id' => 'h_num_es','value' => 0)) ?>





	<div role="tabpanel" class="tab-pane fade" id="refaccion" aria-labelledBy="refaccion-tab">
		<p>
			<div id="div_re0">
				<center>
		    		<?= anchor('#','<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-plus-fill" viewBox="0 0 16 16">
								  <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM8.5 7v1.5H10a.5.5 0 0 1 0 1H8.5V11a.5.5 0 0 1-1 0V9.5H6a.5.5 0 0 1 0-1h1.5V7a.5.5 0 0 1 1 0z"/>
								</svg> Refacción','onclick="xajax_add_re(\'1\');return false;"') ?>
				</center>
	    	</div>
			
		</p>
	</div>
	<?= form_input(array('type' => 'hidden','name' => 'h_num_re','id' => 'h_num_re','value' => 0)) ?>
	<div role="tabpanel" class="tab-pane fade" id="servicio" aria-labelledBy="servicio-tab">
		<p>
			<div id="div_se0">
				<center>
		    		<?= anchor('#','<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-plus-fill" viewBox="0 0 16 16">
								  <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM8.5 7v1.5H10a.5.5 0 0 1 0 1H8.5V11a.5.5 0 0 1-1 0V9.5H6a.5.5 0 0 1 0-1h1.5V7a.5.5 0 0 1 1 0z"/>
								</svg> Servicio','onclick="xajax_add_se(\'1\');return false;"') ?>
				</center>
	    	</div>
			
		</p>
	</div>
	<?= form_input(array('type' => 'hidden','name' => 'h_num_se','id' => 'h_num_se','value' => 0)) ?>













	<div role="tabpanel" class="tab-pane fade" id="localizacion" aria-labelledBy="localizacion-tab">
    	<p>
    		
    		<center>
	    	<div id="div_la0">
		    	<?= anchor('#','<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-plus-fill" viewBox="0 0 16 16">
								  <path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM8.5 7v1.5H10a.5.5 0 0 1 0 1H8.5V11a.5.5 0 0 1-1 0V9.5H6a.5.5 0 0 1 0-1h1.5V7a.5.5 0 0 1 1 0z"/>
								</svg> Localización Adicional','onclick="xajax_add_la(\'1\');return false;"') ?>
	    	</div>
	    	</center>
			
		</p>
	</div>
	<?= form_input(array('type' => 'hidden','name' => 'h_num_la','id' => 'h_num_la','value' => 0)) ?>
	<div role="tabpanel" class="tab-pane fade" id="doc_dig" aria-labelledBy="doc_dig-tab">
		<div class='form-group row'>
			<?php 
				$vista = "";
				foreach ($cat_anexos as $anexos) {
					//quitamos los caracteres especiales
					$descripcion = str_replace(".","",$anexos->descripcion);
					//quitamos los espacios para remplazarlos por "_"
					$descripcion = str_replace(" ","_",$descripcion);
					//quitamos las mayusculas
					$descripcion = strtolower($descripcion);
					for($j = 1; $j <= $anexos->cantidad; $j++){
						$vista.= "<div class='col-sm-4'>
									".form_label(strtoupper($descripcion)." ".$j,'')."
									".form_upload($descripcion."_".$j)."
								</div>";
					}
				}
				echo $vista;
			?>
		</div>
	</div>
</div>


<!-- Panle principal -->
<div class='card'>
	<div class='card-header'>Información Relevante:</div>
	<div class='card-body'>
		<p>
			
			<div class='form-group row'>
				<?= form_label('Actividad: ','lbl_actividad',array('class' => 'col-sm-2 control-label')) ?>
				<div class='col-sm-3'>
					<?= combos($actividades,'pk_cat_actividad','descripcion','fk_cat_actividad','fk_cat_actividad','loading_small(\'div_tipo_actividad\');xajax_cargar_combos(this.value,\'div_tipo_actividad\')'); ?>
				</div>
				<?= form_label('Tipo de la actividad: ','lbl_tipo_actividad',array('class' => 'col-sm-3 control-label')) ?>
				<div class='col-sm-3' id='div_tipo_actividad'>
					<?= form_dropdown('cmb_tipo_actividad',array("-" => "-- Selecciona Actividad --"),'','required="required" class="form-control chosen-select"'); ?>
				</div>
				<div class='col-sm-1'></div>
			</div>
			<center>
			<div class='form-group row'>
				<div class='col-sm-4'>
					<?= form_label('Probabilidad de Compra: ','lbl_colonia') ?>
					<?= combos($probabilidades_compra,'pk_cat_probabilidad_compra','descripcion','fk_cat_probabilidad_compra','fk_cat_probabilidad_compra',''); ?>
				</div>
				<div class='col-sm-4'>
					<?= form_label('Condiciones Pago: ','lbl_condiciones_pago') ?>
					<?= combos($condiciones_pago,'pk_cat_condiciones_pago','descripcion','fk_cat_condiciones_pago','fk_cat_condiciones_pago',''); ?>
				</div>
				<div class='col-sm-4'>
					<?= form_label('Plazo Pago: ','lbl_plazo_pago') ?>
					<?= combos($plazo_pago,'pk_cat_plazo_pago','descripcion','fk_cat_plazo_pago','fk_cat_plazo_pago',''); ?>
				</div>
			</div>
			<div class='form-group row'>
				<?= form_label('Observaciones: ','lbl_obsrevaciones',array('class' => 'col-sm-3 control-label')) ?>
				<div class='col-sm-5'>
					<?= form_textarea(array('class' => 'form-control','type' => 'text','name' => 'obs_prospecto','id' => 'obs_prospecto','required' => 'required','placeholder' => 'Escribir observaciones del prospecto....','rows' => '2','cols')) ?>
				</div>
				<!-- <div class='col-sm-4'>
					<?= form_label('El prospecto: ') ?>
					<br />
					<?= form_label('Realiza servicios '.
						form_checkbox('ch_servicio','SI',FALSE),
						'') ?>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<?= form_label('Compra refacciones '.
						form_checkbox('ch_refaccion','SI',FALSE),
						'') ?>
				</div> -->
			</div>
			</center>
			<div class='card'>
				<div class='card-header'>Crear Actividad de Seguimiento:</div>
				<div class='card-body'>
					<p>
						<div class='form-group row'>
							<?= form_label('Status: ','',array('class' => 'col-sm-2 control-label')) ?>
							<div class='col-sm-4'>
								<?= combos($motivo_visita,'pk_cat_status_seguimiento','descripcion','fk_cat_status_seguimiento','1','',TRUE,TRUE,TRUE,TRUE); ?>
							</div>
							<?= form_label('Actividad: ','',array('class' => 'col-sm-2 control-label')) ?>
							<div class='col-sm-4'>
								<?= combos($actividad_status,'pk_cat_actividad_status_seguimiento','descripcion','fk_cat_actividad_status_seguimiento','fk_cat_actividad_status_seguimiento',''); ?>
							</div>
						</div>
						<div class='form-group row'>
							<?= form_label('Fecha Actividad: ','',array('class' => 'col-sm-2 control-label')) ?>
							<div class='col-sm-3'>
								<div class='input-group date' id='dt_fecha_actividad'>
									<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_fecha_actividad','id' => 'txt_fecha_actividad','required' => 'required','title' => 'Necesario Seleccionar una Fecha de Actividad','placeholder' => 'Nuevo Fecha de Actividad','data-format' => 'YYYY-MM-DD HH:mm:ss','readonly' => 'readonly')) ?>
									<span class='input-group-text'>
				                        <svg class='bi bi-calendar3-fill' width='1em' height='1em' viewBox='0 0 16 16' fill='currentColor' xmlns='http://www.w3.org/2000/svg'>
				                          <path d='M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2H0z'/>
				                          <path fill-rule='evenodd' d='M0 3h16v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3zm6.5 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-8 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-8 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/>
				                        </svg>
				                    </span>
								</div>
								<script type="text/javascript">
									$(function () {
										$('#dt_fecha_actividad').datetimepicker({ pickTime: false });
									});
								</script>
							</div>
							<?= form_label('Lugar: ','',array('class' => 'col-sm-2 control-label')) ?>
							<div class='col-sm-5'>
								<?= form_input(array('class' => 'form-control','type' => 'text','name' => 'txt_lugar','id' => 'txt_lugar','required' => 'required','title' => 'Necesario Escribir un Lugar','placeholder' => 'Nuevo Lugar')) ?>
							</div>
					    </div>
					    <div class='form-group row'>
							<?= form_label('Observaciones: ','',array('class' => 'col-sm-3 control-label')) ?>
							<div class='col-sm-5'>
								<?= form_textarea(array('class' => 'form-control','type' => 'text','name' => 'observaciones_agenda','id' => 'observaciones_agenda','required' => 'required','placeholder' => 'Escribir observaciones de la actividad....','rows' => '2','cols')) ?>
							</div>
						</div>
					</p>
				</div>
			</div>
		</p>
	</div>
</div>

<center><div id='div_msj'></div><?= form_button(array('type' => 'submit','id' => 'btn_guardar','content' => 'Aceptar','class' => 'btn btn-primary')) ?></center>
<?= form_close(); ?>