Ejemplo n.º 1
0
 public function comment()
 {
     $id = intval($this->input['status_id']);
     $content = $this->input['text'];
     $transmit_type = intval($this->input['transmit_type']);
     !$this->input['cid'] && ($cid = 0);
     $result = $this->mComment->comment($id, $content, $cid);
     if ($result && is_array($result)) {
         $result['content'] = hg_verify($result['content']);
         $result['comment_time'] = $result['comment_time'];
         $result['create_at'] = hg_get_date($result['create_at']);
     }
     //同时转发到我的点滴
     if ($transmit_type == 1) {
         $status = new status();
         $status->update($content, '点滴', $id);
     }
     if ($this->user['id'] != $result['status']['user']['id']) {
         include_once ROOT_PATH . 'lib/class/notify.class.php';
         $notify = new notify();
         $content = array('title' => '新评论', 'page_link' => SNS_MBLOG . 'all_comment.php');
         $content = serialize($content);
         $notyfy_arr = $notify->notify_send($result['status']['member_id'], $content, 2);
         //发新评论通知
     }
     $result['text'] = hg_verify($result['text']);
     $result = json_encode($result);
     print_r($result);
 }
Ejemplo n.º 2
0
    public function reply()
    {
        include_once ROOT_DIR . 'lib/class/settings.class.php';
        $setting = new settings();
        $result_setttings = $setting->getMark('mblog_comment');
        if (!empty($result_setttings) && $result_setttings['state']) {
            $this->errorOutput('评论回复已关闭');
        }
        $userinfo = $this->mUser->verify_credentials();
        if (!$userinfo['id']) {
            $this->errorOutput(USENAME_NOLOGIN);
        }
        $status_id = intval($this->input['status_id']);
        $cid = intval($this->input['cid']);
        $text = urldecode($this->input['text']);
        (!$status_id || !$text) && $this->errorOutput(OBJECT_NULL);
        //点滴id为空就返回错误
        $time = time();
        $query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE id = ' . $cid);
        !$query_info && $this->errorOutput(OBJECT_NULL);
        $sql = 'INSERT INTO ' . DB_PREFIX . 'status_comments ( status_id , member_id , content , comment_time , reply_comment_id , reply_member_id )
				VALUES(' . $status_id . ', ' . $userinfo['id'] . ', "' . $text . '" , "' . $time . '" , ' . $cid . ',' . $query_info['member_id'] . ')';
        $this->db->query($sql);
        $insert_id = $this->db->insert_id();
        $query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE status_id = ' . $status_id . ' AND id = ' . $cid);
        //将该条点滴的评论次数加1
        $this->db->query('UPDATE ' . DB_PREFIX . 'status_extra SET comment_count = comment_count + 1 WHERE status_id = ' . $status_id);
        $members = $this->mUser->getUserById($userinfo['id']);
        $members = $members[0];
        $status = $this->mStatus->show($status_id);
        $return_array = array('id' => $insert_id, 'text' => $text, 'create_at' => $time, 'reply_member_id' => $query_info['member_id'], 'reply_comment_id' => $cid, 'status' => $status[0], 'user' => $members);
        if ($userinfo['id'] != $query_info['member_id'] && $userinfo['id'] != $status[0]['user']['id']) {
            $notify_userid = $query_info['member_id'] . ',' . $status[0]['user']['id'];
            //加通知
            include_once ROOT_PATH . 'lib/class/notify.class.php';
            $notify = new notify();
            $content = array('title' => '新回复', 'page_link' => SNS_MBLOG . 'all_comment.php');
            $content = serialize($content);
            $notyfy_arr = $notify->notify_send($notify_userid, $content, 2);
            //发新评论通知
        }
        $this->addItem($return_array);
        $this->output();
    }
Ejemplo n.º 3
0
 function set($language, $mobile)
 {
     $this->currentLanguage = $language;
     $this->mobile = $mobile;
     // Include lang-file
     $path = './lang/lang_' . $language . '.php';
     // file exists?
     if ($handle = @fopen($path, 'rb')) {
         // Load ...
         include $path;
         // ... and put into var.
         // $lang is in lang_XX.php
         $this->lang = $lang;
     } else {
         notify::raiseError('Language File', 'Language File lang_' . $language . '.php not found.');
     }
 }
