コード例 #1
0
ファイル: functions.php プロジェクト: chaimaech/UPDS
function recipe_func($recipeObject)
{
    global $recipeObject;
    global $recipePost;
    $recipe = $recipeObject['steps'];
    $return = "<div id='recipe'>\n            <div id='recipeHeader'>\n                <h2>" . $recipeObject['recipeName']['value'] . "</h2>\n                <h4>" . $recipeObject['recipeAccroche']['value'] . "</h4>\n                    <a class='print' href='javascript:window.print();'><i class='fa fa-print fa-lg'></i> Imprimer</a> \n                    <!--<a class='pdf'><i class='fa fa-file-text-o fa-lg'></i> Recette en PDF</a>-->\n            </div>\n            <div id='recipeInfos'>\n                <ul>\n                    <li>\n                        <img alt='Nombre de parts' class='servings' src='/wp-content/themes/BayleafView/images/icons/Fork&Knife.png' />" . $recipeObject['servings']['label'] . "\n                        <br/>\n                        <i id='minus' class='fa fa-minus'></i>\n                        <span ";
    if ($recipePost == true) {
        $return .= "itemprop='recipeYield'";
    }
    $return .= ">" . $recipeObject['servings']['value'] . "\n                        </span>\n                        <i id='plus' class='fa fa-plus'></i>\n                    </li>\n                    <li>\n                        <img alt='Temps total' class='totalTime' src='/wp-content/themes/BayleafView/images/icons/Timer.png' />\n                        Temps total\n                        <span ";
    if ($recipePost == true) {
        $return .= "itemprop='totalTime' content='PT" . ($recipeObject['prepTime']['value'] + $recipeObject['cookTime']['value']) . "M'";
    }
    $return .= ">" . convertToHoursMins($recipeObject['prepTime']['value'] + $recipeObject['cookTime']['value']) . "</span>\n                    </li>";
    switch ($recipeObject['difficulty']['value']) {
        case 'Intermédiaire':
            $cssClass = 'intermediaire';
            break;
        case 'Difficile':
            $cssClass = 'difficile';
            break;
        default:
            $cssClass = 'debutant';
    }
    $return .= "<li";
    if (isset($cssClass)) {
        $return .= " class=" . $cssClass;
    }
    $return .= ">\n                        <img alt='" . $cssClass . "' class='totalTime' src='/wp-content/themes/BayleafView/images/icons/" . $cssClass . ".png' />" . $recipeObject['difficulty']['label'] . "\n                        <span>" . $recipeObject['difficulty']['value'] . "</span>\n                    </li>\n                </ul>\n            </div>\n            <div id='recipeBody'>\n                <div id='recipeSide'>\n                    <div class='sideBody'>\n                        <h3>" . $recipe['sub_fields'][2]['label'] . "</h3>\n                        <ul class='ingredients'>";
    foreach ($recipe['value'] as $keyStep => $step) {
        if ($step['stepTitle'] && $step['stepTitle'] != '') {
            $return .= "<span class='steptitle'>Pour " . $step['stepTitle'] . "</span>";
        }
        foreach ($step['stepIngredients'] as $ingredient) {
            $return .= "\n                                        <li class='ingredient step" . $keyStep . "'>\n                                            <ul>\n                                                <li class='ingredientQuantity' data-initialValue='" . $ingredient['stepIngredientQuantity'] . "'>" . $ingredient['stepIngredientQuantity'] . "</li>\n                                                <li class='ingredientUnity'>" . $ingredient['stepIngredientUnity'] . "</li>\n                                                <li class='ingredientName' ";
            if ($recipePost == true) {
                $return .= "itemprop='ingredients'";
            }
            $return .= ">" . $ingredient['stepIngredientName'] . "</li>\n                                            </ul>\n                                        </li>";
        }
    }
    $return .= "</ul>\n                        <h3>" . $recipe['sub_fields'][3]['label'] . "</h3>\n                        <ul class='materials'>";
    $occurences = array();
    $materials = array();
    foreach ($recipe['value'] as $keyStep => $step) {
        if (is_array($step['stepMaterials'])) {
            foreach ($step['stepMaterials'] as $material) {
                array_push($materials, $material["stepMaterialName"]);
            }
        }
    }
    $occurences = array_count_values($materials);
    foreach ($occurences as $materialName => $materialQuantity) {
        $return .= "<li class='material step" . $keyStep . "'>\n                                    <ul>\n                                        <li class='materialQuantity'>" . $materialQuantity . "</li>\n                                        <li class='materialName'>" . $materialName . "</li>\n                                    </ul>\n                                </li>";
    }
    $return .= "</ul>\n                    </div>\n                </div>\n                <div id='recipeBlock'>\n                    <div class='blockBody'>\n                        <h3>" . $recipeObject['steps']['label'] . "</h3>\n                        <ol class='steps'";
    if ($recipePost == true) {
        $return .= " itemprop='recipeInstructions'";
    }
    $return .= ">";
    foreach ($recipeObject['steps']['value'] as $step) {
        $return .= "<li class='step step" . $keyStep . "'>" . $step['stepDescription'] . "</li>";
    }
    $return .= "</ol>\n                    </div>\n                </div>\n            </div>";
    if ($recipeObject['remarques']['value']) {
        $return .= "<div id='recipeFooter'>\n                    <h3>" . $recipeObject['remarques']['label'] . "</h3>\n                    <p>" . $recipeObject['remarques']['value'] . "</p>\n                </div>";
    }
    $return .= "</div>";
    if ($recipePost == true) {
        return $return;
    }
}
コード例 #2
0
ファイル: index.php プロジェクト: andi-git/boatpos
        echo $d->format("H:i");
        ?>
 Uhr
                            </td>
                        </tr>
                        <tr class="table-no-style">
                            <td class="table-no-style"><b>Uhrzeit</b></td>
                            <td class="table-no-style"><?php 
        echo date("H:i", time());
        ?>
 Uhr</td>
                        </tr>
                        <tr class="table-no-style">
                            <td class="table-no-style"><b>Fahrzeit</b></td>
                            <td class="table-no-style"><?php 
        echo convertToHoursMins($rental['timeOfTravel'], '%02d Std %02d Min');
        ?>
