Exemple #1
0
function CollectData($type_for_search, $username, $strDateFrom, $strDateTo)
{
    //$strDateFrom = date('Y-m-d', strtotime($year."W".$week_number.'-1'));
    //$strDateTo = date('Y-m-d', strtotime($year."W".$week_number.'-7'));
    //echo $strDateFrom;
    //echo $strDateTo;
    // $strDateFrom = date("Y-m-d",strtotime('monday this week'));
    // $strDateTo = date("Y-m-d",strtotime("sunday this week"));
    // echo 'from';
    // echo $strDateFrom;
    // echo 'to';
    // echo $strDateTo;
    $dates_array = createDateRangeArray($strDateFrom, $strDateTo);
    $daily_rank_sum_arr = array();
    foreach ($dates_array as &$value) {
        //echo $value;
        if (Get_Logged_users_id()) {
            if ($type_for_search != -1) {
                $SQL = "SELECT DISTINCT SUM(homeworks.Rank) FROM homeworks,user,uh,solvedhomeworks WHERE homeworks.Type = " . $type_for_search . " AND user.Name = '" . $username . "' AND uh.HWID = homeworks.UID AND uh.USERID = user.UID AND homeworks.Date = '" . $value . "' AND homeworks.UID NOT IN (SELECT solvedhomeworks.HWID FROM solvedhomeworks WHERE solvedhomeworks.USERID = " . Get_Logged_users_id() . ")";
            } else {
                $SQL = "SELECT DISTINCT SUM(homeworks.Rank) FROM homeworks,user,uh,solvedhomeworks WHERE user.Name = '" . $username . "' AND uh.HWID = homeworks.UID AND uh.USERID = user.UID AND homeworks.Date = '" . $value . "' AND homeworks.UID IN (SELECT solvedhomeworks.HWID FROM solvedhomeworks WHERE solvedhomeworks.USERID = " . Get_Logged_users_id() . ")";
            }
        } else {
            $SQL = "SELECT DISTINCT SUM(homeworks.Rank) FROM homeworks,user,uh WHERE homeworks.Type = " . $type_for_search . " AND user.Name = '" . $username . "' AND uh.HWID = homeworks.UID AND uh.USERID = user.UID AND homeworks.Date = '" . $value . "'";
        }
        //echo $SQL;
        $result = mysql_query($SQL);
        $daily_rank_sum = mysql_fetch_array($result);
        if ($daily_rank_sum[0] <= 0) {
            $daily_rank_sum[0] = 0;
        }
        array_push($daily_rank_sum_arr, $daily_rank_sum[0]);
    }
    unset($value);
    foreach ($daily_rank_sum_arr as &$value) {
        //echo $value;
    }
    unset($value);
    $done_array = array();
    for ($i = 0; $i < sizeof($dates_array); $i++) {
        array_push($done_array, array($dates_array[$i], $daily_rank_sum_arr[$i] * 10));
    }
    return $done_array;
    // NOW LET'S USE $dates_array and $daily_rank_sum_arr for the graph :D
}
Exemple #2
0
if (isset($_GET["time_period"])) {
    $TimePeriod = $_GET["time_period"];
} else {
    $TimePeriod = "false";
}
if ($TimePeriod == "today_and_tomorrow") {
    $the_end_of_query = "AND homeworks.Date >= '" . gmdate("Y-m-d", time() + 3600 * ($timezone + date("I"))) . " 00:00:00' AND homeworks.Date <= '" . $datetime . "' ORDER BY homeworks.Date ASC";
} else {
    if ($TimePeriod == "only_unsolved") {
        $the_end_of_query = "AND homeworks.UID NOT IN (SELECT solvedhomeworks.HWID FROM solvedhomeworks WHERE homeworks.UID = solvedhomeworks.HWID AND solvedhomeworks.USERID = " . Get_Logged_users_id() . ") ORDER BY homeworks.Date ASC";
    } else {
        if ($TimePeriod == "only_solved") {
            $the_end_of_query = "AND homeworks.UID IN (SELECT solvedhomeworks.HWID FROM solvedhomeworks WHERE homeworks.UID = solvedhomeworks.HWID AND solvedhomeworks.USERID = " . Get_Logged_users_id() . ") ORDER BY homeworks.Date ASC";
        } else {
            if ($TimePeriod == "with_past_unsolved") {
                $the_end_of_query = "AND ((homeworks.Date >= '" . gmdate("Y-m-d", time() + 3600 * ($timezone + date("I"))) . " 00:00:00') OR (homeworks.UID NOT IN (SELECT solvedhomeworks.HWID FROM solvedhomeworks WHERE homeworks.UID = solvedhomeworks.HWID AND solvedhomeworks.USERID = " . Get_Logged_users_id() . "))) ORDER BY homeworks.Date ASC";
            } else {
                $the_end_of_query = "AND homeworks.Date >= '" . gmdate("Y-m-d", time() + 3600 * ($timezone + date("I"))) . " 00:00:00' ORDER BY homeworks.Date ASC";
            }
        }
    }
}
if (ifLogged() > 0) {
    $button_to_render = '<div><div class="dropdown" style = "float:left;padding-right:10px;">
				<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style = "width:60px;height:46px;
																																									width:100%;background:#d2c9c6;
																																									color:#837d7c;
																																									font-weight:bold;
																																									border-radius:5px;
																																									font-size:25px;
																																									font-family: Hattori;
function PrintMyWeekDropdownButtons($done_array1, $EditMode, $username, $width, $leftmargin, $WeekDayFullOrNot, $timezone)
{
    echo '<style>.btn-group {width:' . ($width - $leftmargin) / sizeof($done_array1) . '%;}.btn btn-default dropdown-toggle{width: 100%;}</style>';
    echo '<div style = "margin-left: ' . $leftmargin . '%;width:' . ($width - $leftmargin) . '%;">';
    foreach ($done_array1 as $value) {
        if ($value[0] == gmdate("Y-m-d", time() + 3600 * ($timezone + date("I")))) {
            $buttonClass = "btn btn-success dropdown-toggle";
        } else {
            $buttonClass = "btn btn-default dropdown-toggle";
        }
        echo '<div class="btn-group"><button type="button" class="' . $buttonClass . '" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';
        $timestamp = strtotime($value[0]);
        $weekday = date("w", $timestamp);
        echo ConvertWeekdayFromPhp($weekday, $WeekDayFullOrNot);
        echo '<span class="caret"></span>';
        echo '</button>';
        if ($_GET["height"] > $_GET["width"]) {
            $MyDropdownMenuWidth = 200;
        } else {
            $MyDropdownMenuWidth = 300;
        }
        echo '<ul class="dropdown-menu" style = "background-color: white;width:' . $MyDropdownMenuWidth . 'px;padding-right:10px;padding-left:10px;padding-top:10px;padding-bottom:0px;overflow-y: scroll; height:320px;">';
        $SQL = "SELECT homeworks.UID FROM homeworks, user, uh WHERE homeworks.Date = '" . $value[0] . "' AND homeworks.UID = uh.HWID AND user.UID = uh.USERID AND user.Name = '" . $username . "'";
        $result4 = mysql_query($SQL);
        $SQL = "SELECT COUNT(homeworks.UID) FROM homeworks, user, uh WHERE homeworks.Date = '" . $value[0] . "' AND homeworks.UID = uh.HWID AND user.UID = uh.USERID AND user.Name = '" . $username . "'";
        $result5 = mysql_query($SQL);
        $number_of_hws = mysql_fetch_array($result5);
        if ($number_of_hws[0] <= 0) {
            echo '<p><a href="#">Няма нищо</a></p>';
        } else {
            while ($homework_info = mysql_fetch_array($result4)) {
                $MyHomeworkInfoArray = returnHomeworkInfoByID($homework_info[0]);
                $myHeadingBackgroundColor = "white";
                $TextColor = "black";
                $myHeadingContent = "NULL";
                if ($MyHomeworkInfoArray["MainInfo"]["Type"] == 0) {
                    $myHeadingBackgroundColor = "#86cf4b";
                    $myHeadingContent = "Домашно";
                    $headingPadding = 19;
                } else {
                    if ($MyHomeworkInfoArray["MainInfo"]["Type"] == 1) {
                        $myHeadingBackgroundColor = "#4ba8cf";
                        $myHeadingContent = "Изпит";
                        $headingPadding = 24;
                    } else {
                        if ($MyHomeworkInfoArray["MainInfo"]["Type"] == 2) {
                            $myHeadingBackgroundColor = "#dd8043";
                            $myHeadingContent = "Напомняне";
                            $headingPadding = 24;
                        }
                    }
                }
                if (Get_Logged_users_id()) {
                    $SQL = "SELECT COUNT(solvedhomeworks.UID) FROM solvedhomeworks WHERE solvedhomeworks.HWID = " . $homework_info[0] . " AND solvedhomeworks.USERID = " . Get_Logged_users_id();
                    //echo $SQL;
                    $IfISolvedResult = mysql_query($SQL);
                    $MyIfISolved = mysql_fetch_array($IfISolvedResult);
                    if ($MyIfISolved[0] > 0) {
                        $myHeadingBackgroundColor = "#673e7a";
                        //echo "USERID = ".Get_Logged_users_id();
                        $TextColor = "white";
                    }
                }
                if ($EditMode == 1) {
                    $Trash = '<a href="delete_hw_confirm.php?hwid=' . $homework_info[0] . '&class=' . $username . '&page=homeworks_time_chart" style = "text-decoration:none;color:white;font-size:13px;padding:4px;"><span class="glyphicon glyphicon-trash"></span> </a>';
                    $Pencil = '<a href="edit_hw.php?hwid=' . $homework_info[0] . '&class=' . $username . '" style = "text-decoration:none;color:white;font-size:13px;"><span class="glyphicon glyphicon-pencil"></span> </a>';
                } else {
                    $Trash = "";
                    $Pencil = "";
                }
                echo '<p style = "padding-bottom:15px;padding-top:3px;color:' . $TextColor . ';background-color:' . $myHeadingBackgroundColor . ';text-left:center;font-size:16px;border-radius:3px;border:solid #837d7c;">' . $Trash . $Pencil . '<a href="comments.php?hwid=' . $homework_info[0] . '" style = "text-decoration:none;color:white;font-size:13px;"><span class="glyphicon glyphicon-comment"></span> ' . $MyHomeworkInfoArray["MainInfo"]["NumOfComments"];
                if ($MyHomeworkInfoArray["MainInfo"]["NumOfSolvers"] > 0) {
                    echo '<a href="homework_solvers.php?hwid=' . $homework_info[0] . '&user='******'" style = "text-decoration:none;color:white;font-size:13px;"><span class="glyphicon glyphicon-stats"></span> ' . $MyHomeworkInfoArray["MainInfo"]["NumOfSolvers"];
                    echo '</a>';
                }
                if (CheckIfUserIsSolver(Get_Logged_users_id(), $homework_info[0]) == 0) {
                    $SQL = "SELECT user.Name FROM user WHERE user.Password = '******'";
                    //echo $SQL;
                    $current_logged_in_username_result = mysql_query($SQL);
                    $current_logged_in_username = mysql_fetch_array($current_logged_in_username_result);
                    echo '<a href="' . 'solve_homework.php?hwid=' . $homework_info[0] . '&user='******'" style = "text-decoration:none;color:white;font-size:13px;"><span class="glyphicon glyphicon-ok"></span> ';
                    echo '</a>';
                }
                echo '<span style = "padding-left:' . $headingPadding . '%;">' . $myHeadingContent . '<span></p>';
                echo '<div style = "padding:0px;">';
                echo '<a href="#" style = "text-decoration:none;"><p style = "margin-top:-12px;padding:3px;padding-bottom:15px;padding-top:5px;text-align:center;background-color:#837d7c;color:#d2c9c6;font-weight:bold;">' . $MyHomeworkInfoArray["MainInfo"]["Title"] . '</p></a>';
                if (strlen($MyHomeworkInfoArray["MainInfo"]["IMGURL"]) > 0) {
                    echo '<div style = "background-color:#d2c9c6;border:solid #837d7c;border-bottom:none;margin-top:-10px;margin-bottom:-6px;color:#837d7c;font-size:15px;">';
                    echo '<a href = "' . $MyHomeworkInfoArray["MainInfo"]["IMGURL"] . '" rel="lightbox"><img src = "' . $MyHomeworkInfoArray["MainInfo"]["IMGURL"] . '" style = "border:solid #9f9593;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;margin-bottom:10px;" width = "100%"></a>';
                    echo '</div>';
                }
                if (strlen($MyHomeworkInfoArray["MainInfo"]["Data"]) >= 0) {
                    echo '<div style = "background-color:#d2c9c6;border:solid #837d7c;border-top:none;padding-left:4px;padding-right:4px;padding-bottom:15px;padding-top:12px;margin-top:-10px;margin-bottom:-6px;color:#837d7c;font-size:15px;"><p>' . $MyHomeworkInfoArray["MainInfo"]["Data"] . "</p>";
                    echo '</div>';
                }
                //echo '<li><a href="#">'.$homework_info[2].'</a></li>';
                echo '</div>';
                echo '<div style = "margin-bottom:10px;">';
                $MyPercentage = $MyHomeworkInfoArray["MainInfo"]["Rank"] * 25;
                echo '<div id="progressbar">';
                echo '<div style = "width: ' . $MyPercentage . '%;color:#837d7c;font-weight:bold;">';
                echo $MyPercentage . '%';
                echo '</div>';
                echo '</div>';
                echo '</div>';
            }
        }
        echo '</ul>';
        echo '</div>';
    }
    unset($value);
    echo '</div>';
}
Exemple #4
0
<?php 
session_start();
echo '<html lang="en" class="no-js">';
include "head.php";
include "config.php";
CheckFriendShipByNameAndKickOut($_GET["user"], Get_Logged_users_id());
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>

<div class="container">
<?php 
include "main_menu.php";
?>

<div id = "my_page" style = "border-radius:20px;background: rgba(243, 243, 243, 0.4);">

	<div id = "urlForm">
	
	<?php 
$SQL = "SELECT user.UID FROM user WHERE user.Name = '" . $username . "'";
$MyUserIDResult = mysql_query($SQL);
$MyUserID = mysql_fetch_array($MyUserIDResult);
$SQL = "SELECT favsites.Name, favsites.ImgUrl, favsites.Url, favsites.USERID, favsites.Data, favsites.UID FROM favsites WHERE favsites.USERID = " . $MyUserID[0];
$MyResult = mysql_query($SQL);
$UserInfo = ReturnALLUserInfoByIdOrByName($username);
echo '<h1 id = "urlTitleForm">Важните сайтове на ' . $UserInfo["FirstName"] . " " . $UserInfo["LastName"] . '</h1>';
	<link rel="stylesheet" href="vertical-timeline/css/reset.css">
	<link rel="stylesheet" href="vertical-timeline/css/style.css">
	<script src="vertical-timeline/js/modernizr.js"></script>
</head>
<?php 
include "start_check.php";
if ($_SESSION['page'] != 'check_width') {
    header('Location: check_width_and_send_to.php?user='******'&page=hws_waiting_assessment') and exit;
}
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
$MyUnappreciatedHomeworks = UnappreciatedHomeworks(Get_Logged_users_id());
echo '<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);margin-top:50px;">';
while ($CurrentUnappreciatedHomeworkID = mysql_fetch_array($MyUnappreciatedHomeworks)) {
    if ($_GET["height"] > $_GET["width"]) {
        PrintHWInfoInTableByID($CurrentUnappreciatedHomeworkID[0], $timezone, $EditMode, $username, Get_Logged_users_id());
    } else {
        PrintHomeworksTimeline($CurrentUnappreciatedHomeworkID[0], $timezone, $EditMode, $username, Get_Logged_users_id());
    }
}
echo '</div>';
?>



</body>
Exemple #6
0
            $SubjectID = $MySubjectName[1];
        }
        //echo $MySubjectName[0]." = ".$MyCurrentHomeworkIfno["MainInfo"]["Title"];
    }
    if ($IhaveIt == 0) {
        $SubjectID = 0;
    }
    //echo '<p style = "margin-top:10%;">'.$SubjectID.'</p>';
    return $SubjectID;
}
if (!IHaveThisSubjectInSubjectList(Get_Logged_users_id(), $_GET["hwid"])) {
    $MyCurrentHomeworkIfno = returnHomeworkInfoByID($_GET["hwid"]);
    $_SESSION['Subject'] = $MyCurrentHomeworkIfno["MainInfo"]["Title"];
    header('Location: add_to_my_list_subject_with_name.php?hwid=' . $_GET["hwid"]) and exit;
} else {
    $SubjectID = IHaveThisSubjectInSubjectList(Get_Logged_users_id(), $_GET["hwid"]);
}
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
$_SESSION["hwid"] = $_GET["hwid"];
?>

