Welcome Guest, Not a member yet? Register   Sign In
ayuda con formato PDF

[eluser]Tim Brownlaw[/eluser]
Hola y bienvenido al mundo de PHP y CodeIgniter Smile
Puede usar https://translate.google.com si usted no entiende Ingl├ęs

This might help... ( I have not tested this, so there might be a few mistakes)
I have kept this simple without adding any error checking but I have added in some comments where you would need to take some action depending upon the outcome.

Your Model is

function seleccionar($tabla=NULL, $columna=NULL, $valor=NULL){
if($tabla != NULL AND $columna != NULL AND $valor != NULL)
   $row = $this->db->from($tabla)->where($columna, $valor)->get()->row();
   // Test if $row does not have a result and return false
  return false;  // Missing Parameters

Your Controller should be...

function formato_baja($id=0) {
  if ($id == 0) {
    redirect('personal', 'refresh');
  $this->data['fecha_baja'] =
      $this->cdc_model->seleccionar('comisionista_baja', 'id_comisionista_baja',$id);
// Need to know what to do if $this->data['fecha_baja'] is FALSE

So $this->data['echa_baja'] will be an object of an array.

If you pass $this->data['fecha_baja'] to your view you will need to access the elements using something like
$fecha_baja->id etc.

As an example ( as I do not know the other field names you want to display from the database row)
The Simple, One entry from the database, view.
<td colspan="1">Fecha de baja:</td>
      <td colspan="3"><div class="info">&lt;?php echo $fecha_baja->id;?&gt;</div></td>

There are various ways to create a table of all the values... but see if this part works first!

You haven't shown how you are displaying the actual view... One thing you would need to do is to check the return from the model in the controller to determine the output... as I have indicated above.

Messages In This Thread
ayuda con formato PDF - by El Forum - 08-12-2014, 05:12 PM
ayuda con formato PDF - by El Forum - 08-12-2014, 07:32 PM

Theme © iAndrew 2016 - Forum software by © MyBB