예제 #1
0
            $current = $countp;
        } else {
            $current = $page;
        }
        // sinon la page courante est bien celle indiquée dans l'URL
    }
    /* $start est la valeur de départ du LIMIT dans notre requête SQL (est fonction de la page courante) */
    $start = $current * $epp - $epp;
    /* Récupération des données à afficher pour la page courante */
    $uh = mysql_query("select * from notes where user='******' and (type='1' or type='2') order by notes_id desc LIMIT {$start}, {$epp}");
    if ($uh) {
        /* Affichage des données */
        while ($yow = mysql_fetch_array($uh)) {
            $pic = loadpic($yow['user']);
            $userN = nameUser($yow['user']);
            $timestamp = Timesince($yow['date']);
            $noteIDs = hashit($yow['notes_id']);
            $notes = stripslashes(nl2br($yow['note']));
            $notes = wordwrap($notes, 20, "\n", 1);
            echo "\n\n\t\t\t\t<table width='765' border='0'>\n\t\t\t\t  <tr>\n\t\t\t\t\t<td width='10' height='21' valign='top'><a href='user/{$userN}'>{$pic}</a></td>\n\t\t\t\t\t<td width='745' valign='top'><a href='user/{$userN}'><font color='blue'>{$userN}</font></a> <a href='note/{$noteIDs}'>" . $notes . "</a><br /><em><font color='grey'>Posted {$timestamp} ago</font></em></td>\n\t\t\t\t  </tr>\n\t\t\t\t  \t\n\n\t\t\t\t  \n\t\t\t\t</table>\n\t\t\t\t<hr />\n\n\t\t\t\n\t\t\t\n\t\t\t\t\t";
        }
        /* Libération du résultat */
        mysql_free_result($uh);
    }
    //else echo mysqli_error($dbc);
}
//while of friends
/* Appel de la fonction */
echo @paginate("welcome.php", '?p=', $countp, $current);
////////////////////////////////////////////////////////////////////////
?>
예제 #2
0
    if ($i + 1 < $j) {
        // now getting the second item
        $seconds2 = $chunks[$i + 1][0];
        $name2 = $chunks[$i + 1][1];
        // add second item if its greater than 0
        if (($count2 = floor(($since - $seconds * $count) / $seconds2)) != 0) {
            $print .= $count2 == 1 ? ', 1 ' . $name2 : " {$count2} {$name2}s";
        }
    }
    return $print;
}
$db = $Core->db();
$params = array($user['store']);
$Main = $Core->pdoQuery($db, 'SELECT t_id,t_customer,t_manufacturer,t_model,t_imei,t_issue,t_password,t_date FROM core_tickets_estimate WHERE t_store=?' . $assets, $params);
foreach ($Main as $a) {
    $params = array($a['t_customer'], $a['t_manufacturer'], $a['t_model']);
    $Data = $Core->pdoQuery($db, 'SELECT core_customers.c_name,core_customers.c_phone,device_manufacturers.m_name,device_models.m_name FROM core_customers,device_manufacturers,device_models WHERE core_customers.c_id=? AND device_manufacturers.m_id=? AND device_models.m_id=?', $params);
    echo '
        <tr class="ajaxrow">
            <td>&nbsp;' . $a['t_id'] . '</td>
            <td>&nbsp;' . $a['t_imei'] . '</td>
            <td>&nbsp;' . $Data[0][0] . '</td>
            <td>&nbsp;' . $Data[0][2] . '</td>
            <td>&nbsp;' . $Data[0][3] . '</td>
            <td>&nbsp;' . Timesince(strtotime($a['t_date'])) . ' ago</td>
        </tr>
        <tr class="ajaxrow">
            <td colspan="6" style="display:none;"></td>
        </tr>
    ';
}