ANNEX. CODI FONT DE LES CLASSES DESENVOLUPADES

Similar documents
Projecte Final de Carrera - Domotització d un jardí domèstic Annex 1

PHP PROGRAMMING PATTERN FOR THE PREFERENCES USABILITY MECHANISM

Annexes. Kpax Plataforma d'aprenentatge en Xarxa: Migració de kpaxserver a NodeJs amb MongoDB

Software Design User testing exercise

SUMARI 1 I. CLASSES DEL SUBPROGRAMA DE CÀLCUL 3. A. Classe CEstructura...3 B. Classe CElement...74 II. MÒDULS DEL SUBPROGRAMA DE CÀLCUL 127

Dynamic Select Option Menu Using Ajax And PHP. Wednesday, Mar 11, 2015

4- PHP introduc.on. Course: Developing web- based applica.ons. Cris*na Puente, Rafael Palacios

Propedéutico de Programación

ToDoList. 1.2 * allow custom user list to be passed in * publish changes to a channel ***/

Títol: Bibliotècnica a mida. Volum: 2/2 Estudiant: Oriol Rico Millán Director/Ponent: Ramón Sangüesa Departament: LSI Data: Primavera 2004

TeamBuilder: Android Enquiry Application for creating project teams.

if(! list.contains(list.collect(params,'key'),'title')){ <div style="font-weight:bold;color:red;">"warning: A title field must be assigned.

HTMLnotesS15.notebook. January 25, 2015

Date Picker Haim Michael

Rapid Serial Visual Presentation for Relevance Feedback in Image Retrieval with EEG Signals.

Web Programming Paper Solution (Chapter wise)

cwhois Manual Copyright Vibralogix. All rights reserved.

COMS 359: Interactive Media

1.2 * allow custom user list to be passed in * publish changes to a channel

CSE 154 LECTURE 8: FORMS

Single user Installation. Revisión: 13/10/2014

COM1004 Web and Internet Technology

Using htmlarea & a Database to Maintain Content on a Website

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

Creating HTML files using Notepad

UNIT-VI CREATING AND USING FORMS

SPARK. User Manual Ver ITLAQ Technologies

Active WireFrame Plugin for PimCore

Web Development. With PHP. Web Development With PHP

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

PHP with MySQL: What you need to know Chapter 3. This section is on using PHP script tags appropriately in your PHP program.

What are three categories of Perl variables? Give Examples for each.

OPENFLOW 1.3 WITH RYU CONTROLLER

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

CS144 Notes: Web Standards

If Only. More SQL and PHP

HTML. HTML Evolution

src1-malan/ajax/ajax1.html ajax1.html Gets stock quote from quote1.php via Ajax, displaying result with alert().

FORMAS DE IMPLEMENTAR LOS OYENTES. A).- El oyente en una clase independiente con el constructor con un argumento y usando el método getactioncommand.

BIS1523 Homework Assignments 2.1

Diseño de la capa de datos para el POS