<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">


<form role="form" <?php 
echo 'action=';
echo "solve_homework_final.php?user="******"user"] . "&hwid=" . $_GET["hwid"];
Exemple #7
0
//echo $SQL;
$result5 = mysql_query($SQL);
?>
        <div id="sidebar-wrapper" style = "background-color:#eeeeee;margin-top:-0.2%;">
            <ul class="sidebar-nav" style = "">
                <li class="sidebar-brand">
                    <a href="fr_waiting_accept.php" style = "color:#7a7574;font-family:Arial;font-size:15px;margin-left:-10px;">
                        <span class = "glyphicon glyphicon-user"></span> Чакащи одобрение - <?php 
echo CountWaitingRequests(Get_Logged_users_id());
?>
                    </a>
					</li>
					<li class="sidebar-brand">
					<a href="hws_waiting_assessment.php" style = "color:#7a7574;font-family:Arial;font-size:15px;margin-left:-10px;">
                        <span class = "glyphicon glyphicon-duplicate"></span> Решени за оценка - <?php 
echo CountUnappreciatedHomeworks(Get_Logged_users_id());
?>
                    </a>
                </li>
				 <table style = "margin-left: 6%;width:100%;margin-left:4px;">
				<thead>
				  <tr style = "background-color: #8f8a89; color:white; font-family:Arial;">
					<th colspan="1" style = "padding: 7px;text-align:center; font-weight: normal;">HW </th>
					<th colspan="1" style = "padding: 7px;text-align:center; font-weight: normal;">INFO </th>
					<th colspan="1" style = "padding: 7px;text-align:center; font-weight: normal;">USERNAME</th>
				  </tr>
				</thead>
				<tbody>
				
				<?php 
