case "chatxml": $ret = plugin_func($n, $id, $va, $opt, $res); break; //sys //sys case "offon": $ret = offon($id); break; case "nbp": req('pop,spe,tri'); $ret = nbp($id, $va); $t = 'footnote #' . $id; $s = 400; break; case "export": $ret = exportation($id, $va, $opt, $optb); $t = 'export:' . $id; $s = 440; break; case "deploy": $ret = plugin('deploy', $id); $t = 'deployement: ' . $id; $s = 440; break; //j //j case "embed": $ret = input2('text', '" size="40', $id, 'txtblc'); $tt = $va; break; case "url":
function selectRessources($key,$mode){ try{ $conn = new PDO("mysql:host=localhost;dbname=csv", 'root', 'root',array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql_select_basicat="SELECT * FROM ressources WHERE Basicat='$key'"; $sql_select_id="SELECT * FROM ressources WHERE ID_Appli='$key'"; $sql_select_name="SELECT * FROM ressources WHERE Appli LIKE '$key%'"; if($mode=='Basicat'){ $stmt0 = $conn->prepare($sql_select_basicat); $stmt0->execute(); $result0=$stmt0->fetchAll(); if(!empty($result0)){ echo 'it is basicat'.'<br/>'; $_SESSION["sql_result"]=$result0; exportation(); displayContentsOfRessources($result0); // tabletest(); }else{ echo 'The server locates outside 1'; } }else if($mode=='ID_Appli'){ $stmt1 = $conn->prepare($sql_select_id); $stmt1->execute(); $result1=$stmt1->fetchAll(); if(!empty($result1)){ echo 'it is ID_Appli'.'<br/>'; $_SESSION["sql_result"]=$result1; exportation(); displayContentsOfRessources($result1); //exportation(); }else{ echo 'The server locates outside 2'; } }else if($mode=='Name'){ $stmt2 = $conn->prepare($sql_select_name); $stmt2->execute(); $result2=$stmt2->fetchAll(); if(!empty($result2)){ echo 'it is appli name'.'<br/>'; $_SESSION["sql_result"]=$result2; exportation(); displayContentsOfRessources($result2); //exportation(); }else{ echo 'The server locates outside 3'; } }else{ $_SESSION['sql_result']='no_input'; echo 'please input the right reference'; } }catch(PDOException $e) { echo '<br/>' . $e->getMessage().'<br/>'; } $conn = null; }