state View; else if (mesg == "Overview") { state Overview; state_exit(){}

Introduction to using HTML to design webpages

TGA - Graphic Cards and Accelerators

Goal: Learn More About Cancer for Clues To Effective Treatment. Research is often an exploration

Configuració d'ocs Inventory en CentOS 6.3

By: JavaScript tutorial-a simple calculator

CPSC 481: CREATIVE INQUIRY TO WSBF

Copy and Paste the scripts below into the Alter Response Replacement field:

Agenda: Estado Actual 2012

Javascript value to jsp variable. Javascript value to jsp variable.zip

Come & Join Us at VUSTUDENTS.net

Secure Web-Based Systems Fall Test 1

Denes Kubicek. Oracle ACE APEX Developer of the Year 2008

Default Route de la configuración en el EIGRP

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

How to use PHP with a MySQL database

MASTER THESIS. TITLE: Color Based Image Classification and Description. MASTER DEGREE: Master in Science in Telecommunication Engineering & Management

FINAL PROJECT. x x x x x x x x x x x. TITLE : Application of SP and SI frames in wireless multimedia communication

By the end of this chapter, you will have a very basic, but fully functional blogging system.

Assignments (4) Assessment as per Schedule (2)

ゼミ Wiki の再構築について 資料編 加納さおり

Caso de Estudio: Parte II. Diseño e implementación de. Integración de Sistemas. aplicaciones Web con.net

B. V. Patel Institute of BMC & IT 2014

SCRIPT.ACULO.US - DRAG & DROP

[PDF] ABAP OBJECT MANUAL DOWNLOAD

Computer Science E-75 Building Dynamic Websites

Chapter 6. Cascading Style Sheets CSS

PHP & My SQL Duration-4-6 Months

LAB Test 1. Rules and Regulations:-

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

EPUB - JAVA SCRIPT MANUAL EBOOK

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os

FORMULARIS 1-. FRM_BD_COMERCIAL

extension for Magento2 User Guide

Manual De Adobe Photoshop Cs3 En Espanol File Type

USER DOCUMENTATION. Web OPAC Screens: Structure and Customization

Connecting the Dots. Building Web Applications with PHP, HTML, CSS, and JavaScript

ASXI-M - Architecture and Security of Computer Networks

PIC 40A. Midterm 1 Review

showinplaceholder The jquery Plug-in

=================== coffee-submit.php ==========================

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

Anexos. Diseño y construcción de un puente grúa automatizado de precisión

Working Bootstrap Contact form with PHP and AJAX

Live Agent Developer's Guide

Santa Tracker. Release Notes Version 1.0

PAST - Advanced Programming for Telecommunications Engineering

Last &me: Javascript (forms and func&ons)

HTML forms and the dynamic web

grabattention The jquery Plug-in

HTML HTML5. DOM(Document Object Model) CSS CSS

RAVASMARTSOLUTIONS - TECH TIPS

MS_ Programming in HTML5 with JavaScript and CSS3.

1. Cascading Style Sheet and JavaScript

SilkTest 2009 R2. Rules for Object Recognition

Syllabus - July to Sept

Transcription:

ANNEX. CODI FONT DE LES CLASSES DESENVOLUPADES CLASSE FORMULARI <?php class formulari private $datos= array(); //Array d'objectes "dada" //---------------------------------------------------------------- //Afegeix una dada a l'array de dades. public function afegeixdada($nombre,$tipus,$caract) $dada=new dato($nombre,$tipus,$caract); $this->datos[$dada->aconsegueixnom()]=$dada; //Imprimeix el codi HTML de l'element de formulari public function generahtml($i) echo $this->datos[$i]->generahtml(); //---------------------------------------------------------------- //Imprimeix el codi HTML per fer servir la funció Tipsy public function generatipsy()?> <script type='text/javascript' src='js/jquery-1.7.2.min.js'></script> <script type='text/javascript' src='js/tipsy/javascripts/jquery.tipsy.js'></script> <script type='text/javascript'> $(function() <?php //Recorro l'array d'objectes de formulari foreach( $this->datos as $nom=>$dada ) //Recorro els atributs de cada objecte foreach( $dada->aconsegueixatributs() as $parametre=>$valor ) case "obligatori": case "importobligatori": case "readonly":

case "title": //Si el tipus éss radio afegim "-img" per que el title a mostrar és el de la imatge i no el del camp que recull el valor. if ($dada->aconsegueixtipus()=="radio") $nom=$dada->aconsegueixnom()."- img"; else $nom=$dada->aconsegueixnom();?> $('#<?php echo $nom;?>').tipsy(gravity: 'w',fade:true); <?php?> ); </script> <link rel="stylesheet" href="js/tipsy/stylesheets/tipsy.css" type="text/css" /> <?php --------// //Comprova si els camps obligatoris estan emplenats public function controlcampsobligatoris() $control=1; foreach( $this->datos as $nom=>$dada ) //Recorro els atributs de cada objecte foreach( $dada->aconsegueixatributs() as $parametre=>$valor ) case "obligatori": //Cas bàsic: si el camp esta buit dona error case 'obligatori': if (isset($_post[$dada->aconsegueixnom()]) && $_POST[$dada- >aconsegueixnom()]=="") $control=0; //Cas especial: en $valor detallo un camp. Un dels dos ha d'estar omplert, o el camp actual o el camp que poso en $valor. Ex: projecte i centrecost case 'projecte': case 'centrecost': if ((isset($_post[$dada->aconsegueixnom()]) && $_POST[$dada- >aconsegueixnom()]=="")&&(isset($_post[$valor]) && $_POST[$valor]=="")) $control=0;

// Si el camp $valor està omplert llavors aquesta dada és obligatòria if ((isset($_post[$dada->aconsegueixnom()]) && $_POST[$dada- >aconsegueixnom()]=="")&&(isset($_post[$valor]) && $_POST[$valor]!="")) $control=0; case "importobligatori": if (isset($_post[$dada->aconsegueixnom()]) && $_POST[$dada- >aconsegueixnom()]=="") $control=0; return $control; //Genera html: llista de dades del formulari com dades ocultes per generar el PDF al inserir un formulari. public function llistacampsocults() foreach( $this->datos as $nom=>$dada ) echo "<input name=\"".$nom."\" id=\"".$nom."\" type=\"hidden\" value=\"".$_post[$nom]."\"/>"; //Insereix les dades en la base de dades public function inserirbbdd($tabla) $db = conectadb(); //Sempre el primer camp a introduir és el identificador d'usuari (NIU) $txt_campos="id_usuari"; $txt_dades="'".$_session['mm_username']."'"; //Resta de dades foreach( $this->datos as $nom=>$dada ) $txt_campos.=",".$nom; //Si la dada és de tipus "data" hem de girar els camps mes i dia $valor= ($dada->aconsegueixtipus() == "data")? $valor=data_giramesdia($_post[$nom]) : $valor=$_post[$nom];

//Previsió de SQL Injection $valor = function_exists("mysql_real_escape_string")? mysql_real_escape_string($valor) : mysql_escape_string($valor); //Afegim les cometes per construir l'insert $valor= ($valor!= "")? "'". $valor. "'" : "NULL"; $valor=str_replace("\"","'",$valor); $txt_dades.=",".$valor; $insertsql = "INSERT INTO ".$tabla." (".$txt_campos.") VALUES (".$txt_dades.")"; //echo $insertsql; if ($db->query($insertsql)) //echo "<p>registre inserit correctament.</p>\n"; $idformulari = $db->lastinsertid(); $nombre=$_session['usuari']; insertar_log($tabla,$idformulari,"insert","usuari: ".$_SESSION['MM_Username']." (".$nombre.") ha fet la petició."); $db = null; return $idformulari; else echo "<p>error al guardar el formulari. Posi's en contacte amb la vostra Gestió.<p>\n"; $db = null; return false; //Actualitza les dades en la base de dades public function actualtizarbbdd($tabla,$id) $db = conectadb(); //Sempre el primer camp a introduir és el camp revisat a 1 $txt_campos="revisat=1"; //Resta de dades foreach( $this->datos as $nom=>$dada ) $txt_campos.=",".$nom; //Si la dada és de tipus "data" hem de girar els camps mes i dia $valor= ($dada->aconsegueixtipus() == "data")? $valor= data_giramesdia ($_POST[$nom]) : $valor=$_post[$nom];

//Previsió de SQL Injection $valor = function_exists("mysql_real_escape_string")? mysql_real_escape_string($valor) : mysql_escape_string($valor); //Afegim les cometes per construir l'insert $valor= ($valor!= "")? "'". $valor. "'" : "NULL"; $valor=str_replace("\"","'",$valor); $txt_campos.="=".$valor; $updatesql = "UPDATE ".$tabla." SET ".$txt_campos." WHERE id=".$id; //echo $updatesql; if ($db->query($updatesql)) //echo "<p>registre actualitzat correctament.</p>\n"; $idformulari = $db->lastinsertid(); $nombre=$_session['usuari']; insertar_log($tabla,$id,"update","usuari: ".$_SESSION['MM_Username']." (".$nombre.") ha revisat la petició."); $db = null; return true; else echo "<p>error al guardar el formulari. Posi's en contacte amb la vostra Gestió.<p>\n"; $db = null; return false; //Recupera les dades de la base de dades segons un id public function recuperabbdd($tabla,$id) $db = conectadb(); $query_rsconsulta = sprintf("select * FROM %s WHERE id = %s", $tabla, GetSQLValueString($id, "int")); //echo $query_rsconsulta; $rsconsulta = $db->query($query_rsconsulta); $row_rsconsulta = $rsconsulta->fetch(pdo::fetch_assoc); foreach( $this->datos as $nom=>$dada ) $atributs=$dada->aconsegueixatributs(); $valor=$row_rsconsulta[$nom]; //echo $nom.": ".$valor."</br>"; if ($dada->aconsegueixtipus() == "data") $valor=data_giramesdia ($valor);

$atributs['value']=$valor; $dada->afegeixatributs($atributs);?>

CLASSE DADA <?php class dada private $id; //Nom de la dada private $tipus; //Tipus de dada (text,int,date,etc) private $atributs; //(Obligatori, No editable, CentreCost, Projecte, Trïa entre dos, etc) //----------- Mètodes -------------- public function construct($nom,$tipus,$atributs = array()) $this->id=$nom; $this->tipus=$tipus; $this->atributs = array(); $this->atributs=$atributs; //Retorna el nom de la dada public function aconsegueixnom() return $this->id; //Retorna el tipus de la dada public function aconsegueixtipus() return $this->tipus; //Retorna els atributs de la dada public function aconsegueixatributs() return $this->atributs; //Inserta els atributs de la dada public function afegeixatributs($atributs = array()) $this->atributs=$atributs; //Retorna el codi HTML corresponent a aquest element de formulari public function generahtml() $tipus=$this->tipus; switch ($tipus) case "text": $str=$this->htmltext(); case "select": $str=$this->htmlselect();

case "textarea": $str=$this->htmltextarea(); case "data": $str=$this->htmldata(); case "radio": $str=$this->htmlradio(); case "checkbox": $str=$this->htmlcheckbox(); //Retorna el codi HTML de una dada de tipus TEXT private function HTMLtext() $str="<input id=\"".$this->id."\" type=\"".$this->tipus."\" name=\"".$this->id."\""; if ($this->atributs) $str.= $this->afegeixatributstext($this->atributs); />"; //Afegeix els atributs a un camp TEXT private function afegeixatributstext($atributs) $str=""; foreach( $atributs as $parametre=>$valor ) case "value": //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $parametre=\"$post\"";

case "usuari": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $parametre=\"$post\""; else $usuari=$_session['usuari']; $parametre=\"$usuari\""; quan es recupera al formulari 2. $parametre=\"$valor\""; //Resta de casos. Per exemple case "obligatori": case 'obligatori': //Títol Camp Obligatori i marcar en vermell si està buit. $str.= " title=\"".camp_obligatori."\""; >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]=="") $style.=" border: 1px solid #F00;"; case 'projecte': case 'centrecost': // $valor fa referència a un camp que ha d estar omplert. Si no es així cal marcar en vermell. // Ex: el camp projecte s ha de marcar en vermell si està buit i si centrecost també està buit if ((isset($_post[$this- >aconsegueixnom()]) && $_POST[$this- >aconsegueixnom()]=="")&&(isset($_post[$valor]) && $_POST[$valor]=="")) $style.=" border: 1px solid #F00;"; // Si el camp $valor està omplert llavors aquesta dada és obligatòria if ((isset($_post[$this- >aconsegueixnom()]) && $_POST[$this- >aconsegueixnom()]=="")&&(isset($_post[$valor]) && $_POST[$valor]!="")) $style.=" border: 1px solid #F00;";

case "importobligatori": //Títol Camp Obligatori amb exemple,marcar en vermell si està buit. $str.= " title=\"".camp_obligatori_ex."\" onkeypress=\"return validanan(event);\""; >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]=="") $style.=" textalign: right;border: 1px solid #F00;"; case "readonly": $parametre=\"$parametre\""; $str.= " title=\"".camp_no_editable."\""; case "justificat": case "dreta": $style.=" text-align: right;"; case "gris": $style.=" background-color:#e6e6e6;"; $parametre=\"$valor\""; $str.=" style=\"".$style."\""; //Retorna el codi HTML de una dada de tipus SELECT private function HTMLselect() $str="<select id=\"".$this->id."\" name=\"".$this->id."\""; if ($this->atributs) $str.= $this->afegeixatributsselect($this->atributs); </select>"; //Afegeix les opcions i els atributs a un camp SELECT

private function afegeixatributsselect($atributs) //Recorro els atributs //var_dump($atributs); foreach( $atributs as $parametre=>$valor ) case "value": $str.=">"; //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $seleccionado=$_post[$this->aconsegueixnom()]; //Resta de casos. Per exemple quan es recupera al formulari 2. $seleccionado=$valor; case "readonly": disabled=\"disabled\""; $str.= " title=\"".camp_no_editable."\""; case "gris": $str.=" style=\"backgroundcolor:#e6e6e6\""; case "option": $parametre=\"$valor\""; foreach( $atributs as $parametre=>$valor ) case "option": //Recorro la llista de OPTIONS foreach( $valor as $opcion=>$mostrar ) $str.= "<option value=\"".$opcion."\"";

//echo $seleccionado."=".$opcion." "; if ($seleccionado==$opcion) $str.=" selected=\"selected\""; $str.= ">".$mostrar."</option>"; //Retorna el codi HTML de una dada de tipus TEXTAREA private function HTMLtextArea() $str="<textarea id=\"".$this->id."\" name=\"".$this->id."\""; if ($this->atributs) $str.= $this->afegeixatributstextarea($this->atributs); </textarea>"; //Afegeix los atributs a un camp TEXTAREA private function afegeixatributstextarea($atributs) $str=""; foreach( $atributs as $parametre=>$valor ) case "ample": style=\"width:838px\""; //Ha de ser sempre la darrera ja que tanco el tag textarea case "value": $str.=">"; //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $str.= $post; $str.= $valor;

case "readonly": $parametre=\"$parametre\""; $str.= " title=\"".camp_no_editable."\""; case "gris": $str.=" style=\"width:838px;background-color:#e6e6e6\""; $parametre=\"$valor\""; //Retorna el codi HTML de una dada de tipus DATA private function HTMLdata() $str="<input id=\"".$this->id."\" type=\"text\" name=\"".$this- >id."\" size=\"9\" maxlenght=\"10\""; if ($this->atributs) $str.= $this->afegeixatributsdata($this->atributs); />"; foreach( $this->atributs as $parametre=>$valor ) case "calendari": <script language=\"javascript\">new tcal ('controlname': '".$this- >id."');</script>"; //Afegeix els atributs a un camp DATA private function afegeixatributsdata($atributs) $str=""; foreach( $atributs as $parametre=>$valor )

case "value": //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $parametre=\"$post\""; d'avui $parametre=\"".date('d-m-y')."\""; quan es recupera al formulari 2. $parametre=\"$valor\""; //Cas "avui": torna la data case "avui": $str.=" //Resta de casos. Per exemple case "obligatori": //Títol Camp Obligatori i marcar en vermell si està buit. $str.= " title=\"".camp_obligatori."\""; >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]=="") $str.=" style=\"border: 1px solid #F00;\""; case "readonly": $parametre=\"$parametre\""; $str.= " title=\"".camp_no_editable."\""; case "gris": $str.=" style=\"backgroundcolor:#e6e6e6\""; $parametre=\"$valor\"";

//Retorna el codi HTML de una dada de tipus RADIO private function HTMLradio() $str="<input id=\"".$this->id."\" name=\"".$this->id."\" type=\"hidden\""; if ($this->atributs) $str.= $this->afegeixatributsradio($this->atributs); />"; $str.= $this->afegeixbotoradio($this->atributs); //Afegeix les opcions i els atributs al hidden de un camp RADIO private function afegeixatributsradio($atributs) //Recorro els atributs //var_dump($atributs); foreach( $atributs as $parametre=>$valor ) case "value": //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $parametre=\"$post\""; //Resta de casos. Per exemple quan es recupera al formulari 2. $parametre=\"$valor\""; case "readonly": $str.= " title=\"".camp_no_editable."\"";

$parametre=\"$valor\""; //Afegeix les opcions i els atributs al gràfic RADIO private function afegeixbotoradio($atributs) $str.="<img "; //Recorro els atributs //var_dump($atributs); foreach( $atributs as $parametre=>$valor ) case "value": case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]=="1") $str.= "src=\"images/radio-check.png\" id=\"".$this->id."-img\""; else $str.= "src=\"images/radio.png\" id=\"".$this->id."-img\""; if (isset($valor) && $valor=="1") $str.= "src=\"images/radio-check.png\" id=\"".$this->id."-img\""; else $str.= "src=\"images/radio.png\" id=\"".$this->id."-img\""; case "obligatori": case 'obligatori': //Miro tots els elements del radio button. Si no n hi ha cap marcat mostro el fil vermell indicant que es camp obligatori $marca = 1; foreach( $atributs['option'] as $ordre=>$opcio )

if (isset($_post[$opcio]) && $_POST[$opcio]=="1") $marca=0; //echo $opcio."= ".$_POST[$opcio]." "; //echo "Marca= ".$marca." "; if (isset($_post[$opcio])&&($marca==1)) $str.=" style=\"border: 1px solid #F00;\""; case "option": onclick=\""; foreach( $valor as $opcion ) if ($opcion==$this- >aconsegueixnom()) $str.= "document.getelementbyid('".$opcion."').value=1; document.getelementbyid('".$opcion."-img').src='images/radio-check.png';"; else $str.= "document.getelementbyid('".$opcion."').value=0; document.getelementbyid('".$opcion."-img').src='images/radio.png';"; \" "; />"; $parametre=\"$valor\""; //Retorna el codi HTML de una dada de tipus CHECKBOX private function HTMLcheckbox() $str="<input id=\"".$this->id."\" name=\"".$this->id."\" type=\"hidden\""; if ($this->atributs) $str.= $this->afegeixatributscheckbox($this->atributs); />"; $str.= $this->afegeixbotocheckbox($this->atributs); //Afegeix els atributs a un campcheckbox

private function afegeixatributscheckbox($atributs) //Recorro els atributs //var_dump($atributs); foreach( $atributs as $parametre=>$valor ) case "value": //Cas "post": per recollir les dades per POST case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]!="") $post=$_post[$this- >aconsegueixnom()]; $parametre=\"$post\""; //Resta de casos. Per exemple quan es recupera al formulari 2. $parametre=\"$valor\""; $parametre=\"$valor\""; //Afegeix les opcions i els atributs al gràfic CHECKBOX private function afegeixbotocheckbox($atributs) $str.="<img "; foreach( $atributs as $parametre=>$valor ) case "value": case "post": >aconsegueixnom()]) && $_POST[$this->aconsegueixNom()]=="1")

$str.= "src=\"images/check-in-box.png\" id=\"".$this->id."-img\""; else $str.= "src=\"images/check-box.png\" id=\"".$this->id."-img\""; \" "; if (isset($valor) && $valor=="1") $str.= "src=\"images/check-in-box.png\" id=\"".$this->id."-img\""; else $str.= "src=\"images/check-box.png\" id=\"".$this->id."-img\""; \" "; //Marca si el checkbox es podrà prémer o no. En formulari 1 y 2 interessa que sigui modificable. En vista no. case "modificable": onclick=\"cambiarinbox('".$this->id."');\" "; \" "; />"; $parametre=\"$valor\"";?>