</td>
                        </tr>
                        <?php 
        if (!empty($rental['commitmentBeans'])) {
            ?>
                            <tr class="table-no-style">
                                <td class="table-no-style"><b>Einsatz</b></td>
                                <td class="table-no-style"><?php 
            foreach ($rental['commitmentBeans'] as $commitment) {
                echo $commitment['name'] . " ";
            }
            ?>
</td>
                            </tr>
コード例 #3
0
function getTimeDuration($ParentInTime)
{
    if (!$ParentInTime) {
        echo 'Parent Time is empty';
    }
    $now = date('Y-m-d H:i:s');
    $timeStampParentInTime = strtotime($ParentInTime);
    //1434650400
    $timeStampNow = strtotime($now);
    $strNowDate = date('Y-m-d', $timeStampNow);
    $strInDate = date('Y-m-d', $timeStampParentInTime);
    $sql44 = "SELECT COUNT(*) CountNwdDays FROM t_non_working_days WHERE NwdDate > '{$strInDate}' AND NwdDate < '{$strNowDate}';";
    $result44 = mysql_query($sql44);
    if ($result44) {
        $aData44 = mysql_fetch_assoc($result44);
    }
    $countNwdDays = 0;
    if ($aData44) {
        $countNwdDays = $aData44['CountNwdDays'];
    }
    $diff = $timeStampNow - $timeStampParentInTime;
    $duration = $diff - $countNwdDays * 86400;
    $txtDuration = convertToHoursMins($duration, '%02d hours %02d minutes');
    return array('Duration' => $duration, 'txtDuration' => $txtDuration);
}
コード例 #4
0
function getDiffLevelTableData()
{
    $StartDate = $_POST['dp1_start'];
    $EndDate = $_POST['dp1_end'];
    $ProcUnitId = 1;
    $query = "SELECT ProcessId, ProcessName, ProcessOrder\nFROM t_process_list\nWHERE t_process_list.ProcUnitId = {$ProcUnitId}\nORDER BY ProcessOrder;";
    $result = mysql_query($query);
    $monthListShort = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');
    $aData = array();
    $aTemplateValues = array();
    $aColumns = array();
    if ($result) {
        while ($rec = mysql_fetch_object($result)) {
            //get dynamic columns for the datatable
            $pia = $rec->ProcessOrder . 'i';
            // for InTime
            $pib = $rec->ProcessOrder . 'o';
            // for OutTime
            $pid = $rec->ProcessOrder . 'd';
            // for Duration
            $aColumns[] = $rec->ProcessName;
            // for InTime
            $aColumns[] = $rec->ProcessName;
            // for OutTime
            $aColumns[] = $rec->ProcessName;
            // for Duration
            $aData[] = $rec;
            ///get the initial value for each facility, if a facility have no value for a specific item then
            //the following array keep track the zero value for that position.
            $aTemplateValues[$pia] = '';
            $aTemplateValues[$pib] = '';
            $aTemplateValues[$pid] = '';
        }
    }
    $aTemplateValues['Total'] = 0;
    $aaData = array();
    $tmpFacilityCode = '';
    $tmpFacilityName = '';
    $tmpItemName = '';
    $tmpUnitName = '';
    $sl = 0;
    /* $sQuery = "SELECT 
       t_process_tracking.TrackingNo, t_process_tracking.RegNo, t_process_tracking.ProcessId, t_process_list.ProcessName, t_process_list.ProcessOrder, t_process_tracking.InTime, t_process_tracking.OutTime,  Duration
       FROM
       t_process_tracking
       INNER JOIN t_process_list
       ON t_process_tracking.ProcessId = t_process_list.ProcessId
       WHERE EntryDate >= '$StartDate'
       AND EntryDate <= '$EndDate'
       AND t_process_tracking.ProcUnitId = $ProcUnitId
       ORDER BY t_process_tracking.TrackingNo, t_process_list.ProcessOrder;"; */
    $sQuery = "SELECT \n\t\t\t\t  RegNo, ProcessName, ProcessOrder, InTime, OutTime,  Duration\n\t\t\t\tFROM\n\t\t\t\t  t_process_tracking \n\t\t\t\t  INNER JOIN t_process_list \n\t\t\t\t\tON t_process_tracking.ProcessId = t_process_list.ProcessId \n\t\t\t\tWHERE RegNo IN (SELECT RegNo\n\t\t\t\tFROM\n\t\t\t\t  t_process_tracking \n\t\t\t\tWHERE EntryDate >= '{$StartDate}' \n\t\t\t\t  AND EntryDate <= '{$EndDate}' \n\t\t\t\t  AND ProcUnitId = {$ProcUnitId})\n\t\t\t\tORDER BY RegNo, ProcessOrder;";
    $rResult = mysql_query($sQuery);
    //$holidays = array("2015-06-18","2015-06-19");
    if ($rResult) {
        while ($data = mysql_fetch_object($rResult)) {
            $TrackNo = $data->RegNo;
            if ($TrackNo != $tmpFacilityCode) {
                // get each row to a array when it changes it state so in this case last row always skipped
                if (!is_null($row)) {
                    $row['Total'] = is_null($row['Total']) ? '' : convertToHoursMins($row['Total'], '%02d hours %02d minutes');
                    $tmpRow = array_values($row);
                    array_unshift($tmpRow, ++$sl, $tmpFacilityName);
                    $aaData[] = $tmpRow;
                }
                // initialize the $row the zero values array sized with the number of facility.
                $row = $aTemplateValues;
                // collecting data for the facility
                $row[$data->ProcessOrder . 'i'] = is_null($data->InTime) ? '' : date('d/m/Y g:i A', strtotime($data->InTime));
                $row[$data->ProcessOrder . 'o'] = is_null($data->OutTime) ? '' : date('d/m/Y g:i A', strtotime($data->OutTime));
                $row[$data->ProcessOrder . 'd'] = is_null($data->Duration) ? '' : convertToHoursMins($data->Duration, '%02d hours %02d minutes');
                $row['Total'] += is_null($data->Duration) ? 0 : $data->Duration;
                // put the temp variable with the item code
                $tmpFacilityCode = $data->RegNo;
                $tmpFacilityName = $data->RegNo ? $data->RegNo : $data->RegNo;
            } else {
                // collecting data for the facility
                $row[$data->ProcessOrder . 'i'] = is_null($data->InTime) ? '' : date('d/m/Y g:i A', strtotime($data->InTime));
                $row[$data->ProcessOrder . 'o'] = is_null($data->OutTime) ? '' : date('d/m/Y g:i A', strtotime($data->OutTime));
                $row[$data->ProcessOrder . 'd'] = is_null($data->Duration) ? '' : convertToHoursMins($data->Duration, '%02d hours %02d minutes');
                $row['Total'] += is_null($data->Duration) ? 0 : $data->Duration;
                // put the temp variable with the item code
                $tmpFacilityCode = $data->RegNo;
            }
        }
    }
    $num_rows = mysql_num_rows($rResult);
    if ($num_rows) {
        // get the last row that is skipped in the above loop
        $row['Total'] = is_null($row['Total']) ? '' : convertToHoursMins($row['Total'], '%02d hours %02d minutes');
        $tmpRow = array_values($row);
        array_unshift($tmpRow, ++$sl, $tmpFacilityName);
        $aaData[] = $tmpRow;
    }
    echo '{"sEcho": ' . intval($sEcho) . ', "iTotalRecords":"10","iTotalDisplayRecords": "10", "aaData":' . json_encode($aaData) . '}';
}
コード例 #5
0
function getWaitingProcessList($conn)
{
    global $gTEXT;
    date_default_timezone_set("Asia/Dhaka");
    $lan = $_POST['lan'];
    $ProcessId = $_POST['ProcessId'];
    $ProcessOrder = $_POST['ProcessOrder'];
    $sLimit = "";
    if (isset($_POST['iDisplayStart'])) {
        $sLimit = " LIMIT " . mysql_real_escape_string($_POST['iDisplayStart']) . ", " . mysql_real_escape_string($_POST['iDisplayLength']);
    }
    $sOrder = "";
    if (isset($_POST['iSortCol_0'])) {
        $sOrder = " ORDER BY  ";
        for ($i = 0; $i < mysql_real_escape_string($_POST['iSortingCols']); $i++) {
            $sOrder .= fnColumnToField_itemlist(mysql_real_escape_string($_POST['iSortCol_' . $i])) . "\n\t\t\t\t\t\t\t\t" . mysql_real_escape_string($_POST['sSortDir_' . $i]) . ", ";
        }
        $sOrder = substr_replace($sOrder, "", -2);
    }
    $sWhere = "";
    if ($_POST['sSearch'] != "") {
        $sWhere = " AND  (t_process_tracking.TrackingNo LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%'  OR " . " t_process_list.ProcessName LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' OR " . " t_process_tracking.InTime LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%' OR " . " t_process_tracking.OutTime LIKE '%" . mysql_real_escape_string($_POST['sSearch']) . "%') ";
    }
    $sql = "SELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t t_process_tracking.ProTrackId\n\t\t\t\t, t_process_tracking.TrackingNo\n\t\t\t\t, t_process_list.ProcessId\n\t\t\t\t, t_process_list.ProcessName\n\t\t\t\t, t_process_list.ProcessOrder\n\t\t\t\t, t_process_tracking.InTime\n\t\t\t\t, t_process_tracking.OutTime\n\t\t\t\t, TIMESTAMPDIFF(MINUTE, InTime, NOW()) AS Duration\n\t\t\t\t, UsualDuration\n\t\t\t\t, (TIMESTAMPDIFF(MINUTE, InTime, NOW()) - UsualDuration) Status\n\t\t\tFROM\n\t\t\t\tt_process_tracking\n\t\t\t\tINNER JOIN t_process_list\n\t\t\t\t\tON (t_process_tracking.ProcessId = t_process_list.ProcessId)\n\t\t\t\t\tWHERE t_process_tracking.ReadyForProOrder = {$ProcessOrder}\n                    {$sWhere} \n                    {$sOrder} \n                    {$sLimit} ";
    $result = mysql_query($sql, $conn);
    $total = mysql_num_rows($result);
    $sQuery = "SELECT FOUND_ROWS()";
    $rResultFilterTotal = mysql_query($sQuery);
    $aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
    $iFilteredTotal = $aResultFilterTotal[0];
    $sOutput = '{';
    $sOutput .= '"sEcho": ' . intval($_POST['sEcho']) . ', ';
    $sOutput .= '"iTotalRecords": ' . $iFilteredTotal . ', ';
    $sOutput .= '"iTotalDisplayRecords": ' . $iFilteredTotal . ', ';
    $sOutput .= '"aaData": [ ';
    $serial = $_POST['iDisplayStart'] + 1;
    $f = 0;
    while ($aRow = mysql_fetch_array($result)) {
        if ($f++) {
            $sOutput .= ',';
        }
        $sOutput .= "[";
        $sOutput .= '"' . $aRow['ProTrackId'] . '",';
        $sOutput .= '"' . $serial++ . '",';
        $sOutput .= '"' . $aRow['TrackingNo'] . '",';
        $sOutput .= '"' . $aRow['ProcessName'] . '",';
        $sOutput .= '"' . date('d/m/Y g:i A', strtotime($aRow['InTime'])) . '",';
        $sOutput .= '"' . $aRow['OutTime'] . '",';
        $sOutput .= '"' . convertToHoursMins($aRow['Duration'], '%02d hours %02d minutes') . '",';
        $sOutput .= '"' . ($aRow['Status'] < 0 ? abs($aRow['Status']) . ' minutes ahead' : abs($aRow['Status']) . ' minutes delay') . '",';
        $sOutput .= '"' . $aRow['ProcessId'] . '",';
        $sOutput .= '"' . $aRow['ProcessOrder'] . '"';
        $sOutput .= "]";
    }
    $sOutput .= '] }';
    echo $sOutput;
}
コード例 #6
0
?>
<ul id="og-grid" class="og-grid">
    
<?php 
while ($result = $sessionsCompleteList->fetch()) {
    $filename = 'resources/imgs/content/movies/' . $result->idMovie . 'Poster.jpg';
    if (file_exists($filename)) {
        $img = $filename;
    } else {
        $rand = rand(1, 2);
        $img = 'resources/imgs/content/movies/defaultPoster' . $rand . '.jpg';
    }
    $date = $result->date;
    //    $date = date_format($date, 'Y-m-d H:i:s');
    //   $date = $date->format('%A %d %B %Y H:i');
    $runningTimeHour = convertToHoursMins($result->runningTime, '%02d h %02d minutes');
    ?>
    <li class="li_prog">
       <a href="movie-details.php?id=<?php 
    echo $result->idMovie;
    ?>
" data-largesrc="<?php 
    echo $img;
    ?>
" data-title="<?php 
    echo $result->title;
    ?>
" data-releasedate="<?php 
    echo $result->releaseDate;
    ?>
" data-runningtime="<?php 
コード例 #7
0
ファイル: home.php プロジェクト: ribeirog/Pizza
        $timeToFinish += 15;
    }
    if (!feof($handle)) {
        echo "<tr><td colspan='2'>" . "Error: unexpected fgets() fail" . "</td></tr>";
    }
    fclose($handle);
}
?>
            </tbody>
            <tr style="background: #f8f8f8;">
                <td colspan="2">
                    <?php 
