include 'head.php';
?>
    <title>Content </title>
</head>

<body>
    <?php 
include 'nav.php';
?>
    <h1>Gestion de contenus de l'enfant</h1>
    
    <?php 
$root = './';
include "includes.php";
$contentDao = new ContentDAO(DynamoDbClientBuilder::get());
$childDao = new ChildDAO(DynamoDbClientBuilder::get());
$email = $_SESSION['email'];
$child = $childDao->get($email);
// URL parameter
// parameter 'type', possible values : {teacher, family, doctor}
$type = $_GET['type'];
// use method getContentyType ??
if ($type == 'teacher') {
    $contents = $child->getTeachingContent();
} else {
    if ($type == 'family') {
        $contents = $child->getFamilyContent();
    } else {
        if ($type == 'doctor') {
            $contents = $child->getMedicalContent();
        }
?>
        <title>Children </title>
    </head>
        
    <body>
        
        <?php 
include 'nav.php';
echo "<a href=\"./adultShowContents.php\">Gestion de contenu</a>";
?>
        
        <h1>Enfants</h1>
            
        <?php 
$root = './';
include "includes.php";
$contentDao = new ContentDAO(DynamoDbClientBuilder::get());
$email = $_SESSION['email'];
$childDao = new ChildDAO(DynamoDbClientBuilder::get());
$children = $childDao->getChildren($email);
foreach ($children as $child) {
    echo $child->getFirstname() . ' ' . $child->getLastName() . ' ' . "<a href = /calendar/calendar.php?email=" . $child->getEmail() . ">calendrier</a></br>";
}
?>
        
        <?php 
include 'footer.php';
?>
        
    </body>
</html>
Example #3
0
<?php

session_start();
include "includes.php";
$name = $_GET['name'];
$type = $_GET['type'];
if (!empty($type)) {
    $email = $_SESSION['email'];
    $childDAO = new ChildDAO(DynamoDbClientBuilder::get());
    $child = $childDAO->get($email);
    $child->readContent($name, $type);
    $childDAO->update($child);
    echo '<pre>';
    print_r($child->getContentByType($type));
    echo '</pre></br>';
}
$s3 = new S3Access(S3ClientBuilder::get());
$result = $s3->getFile($name);
header("Content-Type: {$result['ContentType']}");
header("Content-Disposition: attachment; filename=\"{$name}\"");
echo $result['Body'];
               data-sort-order="desc">
          <thead>
            <tr>
              <th data-field="name" data-sortable="true">Nom</th>
              <th>Prénom</th>
              <th>Modification</th>
            </tr>
          </thead>
          <tbody>
            <?php 
$nbr_enf = 0;
foreach ($les_enfants as $nom_pre) {
    $nbr_enf++;
    $tab_nom_pre = explode('___', $nom_pre);
    //recherche les infos de l'enfant
    $childDao = new ChildDAO(DynamoDbClientBuilder::get());
    $children = $childDao->getALLChildren();
    foreach ($children as $child) {
        if (strpos($tab_nom_pre[0], $child->getFirstname()) !== false) {
            if (strpos($tab_nom_pre[1], $child->getLastname()) !== false) {
                $theChild = $child;
            }
        }
    }
    echo "<tr>\r\n                    <td>" . $tab_nom_pre[0] . "</td>\r\n                    <td>" . $tab_nom_pre[1] . "</td>\r\n                    <td>\r\n                    <form class='formB' action='gestionEnfants.php' method='POST' onsubmit='return m_verif_champs();'>\r\n                    <button type='button' class='btn btn-primary' data-toggle='collapse' data-target='#demo2" . $nbr_enf . "'>\r\n                        <span class='glyphicon glyphicon-pencil' style='margin-right: 10px;'></span>Modifier</button>\r\n                    <div id='demo2" . $nbr_enf . "' class='collapse' style=' background-color: gainsboro; padding: 10px; margin-bottom: 10px;'>\r\n                        <input name='mail_modif' value='" . $theChild->getEmail() . "' hidden>\r\n                        <input name='MAJ' value='MAJ' hidden>\r\n                        <label for='nom'>Nom de l'enfant :</label>\r\n                        <input name='nom' class='form-control' id='m_nom' value='" . $tab_nom_pre[0] . "'>\r\n                        <label for='prenom'>Prénom de l'enfant :</label>\r\n                        <input name='prenom' class='form-control' id='m_prenom' value='" . $tab_nom_pre[1] . "'>\r\n                        <label for='mail'>E-mail de l'enfant :</label>\r\n                        <input name='mail' class='form-control' id='m_mail' value='" . $theChild->getEmail() . "'>\r\n                        <label for='password'>Mot de passe de l'enfant :</label>\r\n                        <input name='password' type='password' class='form-control' id='m_password' value='" . $theChild->getPassword() . "'>\r\n                        <label for='repassword'>Confirmer le mot de passe de l'enfant :</label>\r\n                        <input name='repassword' type='password' class='form-control' id='m_repassword' value='" . $theChild->getPassword() . "'>\r\n                        <br/><br/>\r\n                        <button type='submit' class='btn btn-success' name='Enregistrer' value='Enregistrer' onclick ><span class='glyphicon glyphicon-floppy-saved' style='margin-right: 7px;'></span>Enregistrer</button>\r\n                    </div>\r\n                    <button type='submit' class='btn btn-danger' name='Supp' value='Supp' onclick ><span class='glyphicon glyphicon-remove'  style='margin-right: 7px;'></span>Supprimer</button> \r\n                    </form></td>\r\n                    </tr>";
}
?>
          </tbody>
        </table>
      </div>
Example #5
0
 public function UpDate($content, $children)
 {
     try {
         $result = $this->client->updateItem(['TableName' => ContentDAO::$TABLE_NAME, 'Key' => array('name' => array('S' => $content->getName()), 'owner' => array('S' => $content->getEmailOwner())), 'ExpressionAttributeNames' => ['#NA' => 'url'], 'ExpressionAttributeValues' => [':val1' => array('S' => $content->getUrl())], 'UpdateExpression' => 'set #NA = :val1 ']);
         // print_r($result);
         /* $this->client->UpdateItem(array(
                'TableName' => ContentDAO::$TABLE_NAME,
                'Key' => array(
                    'name'    => array('S' => $content->getName()),
                    'owner'   => array('S' => $content->getEmailOwner()),
                    'url'     => array('S' => $content->getUrl()),
                    'type'    => array('S' => $content->getType())
                    ),
                'AttributeUpdates' => array(
                    'url'     => array('Value' => array('SS' => $content->getUrl()), 'Action'=>'ADD')
                    )
            ));*/
         $length = count($children);
         $childDAO = new ChildDAO($this->client);
         for ($i = 0; $i < $length; $i++) {
             $email = $children[$i]['email'];
             $child = $childDAO->get($email);
             if ($child != null) {
                 $dateStart = $children[$i]['dateStart'];
                 $dateEnd = $children[$i]['dateEnd'];
                 $child->addContent($content, $dateStart, $dateEnd);
                 $childDAO->update($child);
             }
         }
     } catch (Exception $e) {
         print $e->getMessage();
     }
 }
Example #6
0
    <body>

        <?php 
include $root . 'nav.php';
?>
        
        <?php 
$doy = new DaysOfYear();
$year = date('Y');
$calendar = $doy->getAll($year);
$access_rights = Rights::$NONE;
$child_email = $_GET['email'];
$adult_email = $_SESSION['email'];
if (!empty($child_email) && !empty($adult_email)) {
    $childDao = new ChildDAO(DynamoDbClientBuilder::get());
    $child = $childDao->get($child_email);
    $usrDao = new UserDAO(DynamoDbClientBuilder::get());
    $user = $usrDao->get($adult_email);
    if ($child->isFather($user->getEmail())) {
        $access_rights = Rights::$FULL_ACCESS;
        // pour l'instant en dur, plus tard dans la base
    }
    echo '<span class="email" email="' . $child_email . '"></span>';
    echo '<span class="adultEmail" email="' . $adult_email . '"   type="' . $user->getType() . '"></span>';
}
?>
    
        
           
        
function deleteFile($child, $type, $adultEmail, $fileName)
{
    $child->deleteContent($fileName, $adultEmail, $type);
    $childDao = new ChildDAO(DynamoDbClientBuilder::get());
    $childDao->update($child);
}
Example #8
0
            text-align: right;
            filter: alpha(opacity=0);
            opacity: 0;
            outline: none;
            background: white;
            cursor: inherit;
            display: block;
        }
    </style>
</head>

<body>
    <?php 
include 'nav.php';
include 'includes.php';
$childDao = new ChildDAO(DynamoDbClientBuilder::get());
$children = $childDao->getChildren($_SESSION['email']);
$nbre_enfant = 0;
foreach ($children as $child) {
    $nbre_enfant++;
}
?>
     <br/>
     <h1 style="margin-left: 27px; margin-bottom: 30px;">Ajouter un document Excel pour créer une description d'un scénario</h1>
     <form method="POST" action="ExcelValider.php" enctype="multipart/form-data" style="margin-left: 20px;" <?php 
echo 'onsubmit="return testcheck(' . $nbre_enfant . ')"';
?>
>
        <div class="input-group" style="margin-bottom: 20px;">
                <span class="input-group-btn">
                    <span class="btn btn-primary btn-file">