Автор: ConstantContact
Наследование: extends BaseService
 /**
  * Short description of method isIsolatedConnector
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param  Resource connector
  * @return boolean
  */
 public function isIsolatedConnector(core_kernel_classes_Resource $connector)
 {
     $returnValue = (bool) false;
     $returnValue = true;
     //need to be initiated as true
     $propNextActivities = new core_kernel_classes_Property(PROPERTY_STEP_NEXT);
     foreach ($connector->getPropertyValuesCollection($propNextActivities)->getIterator() as $nextActivityOrConnector) {
         if ($this->activityService->isActivity($nextActivityOrConnector)) {
             $returnValue = false;
         } else {
             if ($this->connectorService->isConnector($nextActivityOrConnector)) {
                 $isolated = $this->isIsolatedConnector($nextActivityOrConnector);
                 if ($returnValue) {
                     $returnValue = $isolated;
                 }
             } else {
                 throw new common_exception_Error('the next acitivty of "' . $connector->getUri() . '" is neither an activity nor a connector');
             }
         }
     }
     if ($returnValue) {
         $this->isolatedConnectors[$connector->getUri()] = $connector;
     }
     return (bool) $returnValue;
 }
Пример #2
0
<?php

require_once ykfile('source/activity_service.php');
$param = json_decode(file_get_contents('php://input'));
$act = $param;
$actsrv = new ActivityService();
$result = $actsrv->create_activity($act);
$status = NULL;
$message = NULL;
if ($result) {
    $status = 0;
    $message = "发布成功,请等待审核";
    $act = $result;
} else {
    $status = ERR_INTERNAL;
    $message = "发布失败";
}
echo json_encode(array("status" => $status, "message" => $message, "activity" => $act));
Пример #3
0
<?php

require_once ykfile('source/activity_service.php');
$next_id = intval($_GET['next_id']);
$count = intval($_GET['count']);
if ($count <= 0) {
    $count = 10;
}
//活动的列表页
$actSer = new ActivityService();
$act_list = $actSer->get_all(@$tag_id, $next_id, $count, STAGE_ADMIN);
$act_total = $actSer->get_activity_count(NULL);
// 以下4个参数,必须计算出来,分页器要使用
// page_cur: 当前页, 从1开始计算
// page_count: 总页数
// page_prefix: 点页数后,取数据的url前缀
// next_id: 下一页超始数据
$page_cur = intval(($next_id + 1 + 9) / 10);
$page_count = intval(($act_total + 9) / 10);
$page_prefix = "/m/admin.php?mod=activity";
$next_id += $count;
include ykfile('pages/admin/activity_list.php');
Пример #4
0
<?php

//  审核发布信息  0:  审核   1:驳回     2:发布
require_once ykfile("source/activity_service.php");
$state = $_GET['state'];
$act_id = $_GET['act_id'];
$reject_message = $_GET['reject'];
$actSer = new ActivityService();
$result = $actSer->set_act_state($act_id, $state, $reject_message);
$status = 0;
$message = "";
if ($result) {
    $statue = 0;
    $message = "success";
} else {
    $status = 1;
    $message = "fail";
}
echo json_encode(array("status" => $status, "message" => $message));
Пример #5
0
     		</li>         
     	</ul>
        <div class="move-bg"></div>        
    </div>
</div>
<div class="daohang">
	<div class="menu">
    	<ul>
      		<li class="menu-item_cur"><a href="http://localhost/healthyone/view/activityManage.php">活动管理</a></li>
            <li class="menu-item"><a href="http://localhost/healthyone/view/releaseActivity.php">发布活动</a></li>
        </ul>
    </div>
</div>
	<?php 
require '../model/activityService.class.php';
$res = ActivityService::find($_GET['id']);
$item = $res->fetchArray(SQLITE3_ASSOC);
?>
	
<div class="content">
	<div class="item"> 
		<form name="activity" method="post" action="http://localhost/healthyOne/controller/activityManageProcess.php?operation=1" onsubmit="return check()">
		<p class="item"><b>活动描述</b><input id="describe_input" type="text" name="describe" value="<?php 