$UserInfo = ReturnALLUserInfoByIdOrByName($name);
<?php 
session_start();
echo '<html lang="en" class="no-js">';
include "head.php";
include "config.php";
$query = $_SERVER['PHP_SELF'];
$path = pathinfo($query);
$MyCurrentPhpPage = $path['basename'];
if ($MyCurrentPhpPage != "index.php" && $MyCurrentPhpPage != "acc_added.php") {
    if (Get_Logged_users_id() == 0) {
        header('Location: index.php') and exit;
    }
}
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
?>

<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">

	<h1 id = "urlTitleForm">Не можете да видите това съдържание понеже не сте приятели с <?php 
$SecuredUserInfo = ReturnALLUserInfoByIdOrByName($_GET["secured_user"]);
echo $SecuredUserInfo["FirstName"] . " " . $SecuredUserInfo["LastName"];
?>
<?php 
session_start();
echo '<html lang="en" class="no-js">';
include "head.php";
include "config.php";
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
AcceptRequest($_GET["userid"], Get_Logged_users_id());
$userinfo = ReturnALLUserInfoByIdOrByName("", $_GET["userid"]);
?>

<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">

	<h1 id = "urlTitleForm">Честито! Вече сте приятели с <?php 
echo $userinfo["FirstName"] . " " . $userinfo["LastName"];
?>
</h1>

