Exemplo n.º 1
0
 function prepareProfileData()
 {
     $submit = $this->call('ajaxLocationPublish', "getMyPositionData()");
     $cd = new \Modl\ContactDAO();
     $c = $cd->get($this->user->getLogin());
     if ($c->loctimestamp) {
         $data = prepareDate(strtotime($c->loctimestamp)) . '<br /><br />';
         $data .= $c->getPlace();
     } else {
         $data = '';
     }
     $html = '';
     $html .= '
         <div id="location">
             <div id="mapdata" style="margin: 1em 0;">' . $data . '</div>
             <div id="mapdiv" style="width: auto; height: 250px; display: none;"></div>
             <div class="clear"></div>
             <a 
                 class="button color green" 
                 style="margin-top: 1em;"
                 onclick="getMyPosition(); this.style.display = \'none\';">
                 <i class="fa fa-compass"></i> ' . $this->__('location.update') . '
             </a>
             <a 
                 id="mypossubmit" 
                 style="display: none; margin-top: 1em; float: right;"
                 class="button color green merged left" 
                 onclick="' . $submit . ' hidePositionChoice();">
                 <i class="fa fa-check"></i> ' . $this->__('button.accept') . '</a>
         </div>';
     return $html;
 }
Exemplo n.º 2
0
function addReceipt($userId, $receipt)
{
    static $id = 0;
    if (isset($receipt['@'])) {
        $receipt = array($receipt);
    }
    foreach ($receipt as $item) {
        $id++;
        $data = array('id' => $id, 'number' => $id, 'user_id' => $userId, 'bdate' => prepareDate($item['@']['bdate']), 'cdate_virt' => prepareDate($item['@']['cdate']), 'shop_id' => isset($item['@']['shop_id']) ? $item['@']['shop_id'] : 1, 'bit_mask' => isset($item['@']['bit_mask']) ? $item['@']['bit_mask'] : 2);
        $q = M('Db')->createQuery('rm_receipt', 'insert');
        foreach ($data as $k => $v) {
            $q->set($k, $v);
        }
        $q->execute();
        if (isset($item['purchase'])) {
            $purchases = is_array($item['purchase']) ? $item['purchase'] : array($item['purchase']);
            foreach ($purchases as $purchase) {
                addPurchase($id, $purchase);
            }
        }
    }
}
Exemplo n.º 3
0
Arquivo: Chat.php Projeto: Trim/movim
 function prepareMessage(&$message)
 {
     if (isset($message->html)) {
         $message->body = $message->html;
     } else {
         $message->body = prepareString(htmlentities($message->body, ENT_COMPAT, 'UTF-8'));
     }
     if ($message->type == 'groupchat') {
         $message->color = stringToColor($message->session . $message->resource . $message->jidfrom . $message->type);
     }
     $message->published = prepareDate(strtotime($message->published));
     return $message;
 }
Exemplo n.º 4
0
            }
        }
    }
}
?>

    </tr>
    <?php 
