/** * Returns class instance * * @return PostDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
function subdomaineName($params, $idproj) { $nameDomain = array(); //$domaine_post = $domaine; $linkdao = new LinkDao(new Link()); $list1 = $linkdao->getAllDataActive(array('id_project' => "{$idproj}", 'id_service' => "{$params}")); $serviceDao = new ServiceDao(new Service()); $service = $serviceDao->read($params); foreach ($list1 as $value) { $id_dom = $value->getId_domaine(); $domainedao = new DomaineDao(new Domaine()); $list = $domainedao->read($id_dom); $nameDomain[] = $list->getTitre(); } $result = array("serviceName" => $service->getTitre(), 'domainesName' => $nameDomain, 'active' => "1"); $this->set($result); $this->partialView('subdomaine'); }
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php session_start(); // 保存一天 $lifeTime = 24 * 3600; setcookie(session_name(), session_id(), time() + $lifeTime, "/"); header('Content-type: text/html; charset=utf-8'); ini_set("error_reporting", "E_ALL & ~E_NOTICE"); //设置时间格式 date_default_timezone_set('Asia/Shanghai'); //获得时间 $dateTime = date('Y-m-d H:i:s'); $type = @$_POST['type']; if ("sharelink" == $type) { require_once '../dao/LinkDao.php'; require_once '../../../util/StackConst.php'; $linkDao = new LinkDao(); //分享链接 $fk_user_id = $_SESSION['userLoginMessage']['user_id']; $fk_category_sort_name = @$_POST['fk_category_sort_name']; $fk_language_sort_name = @$_POST['fk_language_sort_name']; $resource_link_name = @$_POST['resource_link_name']; $resource_link_url = @$_POST['resource_link_url']; $resource_link_content = @$_POST['resource_link_content']; $resource_link_data = $dateTime; $resourceLink = array("fk_user_id" => $fk_user_id, "fk_category_sort_name" => $fk_category_sort_name, "fk_language_sort_name" => $fk_language_sort_name, "resource_link_name" => $resource_link_name, "resource_link_url" => $resource_link_url, "resource_link_content" => $resource_link_content, "resource_link_data" => $resource_link_data); if ($linkDao->shareLink($resourceLink)) { StackConst::jump_page("../view/linklist.php?fk_category_sort_name={$fk_category_sort_name}"); } }
header('Content-type: text/html; charset=utf-8'); ini_set("error_reporting", "E_ALL & ~E_NOTICE"); require_once '../dao/LinkDao.php'; //获得资源分类 $fk_category_sort_name = @$_GET['fk_category_sort_name'] == "" ? @$_POST['fk_category_sort_name'] : @$_GET['fk_category_sort_name']; if ("" == $fk_category_sort_name) { $fk_category_sort_name = "书籍"; } //获得语言分类 $fk_language_sort_name = @$_GET['fk_language_sort_name']; //获得检索关键字[如果post方式为空,那么就用get方式获得] $resource_link_name = @$_POST['resource_link_name'] == "" ? @$_GET['resource_link_name'] : @$_POST['resource_link_name']; //获得页数 $page = @$_GET['page']; //实例化LinkDao $linkDao = new LinkDao(); //获得链接集合 $arrLinks = $linkDao->getLinkList($page, $fk_category_sort_name, $fk_language_sort_name, $resource_link_name); //获得语言分类 $languageSorts = $linkDao->getLanguageSort(); //获得语言分类下链接资源的数量[根据语言有区分] $eachLinkCount = $linkDao->getEachLinkCount($fk_category_sort_name); //验证是否登录 $isUserLogin = isset($_SESSION['userLoginMessage']) ? "0" : "1"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ITstack|-link 链接库</title>
function lier_projet_service($params) { if ($_SERVER['REQUEST_METHOD'] === 'POST') { $service = $_POST['skills']; $domaines = $_POST['domaines']; $id_projet = $_POST['projet']; foreach ($domaines as $value) { $linkdao = new LinkDao(new Link()); $list = $linkdao->getAllDataActive(array('id_project' => "{$id_projet}", 'id_service' => "{$service}", 'id_domaine' => "{$value}")); if ($list) { } else { if ($value != '') { $linkdao = new LinkDao(new Link(array('id_project' => "{$id_projet}", 'id_service' => "{$service}", 'id_domaine' => "{$value}", 'general' => '0'))); $linkdao->create(); } } if (!isset($_POST['domaines'])) { $linkdao = new LinkDao(new Link(array('id_project' => "{$id_projet}", 'id_service' => "{$service}", 'general' => '1'))); $linkdao->create(); } } } $projetDao = new ProjetDao(new Projet()); $projet = $projetDao->read($params); $linkdao = new LinkDao(new Link()); $list = $linkdao->getAllDataActive(array('id_project' => "{$params}")); $servicedao = new ServiceDao(new Service()); $service = $servicedao->getAllData(); $this->set(array('link' => $list, 'services' => $service, 'projet' => $projet)); $this->render('lier_projet_service'); }
private function __construct() { $this->dao = LinkDao::getInstance(); }