Ejemplo n.º 4
0
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>Agregar Ingreso</title>

	<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png">
	<link rel="stylesheet" href="../../css/bootstrap.css">
	<link rel="stylesheet" href="../../css/flat-ui.css">
</head>
<body>

<?php 
require_once 'menu_ingreso.php';
if ($error) {
    require_once '/../../php/notify.php';
    $notifica = new notify();
    $notifica->warning("Error de Datos", "El monto debe ser numérico");
}
?>

<form action="ingresos.agregar.php" method="POST" class="form1 center-block">
	<h4 align="center" style="font-size:20px;">Registrar Ingreso</h4>

	<div class="form-group">
		<h5 style="font-size: 14px;">Descripción</h5>
		<textarea name="descripcion" class="form-control" placeholder="Descripción o Referencia" rows="3" style="resize:none;" required></textarea>
	</div>

	<div class="form-group">
		<h5 style="font-size: 14px;">Monto</h5>
		<input type="text" class="form-control" name="monto" placeholder="Monto de Ingreso" maxlength="7" required>
Ejemplo n.º 5
0
 /**
  * 验证text中搜含是否含有话题,用户名
  * @param $text 传入话题
  * @param $id 用户ID
  */
 private function verify($text, $id)
 {
     $pattern = "/@([\\x{4e00}-\\x{9fa5}0-9A-Za-z_-]+)[\\s::,,.。\\'‘’\"“”、!!]/iu";
     //这里牵扯到用户名命名规则问题
     if (preg_match_all($pattern, $text, $username)) {
         foreach ($username[1] as $value) {
             $name[] = $value;
         }
         $screen_name = implode(",", $name);
         $userInfo = $this->member->getMemberByName($screen_name);
         if ($userInfo) {
             include_once ROOT_PATH . 'lib/class/notify.class.php';
             $notify = new notify();
             foreach ($userInfo as $key => $value) {
                 $ids[] = $value['id'];
             }
             $sql = "INSERT IGNORE INTO " . DB_PREFIX . "status_member \r\n\t\t\t\t(status_id,member_id)\r\n\t\t\t\tVALUES";
             foreach ($ids as $value) {
                 $sql .= "(" . $id . ",\r\n\t\t\t\t\t" . $value . "),";
                 $idd .= $value . ",";
             }
             $idd = rtrim($idd, ",");
             $content = array('title' => '提到我的', 'page_link' => SNS_MBLOG . 'atme.php');
             $notyfy_arr = $notify->notify_send($idd, serialize($content), 3);
             //提到我的通知
             $sql = rtrim($sql, ",");
             $this->db->query($sql);
         }
     }
     $pattern = "/#([\\x{4e00}-\\x{9fa5}0-9A-Za-z_-]+)[\\s#]/iu";
     //这里牵扯到话题规则问题
     if (preg_match_all($pattern, $text, $topic)) {
         foreach ($topic[1] as $key => $value) {
             $topics[] = "'" . strtoupper($value) . "'";
             $title[] = $value;
         }
         $topics = implode(",", $topics);
         $sql = "SELECT * FROM " . DB_PREFIX . "topic WHERE title IN(" . $topics . ")";
         $query = $this->db->query($sql);
         while ($array = $this->db->fetch_array($query)) {
             $topicid[] = $array['id'];
             $data[] = $array;
             $topictitle[] = $array['title'];
         }
         if (!count($topictitle)) {
             $newtitle = $title;
         } else {
             if (count($topictitle) <= count($title)) {
                 $newtitle = array_diff($title, $topictitle);
             } else {
                 $newtitle = array_diff($topictitle, $title);
             }
         }
         if ($newtitle) {
             $topicids = array();
             foreach ($newtitle as $value) {
                 $value = str_replace("#", "", trim($value));
                 $sql = "INSERT INTO " . DB_PREFIX . "topic(\r\n\t\t\t\ttitle,\r\n\t\t\t\trelate_count,\r\n\t\t\t\tstatus\r\n\t\t\t\t)\r\n\t\t\t\tVALUES('" . $value . "',1,0)";
                 $this->db->query($sql);
                 $topicids[] = $this->db->insert_id();
             }
             $this->updateStatusTopic($topicids);
         } else {
             foreach ($data as $value) {
                 $relate_count = $value['relate_count'] + 1;
                 $sql = "UPDATE " . DB_PREFIX . "topic \r\n\t\t\t\t\tSET relate_count = " . $relate_count . " \r\n\t\t\t\t\tWHERE id=" . $value['id'];
                 $this->db->query($sql);
             }
             $this->updateStatusTopic($topicid);
         }
     }
     return $text;
 }