function convertToHoursMins($time, $format = '%02d:%02d')
{
    if ($time < 1) {
        return;
    }
    $hours = floor($time / 60);
    $minutes = $time % 60;
    return sprintf($format, $hours, $minutes);
}
echo "Approximate time to bake all the pizzas: <b>" . convertToHoursMins($timeToFinish, '%02d hours %02d minutes</b> <small> (Each pizza takes about 15 minutes to be ready)</small>');
?>
                </td>
            </tr>
        </table>

    </div>

</body>
</html>
コード例 #8
0
ファイル: movedesk.php プロジェクト: anctemarry27/photon-desk
        exec("particle call {$photonName} setheight " . $presets[$previousPosition]['height']);
    } elseif ($cmd == "down" && isset($presets[$nextPosition])) {
        // Go down one position
        exec('notify-send -i ' . $presets[$nextPosition]['icon'] . ' "Moving desk to ' . $nextPosition . '"');
        exec("particle call {$photonName} setheight " . $presets[$nextPosition]['height']);
    } elseif (isset($presets[$cmd])) {
        // go to the preset
        exec('notify-send -i ' . $presets[$cmd]['icon'] . ' "Moving desk to ' . $cmd . '"');
        exec("particle call {$photonName} setheight " . $presets[$cmd]['height']);
    }
} else {
    if ($standingTime > 0 && $totalTime > 0) {
        echo "    Time Standing: " . convertToHoursMins($standingTime) . " - " . number_format($standingTime / $totalTime * 100, 1) . "%\n";
    }
    if ($sittingTime > 0 && $totalTime > 0) {
        echo "     Time Sitting: " . convertToHoursMins($sittingTime) . " - " . number_format($sittingTime / $totalTime * 100, 1) . "%\n";
    }
    echo "     Time at desk: " . convertToHoursMins($totalTime) . "\n\n";
    $currentHeight = exec("particle call {$photonName} getheight");
    echo "   Current Height: " . $currentHeight . "cm\n";
    $currentPosition = getClosest($currentHeight, $presets);
    $previousPosition = getPrevious($currentPosition, $presets);
    $nextPosition = getNext($currentPosition, $presets);
    if (!is_null($previousPosition)) {
        echo "      Up Position: " . $previousPosition . " (" . $presets[$previousPosition]['height'] . "cm)\n";
    }
    echo " Current Position: " . $currentPosition . " (" . $presets[$currentPosition]['height'] . "cm)\n";
    if (!is_null($nextPosition)) {
        echo "    Down Position: " . $nextPosition . " (" . $presets[$nextPosition]['height'] . "cm)\n";
    }
}
コード例 #9
0
ファイル: profil.inc.php プロジェクト: Taehupo/MyPHPProject
if (isset($_REQUEST['supprimer'])) {
    $user = $PDO_BDD->query("SELECT * FROM t_recette_rct NATURAL JOIN t_utilisateur_uti WHERE rct_id = " . $_REQUEST['rctid'])->fetch(PDO::FETCH_ASSOC);
    if ($_SESSION['login'] == $user['UTI_LOGIN']) {
        $PDO_BDD->query("DELETE FROM `t_commentaire_com` WHERE rct_id=" . $_REQUEST['rctid']);
        $PDO_BDD->query("DELETE FROM `tj_cat_rct` WHERE rct_id=" . $_REQUEST['rctid']);
        $PDO_BDD->query("DELETE FROM `t_recette_rct` WHERE rct_id=" . $_REQUEST['rctid']);
    }
    header('Location: index.php?page=profil');
}
if (isset($_REQUEST['ajouter'])) {
    $data['affiche_form'] = "";
}
if (isset($_REQUEST['envoyer'])) {
    $data['erreur'] = '';
    if ($_FILES['image_recette']['error'] == 0) {
        $data['erreur'] .= verifyImageFile($_FILES['image_recette']);
    }
    if ($_FILES['image_recette']['error'] == 0 && empty($data['erreur'])) {
        $filename = time() . '.png';
        move_uploaded_file($_FILES['image_recette']['tmp_name'], 'media/' . $_SESSION['login'] . '/' . $filename);
        $categorie = $PDO_BDD->query("SELECT * FROM t_categorie_cat WHERE cat_label = '" . $_REQUEST['cat_recette'] . "'")->fetch(PDO::FETCH_ASSOC);
        $tst = $PDO_BDD->prepare("INSERT INTO t_recette_rct (`RCT_DATE`, `RCT_TITRE`, `RCT_DESCRIPTION`, `RCT_RECETTE`, `RCT_TEMPS_PREPARATION`, `RCT_TEMPS_CUISSON`, `RCT_TEMPS_REPOS`, `RCT_DIFFICULTE`, `RCT_COUT`, `RCT_STATUT`, `RCT_ILLUSTRATION`, `UTI_ID`, `RCT_NBPERSONNE`)\n\t\t\t\t VALUES (CURRENT_TIMESTAMP, '" . $_REQUEST['nom_recette'] . "', '" . addslashes($_REQUEST['desc_mini']) . "', '" . addslashes($_REQUEST['texte_recette']) . "', '" . convertToHoursMins($_REQUEST['temps_prepa']) . "', '" . $_REQUEST['temps_cuisson'] . "', '" . $_REQUEST['temps_repos'] . "', '" . $_REQUEST['difficultee'] . "', '" . $_REQUEST['cout'] . "', 'finale', '" . $filename . "', " . $profil[0]['UTI_ID'] . ", " . $_REQUEST['nb_pers'] . ")");
        $tst->execute();
        $PDO_BDD->query("INSERT INTO tj_cat_rct (`rct_id`, `cat_id`) VALUES (" . $PDO_BDD->lastInsertId() . "," . $categorie['CAT_ID'] . ")");
        header('Location: index.php?page=profil');
    } else {
        $data['erreur'] .= 'Problème de lecture : ' . $_FILES['image_recette']['error'];
    }
}
$data['profil'] = $profil;
$data['user_rct'] = $user_rct;
コード例 #10
0
	</table>