</div>

</body>
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
?>
	
	<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">
	
		<div style = "background-color:#d2c9c6;margin-left:auto;margin-right:auto;margin-top:30px;margin-bottom:20px;width:100%;height:60%;border:solid #6d6765;border-width:thin;">
<?php 
echo '<h3 style = "margin-top:0px;border:solid #6d6765;text-align:center;background-color: #837d7c;border-width:thin;border-top-left-radius: 0px;border-top-right-radius: 0px; padding: 10px;color:#d2c9c6;font-size:35px;"><span style = "padding-left:13px;">Добавяне на оценка</span></h3>';
echo '<form role="form" action=AssessmentAdded.php?userid=' . Get_Logged_users_id() . '&hwid=' . $_GET["hwid"] . ' method="post">';
echo '<select class="form-control" name="assessment" style = "background-color:#ddd5d3;border:solid #6d6765;border-width:thin;margin:auto;margin-top:8%;height:50px;font-size:20px;width:60%;">
					<option value="1">Никаква</option>
					<option value="2">Слаб 2</option>
					<option value="3">Среден 3</option>
					<option value="4">Добър 4</option>
					<option value="5">Много добър 5</option>
					<option value="6">Отличен 6</option>
				</select>
			';
if ($EditMode == 1) {
    echo '<div style = "margin-left:30%;">';
    echo '<button type="submit" style = "margin-top:9%;width:50%;background:#837d7c;color:#d2c9c6;height:50px;font-family:MyDays;font-size:25px;" class="btn btn-default">Запази</button>';
    echo '</div>';
}
echo '</div>';
Exemple #11
0
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>