Ejemplo n.º 6
0
 public function addFollower($follower_id)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $account = new account($this->db, $this->id);
     $account->setLastActive();
     unset($account);
     if ($this->is_friend_exists($follower_id)) {
         return $result;
     }
     if ($this->is_follower_exists($follower_id)) {
         $stmt = $this->db->prepare("DELETE FROM profile_followers WHERE follower = (:follower) AND follow_to = (:follow_to)");
         $stmt->bindParam(":follower", $follower_id, PDO::PARAM_INT);
         $stmt->bindParam(":follow_to", $this->id, PDO::PARAM_INT);
         $stmt->execute();
         $result = array("error" => false, "error_code" => ERROR_SUCCESS, "follow" => false, "followersCount" => 0);
         $notify = new notify($this->db);
         $notify->removeNotify($this->id, $follower_id, NOTIFY_TYPE_FOLLOWER, 0);
         unset($notify);
     } else {
         $create_at = time();
         $stmt = $this->db->prepare("INSERT INTO profile_followers (follower, follow_to, create_at) value (:follower, :follow_to, :create_at)");
         $stmt->bindParam(":follower", $follower_id, PDO::PARAM_INT);
         $stmt->bindParam(":follow_to", $this->id, PDO::PARAM_INT);
         $stmt->bindParam(":create_at", $create_at, PDO::PARAM_INT);
         $stmt->execute();
         $blacklist = new blacklist($this->db);
         $blacklist->setRequestFrom($this->id);
         if (!$blacklist->isExists($follower_id)) {
             $account = new account($this->db, $this->id);
             if ($account->getAllowFollowersGCM() == ENABLE_FOLLOWERS_GCM) {
                 $gcm = new gcm($this->db, $this->id);
                 $gcm->setData(GCM_NOTIFY_FOLLOWER, "You have new follower", 0);
                 $gcm->send();
             }
             unset($account);
             $notify = new notify($this->db);
             $notify->createNotify($this->id, $follower_id, NOTIFY_TYPE_FOLLOWER, 0);
             unset($notify);
         }
         unset($blacklist);
         $result = array("error" => false, "error_code" => ERROR_SUCCESS, "follow" => true, "followersCount" => 0);
     }
     return $result;
 }
