function getUserImageByUserId($userId, $width = 200)
{
    $pic = getUserImagePath($userId);
    $ret = new Image($pic);
    $ret->setWidth($width);
    //$ret = "<img src='"  .$pic  ."' width='" .$width ."'>";
    return $ret;
}
Example #2
0
    <div data-role="header">
        <h3>File Selection and preview</h3>
    </div>
    <div data-role="content">
        <button id="chooseFile">Choose file</button>
        <button class="ui-disabled" id="updateimagebutton">Upload picture</button>
        <label id="progress"></label>
        <div class="hiddenfile">
            <form id="form1" enctype="multipart/form-data" method="post" action="Upload_file.php">
                <input type="file" name="fileToUpload" id="fileToUpload" accept="image/*" capture="camera" />
            </form>
<!--            <input type="file"  data-clear-btn="false" name="image" accept="image/*" capture>-->
        </div>
        <div id="preview"> 
            <img class="arrow-img rotate2" src="<?php 
echo getUserImagePath($userObj->idusers);
?>
" id="preview-img"/>
            <script>
                var globRotation = 0;
                $('.arrow-img').on('vmousedown', function() {
//                    alert("click");
                    if (globRotation === 0) {
                        $('.arrow-img').toggleClass('rotate');
                        $('.arrow-img').toggleClass('rotate2');
                        globRotation = 90;
                    }
                    else if (globRotation === 90) {
                        $('.arrow-img').toggleClass('rotate');
                        $('.arrow-img').toggleClass('rotate3');
                        globRotation = 180;
/**
 * getUserprofileXml()
 * 
 * @param mixed $userId
 * @return
 */
function getUserprofileXml($userId)
{
    $xsltProcessor = new XsltProcessor();
    $xsltProcessor->registerPHPFunctions();
    $UserImage = "http://" . $_SERVER['HTTP_HOST'] . substr(dirname($_SERVER['SCRIPT_NAME']), 1) . "/includes/pictures/generateBBThumb.inc.php?picname=" . getUserImagePath($userId);
    $lastGpsUpdate = getLastGpsUpdateSince($_SESSION['config']->DBCONNECT, $userId);
    echo getSqlResultAsXml($_SESSION['config']->DBCONNECT, "SELECT  id,\r\n                                                Vorname,\r\n                                                Nachname,\r\n                                                Name,\r\n                                                Geburtstag,\r\n                                                Strasse,\r\n                                                Plz,\r\n                                                Ort,\r\n                                                Email,\r\n                                                Telefon,\r\n                                                Fax,\r\n                                                Handy,\r\n                                                Icq,\r\n                                                Aim,\r\n                                                Homepage,\r\n                                                User,\r\n                                                Nation,\r\n                                                Status,\r\n                                                User_group_id,\r\n                                                Newsletter,\r\n                                                Signatur,\r\n                                                Lastlogin,\r\n                                                Posts,\r\n                                                Beschreibung,\r\n                                                pic,\r\n                                                pnnotify,\r\n                                                autoforumnotify,\r\n                                                geaendert,\r\n                                                emailJN,\r\n                                                icqJN,\r\n                                                telefonJN,\r\n                                                aktiv,\r\n                                                angelegt,\r\n                                                '" . $UserImage . "' as UserImage,\r\n                                                '" . $lastGpsUpdate . "' as LastGpsUpdate,\r\n                                                (SELECT (now() - g.timeonupdate) as diffTme FROM  gpsPositions g WHERE g.user_id = user.id) as diffTime \r\n        \r\n                                        FROM user\r\n                                        WHERE id = " . $userId);
}