echo $item['DESCRIBE'];
?>
"/></p>
		<p class="item"><b>活动时间</b><input id="time_input" type="text" name="time" value="<?php 
echo $item['TIME'];
?>
"/></p>			
		<p class="item"><b>活动地点</b><input id="place_input" type="text" name="place" value="<?php 
Пример #6
0
require_once ykfile("source/model/user_model.php");
require_once ykfile('source/activity_service.php');
$param = json_decode(file_get_contents('php://input'));
$state = $param->state ? $param->state : ActivityModel::state_published;
$param->state = $state;
$user = new UserModel();
$user->uuid = unserialize($_SESSION['current_user'])->uuid;
$param->author = $user;
date_default_timezone_set("Asia/Shanghai");
$now_time = date("Y-m-d H:i:s");
$param->modify_time = $now_time;
$param->isdelete = 0;
$param->longitude = 0;
$param->latitude = 0;
if (!$param->position) {
    $param->position = 0;
}
$actsrv = new ActivityService();
$result = $actsrv->save_activity($param);
$status = NULL;
$message = NULL;
if ($result !== false) {
    $status = 0;
    $message = "发布成功,请等待审核";
    $act = $result;
} else {
    $status = ERR_INTERNAL;
    $message = "发布失败";
    $act = $param;
}
echo json_encode(array("status" => $status, "message" => $message, "activity" => $act));
Пример #7
0
<?php

require_once "../config.php";
require_once ykfile("source/activity_service.php");
header("application/json;charset=utf-8");
$next_id = intval($_GET['next_id']);
if ($next_id < 0) {
    $next_id = 0;
}
$count = intval($_GET['count']);
if ($count <= 0 || $count > 1000) {
    $count = 0;
}
$tag_id = $_GET['tag'];
$activityService = new ActivityService();
$act_list = $activityService->get_all($tag_id, $next_id, $count, STAGE_INDEX);
foreach ($act_list as $act) {
    $start_time = date("Y-m-d H:i", strtotime($act->start_time));
    $act->start_time = $start_time;
    $end_time = date("m-d H:i", strtotime($act->end_time));
    $act->end_time = $end_time;
}
$json_array = array("activities" => $act_list);
echo json_encode($json_array);
Пример #8
0
<?php

require_once ykfile('source/portal_service.php');
require_once ykfile('source/talk_service.php');
require_once ykfile('source/talker_service.php');
require_once ykfile('source/modules/adv_module.php');
require_once ykfile('source/activity_service.php');
$talksrv = new TalkService();
$talks = $talksrv->get_talk_all(NULL, 0, 1000, STAGE_ADMIN);
$actsrv = new ActivityService();
$activities = $actsrv->get_all(NULL, 0, 1000, STAGE_ADMIN);
$talkersrv = new TalkerService();
$talkers = $talkersrv->get_all(0, 1000);
$porsrv = new PortalService();
$channels = $porsrv->get_portal_content();
$advmod = new AdvModule();
$advs = $advmod->get_adv(0, 1000);
$page_title = '编辑首页';
include ykfile('pages/admin/edit_portal.php');
Пример #9
0
     	</ul>
        <div class="move-bg"></div>        
    </div>
</div>
<div class="daohang">
	<div class="menu">
    	<ul>
      		<li class="menu-item"><a href="http://localhost/healthyone/view/activity.php">活动列表</a></li>
            <li class="menu-item_cur"><a href="http://localhost/healthyone/view/myActivity.php">我的活动</a></li>
        </ul>
    </div>
</div>
<div class="content">
	<?php 
