Picon

Handled errors.

Hello everybody, well:
I am working in an action in a manager inserting data in a table, in a foreach i am checking that every query is right(i mean foreign keys are correct for instance), so when a query is right it should be insert but when something is wrong in the query it shouldn't insert it, i just need add (concatenate)it to a variable and at the end of the foreach show what queries were wrong.
1.- It doesn't insert the wrong queries, queries right are inserted(this is fine).
2.- if there is a query right after a wrong query it doesn't insert it(wrong), only insert queries righst that are before one wrong query is find.

how can i get the errors and continue with the foreach without complications(insert queries right after queries wrong) and at the end just show as a message the queries that weren't inserted.

i am trying to do this:

foreach( $grupos as $grupoi ) {
        
          $insert="INSERT INTO PROGRAMACION_ESQ.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID) VALUES ($idn, '$grupon', $peranioId, $materiaId, $planId, $alumnos, $empleadoId)";
          $dbh->Execute($insert);

        $success = false;
        if ($dbh->Affected_Rows() > 0)
            $success = true;

            if ($success !== false) {
                 SGL::raiseMsg('Se insertaron los datos correctamente ', false, SGL_MESSAGE_INFO);
            } else {
                $insert.="\n";
            //SGL::raiseError($insert, SGL_ERROR_NOAFFECTEDROWS);
        }
      
}
            $output->xml=$insert;

You don't care about how can i get the values from the insert, the problem is with the messages in the errors.
I don't want this large error, i want to show something like.

Fatal error: Uncaught exception 'ADODB_Exception' with message 'oci8 error: [2291: ORA-02291: integrity constraint (PROGRAMACION_ESQ.EDUC_GRUPOS_FK1) violated - parent key not found] in EXECUTE("INSERT INTO PROGRAMACION_ESQ.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID) VALUES (10, 'B', 8, 1, 1, 22, 596)") ' in /var/www/sii_dgest/lib/pear/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/sii_dgest/lib/pear/adodb/adodb.inc.php(1040): adodb_throw('oci8', 'EXECUTE', 2291, 'ORA-02291: inte...', 'INSERT INTO PRO...', false, Object(ADODB_oci8)) #1 /var/www/sii_dgest/lib/pear/adodb/drivers/adodb-oci8.inc.php(843): ADOConnection->_Execute('INSERT INTO PRO...', false) #2 /var/www/sii_dgest/modules/estructuraeducativa/classes/Educ_GruposServiciosWebMgr.php(300): ADODB_oci8->Execute('INSERT INTO PRO...') #3 /var/www/sii_dgest/lib/SGL/Manager.php(251): Educ_GruposServiciosWebMgr->_cmd_cliente(Object(SGL_Registry), Object(SGL_Output)) #4 /var/www/sii_dgest/lib in /var/www/sii_dgest/lib/pear/adodb/adodb-exceptions.inc.php on line 78

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Picon

Use a library

hi everybody, well i posted a question days ago, because i would like to know how can i include a library in a manager, i want to use nusoap a php librarie for web services, so, do i have to put the librarie in a folder? and how i should call it in my manager, thank you.

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Oscar Padron | 24 Oct 17:00
Picon

Question about include a php file

Hi:

I have a new question, how can i include an external php file in a
manager in seagull and to use
everything in the file(variables,methods, etc), i have included as i
know with php files for example (include once & required) and it
doesn't work, i hope that you can help me.
thank you

--

-- 
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General
Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.

Picon

External file php in manager seagull

Hello everybody:

how can i include an external php file in a manager in seagull and to use
everything in the file(variables,methods, etc)

thank you

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
elrco | 19 Oct 15:04
Picon

Media Module problem in Seagull 6.8

hi all

After hours of debugging Media module, I found a piece of code which
seems buggy. The problem is that, when I want to upload image, nothing
happens after browsing the file and submitting the form (the save form
does not open) and there is no php error too!

The problem is in pear's Transform.php in it's factory function in
line:
$obj =& new $classname();

when I comment this line, the save page is opened but when it runs,
nothing happens! Just a white page without any error. I'm sure there
is no problem in opening and including required files.

Any ideas?!

tanx
eli

--

-- 
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General
Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.

Heinrich Stoellinger | 15 Oct 12:15
Picon

Seagull Status

Hello,
I wonder what the status of Seagull is at this time. Are there plans to develop
it further or should one try to look at other offerings?
Regards and best wishes
Heinrich

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

--

-- 
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General
Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.

Picon

CALL AN ACTION

HI, i have created two actions in my manager, and i have two links(html tag a) in my template, in my two actions i am getting values from diferents tables and storing in an array, so when i clic one link i want to show the values of one of the table and when i clic the another link i want to show the others values, how can i do this in my template with a foreach if i have somethin like this.

function _cmd_listarCarreras(&$input,&$output)  {
               
              SGL::logMessage(null, PEAR_LOG_DEBUG);
              $this->accion=true;
               $dbh = &$this->getDb();
              $rs = $dbh->Execute("SELECT NOMBRE FROM programacion_esq.EDUC_CARRERA");
              $aCarreras = array();
              while (!$rs->EOF) {      
              $aCarreras[] = clone($this->ADOdbArrayToObject( $rs->fields ));
              $rs->MoveNext();
         
        }
       
        $output->results = $aCarreras;
          }
         
        
        function _cmd_listarDepartamentos()  {
               
              SGL::logMessage(null, PEAR_LOG_DEBUG);
              $dbh = &$this->getDb();
              $rs = $dbh->Execute("SELECT NOMBRE_DEPARTAMENTO FROM programacion_esq.EDUC_DEPARTAMENTOS");
              $aDepartamentos = array();
              while (!$rs->EOF) {      
              $aDepartamentos[] = clone($this->ADOdbArrayToObject( $rs->fields ));
              $rs->MoveNext();
         
        }
       
        $output->results2 = $aDepartamentos;
          } 