Ejemplo n.º 7
0
        if (!$notifications) {
            $data = "<li><span class='title'>No notifications found</span></li>";
        }
        $this->ajax = true;
        if ($count > 0) {
            $count = "<font color='lime'><b>{$count}</b></font>";
        }
        $content = ['count' => $count, 'content' => $data, 'gtitle' => $gTitle, 'gbody' => $gBody];
        $this->jsonE('success', $content);
    }
    public function clear()
    {
        $this->query("UPDATE notifications SET notification_viewed = TRUE where user_id='{$this->user->id}'");
        $suc = ['result' => 'Notifications Cleared'];
        $this->jsonE('success', $suc);
    }
}
//notify
$mod = new notify();
if (!isset($mod->user)) {
    die;
}
if (isset($_GET['getCount'])) {
    $mod->getCount();
} else {
    if (isset($_GET['clear'])) {
        $mod->clear();
    } else {
        $mod->main();
    }
}
Ejemplo n.º 8
0
 public function show_notice()
 {
     $user_info = $this->check('all');
     $gScriptName = SCRIPTNAME;
     $n = intval($this->input['n']);
     $count = 50;
     $pp = intval($this->input['pp']) / $count;
     $user_id = $this->user['id'];
     hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
     switch ($n) {
         case 0:
             $this->page_title = '消息';
             include_once ROOT_PATH . 'lib/messages/messages.class.php';
             $mMessages = new messages();
             $msg_members = array();
             $from_who = $mMessages->get_members($user_id, '', $pp, $count);
             $total = @array_shift($from_who);
             //分页
             $data['totalpages'] = $total;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data, 1);
             $this->tpl->addVar('msg_members', $msg_members);
             $this->tpl->addVar('mMessages', $mMessages);
             $this->tpl->addVar('from_who', $from_who);
             $this->tpl->addVar('total', $total);
             break;
         case 1:
             $this->page_title = '通知';
             include_once ROOT_PATH . 'lib/class/notify.class.php';
             $mNotify = new notify();
             $un_notice = $notice = array();
             $un_notice = $mNotify->notify_get_unread($user_id, -1, $pp, $count);
             $notice = $mNotify->notify_get_read($user_id, -1, $pp, $count);
             /*if(is_array($un_notice))
             		{
             			$nids = $space = "";
             			foreach($un_notice as $key => $value)
             			{
             				$mNotify->notify_send_read($value['id'] , $user_id, $value['type']);
             			}
             		}*/
             $total_count = $mNotify->notify_count($user_id, -1);
             if (is_array($un_notice)) {
                 $data['totalpages'] = $total_count[0];
                 $data['perpage'] = $count;
                 $data['curpage'] = $this->input['pp'];
                 $data['pagelink'] = '?a=show_notice&n=1';
                 $showpages = hg_build_pagelinks($data);
             }
             //$a = $mNotify->notify_send_read($key,$user_id,$n['type']);//将本页未读通知插入到已读表中
             $this->tpl->addVar('un_notice', $un_notice);
             $this->tpl->addVar('notice', $notice);
             break;
     }
     $this->tpl->addVar('showpages', $showpages);
     $this->tpl->addVar('n', $n);
     $this->tpl->addVar('gScriptName', $gScriptName);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->setTemplateTitle($this->lang['pageTitle']);
     $this->tpl->outTemplate('user_show_n');
 }