require '../model/activityService.class.php';
$res = ActivityService::check($username);
while ($item = $res->fetchArray(SQLITE3_ASSOC)) {
    echo "\t<div class='item'> \n\t\t<form name='activity' method='post' action='http://localhost/healthyOne/controller/activityManageProcess.php?operation=3'>\n\t\t\t<p class='activity_tittle'><b>" . $item['DESCRIBE'] . "</b></p>\n\t\t\t<p class='activity_time'>" . $item['TIME'] . "</p>\n\t\t\t<p class='activity_place'>" . $item['PLACE'] . "</p>\n            <input type='hidden' name='id' value='" . $item['ID'] . "'></input>\n\t\t\t<input class='activity_submit' type='submit' value='取消报名'/>\n\t\t</form></div>";
}
?>
</div>
<script>
$(function(){
	$(".nav").movebg({width:120/*滑块的大小*/,extra:40/*额外反弹的距离*/,speed:300/*滑块移动的速度*/,rebound_speed:400/*滑块反弹的速度*/});
})
</script>



</body>
</html>
 /**
  * Short description of method getNewActivityFromOldActivity
  *
  * @access protected
  * @author Joel Bout, <*****@*****.**>
  * @param  Resource oldActivity
  * @param  Resource oldReferenceActivity
  * @param  string connectionType
  * @param  Resource clonedConnector
  * @return core_kernel_classes_Resource
  */
 protected function getNewActivityFromOldActivity(core_kernel_classes_Resource $oldActivity, core_kernel_classes_Resource $oldReferenceActivity, $connectionType, core_kernel_classes_Resource $clonedConnector)
 {
     $returnValue = null;
     $activity = $oldActivity;
     $activityIO = '';
     switch ($connectionType) {
         case 'next':
         case 'then':
         case 'else':
             //explanation: we are looking for the activity than is in the property "next activity" so it is the activity entering point that should be considered
             $activityIO = 'in';
             break;
         case 'prev':
             $activityIO = 'out';
             break;
         default:
             throw new Exception("unknown connectionType");
     }
     //note: most of the time, $this->clonedActivities[$activity->getUri()]['in'] = $this->clonedActivities[$activity->getUri()]['out']
     if (!is_null($activity) && !is_null($oldReferenceActivity)) {
         if ($this->activityService->isActivity($activity)) {
             $newActivity = $this->getClonedActivity($activity, $activityIO);
             if (!is_null($newActivity)) {
                 $returnValue = $newActivity;
                 //note: works for parallel activity too, where multiple branch is created a parallelized branch
             } else {
                 //must have been cloned!
                 // print_r($this->clonedActivities);
                 throw new common_exception_Error("the activity {$activity->getLabel()} ({$activity->getUri()}) has not been cloned!");
             }
         } else {
             if ($this->connectorService->isConnector($activity)) {
                 $newConnector = $this->getClonedConnector($activity);
                 if (!is_null($newConnector)) {
                     //it is a reference to a connector with another activity reference and it has been cloned already
                     $returnValue = $newConnector;
                 } else {
                     //not cloned yet:
                     //clone it only if the reference id is the current activity
                     //OR if the previous activities of a split connector:
                     if ($oldReferenceActivity->getUri() == $activity->getUniquePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_ACTIVITYREFERENCE))->getUri() && $activityIO == 'in') {
                         //recursively clone it
                         $nextConnectorClone = $this->cloneConnector($activity);
                         // $this->setWaitingConnector($activity, 'prev', $nextConnectorClone);//important to set the connector as a required one
                         // if(!$this->updateWaitingConnector($activity, $nextConnectorClone)){
                         // throw new Exception("the next connector clone cannot be updated");
                         // }
                         if (!is_null($nextConnectorClone)) {
                             $returnValue = $nextConnectorClone;
                         } else {
                             throw new Exception("the next connector cannot be cloned");
                         }
                     } else {
                         //it is a connector of another activityReference branch and it is not cloned yet, so set it as such:
                         //put in the waiting list:
                         $this->setWaitingConnector($activity, $connectionType, $clonedConnector);
                     }
                 }
             }
         }
     }
     return $returnValue;
 }
Пример #11
0
<?php