<td> <a href="{webRoot}/index.php/estructuraeducativa/EDUC_ASIGNA_MODULOS/action/listarCarreras">
                     CARRERAS/MATERIAS
                </a></td>
                <td><a href="{webRoot}/index.php/estructuraeducativa/EDUC_ASIGNA_MODULOS/action/listarDepartamentos">
                     GRUPOS/GRUPOS COMPARTIDOS POR DEPARTAMENTO
                     </a></td>


  <div align="center">
               
              {foreach:results,key,valueObj}
        <tr class="{switchRowClass()}">
            <td nowrap>{valueObj.nombre}</td>
        </tr>
        {end:}

{foreach:results2,key,valueObj}
        <tr class="{switchRowClass()}">
           <td nowrap>{valueObj.nombre_departamento}</td>
        </tr>
        {end:}         </div>


i think i am wrong, and i need a condition where one of the two foreach it works and the other doesn't or if someone could help me please

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Picon

SAVING VALUES FROM LOGIN

Hello everybody, well is there some way which i can obtain the values from a login in seagull and save them to use them in my manager?

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Picon

ERROR INSERT WITH SELECT

Hello everyone, i am using adodb for a connection to a database and a oracle database, but when i try to insert data for a form appear me this error, i think that this is because i am not getting the values right.
So i would like to know how can i get the value of a select and insert it in a table, my code is like follow:

<tr>
    <td class="fieldName">MATERIA</td>
    <td class="fieldValue"><select  name="educ_grupos[materia]">{generateSelect(aMaterias,educ_grupos.materias_id):h}</select>
</td>
</tr>

$insert = "INSERT INTO programacion_esq.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID)
                   VALUES ({$input->educ_grupos->id}, '{$input->educ_grupos->grupo}', {$input->educ_grupos->periodo_anio_id}, {$input->educ_grupos->materias_id},
                   {$input->educ_grupos->inst_deptos_carreras_planes_id}, {$input->educ_grupos->cant_alumnos},
                   {$input->educ_grupos->empleados_id})";


Fatal error: Uncaught exception 'ADODB_Exception' with message 'oci8 error: [936: ORA-00936: missing expression] in EXECUTE("INSERT INTO programacion_esq.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID) VALUES (3, 'POS', , , , , )") ' in /var/www/sii_dgest/lib/pear/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/sii_dgest/lib/pear/adodb/adodb.inc.php(1040):


how you can see it doesn't get the values of selects, and from an input text too.

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Picon

CONNECTION TO A DATABASE WITH ADODB IN SEAGULL

Hello everybody, well this time i would like to know how can i do a connection to a database using adodb instead of the connection than i use with seagull.
I would like to know what i need to import, the sintax to create the object of connection, and what do i need write in my manager and templates to run my queries with adodb.
Thank you.

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
Picon

ERROR TO INSERT IN A TABLE

Hello everybody, well i am having a problem trying to insert data in a table of my database, how is shown in the query there are two errors:
---one is in the foreign key and other is with a column that store a data string.
Someone knows what is the problem, i am sending the data from a form and the restriction of the foreign key i think are right.


INSERT INTO `educ_grupos` (`grupo` ) VALUES ('MIG' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`seagull`.`educ_grupos`, CONSTRAINT `educ_grupos_ibfk_1` FOREIGN KEY (`educ_materias_id`) REFERENCES `educ_materias` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)]

create table if not exists `educ_grupos` (
  `id` int(5) unsigned not null,
  `educ_inst_deptos_carreras_planes_id` int(5) unsigned not null,
  `educ_periodo_anio_id` int(3) unsigned not null,
  `educ_empleados_id` int(10) unsigned not null,
  `educ_materias_id` int(9) unsigned not null,
  `grupo` varchar(8) default null,
  `cantidad_alumnos` int(3) unsigned default null,
  primary key (`id`),
  key `educ_grupos_fkindex1` (`educ_materias_id`),
  key `educ_grupos_fkindex2` (`educ_empleados_id`),
  key `educ_grupos_fkindex3` (`educ_periodo_anio_id`),
  key `educ_grupos_fkindex4` (`educ_inst_deptos_carreras_planes_id`)
) engine=innodb default charset=latin1;

create table if not exists `educ_materias` (
  `id` int(9) unsigned not null,
  `nombre_materia` varchar(50) default null,
  `clave_oficial` varchar(8) default null,
  `hrs_teoricas` int(1) unsigned default null,
  `hrs_practicas` int(1) unsigned default null,
  `semestre` int(2) unsigned default null,
  primary key (`id`)
) engine=innodb default charset=latin1;



alter table `educ_grupos`
  add constraint `educ_grupos_ibfk_1` foreign key (`educ_materias_id`) references `educ_materias` (`id`) on delete cascade on update cascade;

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.

Gmane