if (!empty($entities)) {
    foreach ($entities as $entity) {
        if (!$entity['enabled']) {
            continue;
        }
        echo "<tr class='data-node'>";
        echo "<td class='status'><div class='status-div'></div></td>";
        echo "<td class='time' data-time=" . (empty($entity['lastInsertDate']) ? "" : toTimestamp($entity['lastInsertDate'])) . ">" . (empty($entity['lastInsertDate']) ? "" : prepareDate($entity['lastInsertDate'])) . "</td>";
        echo "<td class='diff' sorttable_customkey='" . (empty($entity['lastInsertDate']) ? "0" : toTimestamp($entity['lastInsertDate'])) . "'>" . (empty($entity['lastInsertDate']) ? "" : getDiff($date, toTimestamp($entity['lastInsertDate']))) . "</td>";
        echo '<td><a href=javascript:redirect("' . rawurlencode($entity['name']) . '")>' . $entity['name'] . '</a></td>';
        foreach ($orderedTags as $tagName) {
            if (!empty($entity['tags'][$tagName])) {
                echo "<td>" . $entity['tags'][$tagName] . "</td>";
            } else {
                echo "<td></td>";
            }
        }
        echo "</tr>";
    }
}
?>
</table>
<!-- Start of StatCounter Code -->
Exemplo n.º 5
0
 function prepareMessage(&$message, $jid = null)
 {
     if ($jid != $message->jidto && $jid != $message->jidfrom && $jid != null) {
         return $this->_wrapper;
     }
     $message->jidto = echapJS($message->jidto);
     $message->jidfrom = echapJS($message->jidfrom);
     if (isset($message->html)) {
         $message->body = $message->html;
     } else {
         // We add some smileys...
         $message->convertEmojis();
         $message->addUrls();
         //    $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
     }
     if (isset($message->sticker)) {
         $p = new Picture();
         $sticker = $p->get($message->sticker, false, false, 'png');
         $stickerSize = $p->getSize();
         if ($sticker == false) {
             $r = new Request();
             $r->setTo($message->jidfrom)->setResource($message->resource)->setCid($message->sticker)->request();
         } else {
             $message->sticker = ['url' => $sticker, 'width' => $stickerSize['width'], 'height' => $stickerSize['height']];
         }
     }
     if (isset($message->picture)) {
         $message->sticker = ['url' => $message->picture, 'picture' => true];
     }
     $message->publishedPrepared = prepareDate(strtotime($message->published), true);
     if ($message->delivered) {
         $message->delivered = prepareDate(strtotime($message->delivered), true);
     }
     $date = substr($message->published, 0, 10);
     if ($message->type == 'groupchat') {
         $message->color = stringToColor($message->session . $message->resource . $message->jidfrom . $message->type);
         //fillup $wrapper
         if ($message->body != "") {
             if (!array_key_exists($date, $this->_wrapper)) {
                 $this->_wrapper[$date] = [$message];
             } else {
                 array_push($this->_wrapper[$date], $message);
             }
         }
     } else {
         $msgkey = $message->jidfrom . '>' . substr($message->published, 11, 5);
         //fillup $wrapper
         if (!array_key_exists($date, $this->_wrapper)) {
             $sticker = "";
             if (isset($message->sticker)) {
                 $sticker = "sticker";
             }
             $this->_wrapper[$date] = ['0' . $sticker . '<' . $msgkey => [$message]];
         } else {
             //date contains at least one speaker@time=>msg already
             end($this->_wrapper[$date]);
             $lastkey = key($this->_wrapper[$date]);
             if (substr($lastkey, strpos($lastkey, '<') + 1) == $msgkey && !isset($message->sticker) && strpos($lastkey, "sticker<") === false) {
                 // the previous msg was not a sticker
                 array_push($this->_wrapper[$date][$lastkey], $message);
             } else {
                 $sticker = "";
                 if (isset($message->sticker)) {
                     $sticker = "sticker";
                 }
                 $this->_wrapper[$date][count($this->_wrapper[$date]) . $sticker . '<' . $msgkey] = [$message];
             }
         }
     }
     return $this->_wrapper;
 }
Exemplo n.º 6
0
 function getTime($date)
 {
     return prepareDate(strtotime($date));
 }
Exemplo n.º 7
0
"><div id="mic3" class="chenar mic"></div></a>
        <a href="#"><div id="mic4" class="chenar mic"></div></a>
    </div>
    <div id="evenimente">
        <br/><br/>
        <table>
            <?php 
if ($evenimente != null) {
    ?>
            <?php 
    foreach ($evenimente as $eveniment) {
        ?>
                <tr>
                    <td class="data" valign=top>
                        <p><?php 
        echo prepareDate($eveniment["data"]);
        ?>
</p>
                    </td>
                    <td>
                        <p class="eveniment"><?php 
        echo $eveniment["titlu"];
        ?>
</p>

                        <p class="text"><?php 
        echo $eveniment["continut"];
        ?>
                    </td>
                </tr>
            <?php