header("Content-type: text/html; charset=utf-8");
include_once "../config.php";
include_once ykfile("source/activity_service.php");
include_once ykfile("source/tag_service.php");
$tag_id = $_GET['id'];
//根据标签的id 查询到对应的文章----沙龙活动
$activityService = new ActivityService();
$act_list = $activityService->get_act_by_tag($tag_id, @$next_id, @$pagesize);
// 第一次进入沙龙页面的时候 默认的5种标签
$tagService = new TagService();
$tag_list = $tagService->get_defualt(HOT_ACTIVITY_CHANNEL);
$page_title = "热门活动";
if ($act_list != 1000 && !empty($act_list)) {
    include_once ykfile("pages/activity/activity_tag.php");
} else {
    echo "没有对象的文章";
}
Пример #12
0
<?php

header("Content-type: text/html; charset=utf-8");
session_start();
include_once "../config.php";
include_once ykfile("source/activity_service.php");
$id = $_GET['id'];
$activityService = new ActivityService();
//根据id查询到单条的活动对象
$activity = $activityService->get_by_id($id);
$page_title = "活动详情";
include_once ykfile("pages/activity/detail.php");
Пример #13
0
<?php

require_once ykfile('source/activity_service.php');
$page_title = "提交活动";
$act_id = intval($_GET['act_id']);
// 没有有效的活动ID
if ($act_id <= 0) {
    echo "<script type='text/javascript'>alert('亲,该功能正在月球上开发'); window.location.href='/m/'</script>";
}
$actsrv = new ActivityService();
$activity = $actsrv->get_by_id($act_id);
if ($activity == NULL) {
    return;
}
include ykfile("pages/user/edit_activity.php");
Пример #14
0
<?php

require '../model/activityService.class.php';
$describe = $_POST['describe'];
$time = $_POST['time'];
$place = $_POST['place'];
$res = ActivityService::add($describe, $time, $place);
if ($res) {
    header("Location: http://localhost/healthyone/view/releaseActivity.php?success=1");
    exit;
} else {
    header("Location: http://localhost/healthyone/view/releaseActivity.php?errno=0");
    exit;
}
Пример #15
0
<?php