</body>
</html>';
    if ($user == 'Guy') {
        echo '<table>';
        $datas = json_decode(file_get_contents($domoticzurl . 'json.htm?type=lightlog&idx=131', true, $ctx), true);
        $status = '';
        $tijdprev = $time;
        $totalon = 0;
        if (!empty($datas['result'])) {
            foreach ($datas['result'] as $data) {
                if ($status != $data['Status']) {
                    $status = $data['Status'];
                    $level = $data['Level'];
                    $tijd = strtotime($data['Date']);
                    if ($tijd < $twaalfuur) {
                        break;
                    }
                    $period = $tijdprev - $tijd;
                    if ($status == 'On') {
                        $totalon = $totalon + $period;
                    }
                    $tijdprev = $tijd;
                    echo '<tr align="right"><td>' . $data['Date'] . '</td><td>&nbsp;' . $status . '&nbsp;</td><td>&nbsp;' . convertToHoursMins($period / 60) . '</td></tr>';
                }
            }
        }
        echo '</table>
			<div style="position:absolute;top:4.55em;left:13.6em;width:265px;">Dif= ' . $bigdif . '</div>';
    }
}
コード例 #11
0
ファイル: prox.php プロジェクト: rolandostar/Servi
    <?php 
                if ($config['current']) {
                    $salon = mysql_query("SELECT " . $date . " from horario WHERE " . $date . " BETWEEN SUBTIME(CURTIME(), '01:30') AND CURTIME() AND salon = " . $row['salon']) or die(mysql_error());
                } else {
                    $salon = mysql_query("SELECT " . $date . " from horario WHERE " . $date . " BETWEEN SUBTIME(CAST('" . $config['time'] . "' AS TIME), '01:30') AND CAST('" . $config['time'] . "' AS TIME) AND salon = " . $row['salon']) or die(mysql_error());
                }
                $row2 = mysql_fetch_assoc($salon);
                if ($config['current']) {
                    $minute = mysql_fetch_row(mysql_query("SELECT MINUTE(TIMEDIFF(ADDTIME('" . $row2[$date] . "','01:30'),CURTIME()))"));
                } else {
                    $minute = mysql_fetch_row(mysql_query("SELECT MINUTE(TIMEDIFF(ADDTIME('" . $row2[$date] . "','01:30'),CAST('" . $config['time'] . "' AS TIME)))"));
                }
                ?>
        <td><?php 
                echo convertToHoursMins($minute[0], '%02dhr %02dm');
                ?>