<div class="container">
<?php 
include "main_menu.php";
$imgurl = $_POST["imgurl"];
$title = $_POST["title"];
$data = $_POST["data"];
$url = $_POST["url"];
$SQL = "INSERT INTO favsites (Name, ImgUrl, Data, Url, USERID) VALUES ('" . $title . "', '" . $imgurl . "', '" . $data . "', '" . $url . "', " . Get_Logged_users_id() . ")";
if ($EditMode == 1) {
    $MyInsertion = mysql_query($SQL);
} else {
    $ErrorMessage = "Грешка";
}
?>
<div id = "my_page" style = "border-radius:20px;background: rgba(243, 243, 243, 0.4);">
<?php 
echo '<div id = "urlForm">';
if ($EditMode == 0) {
    echo '<h1 id = "urlTitleForm">Грешка :/</h1>';
} else {
    echo '<h1 id = "urlTitleForm">Сайтът е добавен успешно</h1>
				<div>';
    if (strpos($url, 'http') !== false) {
Exemple #12
0
    echo '	<p style = "background-color:#746f6e;color:#d2c9c6;border-radius:5px; padding: 9px;">' . $value["Data"] . '</p>';
    echo '</div>';
}
unset($value);
echo '</div>';
echo '</div>';
echo '</div>';
?>



</div>

<?php 
echo '<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">';
if (CheckIfUserIsSolver(Get_Logged_users_id(), $_GET['hwid']) == 1) {
    $SolveButton = '<span style = "background-color:#6b6665;padding:12px;margin-left:-10px;"><button class="btn btn-default" style = "background:#6b6665;border:none;color:#d2c9c6;" >Решeно</button></span>';
} else {
    $SQL = "SELECT user.Name FROM user WHERE user.Password = '******'";
    //echo $SQL;
    $current_logged_in_username_result = mysql_query($SQL);
    $current_logged_in_username = mysql_fetch_array($current_logged_in_username_result);
    $SolveButton = '<a href = "solve_homework.php?hwid=' . $_GET['hwid'] . '&user='******'"><span style = "background-color:#6b6665;padding:12px;margin-left:-10px;"><button class="btn btn-default" style = "background:#6b6665;border:none;color:#d2c9c6;" >Реши</button></span></a>';
}
echo '<h3 style = "background-color: #837d7c;border-width:thin;border-top-left-radius: 0px;border-top-right-radius: 0px; padding: 10px;margin:auto;color:#d2c9c6;">' . $SolveButton . '<span style = "padding-left:13px;">Решавания - ' . $MyHomeworkInfoArray["MainInfo"]["NumOfSolvers"] . '</span></h3>';
for ($count = 0; $count < sizeof($MyHomeworkInfoArray["Solvings"]); $count++) {
    $myCurrentArray = $MyHomeworkInfoArray["Solvings"];
    $UserInfo = ReturnALLUserInfoByIdOrByName($myCurrentArray[$MyHomeworkInfoArray["SolversIDs"][$count]]["Name"]);
    //echo "<h3>user.UID ".$MyHomeworkInfoArray["SolversIDs"][$count]."</h3";
    //echo "<p>".$myCurrentArray[$MyHomeworkInfoArray["SolversIDs"][$count]]["UID"]."</p>";
    echo '<div style = "padding-left:20px;padding-bottom:0px;padding-top:5px;background-color:#d2c9c6;">';
Exemple #13
0
echo '<h1>Търсене за <spam style = "color: #006600">"' . $searched_string . '"</spam><small id = "smalltag"> (резултати: ' . $row3[0] . ')</small></h1>';
echo '</div>';
if ($row3[0] <= 0) {
    echo 'Няма съвпадения';
} else {
    $SQL = "SELECT DISTINCT user.Name FROM user WHERE ((user.Name LIKE '%" . $searched_string . "%') || (user.FirstName LIKE '%" . $searched_string . "%') || (user.LastName LIKE '%" . $searched_string . "%') || (user.Text LIKE '%" . $searched_string . "%')) ORDER BY user.Name ASC";
    //echo $SQL;
    $result = mysql_query($SQL);
    while ($row = mysql_fetch_array($result)) {
        echo '<div style = "margin-top:30px;">';
        $MyCurrentUserInfo = ReturnALLUserInfoByIdOrByName($row[0]);
        $MyUserIDResult = mysql_query("SELECT user.UID FROM user WHERE user.Name = '" . $row[0] . "'");
        $currentuserid = mysql_fetch_array($MyUserIDResult);
        if ($currentuserid[0] != Get_Logged_users_id()) {
            if (CheckIfFriends($currentuserid[0], Get_Logged_users_id()) == 0) {
                if (CheckIfRequestSent(Get_Logged_users_id(), $currentuserid[0]) == 0) {
                    echo '<a href = "send_friend_request_to.php?user='******'"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Изпрати покана на ' . $MyCurrentUserInfo["FirstName"] . " " . $MyCurrentUserInfo["LastName"] . '</button></a>';
                } else {
                    echo '<a href = "#"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Поканата е изпратена</button></a>';
                }
            } else {
                echo '<a href = "#"><button class="btn btn-default" style = "min-width:100%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Приятели</button></a>';
            }
        }
        PrintAccountInfoByUSERNAME($row[0], 1);
        //echo '<div class="panel-footer">'.$row[2].'</div>';
        //echo $row[0];
        //echo $row[1];
        //echo $row[2];
        //echo $row[3];
    }
Exemple #14
0
$SQL = "SELECT DISTINCT COUNT(homeworks.Date) FROM homeworks,user,uh WHERE user.Name = '" . $username . "' AND uh.HWID = homeworks.UID AND uh.USERID = user.UID AND ((homeworks.Data LIKE '%" . $searched_string . "%') OR (homeworks.Title LIKE '%" . $searched_string . "%')) ORDER BY homeworks.Date DESC";
$result3 = mysql_query($SQL);
$row3 = mysql_fetch_array($result3);
echo '<div class="page-header">';
echo '<h1 style = "font-size:40px;color:#635d5c;">Търсене за "' . $searched_string . '"<small id = "smalltag" style = "color:#635d5c;"> (резултати: ' . $row3[0] . ')</small></h1>';
echo '</div>';
if ($row3[0] <= 0) {
    echo 'Няма съвпадения';
} else {
    $SQL = "SELECT DISTINCT homeworks.UID FROM homeworks WHERE ((homeworks.Data LIKE '%" . $searched_string . "%') OR (homeworks.Title LIKE '%" . $searched_string . "%')) ORDER BY homeworks.Date DESC";
    $result = mysql_query($SQL);
    $counter = 0;
    while ($row = mysql_fetch_array($result)) {
        $counter++;
        if ($_GET["height"] > $_GET["width"]) {
            PrintHWInfoInTableByID($row[0], $timezone, $EditMode, $username, Get_Logged_users_id());
        } else {
            PrintHomeworksTimeline($row[0], $timezone, $EditMode, $username, Get_Logged_users_id());
        }
        //echo $row[0];
        //echo $row[1];
        //echo $row[2];
        //echo $row[3];
    }
}
?>
	
</div>

</body>
</html>
<?php 
session_start();
echo '<html lang="en" class="no-js">';
include "head.php";
include "config.php";
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
$result = mysql_query("SELECT user.UID FROM user WHERE user.Name = '" . $username . "'");
$currentuserid = mysql_fetch_array($result);
$SQL = "INSERT INTO friends (FirstPersonID, SecondPersonID, FirstConfirm) VALUES (" . Get_Logged_users_id() . ", " . $currentuserid[0] . ", 1)";
$MySendingFriendRequestResult = mysql_query($SQL);
?>

<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">

	<h1 id = "urlTitleForm">Поканата ви чака одобрение.</h1>

</div>

</body>
Exemple #16
0
?>

<div id = "my_page" style = "border-radius:20px;background: rgba(243, 243, 243, 0.4);">

	<div id = "urlForm">
	
	<?php 
$FirstName = $_POST["FirstName"];
$LastName = $_POST["LastName"];
$IMGURL = $_POST["IMGURL"];
$Text = $_POST["Text"];
echo '<div id = "urlForm">';
if ($EditMode == 0) {
    echo '<h1 id = "urlTitleForm">Грешка :/</h1>';
} else {
    $SQL = "UPDATE user SET user.FirstName = '" . $FirstName . "', user.LastName = '" . $LastName . "', user.IMGURL = '" . $IMGURL . "', user.Text = '" . $Text . "' WHERE user.UID = " . Get_Logged_users_id();
    if (mysql_query($SQL)) {
        echo '<h1 id = "urlTitleForm">Профилът е променен успешно</h1>';
    } else {
        echo '<h1 id = "urlTitleForm">Грешка при опит за промяна</h1>';
    }
    echo '<div>';
    PrintAccountInfoByUSERNAME(Get_Logged_users_name(), 1);
    echo '</div>';
    echo '</div>';
}
echo '</div>';
?>
	</div>

</div>
function PrintHomeworksTimeline($hwid, $timezone, $EditMode, $username, $loggeduserid)
{
    //echo "ENTERRRR";
    $MyHomeworkInfo = returnHomeworkInfoByID($hwid);
    //print_r($MyHomeworkInfo);
    if ($MyHomeworkInfo["MainInfo"]["Date"] == gmdate("Y-m-d", time() + 3600 * ($timezone + date("I")))) {
        $weekday2 = '(днес) ';
    } else {
        $weekday2 = "";
    }
    echo '<div class="cd-timeline-block">';
    switch ($MyHomeworkInfo["MainInfo"]["Rank"]) {
        case 1:
            $img_bg_color = "";
            break;
        case 2:
            $img_bg_color = "picture";
            break;
        case 3:
            $img_bg_color = "location";
            break;
        case 4:
            $img_bg_color = "movie";
            break;
    }
    echo '<div class="cd-timeline-img cd-' . $img_bg_color . '" style = "z-index:600;">';
    $margin_top = "margin-top: 30px;";
    $class_zoom = 'class="zoom_img"';
    if (strlen($MyHomeworkInfo["MainInfo"]["IMGURL"]) <= 0) {
        echo '<img src="vertical-timeline/img/cd-icon-picture.svg" alt="Picture">';
    } else {
        echo '<div ' . $class_zoom . ' style = "' . $margin_top . ' position:relative;">';
        echo '<a href = "' . $MyHomeworkInfo["MainInfo"]["IMGURL"] . '" rel="lightbox"><img style= "border-width:thin; border-style: solid;background-color:#afb7c3;border-color: white;border-radius:15px;" src="' . $MyHomeworkInfo["MainInfo"]["IMGURL"] . '" alt="HomeWork image" width="100%" height="100%"></a>';
        echo '</div>';
    }
    echo '</div> <!-- cd-timeline-img -->';
    echo '<style>#MyHWBOX {background-color:#837d7c; border:solid white;border-width:2px;} #MyHWBOX:hover{background-color:#968e8d;}</style>';
    echo '<div class="cd-timeline-content" id = "MyHWBOX">';
    $type_of_event = ReturnTypeOfHWinWords($MyHomeworkInfo["MainInfo"]["Type"]);
    if ($EditMode == 0) {
        echo '	<h2 style = "background-color:#d2c9c6;
										padding:10px;
										font-size:30px;
										color:#837d7c;
										border-radius:10px;
										font-family: Hattori;
										font-weight:bold;">' . $type_of_event . " по " . $MyHomeworkInfo["MainInfo"]["Title"] . '</h2>';
    } else {
        echo '<div class="dropdown" style = "float:left;padding-right:10px;margin-top:-6px;">';
        echo '<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style = "width:100%;background:#d2c9c6;
																																															color:#837d7c;
																																															font-weight:bold;
																																															border-radius:20px;
																																															font-size:25px;
																																															font-family: Hattori;
																																															font-weight:bold;">';
        echo '<span class="glyphicon glyphicon-wrench"></span>';
        echo '</button>';
        echo '<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">';
        echo '<li><a href="delete_hw_confirm.php?hwid=' . $hwid . '&class=' . $username . '"><span class="glyphicon glyphicon-trash"></span> Изтрий</a></li>';
        echo '<li><a href="edit_hw.php?hwid=' . $hwid . '&class=' . $username . '"><span class="glyphicon glyphicon-pencil"></span> Редактирай</a></li>';
        echo '</ul>';
        echo '</div>';
        echo '<h2 style = "background-color:#d2c9c6;
										padding:10px;
										font-size:30px;
										color:#837d7c;
										border-radius:10px;
										font-family: Hattori;
										font-weight:bold;">';
        echo $type_of_event . " по " . $MyHomeworkInfo["MainInfo"]["Title"];
        echo '</h2>';
    }
    $SQL = "SELECT (user.UID) FROM user WHERE user.Name = '" . $username . "'";
    $result4 = mysql_query($SQL);
    $user_id = mysql_fetch_array($result4);
    echo '<div class="dropdown" style = "width:130px;padding-right:10px;margin-top:10px;">';
    echo '<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style = "min-width:100%;color:#837d7c;
																																												background:#d2c9c6;
																																												font-weight:bold;
																																												border-radius:7px;
																																												font-size:16px;
																																												font-family: Hattori;
																																												font-weight:bold;
																																												margin-top:-22px;">';
    if (CheckIfUserIsSolver(Get_Logged_users_id(), $hwid) == 1) {
        echo '<span style = "color:green;" class = "glyphicon glyphicon-ok"> Решено</span></a>';
    } else {
        echo '<span style = "color:red;" class = "glyphicon glyphicon-remove"> Нерешено</span>';
    }
    echo '</button>';
    echo '<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">';
    if ($MyHomeworkInfo["MainInfo"]["Type"] == 0) {
        $Label1 = "Реших това домашно";
        $Label2 = "решили това домашно";
    } else {
        if ($MyHomeworkInfo["MainInfo"]["Type"] == 1) {
            $Label1 = "Взех този изпит";
            $Label2 = "взели този изпит";
        } else {
            if ($MyHomeworkInfo["MainInfo"]["Type"] == 2) {
                $Label1 = "Изпълних тази задача";
                $Label2 = "изпълнили тази задача";
            }
        }
    }
    if (CheckIfUserIsSolver($loggeduserid, $hwid) == 0) {
        $SQL = "SELECT user.Name FROM user WHERE user.Password = '******'";
        $current_logged_in_username_result = mysql_query($SQL);
        $current_logged_in_username = mysql_fetch_array($current_logged_in_username_result);
        echo '<li><a style = "color:green;" href = "solve_homework.php?hwid=' . $hwid . '&user='******'"><span class="glyphicon glyphicon-ok"></span> ' . $Label1 . '</a></li>';
    }
    $SQL = "SELECT COUNT(solvedhomeworks.UID) FROM solvedhomeworks WHERE solvedhomeworks.HWID = " . $hwid;
    $result4 = mysql_query($SQL);
    $number_of_solvers = mysql_fetch_array($result4);
    if ($number_of_solvers[0] > 0) {
        echo '<li><a href="homework_solvers.php?hwid=' . $hwid . '&user='******'"><span class="glyphicon glyphicon-pencil"></span> Виж всички ' . $Label2 . ' (' . $number_of_solvers[0] . ')</a></li>';
    }
    echo '</ul>';
    echo '</div>';
    echo '	<p style = "color:#514d4b;
										font-family: Arial;
										font-size:20px;
										margin-top:20px;">' . $MyHomeworkInfo["MainInfo"]["Data"] . '</p>';
    echo '<p>';
    echo '<style>#CommentsButton{
						text-decoration: none;
						font-size:18px;color:#d2c9c6;
						font-family: Arial;
						font-size:20px;
						margin-top:3px;
					}#CommentsButton:hover{
						color:#4f4b4a;
					}</style>';
    echo '<a href="comments.php?hwid=' . $hwid . '" id = "CommentsButton" style = "">';
    echo '<span class="glyphicon glyphicon-comment"></span>';
    echo ' Коментари ' . $MyHomeworkInfo["MainInfo"]["NumOfComments"] . '</a></p>';
    echo '<p><a href="add_assessment_to_hw.php?hwid=' . $hwid . '" id = "CommentsButton" style = "">';
    echo '<span class="glyphicon glyphicon-stats"></span>';
    echo ' Вашата оценка - ' . CheckMyAssessmentForHWWithID($hwid, $loggeduserid) . '</a></p>';
    echo '<span class="cd-date"><h1 style="color:#6f6967;font-family: MyDays;font-size:22px;font-weight:bold;">' . ConvertWeekday($MyHomeworkInfo["MainInfo"]["WEEKDAY"]) . ' <small id = "smalltag" style = "font-family:Arial;color:black;font-size:15px;">' . $weekday2 . $MyHomeworkInfo["MainInfo"]["Date"] . '</small></h1></span>';
    echo '</div> <!-- cd-timeline-content -->';
    echo '</div> <!-- cd-timeline-block -->';
}
Exemple #18
0
    $password = $_SESSION['psw'];
    if ($name_is_set == 0) {
        $username = $_SESSION['name'];
    }
}
include "CheckEditMode.php";
$_SESSION['psw'] = $password;
$_SESSION['name'] = $username;
$_SESSION['page'] = "other";
?>