require_once ykfile("source/activity_service.php");
require_once ykfile("source/tag_service.php");
// 判断是否有id  如果有  就是编辑  否则就是添加
$act_id = intval($_GET['act_id']);
$activitySer = new ActivityService();
// 获取所有的标签对象
$tagSer = new TagService();
$tag_list = $tagSer->get_all();
$activity = $activitySer->get_by_id($act_id);
if ($activity == NULL) {
    $activity = new ActivityModule();
    $activity->type = ActivityModel::type_activity;
    $activity->author = new UserModel();
}
include ykfile('pages/admin/edit_activity.php');
 /**
  * Check the ACL of a user for a given activity.
  * It returns false if the user cannot access the activity.
  *
  * @access public
  * @author Somsack Sipasseuth, <*****@*****.**>
  * @param  Resource activityExecution
  * @param  Resource currentUser
  * @param  Resource processExecution
  * @return boolean
  */
 public function checkAcl(core_kernel_classes_Resource $activityExecution, core_kernel_classes_Resource $currentUser, core_kernel_classes_Resource $processExecution = null)
 {
     $returnValue = (bool) false;
     if (!is_null($activityExecution) && !is_null($currentUser)) {
         if (is_null($processExecution)) {
             $processExecution = $this->getRelatedProcessExecution($activityExecution);
         }
         //get cached value:
         $cachedValue = $this->getCache(__METHOD__, array($activityExecution, $currentUser, $processExecution));
         if (!is_null($cachedValue) && is_bool($cachedValue)) {
             //				var_dump('ACL results from cache '.$activityExecution->getUri().' '.$currentUser->getLabel());
             $returnValue = $cachedValue;
             return $returnValue;
         }
         //activity and current must be set to the activty execution otherwise a common Exception is thrown
         $modeUri = $activityExecution->getOnePropertyValue($this->ACLModeProperty);
         if (is_null($modeUri)) {
             $returnValue = true;
             //if no mode defined, the activity is allowed
         } else {
             switch ($modeUri->getUri()) {
                 //check if th current user is the restricted user
                 case INSTANCE_ACL_USER:
                     $activityUser = $this->getRestrictedUser($activityExecution);
                     if (!is_null($activityUser)) {
                         if ($activityUser->getUri() == $currentUser->getUri()) {
                             $returnValue = true;
                         }
                     }
                     break;
                     //check if the current user has the restricted role
                 //check if the current user has the restricted role
                 case INSTANCE_ACL_ROLE:
                     $userService = tao_models_classes_UserService::singleton();
                     $activityRole = $this->getRestrictedRole($activityExecution);
                     $returnValue = $userService->userHasRoles($currentUser, $activityRole);
                     break;
                     //check if the current user has the restricted role and is the restricted user
                 //check if the current user has the restricted role and is the restricted user
                 case INSTANCE_ACL_ROLE_RESTRICTED_USER:
                     //check if an activity execution already exists for the current activity or if there are several in parallel, check if there is one spot available. If so create the activity execution:
                     //need to know the current process execution, from it, get the process definition and the number of activity executions associated to it.
                     //from the process definition get the number of allowed activity executions for this activity definition (normally only 1 but can be more, for a parallel connector)
                     $userService = tao_models_classes_UserService::singleton();
                     $activityRole = $this->getRestrictedRole($activityExecution);
                     if (true === $userService->userHasRoles($currentUser, $activityRole)) {
                         $assignedUser = $this->getActivityExecutionUser($activityExecution);
                         if (is_null($assignedUser) || $assignedUser->getUri() == $currentUser->getUri()) {
                             $returnValue = true;
                         }
                     }
                     break;
                     //check if the current user has the restricted role and is the restricted user based on the previous activity with the given role
                 //check if the current user has the restricted role and is the restricted user based on the previous activity with the given role
                 case INSTANCE_ACL_ROLE_RESTRICTED_USER_INHERITED:
                     $userService = tao_models_classes_UserService::singleton();
                     $activityRole = $this->getRestrictedRole($activityExecution);
                     if (true === $userService->userHasRoles($currentUser, $activityRole)) {
                         $roleSearchPattern = array();
                         $roleSearchPattern[] = $activityRole->getUri();
                         $relatedProcessVariable = $this->getRestrictedRole($activityExecution, false);
                         if (!is_null($relatedProcessVariable) && $relatedProcessVariable->getUri() != $activityRole->getUri()) {
                             $roleSearchPattern[] = $relatedProcessVariable->getUri();
                         }
                         //search for a past activity execution that has the the right role:
                         $activityExecutionsClass = new core_kernel_classes_Class(CLASS_ACTIVITY_EXECUTION);
                         $pastActivityExecutions = $activityExecutionsClass->searchInstances(array(PROPERTY_ACTIVITY_EXECUTION_ACTIVITY => $this->getExecutionOf($activityExecution)->getUri(), PROPERTY_ACTIVITY_EXECUTION_PROCESSEXECUTION => $processExecution->getUri(), PROPERTY_ACTIVITY_EXECUTION_ACL_MODE => INSTANCE_ACL_ROLE_RESTRICTED_USER_INHERITED, PROPERTY_ACTIVITY_EXECUTION_RESTRICTED_ROLE => $roleSearchPattern), array('like' => false));
                         $count = count($pastActivityExecutions);
                         if ($count > 0) {
                             foreach ($pastActivityExecutions as $pastActivityExecution) {
                                 $pastUser = $this->getActivityExecutionUser($pastActivityExecution);
                                 if (!is_null($pastUser)) {
                                     if ($pastUser->getUri() == $currentUser->getUri()) {
                                         $returnValue = true;
                                         //user's activity execution
                                     }
                                     break 2;
                                 } else {
                                     continue;
                                 }
                             }
                             $returnValue = true;
                             //no user has taken it
                         } else {
                             //throw exception here, since there should be at least the current acitivty exec here
                             throw new wfEngine_models_classes_ProcessExecutionException('cannot even found a single activity execution that for the inherited role');
                         }
                         break;
                     }
                     break;
                     //special case for deliveries
                 //special case for deliveries
                 case INSTANCE_ACL_ROLE_RESTRICTED_USER_DELIVERY:
                     $userService = tao_models_classes_UserService::singleton();
                     $activity = $this->getExecutionOf($activityExecution);
                     if ($this->activityService->isInitial($activity)) {
                         $activityRole = $this->getRestrictedRole($activityExecution);
                         $returnValue = $userService->userHasRoles($currentUser, $activityRole);
                     } else {
                         $process = $processExecution->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_PROCESSINSTANCES_EXECUTIONOF));
                         if (!is_null($process)) {
                             $processDefinitionService = wfEngine_models_classes_ProcessDefinitionService::singleton();
                             foreach ($processDefinitionService->getRootActivities($process) as $initialActivity) {
                                 if (!is_null($this->getExecution($initialActivity, $currentUser, $processExecution))) {
                                     $returnValue = true;
                                 }
                                 break;
                             }
                         }
                     }
                     break;
             }
         }
         //set cached value:
         if (is_null($cachedValue) || !is_bool($cachedValue)) {
             $this->setCache(__METHOD__, array($activityExecution, $currentUser, $processExecution), $returnValue);
         }
     }
     return (bool) $returnValue;
 }