Ejemplo n.º 9
0
     $result = $this->libactivity->getActivityApply('id,action_id', array('action_id' => $action_id, 'apply_status' => 1, 'state' => 1), 0, -1, '');
     if ($result) {
         $ids = $sp = '';
         foreach ($result as $k => $v) {
             $ids .= $sp . $v['id'];
             $sp = ',';
         }
         //更新待审核为免审核
         if ($this->libactivity->updateActivityApply(array('id' => ids, 'action_id' => action_id, 'apply_status' => 0), true)) {
             //更新申请通过的人数
             $this->libactivity->updateActivity(array('yet_join' => count($result), 'action_id' => action_id), true, true);
         }
     }
     return $result;
 }
 //关闭
 public function delete()
 {
     $data = $this->getData();
     if (!$data['action_id'] || !is_numeric($data['action_id'])) {
         $this->errorOutput("你搜索得活动id参数不合法");
     }
     $rawData = $this->libactivity->get('activity', 'team_id,state', array('action_id' => $data['action_id']), 0, 1, array());
     if (!$rawData['state']) {
         $this->errorOutput("你搜索得活动不存在");
     }
     $state = isset($this->input['state']) ? intval($this->input['state']) : 1;
     //关闭
     $tata['state'] = $state;
     $result = $this->libactivity->update('activity', $tata, array('action_id' => $data['action_id']), array());
     if ($result && $tata['state'] != $rawData['state']) {
         if ($tata['state'] == 2 && $rawData['state'] == 1) {
             //更新对应小组的活动总数
             $this->team->update_total(array('action_num' => -1, 'team_id' => $rawData['team_id']));
             //删除标签
             $this->libmark->delete_source_id_mark(array('source_id' => $data['action_id'], 'source' => 'activity', 'action' => 'keywords', 'parent_id' => $rawData['team_id']));
         } else {
             if ($tata['state'] == 1 && $rawData['state'] == 2) {
                 $this->team->update_total(array('action_num' => 1, 'team_id' => $rawData['team_id']));
             } else {
                 if ($tata['state'] == 0) {
                     if ($rawData['state'] == 1) {
                         //更新对应小组的活动总数
                         $this->team->update_total(array('action_num' => -1, 'team_id' => $rawData['team_id']));
                         //删除标签
                         $this->libmark->delete_source_id_mark(array('source_id' => $data['action_id'], 'source' => 'activity', 'action' => 'keywords', 'parent_id' => $rawData['team_id']));
                     }
                     //nothing todo
                 } else {
                     $this->errorOutput("你更新的活动已经被删除,不可以回复");
                 }
             }
         }
     }
     if ($result) {
         //获取参与行动的用户信息
         $member_info = $this->libactivity->get('activity_apply', 'user_id', array('action_id' => $data['action_id']), 0, -1);
         if ($member_info) {
             //发送通知
             include_once ROOT_PATH . '/lib/class/notify.class.php';
             $notify = new notify();
             $send_arr = array();
Ejemplo n.º 10
0
 public function remove($giftId)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $giftInfo = $this->info($giftId);
     if ($giftInfo['error'] === true) {
         return $result;
     }
     if ($giftInfo['giftTo'] != $this->requestFrom) {
         return $result;
     }
     $currentTime = time();
     $stmt = $this->db->prepare("UPDATE gifts SET removeAt = (:removeAt) WHERE id = (:giftId)");
     $stmt->bindParam(":giftId", $giftId, PDO::PARAM_INT);
     $stmt->bindParam(":removeAt", $currentTime, PDO::PARAM_INT);
     if ($stmt->execute()) {
         $result = array("error" => false, "error_code" => ERROR_SUCCESS);
         $account = new account($this->db, $giftInfo['giftTo']);
         $account->updateCounters();
         unset($account);
         $notify = new notify($this->db);
         $notify->removeNotify($giftInfo['giftTo'], $giftInfo['giftFrom'], NOTIFY_TYPE_GIFT, $giftInfo['id']);
         unset($notify);
     }
     return $result;
 }
Ejemplo n.º 11
0
	<title>Agregar Producto</title>

	<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png">
	<link rel="stylesheet" href="../../css/bootstrap.css">
	<link rel="stylesheet" href="../../css/flat-ui.css">

	<link rel="stylesheet" href="../../css/combobox.css">
	<link rel="stylesheet" href="../../css/bootstrap-select.css">
</head>
<body>

<?php 
require_once 'menu_inventario.php';
if ($error == 'existe') {
    require_once '/../../php/notify.php';
    $notificacion = new notify();
    $notificacion->warning("Servicio Existente!!", "Esta descripcion ya existe");
}
?>

<form action="servicio.agregar.php" method="POST" class="form1 center-block" ng-controller="ctrlservicio">
	<h4 align="center" style="font-size:20px;">Registrar Servicio</h4>
	<div class="form-group">
		<h5 style="font-size: 14px;">Nombre Servicio</h5>
		<input type="text" class="form-control" name="descripcion" placeholder="Descripcion o Nombre" required>
	</div>

	<div class="form-group">
		<h5 style="font-size: 14px;">Equipo</h5>
		<select name="maquina" class="form-control combobox-danger" >
			<optgroup>
/*!
 * ifsoft.co.uk engine v1.0
 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
    $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $notifyId = isset($_POST['notifyId']) ? $_POST['notifyId'] : 0;
    $notifyId = helper::clearInt($notifyId);
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    if ($notifyId == 0) {
        $account = new account($dbo, $accountId);
        $account->setLastNotifyView();
        unset($account);
    }
    $notify = new notify($dbo);
    $notify->setRequestFrom($accountId);
    $result = $notify->getAll($notifyId);
    echo json_encode($result);
    exit;
}
Ejemplo n.º 13
0
 public function get_notify_data()
 {
     // OBTENEMOS LOS COMENTARIOS NUEVOS!!!!!
     extract($_POST);
     //$id_user_writer , $id_user_otherside , $limit_msg_chat
     $QUERY = "SELECT user.username , user.user_pic , chat.msg , ( FROM_UNIXTIME(chat.fecha ) ) as fecha \nfrom chat , user , notify\n\nWHERE (chat.id_chat = notify.id_chat and id_user_writer = {$id_user_otherside} and user.id_user = id_user_writer and chat.id_user_reader={$writtr_})\n\n\tand notify.notified =  0\n";
     $response = mysql_query($QUERY, Conectar::con());
     while ($parse = mysql_fetch_assoc($response)) {
         $DATA[] = $parse;
     }
     if (isset($DATA)) {
         echo json_encode(array('response' => $DATA));
         // si hay datos regresamos las notificaciones!!!
         notify::delete_notify($id_user_otherside, $writtr_);
     } else {
         $response = array('response' => false);
         echo json_encode($response);
         // no regresamos nada!!!!
     }
 }
Ejemplo n.º 14
0
			</small> <br>
			<p class="text-bold" style="font-size: 12px;margin-top:5px;margin-bottom:0px;">
				Desarrollador Walter Corrales
			</p>
		</h5>
</div>

<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript">
	$('#showpass').change(function () {
		var show = $('#showpass').is(':checked');
		if(show){
			$('#clave').attr('type','text');
		}else{
			$('#clave').attr('type','password');
		}
	});
</script>
<!-- <script type="text/javascript" src="js/bootstrap.js"></script> -->
<!-- <script type="text/javascript" src="js/flat-ui.min.js"></script> -->
<?php 
if ($login_error) {
    require_once 'php/notify.php';
    $notificacion = new notify();
    $notificacion->error('Acceso Denegado', 'Credenciales Incorrectas!');
}
?>

</body>
</html>
 <?php 
include "../class.php";
if (isset($_POST)) {
    $UPDATE_CHAT_NOTIFY = new notify();
    switch ($_POST["type"]) {
        // DE QUE TIPO ES EL QUERY A ESTE ARCHIVO ; PUEDE SER VERIFI O GET_DATA
        // VERIFY SOLO CHECA SI HAY CAMBIOS OSEA NOTIFICACIONEs
        // GET_DATA TRAE LOS CAMBIOS SI LOS HAY
        case 'verify':
            $UPDATE_CHAT_NOTIFY->get_notify($_POST["data"]);
            // aqui se pasa el usuario que queremos obtener las notificaciones
            break;
            //*********************************************************************
        //*********************************************************************
        case 'get_data':
            $UPDATE_CHAT_NOTIFY->get_notify_data();
            break;
        default:
            break;
    }
    # code...
}
Ejemplo n.º 16
0
 public function get()
 {
     $result = array("error" => true, "error_code" => ERROR_ACCOUNT_ID);
     $stmt = $this->db->prepare("SELECT * FROM users WHERE id = (:id) LIMIT 1");
     $stmt->bindParam(":id", $this->id, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $notifications_count = 0;
             $messages_count = 0;
             $guests_count = 0;
             $friends_count = 0;
             // Get new messages count
             $msg = new messages($this->db);
             $msg->setRequestFrom($this->id);
             $messages_count = $msg->getNewMessagesCount();
             unset($msg);
             // Get new notifications count
             $notifications = new notify($this->db);
             $notifications->setRequestFrom($this->id);
             $notifications_count = $notifications->getNewCount($row['last_notify_view']);
             unset($notifications);
             // Get new guests count
             $guests = new guests($this->db, $this->id);
             $guests->setRequestFrom($this->id);
             $guests_count = $guests->getNewCount($row['last_guests_view']);
             unset($guests);
             // Get new friends count
             $friends = new friends($this->db, $this->id);
             $friends->setRequestFrom($this->id);
             $friends_count = $friends->getNewCount($row['last_friends_view']);
             unset($friends);
             $profile = new profile($this->db, $row['id']);
             $online = false;
             $current_time = time();
             if ($row['last_authorize'] != 0 && $row['last_authorize'] > $current_time - 15 * 60) {
                 $online = true;
             }
             $time = new language($this->db);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "gcm_regid" => $row['gcm_regid'], "admob" => $row['admob'], "ghost" => $row['ghost'], "vip" => $row['vip'], "gcm" => $row['gcm'], "balance" => $row['balance'], "fb_id" => $row['fb_id'], "rating" => $row['rating'], "state" => $row['state'], "regtime" => $row['regtime'], "ip_addr" => $row['ip_addr'], "username" => $row['login'], "fullname" => stripcslashes($row['fullname']), "location" => stripcslashes($row['country']), "status" => stripcslashes($row['status']), "fb_page" => stripcslashes($row['fb_page']), "instagram_page" => stripcslashes($row['my_page']), "verify" => $row['verify'], "email" => $row['email'], "emailVerify" => $row['emailVerify'], "sex" => $row['sex'], "year" => $row['bYear'], "month" => $row['bMonth'], "day" => $row['bDay'], "lat" => $row['lat'], "lng" => $row['lng'], "language" => $row['language'], "lowPhotoUrl" => $row['lowPhotoUrl'], "normalPhotoUrl" => $row['normalPhotoUrl'], "bigPhotoUrl" => $row['normalPhotoUrl'], "coverUrl" => $row['normalCoverUrl'], "originCoverUrl" => $row['originCoverUrl'], "iStatus" => $row['iStatus'], "iPoliticalViews" => $row['iPoliticalViews'], "iWorldView" => $row['iWorldView'], "iPersonalPriority" => $row['iPersonalPriority'], "iImportantInOthers" => $row['iImportantInOthers'], "iSmokingViews" => $row['iSmokingViews'], "iAlcoholViews" => $row['iAlcoholViews'], "iLooking" => $row['iLooking'], "iInterested" => $row['iInterested'], "allowComments" => $row['allowComments'], "allowMessages" => $row['allowMessages'], "allowLikesGCM" => $row['allowLikesGCM'], "allowGiftsGCM" => $row['allowGiftsGCM'], "allowCommentsGCM" => $row['allowCommentsGCM'], "allowFollowersGCM" => $row['allowFollowersGCM'], "allowMessagesGCM" => $row['allowMessagesGCM'], "allowCommentReplyGCM" => $row['allowCommentReplyGCM'], "lastAuthorize" => $row['last_authorize'], "lastAuthorizeDate" => date("Y-m-d H:i:s", $row['last_authorize']), "lastAuthorizeTimeAgo" => $time->timeAgo($row['last_authorize']), "online" => $online, "friendsCount" => $row['friends_count'], "photosCount" => $row['photos_count'], "likesCount" => $row['likes_count'], "giftsCount" => $row['gifts_count'], "notificationsCount" => $notifications_count, "guestsCount" => $guests_count, "newFriendsCount" => $friends_count, "messagesCount" => $messages_count);
             unset($profile);
             unset($time);
         }
     }
     return $result;
 }
Ejemplo n.º 17
0
	<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png">
	<link rel="stylesheet" href="../../css/bootstrap.css">
	<link rel="stylesheet" href="../../css/flat-ui.css">

	<link rel="stylesheet" href="../../css/spinner.css">
</head>
<body>

<?php 
require_once 'menu_inventario.php';
?>

<?php 
if ($error == 'existe') {
    require_once '/../../php/notify.php';
    $notificacion = new notify();
    $notificacion->warning("Producto Existente!!", "Esta descripcion ya existe");
}
?>

<form action="producto.agregar.php" method="POST" class="form1 center-block" ng-controller="ctrladd">
	<h4 align="center" style="font-size:20px;">Registrar Producto</h4>
	<div class="form-group">
		<h5 style="font-size: 14px;">Nombre Producto</h5>
		<input type="text" class="form-control" name="descripcion" placeholder="Descripcion o Nombre" required>
	</div>

	<div class="form-group">
		<h5 style="font-size: 14px;">Fabricante o Marca</h5>
		<input type="text" class="form-control" name="fabricante" placeholder="Fabricante del Producto" required>
	</div>
Ejemplo n.º 18
0
 public function show_notice()
 {
     $gScriptName = SCRIPTNAME;
     $n = intval($this->input['n']);
     $pp = intval($this->input['pp']) ? intval($this->input['pp']) : 0;
     $count = 50;
     switch ($n) {
         case 0:
             $this->page_title = '消息';
             include_once ROOT_PATH . 'lib/messages/messages.class.php';
             $mMessages = new messages();
             $msg_members = array();
             $from_who = $mMessages->get_members($this->user['id'], '', $pp, $count);
             $total = @array_shift($from_who);
             //分页
             $data['totalpages'] = $total;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             ob_start();
             include hg_load_template("user_msgs");
             $html = ob_get_contents();
             ob_end_clean();
             break;
         case 1:
             $this->page_title = '通知';
             include_once ROOT_PATH . 'lib/class/notify.class.php';
             $mNotify = new notify();
             $notice_arr = $un_notice = $notice = array();
             $notice_arr = $mNotify->notify_get($this->user['id'], -1, $pp, $count);
             //分页,这个通知要区分一下,已读的通知和未知的通知要分开
             $notice_count = $mNotify->notify_count($this->user['id'], -1);
             $total_count = $notice_count[0];
             $total1 = array_sum($total_count);
             $data['totalpages'] = $total1;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=1\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             if ($notice_arr) {
                 $sp = '';
                 foreach ($notice_arr as $key => $n) {
                     if ($n['is_read'] == 0) {
                         if (in_array($n['type'], array(0, 1, 2, 3))) {
                             $un_notice[$n['type']]['idstr'] .= $sp . $n['id'];
                             $un_notice[$n['type']]['content'] = unserialize($n['content']);
                         } else {
                             $un_notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $un_notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                         $a = $mNotify->notify_send_read($key, $this->user['id'], $n['type']);
                         //将本页未读通知插入到已读表中
                         $sp = ',';
                     } else {
                         if ($n['type'] > 3) {
                             $notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                     }
                 }
             }
             ob_start();
             include hg_load_template("user_notices");
             $html = ob_get_contents();
             ob_end_clean();
             break;
     }
     hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
     include hg_load_template("user_show_n");
 }
Ejemplo n.º 19
0
         }
     }
     $this->output();
 }
 //创建
 public function create()
 {
     $data = array();
     //加载数据
     $data = $this->getData();
     //加载原始数据
     $rawData = $this->libactivity->get('activity_apply', 'id,apply_status', array('user_id' => $data['user_id'], 'action_id' => $data['action_id'], 'state' => 1), 0, 1, array());
     $result = $this->team->get_permission($data['team_id'], $data['user_id'], 'ADD_ACTIVITY');
     if (!$result['permission']) {
         //$this->errorOutput("你没有权限操作");
     }
     //加载创建时间
     $data['apply_time'] = TIMENOW;
     //来源ip
     $data['from_ip'] = hg_getip();
     //来源部分
     $data['app_name'] = $this->user['display_name'];
     //来源客户端
     $data['client'] = $_SERVER['HTTP_USER_AGENT'];
     //有效的
     $data['state'] = 1;
     unset($data['team_id']);
     if (!$rawData) {
         //加载审核状态
         $data['apply_status'] = 0;
         $result = $this->libactivity->insert('activity_apply', $data);
         if ($result) {
             //$this->libactivity->updateData($data['action_id'], array('apply_num'=>$data['part_num'],'yet_join'=>$data['part_num']), "+");
             $this->libactivity->update('activity', array('apply_num' => $data['part_num'], 'yet_join' => 1), array('action_id' => $data['action_id']), array('apply_num' => $data['part_num'], 'yet_join' => $data['part_num']));
         }
         $result = $data['apply_status'];
     } else {
         if ($this->libactivity->update('activity_apply', $data, array('id' => $rawData['id']))) {
             $result = $rawData['apply_status'];
         }
     }
     $action_arr = $this->libactivity->get('activity', 'user_id, action_name', array('action_id' => $data['action_id']), 0, 1, array());
     //发送通知
     include_once ROOT_PATH . '/lib/class/notify.class.php';
     $notify = new notify();
     $send_arr = array();
     $send_arr[] = array('from_id' => 0, 'to_id' => $action_arr['user_id'], 'content' => '您的"' . $action_arr['action_name'] . '"行动有人报名!', 'page_link' => 'action.php?a=userList&action_id=' . $data['action_id'], 'link_text' => '去看看');
     if ($send_arr) {
         $notify->notify_send(json_encode($send_arr), 0);