Location: PHPKode > scripts > mysurvey > mysurvey/test.php
<body>
<?php
/*
  ,´¯`.      Federico Larsen
 : (` ;      Linux Registered User #304032.
 `. `´       Mar del Plata. Argentina!
   `·        ICQ: 39334744
*/



include("./lib/db.inc.php"); // include the script to connect to mysql or just type the connection.

//controler encuestas

$ctrenc = new controler_encuestas ();        //create a survey controller
$ctrenc->ver_encuestas ();                   //show all avaliable surveys

if (isset ($ver_res)) {                       //show the results of a selected survey
	$ctrenc->ver_res_encuesta ($ver_res);
}

if (isset ($votar)) {                        //show the form to vote a selected survey
	$ctrenc->votar_1_encuesta ($votar);
}

if (isset ($id_op)) {                       //vote
	$ctrenc->elige_opcion ($id_enc , $id_op);
}

//note that even the surveys management is implemented, is not included in the example.
/* you can create another survey like this
$ctrenc->agregar_encuesta ("Which linux distro you like more?","2002-01-01","2005-01-01" , 3);
$ctrenc->agregar_opcion ("Debian",1);
$ctrenc->agregar_opcion ("Mandrake",2);
$ctrenc->agregar_opcion ("Suse",3);
*/

?>
</body>
Return current item: mysurvey