Пример #17
0
<?php

// 获取后台的的发布记录
require_once ykfile("source/activity_service.php");
$next_id = intval($_GET['next_id']);
$count = intval($_GET['count']);
if ($count <= 0) {
    $count = 10;
}
//发布的列表页
$actSer = new ActivityService();
$act_list = $actSer->get_pub_act_by_state(2, $next_id, $count);
$act_total = $actSer->get_count_by_state(0);
// 以下4个参数,必须计算出来,分页器要使用
// page_cur: 当前页, 从1开始计算
// page_count: 总页数
// page_prefix: 点页数后,取数据的url前缀
// next_id: 下一页超始数据
$page_cur = intval(($next_id + 1 + 9) / 10);
$page_count = intval(($act_total + 9) / 10);
$page_prefix = "/m/admin.php?mod=sub_record";
$next_id += $count;
require_once ykfile("pages/admin/sub_record.php");
Пример #18
0
<?php

header("Content-type: text/html; charset=utf-8");
require_once "config.php";
include_once ykfile("source/activity_service.php");
include_once ykfile("source/tag_service.php");
// 排名前十的沙龙活动
$activityService = new ActivityService();
$act_list = $activityService->get_all(0, @$next_id, @$pagesize, STAGE_INDEX);
$page_title = '热门活动';
// 第一次进入沙龙页面的时候 默认的5种标签
$tagService = new TagService();
$tag_list = $tagService->get_defualt(HOT_ACTIVITY_CHANNEL);
include_once ykfile("pages/activity/activityList.php");
Пример #19
0
<?php

$act_id = intval($_GET['act_id']);
$type = intval($_GET['type']);
$is_delete = intval($_GET['is_delete']);
if ($type == 0) {
    // 演讲
    $talkSer = new TalkService();
    $ret = $talkSer->remove_talk($act_id, $is_delete);
} else {
    if ($type == 1) {
        // 沙龙活动
        $acticitySer = new ActivityService();
        $ret = $acticitySer->remove_activity($act_id, $is_delete);
    } else {
        //mooc
        $moocSer = new MoocService();
        $ret = $moocSer->remove_mooc($act_id, $is_delete);
    }
}
if ($ret == 0) {
    echo json_encode(array("status" => 0, "message" => "删除成功"));
} else {
    echo json_encode(array("status" => $ret, "message" => "删除失败"));
}
Пример #20
0
<?php

