~daker/+junk/SCP

« back to all changes in this revision

Viewing changes to backoffice/tpl/add_news.php

  • Committer: Adnane Belmadiaf
  • Date: 2011-02-25 18:05:22 UTC
  • Revision ID: daker@ubuntu.com-20110225180522-o05q6vtol0h5trhf
* Second commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
    <td style="padding-top: 5px;" width="86%" valign="top">
2
 
            <?php
3
 
        if(!empty($_POST['titre']) && !empty($_POST['contenu']) ) {
4
 
        $classe = 'msg_ok';
5
 
        $msg = array();
6
 
        $contenu = htmlentities(addslashes($_POST['contenu']));
7
 
        $sql = "INSERT INTO `news` (
8
 
                                                `id` ,
9
 
                                                `titre`,
10
 
                                                `contenu`,
11
 
                                                `date_ajout`
12
 
                                                )
13
 
                                                VALUES (NULL , '".$_POST['titre']."' , '".$contenu."', Now())";
14
 
        if(mysql_query($sql))
15
 
            array_push($msg,'Nouveaut� ajout� avec succ�s.');
16
 
        else
17
 
            array_push($msg,'Echec d\'ajout. (Erreyr MySQL) ');
18
 
        
19
 
        affiche_msg($msg,$classe);
20
 
        }
21
 
        ?>
22
 
        <div class="setting_title">Ajouter une Nouveaut�</div>
23
 
        <div id="Container">
24
 
            <?php
25
 
            include("spaw2/spaw.inc.php");
26
 
            ?>
27
 
            <form action="" method="post">
28
 
                <table width="780" border="0" cellpadding="3" cellspacing="2">
29
 
                    <tbody>
30
 
                        <tr>
31
 
                            <td width="50">Titre :</td>
32
 
                            <td><input type="text" name="titre" size="35" maxlength="255"></td>
33
 
                        </tr>
34
 
                        <tr>
35
 
                            <td colspan="2">
36
 
                                <?php
37
 
                                SpawConfig::setStaticConfigValue('default_height','300px');     
38
 
                                $spaw = new SpawEditor('contenu','');   
39
 
                                $spaw->show(); 
40
 
                                 ?>        
41
 
                            </td>
42
 
                        </tr>
43
 
                        <tr>
44
 
                            <td><input type="submit" name="Valider" value="Valider">&nbsp;</td>
45
 
                        </tr>
46
 
                    </tbody>
47
 
                </table>
48
 
            </form>
49
 
        </div>
50
 
    </td>
 
 
b'\\ No newline at end of file'