<div class="container">
<?php 
include "main_menu.php";
echo '<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">';
$WaitingResult = WaitingRequests(Get_Logged_users_id());
while ($WaitingUserID = mysql_fetch_array($WaitingResult)) {
    $SQL = "SELECT user.Name FROM user WHERE user.UID = " . $WaitingUserID[0];
    $Result = mysql_query($SQL);
    $WaitingUsername = mysql_fetch_array($Result);
    echo '<div style = "margin-top:-22px;position: absolute;min-width:40%;">';
    echo '<a href = "accept_friend_request.php?userid=' . $WaitingUserID[0] . '"><button class="btn btn-default" style = "width:50%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-user"></span><span class = "glyphicon glyphicon-user"></span> Приемам</button></a>';
    echo '<a href = "refuse_friend_request.php?userid=' . $WaitingUserID[0] . '"><button class="btn btn-default" style = "width:50%;color:#837d7c;background:#d2c9c6;font-weight:bold;border-radius:7px;font-size:16px;font-family: Arial;font-weight:bold;margin-top:0px;" type="button"><span class = "glyphicon glyphicon-remove"></span> Отхвърлям</button></a>';
    echo '</div>';
    PrintAccountInfoByUSERNAME($WaitingUsername[0], 1);
    //echo '<div class="panel-footer">'.$row[2].'</div>';
    //echo $row[0];
    //echo $row[1];
    //echo $row[2];
    //echo $row[3];
}
Exemple #19
0
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
?>

	<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">