require_once ykfile('source/model/section_model.php');
require_once ykfile('source/talk_service.php');
require_once ykfile('source/activity_service.php');
$params = json_decode(file_get_contents('php://input'));
$type = intval($_GET['type']);
if ($type == 0) {
    $talksrv = new TalkService();
    $ret = $talksrv->save_section($params);
} else {
    $srv = new ActivityService();
    $ret = $srv->save_section($params);
}
if ($ret !== false) {
    echo json_encode(array("status" => "0", "message" => "保存成功", "section" => $ret));
} else {
    echo json_encode(array("status" => 0, "message" => "保存失败"));
}
Пример #21
0
    </div>
</div>
<div class="daohang">
	<div class="menu">
    	<ul>
      		<li class="menu-item_cur"><a href="http://localhost/healthyone/view/activity.php">活动列表</a></li>
            <li class="menu-item"><a href="http://localhost/healthyone/view/myActivity.php">我的活动</a></li>
        </ul>
    </div>
</div>
<div class="content">
	<?php 
require '../model/activityService.class.php';
$res = ActivityService::findAll();
while ($item = $res->fetchArray(SQLITE3_ASSOC)) {
    $res1 = ActivityService::isIn($username, $item['ID']);
    echo "\t<div class='item'> \n\t\t<form name='activity' method='post' action='http://localhost/healthyOne/controller/activityManageProcess.php?operation=2'>\n\t\t\t<p class='activity_tittle'><b>" . $item['DESCRIBE'] . "</b></p>\n\t\t\t<p class='activity_time'>" . $item['TIME'] . "</p>\n\t\t\t<p class='activity_place'>" . $item['PLACE'] . "</p>\n            <input type='hidden' name='id' value='" . $item['ID'] . "'></input>";
    if (!$res1->fetchArray()) {
        echo "<input class='activity_submit' type='submit' value='我要报名'/>";
    } else {
        echo "<input class='activity_submit' type='button' value='已报名'/>";
    }
    echo "</form></div>";
}
?>

</div>
<script>
$(function(){
	$(".nav").movebg({width:120/*滑块的大小*/,extra:40/*额外反弹的距离*/,speed:300/*滑块移动的速度*/,rebound_speed:400/*滑块反弹的速度*/});
})
Пример #22
0
<?php

require_once ykfile('source/activity_service.php');
$user_id = $_GET['user_id'];
$next_id = intval($_GET['next_id']);
$count = intval($_GET['count']);
$actsrv = new ActivityService();
$acts = $actsrv->get_by_user($user_id, $next_id, $count);
echo json_encode(array("records" => $acts));
Пример #23
0
<?php

require_once ykfile('source/activity_service.php');
if (!empty($_SESSION['current_user'])) {
    $user_id = $_SESSION['currnet_user']->uuid;
    $actsrv = new ActivityService();
    $act_list = $actsrv->get_by_user($user_id, 0, 10);
    $page_title = '我的发布';
    require_once ykfile("pages/user/sub_record.php");
} else {
    $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    echo "<script type='text/javascript'>alert('请您先登陆!');window.location.href='/m/user.php?mod=signin&url={$url}'</script>";
}
Пример #24
0
<?php

require_once '../config.php';
require_once ykfile('source/activity_service.php');
// 用于每天晚天后台运行,及时的把已经过期了的预告信息,从预告中移除
$actsrv = new ActivityService();
while ($actsrv->update_channel(10)) {
}
echo "预告移除完成:" . date('Y-m-d H:i:s') . "\n";
Пример #25
0
     	</ul>
        <div class="move-bg"></div>        
    </div>
</div>
<div class="daohang">
	<div class="menu">
    	<ul>
      		<li class="menu-item_cur"><a href="http://localhost/healthyone/view/activityManage.php">活动管理</a></li>
            <li class="menu-item"><a href="http://localhost/healthyone/view/releaseActivity.php">发布活动</a></li>
        </ul>
    </div>
</div>
<div class="content">
	<?php 