</td>
        <td><?php 
                echo $row['salon'];
                ?>
</td>
        <?php 
                if (!$mobile) {
                    echo '<td>' . date("g:i", strtotime($row2[$date])) . " - " . date("g:i", strtotime($row2[$date] . " +1 hours 30 minutes")) . "</td>";
                    echo '<td> <a class="btn-floating btn waves-effect waves-light blue activator" id="' . $jk . '" onclick="notify(\'' . $row['salon'] . '\',0)"><i class="material-icons">add_alert</i></a> </td>';
                } else {
                    echo '<td> <a class="btn-floating btn waves-effect waves-light blue" id="' . $jk . '" onclick="notify(\'' . $row['salon'] . '\',1)"><i class="material-icons">add_alert</i></a> </td>';
                }
                ?>
    </tr>
コード例 #12
0
ファイル: index.php プロジェクト: Zipcore/SteamFunctions
        } else {
            echo "<a href='" . $player->profileurl . "' target='_blank'><img src='" . $player->avatarmedium . "' class=PlayerAvatar style='border: 5px solid #62a7e3;'/></a>";
        }
        echo "<a href='" . $player->profileurl . "' target='_blank' class='PlayerName'>" . $player->personaname . "</a>";
        echo "<a href='steam://friends/add/" . $player->steamid . "' style='font-size:8px;'> Add to Friends</a>";
        echo "</div>";
        echo "<br />";
        $recentGames = @$SteamQuery->GetRecentlyPlayedGames($player->steamid);
        if ($recentGames->response->total_count > 0) {
            echo "<ul class='GamesPlayed'>";
            foreach ($recentGames->response->games as $games) {
                echo "<li>";
                echo "<img src='http://media.steampowered.com/steamcommunity/public/images/apps/" . $games->appid . "/" . $games->img_icon_url . ".jpg' />";
                echo "  ";
                echo $games->name;
                echo "<br />";
                echo convertToHoursMins($games->playtime_2weeks, '%d hours %d minutes') . " played in the last 2 weeks.";
                echo "<br />";
                echo convertToHoursMins($games->playtime_forever, '%d hours %d minutes') . " played total.";
                echo "</li>";
            }
            echo "</ul>";
        } else {
            echo "<br />No Recently played games";
        }
        echo "<hr />";
        echo "</li>";
    }
}
?>