<?php 
$date = mysql_real_escape_string($_POST['date1']);
$date1 = date('Y-m-d', strtotime($date));
$date = mysql_real_escape_string($_POST['date2']);
$date2 = date('Y-m-d', strtotime($date));
$SQL = "SELECT COUNT(schoolyear.USERID) FROM schoolyear, user WHERE schoolyear.USERID = " . Get_Logged_users_id();
$MyResult = mysql_query($SQL);
$ThereIsAlreadySchoolyear = mysql_fetch_array($MyResult);
//echo $ThereIsAlreadySchoolyear[0];
if ($ThereIsAlreadySchoolyear[0] > 0) {
    $SQL = "UPDATE schoolyear SET Start = '" . $date1 . "', Final = '" . $date2 . "' WHERE schoolyear.USERID = " . Get_Logged_users_id();
} else {
    $SQL = "INSERT INTO schoolyear (USERID, Start, Final) VALUES (" . Get_Logged_users_id() . ", '" . $date1 . "', '" . $date2 . "')";
}
$MyInsertionResult = mysql_query($SQL);
echo "<p>Успешно актуализиране на диапазона</p>";
?>
		
	</div>

</div>
Exemple #20
0
 $day = $_POST["day"];
 $hours = $_POST["hours"];
 $mins = $_POST["mins"];
 $subjects = $_POST["subjects"];
 $info = $_POST["info"];
 $classesArray = array();
 //print_r($hours);
 $classesArray["WEEK"] = $week;
 $classesArray["DAY"] = $day;
 for ($counter = 0; $counter < sizeof($hours); $counter++) {
     $classesArray["HOURS"][$counter] = $hours[$counter] . ":" . $mins[$counter];
 }
 $classesArray["SUBJECTS"] = $subjects;
 $classesArray["INFO"] = $info;
 include "some_external_phps/add_curriculum.php";
 AddCurriculum(Get_Logged_users_id(), $classesArray);
 // $SQL = "INSERT INTO class (time, subject, info) VALUES ('".$time1."', '".$subject1."', '".$info1."')";
 // echo $SQL;
 // $result = mysql_query($SQL);
 // $uid = mysql_insert_id();
 // echo $uid;
 // //echo $row[0];
 // $CLASSUIDS = array($uid);
 // $SQL = "INSERT INTO class (time, subject, info) VALUES ('".$time2."', '".$subject2."', '".$info2."')";
 // $result = mysql_query($SQL);
 // $uid = mysql_insert_id();
 // //echo $row[0];
 // array_push($CLASSUIDS, $uid);
 // $SQL = "INSERT INTO class (time, subject, info) VALUES ('".$time3."', '".$subject3."', '".$info3."')";
 // $result = mysql_query($SQL);
 // $uid = mysql_insert_id();
<?php 
session_start();
echo '<html lang="en" class="no-js">';
include "head.php";
include "config.php";
include "start_check.php";
// if ($_SESSION['page'] != 'check_width'){
// header('Location: check_width_and_send_to.php?user='******'&page='.$current_page_is) and exit;
// }
$_SESSION['page'] = "other";
?>
<body>
<div class="container">
<?php 
include "main_menu.php";
RefuseRequest($_GET["userid"], Get_Logged_users_id());
$userinfo = ReturnALLUserInfoByIdOrByName("", $_GET["userid"]);
?>

<div id = "my_page" style = "background: rgba(243, 243, 243, 0.4);">

	<h1 id = "urlTitleForm">Поканата на <?php 
echo $userinfo["FirstName"] . " " . $userinfo["LastName"];
?>
 е отхвърлена успешно.</h1>

</div>

</body>