require '../model/activityService.class.php';
$res = ActivityService::findAll();
while ($item = $res->fetchArray(SQLITE3_ASSOC)) {
    echo "<div class='item'> \n\t\t   <form name='activity' action='http://localhost/healthyOne/controller/activityManageProcess.php'>\n\t\t\t<p class='activity_tittle'><b>" . $item['DESCRIBE'] . "</b></p>\n\t\t\t<p class='activity_time'>" . $item['TIME'] . "</p>\n\t\t\t<p class='activity_place'>" . $item['PLACE'] . "</p>\n\t\t   </form>\n           <a href='http://localhost/healthyOne/view/activityModify.php?id=" . $item['ID'] . "' class='activity_submit' id='modify'>修改</a>\n           <a href='http://localhost/healthyOne/controller/activityManageProcess.php?operation=0&id=" . $item['ID'] . "' class='activity_submit' id='delete' onclick = 'firm()'>删除</a>\n        </div>";
}
?>
</div>
 <script language="javascript">
function firm() {
	 if (!confirm("确认要删除?")) {
         window.event.returnValue = false;
     }
}
</script>
<script>
$(function(){
	$(".nav").movebg({width:120/*滑块的大小*/,extra:40/*额外反弹的距离*/,speed:300/*滑块移动的速度*/,rebound_speed:400/*滑块反弹的速度*/});
Пример #26
0
$act->summary = $summary;
$act->seo_title = $seo_title;
$act->thumbnail = $thumbnail;
$act->seo_alt = $seo_alt;
$act->state = 2;
// state 0:待审核, 1:驳回, 2:发布
$act->author->uuid = @$_SESSION['current_user']->uuid;
$act->start_time = $start_time;
$act->end_time = $end_time;
$act->address = $address;
$act->modify_time = $now_time;
$act->seo_keywords = $seo_keywords;
$act->holder = $holder;
$act->is_delete = 0;
//0:不删除 1:删除
$activitySer = new ActivityService();
$result = $activitySer->save_activity($act);
if ($result) {
    echo "保存成功";
}
function getUuid()
{
    $str = md5(uniqid(mt_rand(), true));
    $uuid = substr($str, 0, 8) . '-';
    $uuid .= substr($str, 8, 4) . '-';
    $uuid .= substr($str, 12, 4) . '-';
    $uuid .= substr($str, 16, 4) . '-';
    $uuid .= substr($str, 20, 12);
    return $uuid;
}
// 上传图片
Пример #27
0
            $id = $_GET['id'];
            $res = ActivityService::delete($id);
            header("Location: http://localhost/healthyone/view/activityManage.php");
        } else {
            if ($_GET['operation'] == 1) {
                $id = $_POST['id'];
                $describe = $_POST['describe'];
                $time = $_POST['time'];
                $place = $_POST['place'];
                $res = ActivityService::modify($id, $describe, $time, $place);
                header("Location: http://localhost/healthyone/view/activityManage.php");
            } else {
                if ($_GET['operation'] == 2) {
                    $id = $_POST['id'];
                    session_start();
                    $username = $_SESSION["username"];
                    $res = ActivityService::join($username, $id);
                    header("Location: http://localhost/healthyone/view/activity.php");
                } else {
                    if ($_GET['operation'] == 3) {
                        $id = $_POST['id'];
                        session_start();
                        $username = $_SESSION["username"];
                        $res = ActivityService::quit($username, $id);
                        header("Location: http://localhost/healthyone/view/myActivity.php");
                    }
                }
            }
        }
    }
}
Пример #28
0
 /**
  * Create an Export Contacts Activity
  * @param string $accessToken - Constant Contact OAuth2 access token
  * @param ExportContacts $exportContacts
  * @return array - Array of all ActivitySummaryReports
  */
 public function addExportContactsActivity($accessToken, ExportContacts $exportContacts)
 {
     return $this->activityService->addExportContactsActivity($accessToken, $exportContacts);
 }