public function __toEpObject($myManager, $epObject, $object)
 {
     $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
     $epObject->operator = isset($object->operator) ? $object->operator : '';
     $epObject->date = isset($object->date) && $object->date ? SimpleDate::toStamp($object->date) : 0;
     $epObject->content = isset($object->content) ? $object->content : '';
     return $epObject;
 }
 public function __toEpObject($myManager, $epObject, $object)
 {
     $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
     $epObject->start = isset($object->start) && $object->start ? SimpleDate::toStamp($object->start) : 0;
     $epObject->end = isset($object->end) && $object->end ? SimpleDate::toStamp($object->end) : 0;
     $epObject->page = isset($object->page) ? $object->page : '';
     return $epObject;
 }
 public function __toEpObject($myManager, $epObject, $object)
 {
     $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
     $epObject->visitId = isset($object->visitId) ? $object->visitId : '';
     $epObject->cancelled = isset($object->cancelled) ? $object->cancelled : 0;
     $epObject->operateType = isset($object->operateType) ? $object->operateType : '';
     $epObject->operator = isset($object->operator) ? $object->operator : '';
     $epObject->operatedDate = isset($object->operatedDate) && $object->operatedDate ? SimpleDate::toStamp($object->operatedDate) : 0;
     $epObject->content = isset($object->content) ? $object->content : '';
     $epObject->prevOperator = isset($object->prevOperator) ? $object->prevOperator : '';
     $epObject->firstVisited = isset($object->firstVisited) ? $object->firstVisited : 0;
     return $epObject;
 }
示例#4
0
 public function __toEpObject($myManager, $epObject, $object)
 {
     require_once dirname(__FILE__) . '/ORMpz_ireverse.class.php';
     $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
     $epObject->createdDate = isset($object->createdDate) && $object->createdDate ? SimpleDate::toStamp($object->createdDate) : 0;
     $epObject->creator = isset($object->creator) ? $object->creator : '';
     $epObject->weddingDay = isset($object->weddingDay) && $object->weddingDay ? SimpleDate::toStamp($object->weddingDay) : 0;
     $epObject->brideName = isset($object->brideName) ? $object->brideName : '';
     $epObject->bridePhone = isset($object->bridePhone) ? $object->bridePhone : '';
     $epObject->brideMobile = isset($object->brideMobile) ? $object->brideMobile : '';
     $epObject->brideEmail = isset($object->brideEmail) ? $object->brideEmail : '';
     $epObject->brideAddress = isset($object->brideAddress) ? $object->brideAddress : '';
     $epObject->groomName = isset($object->groomName) ? $object->groomName : '';
     $epObject->groomPhone = isset($object->groomPhone) ? $object->groomPhone : '';
     $epObject->groomMobile = isset($object->groomMobile) ? $object->groomMobile : '';
     $epObject->groomEmail = isset($object->groomEmail) ? $object->groomEmail : '';
     $epObject->groomAddress = isset($object->groomAddress) ? $object->groomAddress : '';
     $epObject->culturalBackground = isset($object->culturalBackground) ? $object->culturalBackground : '';
     $epObject->ceremonyLocation = isset($object->ceremonyLocation) ? $object->ceremonyLocation : '';
     $epObject->receptionLocation = isset($object->receptionLocation) ? $object->receptionLocation : '';
     $epObject->source = isset($object->source) ? $object->source : '';
     $epObject->firstVisitMethod = isset($object->firstVisitMethod) ? $object->firstVisitMethod : '';
     $epObject->firstVisitDate = isset($object->firstVisitDate) && $object->firstVisitDate ? SimpleDate::toStamp($object->firstVisitDate) : 0;
     $epObject->status = isset($object->status) ? $object->status : 0;
     $epObject->operatorDate = isset($object->operatorDate) && $object->operatorDate ? SimpleDate::toStamp($object->operatorDate) : 0;
     $epObject->opponent = isset($object->opponent) ? $object->opponent : '';
     $epObject->category = isset($object->category) ? $object->category : '';
     $epObject->operator = isset($object->operator) ? $object->operator : '';
     $epObject->operatorMessage = isset($object->operatorMessage) ? $object->operatorMessage : '';
     $epObject->isVisited = isset($object->isVisited) ? $object->isVisited : 0;
     if (isset($epObject->reverses)) {
         $epObject->reverses->removeAll();
         foreach ($object->reverses as &$item) {
             $epObject->reverses[] = $this->__getEpObject_4_lvl_1_object($myManager, $item, new ORMpz_ireverse(), 'pz_ireverse');
         }
     }
     $epObject->note = isset($object->note) ? $object->note : '';
     return $epObject;
 }
示例#5
0
function findByRequest($myPdo)
{
    global $tableVisitor;
    $result = new stdClass();
    $result->data = array();
    $sql = MiscUtils::getParam('sql', '');
    $date = MiscUtils::getParam('date', NULL);
    $sql .= $date ? ' OR (v.weddingDay = \'' . SimpleDate::toStamp(json_decode($date)) . '\')' : '';
    if ($sql) {
        try {
            $stmt = $myPdo->prepare($sql);
            $stmt->execute();
            $i = 0;
            $count = 0;
            while ($i < $stmt->rowCount()) {
                $tmp = $stmt->fetch(PDO::FETCH_OBJ);
                $tmp->weddingDay = $tmp->weddingDay ? SimpleDate::fromStamp($tmp->weddingDay) : NULL;
                $result->data[] = $tmp;
                $i++;
            }
            echo json_encode($result);
        } catch (PDOException $e) {
            echo $e->getMessage();
        }
    }
}
示例#6
0
function visitors($myManager)
{
    $args = json_decode(MiscUtils::decryptParam('a', '[]'));
    $function = MiscUtils::getParam('f', NULL);
    $order = MiscUtils::getParam('o', 'd.e_oid');
    $queue = MiscUtils::getParam('q', 'DESC');
    $page = MiscUtils::getParam('p', START);
    $size = MiscUtils::getParam('s', 8);
    $datefrom = MiscUtils::getParam('datefrom', NULL);
    $dateto = MiscUtils::getParam('dateto', NULL);
    $createdFrom = MiscUtils::getParam('from', NULL);
    $createdTo = MiscUtils::getParam('to', NULL);
    $condition .= $datefrom ? ' AND (d.weddingDay >= \'' . SimpleDate::toStamp(json_decode($datefrom)) . '\')' : '';
    $condition .= $dateto ? ' AND (vd.weddingDay <= \'' . SimpleDate::toStamp(json_decode($dateto)) . '\')' : '';
    $condition .= $createdFrom ? ' AND (d.createdDate >= \'' . SimpleDate::toStamp(json_decode($createdFrom)) . '\')' : '';
    $condition .= $createdTo ? ' AND (d.createdDate <= \'' . SimpleDate::toStamp(json_decode($createdTo)) . '\')' : '';
    $orm = classToOrm('pz_visitor');
    if ($orm) {
        try {
            $result = $orm->find($myManager, $page, $size, $order, $queue, $condition, $function);
            $result->total = count($orm->find($myManager, START, INFINITE, NULL, NULL, $condition, NULL)->data);
            echo json_encode($result);
        } catch (PDOException $e) {
            echo $e->getMessage();
        }
    }
}