예제 #1
0
 public function viewCommentbyNews($newsID)
 {
     global $db;
     $db->select('News', array('NewsID' => $newsID), $limit = false, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin = "");
     $news = $db->row_array();
     $Page_Title = "التعليقات على " . $news['Subject'];
     $myFunctions = new TableView();
     $msg = "هل انت متاكد من حذف التعليق ؟";
     $myFunctions->addF("عرض صاحب التعليق ", "View", "v");
     $myFunctions->addF("خذف التعليق", "Delete", "d");
     $myTable = new TableView();
     $myTable->addE("ID", "CommentID", "`CommentID`");
     $myTable->addE("اسم العضو", "name", "`name`");
     $myTable->addE("القبيله", "Gname", "`Gname`");
     $myTable->addElement("الصوره الشخصيه", "ProfilePic", "`ProfilePic`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $myTable->addE("التعليق", "comment", "`comment`");
     $keyid = "CommentID";
     global $per_page;
     $what = $myTable->returnArray();
     $where = array('POSTID' => $newsID);
     $table = "comments";
     $innerJoin = "INNER JOIN\n (SELECT `groups`.`Gname` Gname ,\n  `members`.`id`,`members`.`name` name,`members`.`ProfilePic` ProfilePic\n  FROM groups INNER JOIN members ON members.groupID=groups.Gid)\n  `members` ON `members`.`id`=`NewsComments`.`memberID`";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select('NewsComments', $where, $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $what, $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }
예제 #2
0
 public function getAvatarsList()
 {
     $Page_Title = "الصور الرمزيه";
     global $db;
     require_once "views/tablelist.php";
     $myTable = new TableView();
     $myTable->addE("id", "id", "`id`");
     $myTable->addElement("الصوره الشخصيه", "imageID", "`imageID`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $msg = "هل انت متاكد من حذف الصوره ؟";
     $keyid = "id";
     global $per_page;
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "View", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     $myFunctions->addF("حذف", "delete", "d");
     $what = $myTable->returnArray();
     $table = "Avatars";
     $innerJoin = "";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select($table, "", $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }
예제 #3
0
파일: news.php 프로젝트: Bixls/QatarBackend
 public function ViewNewsList()
 {
     $Page_Title = "عرض حميع الاخبار المنشوره";
     $where = array('1' => 1);
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "View", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     global $db;
     $myTable = new TableView();
     $myTable->addE("ID", "NewsID", "`NewsID`");
     $myTable->addE("عنوان الخبر", "Subject", "`Subject`");
     $myTable->addE("تفاصيل الخبر", "Description", "`Description`");
     $myTable->addElement("صوره الخبر", "Image", "`Image`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $keyid = "NewsID";
     global $per_page;
     $what = $myTable->returnArray();
     $table = "News";
     $innerJoin = "";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select($table, $where, $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $what, $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }
예제 #4
0
 public function viewFeedbackList()
 {
     $Page_Title = "الشكاوى و المقترحات";
     global $db;
     require_once "views/tablelist.php";
     $myTable = new TableView();
     $myTable->addE("id", "FeedbackID", "`FeedbackID`");
     $myTable->addE("الراسل", "name", "`name`");
     $myTable->addElement("الصوره الشخصيه", "ProfilePic", "`ProfilePic`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $myTable->addE("نوع الرساله", "FeedbackType", "`FeedbackType`");
     $myTable->addE("العنوان", "Subject", "`Subject`");
     $myTable->addE("الرسالة", "Message", "`Message`");
     $keyid = "FeedbackID";
     global $per_page;
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "View", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     $what = $myTable->returnArray();
     $table = "Feedbacks";
     $innerJoin = "inner join members on members.id=Feedbacks.SenderID";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select($table, "", $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }
예제 #5
0
	/**
	 * Returns all Pages beeing on the lower level, i.e. having the given
	 * path or SPID as parent.
	 *
	 * @param string $path Path to the page, "." if you want to use $spid, else use the path in this parameter.
	 * @param integer $spid ID of the sitepage to get the menu strucutre from from.
	 */
	function getLowerLevel($path = ".", $spid = 0) {
		global $page, $db;

		if (($path == ".") && ($spid == 0))
			$spid = $page;

		if (($path == "/") && ($spid == 0))
			$spid = getStartPage();

		if ($path == ".") {
			$spidUsed = getDBCell("sitepage", "MENU_ID", "SPID = $spid");
		} else {
			$spidUsed = getPageFromTree2($path);
		}

		$childs = createDBCArray("sitepage sp, sitemap sm", "SPID", "sm.PARENT_ID = $spidUsed AND sp.MENU_ID = sm.MENU_ID AND sm.IS_DISPLAYED=1 ORDER BY sm.POSITION, sp.POSITION");
		global $splevel, $v;
		$checked = array ();

		for ($i = 0; $i < count($childs); $i++) {
			// get clid
			$myspid = $childs[$i];

			// not sure why the next 2 lines are needed in this function
			// $menuID = getDBCell("sitepage", "MENU_ID", "SPID=$myspid");
			// if ($last != $menuID) {
			$clnid = getDBCell("sitepage", "CLNID", "SPID = $myspid");
			$clid = getDBCell("cluster_variations", "CLID", "CLNID = $clnid AND VARIATION_ID = $v");

			if ($splevel == 10) {
				if (!isExpired($clid)) {
					array_push($checked, $myspid);

					$last = $menuID;
				}
			} else {
				array_push($checked, $myspid);

				$last = $menuID;
			}
		// }
		}

		return $checked;
	}
예제 #6
0
 public function viewGroupList()
 {
     $Page_Title = "القبائل";
     global $db;
     require_once "views/tablelist.php";
     $myTable = new TableView();
     $myTable->addE("id", "Gid", "`Gid`");
     $myTable->addE("اسم القبيله", "Gname", "`Gname`");
     $myTable->addElement("صوره القبيله", "GProfilePic", "`GProfilePic`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $keyid = "Gid";
     global $per_page;
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "View", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     $what = $myTable->returnArray();
     $table = "groups";
     $innerJoin = "";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select($table, "", $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }
	 * @package CDS
	 */

	/**--------------------------------- populate some variables ------------------------------**/
	// Initialize Page configuration
	if (!isset($page))
		$page = value("page", "NUMERIC");

	if (!isset($v))
		$v = value("v", "NUMERIC");

	if ($v == "0" || $v == "")
		$v = 1;

	if ($page == "0" || $page == "")
		$page = getStartPage();

	$clid = getPageCluster($page, $v);
	$clnid = getClusterNode($page);
	$splevel = getSitepageLevel($page);

	// if (isExpired($clid)) exit;

	/**------------------------------- end of variables population ----------------------------**/

	/**
	 * sets a new page ID and therefore reinits all variables!
	 * @param integer New Page-ID
	 */
	function setPage($newpage) {
		global $page, $clid, $clnid, $v;
예제 #8
0
   public function ViewList($where, $Page_Title, $myFunctions)
   {
       global $db;
       $oldGet = $_GET;
       $inlineMenu = "";
       ///////////////////////////////////// View approved only //////////////////////////
       if (!array_key_exists('approved', $where)) {
           $gArray = $oldGet;
           $gArray['VA'] = false;
           $va = true;
           if (array_key_exists('VA', $_GET)) {
               if ($_GET['VA'] == false) {
                   $va = false;
                   $_GET['VA'] = true;
                   $where['approved'] = 1;
               }
           }
           $inlineMenu .= '<div class="checkbox inlineMenuItem"><label>
 <input class="chBox" ch="?' . http_build_query($_GET) . '"  unch="?' . http_build_query($gArray) . '" type="checkbox" ' . ($va ? "checked" : "") . '>اظهر المناسبات الغير مفعله </label></div>';
       }
       ///////////////////////////////////// Sort BYy //////////////////////////
       $_GET = $oldGet;
       $gArray = $_GET;
       $gArray['EX'] = false;
       $ex = true;
       if (array_key_exists('EX', $_GET)) {
           if ($_GET['EX'] == false) {
               $ex = false;
               $_GET['EX'] = true;
               $timeNow = Date("Y-m-d h:m:s");
               $twhere = "`TimeEnded` >= '" . $timeNow . "'";
               array_push($where, $twhere);
               //$where['approved']=1;
           }
       }
       $inlineMenu .= '<div class="checkbox inlineMenuItem"><label>
 <input class="chBox" ch="?' . http_build_query($_GET) . '"  unch="?' . http_build_query($gArray) . '" type="checkbox" ' . ($ex ? "checked" : "") . '>اظهار المناسبات المنتهيه</label></div>';
       ///////////////////////////////////// Sort BYy //////////////////////////
       $inlineMenu .= '<div class="inlineMenuItem">ترتيب حسب
     <select class="form-control" id="sel1">
       <option>تاريخ الانشاء</option>
       <option>تاريخ الانتهاء</option>
     </select></div>';
       ///////////////////////////////////// catigories //////////////////////////
       $nowSelectedCat = 0;
       if (array_key_exists('catID', $_GET)) {
           $where['eventType'] = $_GET['catID'];
           $nowSelectedCat = $_GET['catID'];
       }
       $db->select('EventCatigories', "", $limit = false, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin = "");
       $results = $db->result_array();
       $eventTypeSelect = "";
       foreach ($results as $value) {
           $_GET['catID'] = $value['catID'];
           $eventTypeSelect .= "<option " . ($nowSelectedCat == $value['catID'] ? "selected='selected'" : "") . " value='?" . http_build_query($_GET) . "'>" . $value['catName'] . "</option>";
       }
       unset($_GET['catID']);
       $inlineMenu .= '<div class="inlineMenuItem">اظهار
           <select class="form-control"  id="dynamic_select">
             <option value="?' . http_build_query($_GET) . '">جميع المناسبات</option>
           ' . $eventTypeSelect . '
           </select></div>';
       ///////////////////////////////////// catigories //////////////////////////
       $table = "Events";
       $myTable = new TableView();
       $myTable->addE("ID", "id", "`Events`.`id`");
       $eventStatus = array('1' => "مفعله", '0' => "غير مفعله");
       $myTable->addCustomeElement("vip", "VIP", array('0' => "لا", '1' => "نعم"));
       $myTable->addE("الاسم", "name", "`members`.`name`");
       $eventStatus = array('1' => "مفعله", '0' => "غير مفعله");
       $myTable->addCustomeElement("حاله المناسبة", "approved", $eventStatus);
       $myTable->addE("عنوان المناسبة", "subject", "`Events`.`subject`");
       $myTable->addElement("الصوره", "picture", "`Events`.`picture`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
       $myTable->addE("التفاصيل", "description", "`Events`.`description`");
       $myTable->addE("نوع المناسبة", "catName", "`EventCatigories`.`catName`");
       $myTable->addE("القبيله", "Gname", "`Gname`");
       $keyid = "id";
       global $per_page;
       $what = $myTable->returnArray();
       $innerJoin = "INNER JOIN (SELECT `groups`.`Gname` Gname ,`members`.`name` ,`members`.`id`,`members`.`groupID`\n  FROM groups INNER JOIN members ON members.groupID=groups.Gid)\n   `members` ON `Events`.`CreatorID`=`members`.`id`\n  INNER JOIN `EventCatigories` ON   `Events`.`eventType`=`EventCatigories`.`catID`";
       $getArray = $_GET;
       $where;
       require "functions/generalFunctions.php";
       $start = getStartPage($getArray, $per_page);
       $db->select($table, $where, $limit = $start . "," . $per_page, $order = "TimeEnded DESC", $where_mode = "AND", $print_query = false, $what, $innerJoin);
       $input = $db->result_array();
       include "views/list.php";
   }
예제 #9
0
 public function viewInvitedMembers($eventID)
 {
     global $db;
     $db->select('Events', array('id' => $eventID), $limit = false, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin = "");
     $event = $db->row_array();
     $Page_Title = "المدعوون الى " . $event['subject'];
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "View", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     $myTable = new TableView();
     $myTable->addE("ID", "id", "`id`");
     $myTable->addE("اسم العضو", "name", "`name`");
     $myTable->addE("القبيله", "Gname", "`Gname`");
     //  $myTable->addE("ذاهب","IsGoing","`IsGoing`");
     $myTable->addElement("الصوره الشخصيه", "ProfilePic", "`ProfilePic`", "<img class=\"img-responsive thumbnail\" src='../image.php?id=", "&t=150x150' />");
     $keyid = "id";
     global $per_page;
     $what = $myTable->returnArray();
     $where = array('EventID' => $eventID);
     $table = "members";
     $innerJoin = "INNER JOIN\n   (SELECT `groups`.`Gname` Gname ,\n    `members`.`id`,`members`.`name` name,`members`.`ProfilePic` ProfilePic\n    FROM groups INNER JOIN members ON members.groupID=groups.Gid)\n    `members` ON `members`.`id`=`invitationsLog`.`memberID`";
     // $innerJoin.="INNER JOIN `members` ON `members`.`id`=`invitationsLog`.`memberID`";
     $getArray = $_GET;
     require "functions/generalFunctions.php";
     $start = getStartPage($getArray, $per_page);
     $db->select('invitationsLog', $where, $limit = $start . "," . $per_page, $order = false, $where_mode = "AND", $print_query = false, $what, $innerJoin);
     $input = $db->result_array();
     include "views/list.php";
 }