Esempio n. 1
0
function addPlayer()
{
    include_once "./model/player.php";
    $player = new Player();
    //upload picture here
    $picture = uploadPicture("./images/players", "player_picture");
    $name = $_REQUEST['name'];
    $birth = $_REQUEST['birth'];
    $division = $_REQUEST['division'];
    $position = $_REQUEST['position'];
    $about = $_REQUEST['about'];
    $signed = $_REQUEST['signed'];
    include "../../model/player.php";
    $player = new player();
    if (!$player->add_player($name, $birth, $division, $position, $about, $signed, $picture)) {
        echo 'problem adding player, try again later';
        return;
    }
    echo '' . $name . ' has been added successfully';
}
Esempio n. 2
0
function main()
{
    init();
    switch ($GLOBALS['req']['a']) {
        case 'getSongs':
            connect();
            display('songs', getSongs());
            break;
        case 'getSongsMin':
            connect();
            display('songsMin', getSongsMin());
            break;
        case 'add100':
            add100();
            display('done', 0);
            break;
        case 'getMembers':
            connect();
            display('members', getMembers());
            break;
        case 'validate':
            display('valid', validate($GLOBALS['req']['text']));
            break;
        case 'addMember':
            connect();
            addMember();
            break;
        case 'getNewImageName':
            connect();
            display('done', getNewImageName());
            break;
        case 'uploadPicture':
            connect();
            uploadPicture();
            break;
    }
    echo json_encode($GLOBALS['final_print']);
    disconnect();
}
Esempio n. 3
0
 //Neue Bild-Folie wird gespeichert//
 ////////////////////////////////////
 case 6:
     //Werte abfangen und in Variablen speichern
     $startZeit = formatiereZeitDE2SQL($_POST['startZeit']);
     $endZeit = formatiereZeitDE2SQL($_POST['endZeit']);
     $bild_name = $_FILES['bild']['name'];
     $adminID = $_SESSION['adminID'];
     //Falls der Termin in der Vergangenheit liegt
     if ($endZeit > $now) {
         //Falls die Endzeit nach der Startzeit ist
         if ($startZeit < $endZeit) {
             //Prüfen, ob die Zeiten in der Datenbank bereits besetzt sind
             if (checkBetween($startZeit, $endZeit)) {
                 //Falls das Bild fehlerfrei auf dem Server gespeichert wurde
                 if (uploadPicture()) {
                     $bild_location = $_SESSION['bild_location'];
                     $sql = "INSERT INTO folie(`dateTimeVon`, `dateTimeBis`, `strPath`, `intAdmin_ID`, `intTemplate_ID`) VALUES('{$startZeit}','{$endZeit}','{$bild_location}', '{$adminID}','0')";
                     $result = $db->query($sql);
                     if ($result) {
                         //Folie wurde erfolgreich gespeichert
                         $message = 1;
                     }
                 } else {
                     $message = 5;
                 }
             } else {
                 //Die Zeigt ist bereits belegt
                 $message = 8;
             }
         } else {
    $id = $_SESSION["id"];
    $table = new employerTable($connection);
    $employer = $table->findById($id);
    if (isset($_POST['submit'])) {
        $company = filter_var($_POST['company'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $fName = filter_var($_POST['fName'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $lName = filter_var($_POST['lName'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $email = filter_var($_POST['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $location = filter_var($_POST['location'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $bio = filter_var($_POST['bio'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $password = filter_var($_POST['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
        $picture = $_FILES['picture'];
        if ($picture === null) {
            $picture = $employer->getPicture();
        } else {
            $picture = uploadPicture($picture);
        }
    }
} catch (PDOException $e) {
    $connection = null;
    exit("Connection failed: " . $e->getMessage());
}
?>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/960_16_col.css">
        <link rel="stylesheet" href="css/pageStyle.css">
        <link rel="stylesheet" href="css/bootstrap.css">
Esempio n. 5
0
function updateStudent($ID, $rollno, $grno, $firstname, $lastname, $Fname, $Mname, $address, $phone_stu, $phone_father, $phone_mother, $phone_other, $BatchObj, $picture, $activeflag, $userid, $comment, $actid, $ClassObj, $loginflag, $gender, $dateofbirth, $hscno, $cetno, $college, $email, $dateofadmission, $board10, $agg10, $ms10, $comment)
{
    $conn = getConnection();
    $picurl = uploadPicture($picture);
    $Obj = getStudent($ID, 0);
    $flag1 = false;
    $flag2 = false;
    if ($Obj->getPhoneFather() != $phone_father) {
        $flag1 = true;
    }
    if ($Obj->getPhoneStu() != $phone_stu) {
        $flag2 = true;
    }
    if ($activeflag == 0) {
        removeStudentFromMainTable($Obj->getMainID());
        $Obj->setActiveFlag(trim($activeflag));
        $result = $Obj->update();
        $message = "Student Deletion Succeeded : " . $Obj->getName();
        return $message;
    }
    if ($flag1) {
        updateMainFatherNumber($Obj->getMainID(), $phone_father);
    }
    if ($flag2) {
        updateMainStudentNumber($Obj->getMainID(), $phone_stu);
    }
    if ($picurl == '') {
        $picurl = $Obj->getPicUrl();
    }
    $Obj->setRollNo(trim($rollno));
    $Obj->setGRno(trim($grno));
    $Obj->setFirstName(trim($firstname));
    $Obj->setLastName(trim($lastname));
    $Obj->setMname(trim($Mname));
    $Obj->setFname(trim($Fname));
    $Obj->setPicUrl(trim($picurl));
    $Obj->setAddress(trim($address));
    $Obj->setPhoneStu(trim($phone_stu));
    $Obj->setPhoneFather(trim($phone_father));
    $Obj->setPhoneMother(trim($phone_mother));
    $Obj->setPhoneOther(trim($phone_other));
    //$Obj->setBatchObj($BatchObj);
    $Obj->setPicUrl($picurl);
    $Obj->setActiveFlag(trim($activeflag));
    $Obj->setLastEditedBy(trim($userid));
    $Obj->setComments(trim($comments));
    $Obj->setActid(trim($actid));
    //$Obj->setClassObj($ClassObj);
    $Obj->setLoginFlag(trim($loginflag));
    $Obj->setGender(trim($gender));
    $Obj->setDateOfBirth(trim($dateofbirth));
    $Obj->setHscNo(trim($hscno));
    $Obj->setCetNo(trim($cetno));
    $Obj->setCollege(trim($college));
    $Obj->setEmail(trim($email));
    $Obj->setDateOfAdmission(trim($dateofadmission));
    $Obj->setBoard10(trim($board10));
    $Obj->setAggregate10(trim($agg10));
    $Obj->setMathsScience10(trim($ms10));
    $Obj->setComments(trim($comment));
    $result = $Obj->update();
    if ($result) {
        $message = "Student Updated Successfully :" . $Obj->getName();
    } else {
        $message = "Student Updation Failed : " . $Obj->getName();
    }
    return $message;
}
Esempio n. 6
0
	}
	 #submit{
        margin-top:20px;
        border:1px solid #CCCCCC;
        padding:5px 10px;
        background-color:#00A65A;
        color:#ccc;
        border-radius: 3px;
  
    }
	</style>
	<link rel="stylesheet" href="js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css" id="style-resource-1">
	<link rel="stylesheet" href="css/font-icons/entypo/css/entypo.css" id="style-resource-2">
	<link rel="stylesheet" href="css/bootstrap-min.css" id="style-resource-4">
	<link rel="stylesheet" href="css/neon-core-min.css" id="style-resource-5">
	<link rel="stylesheet" href="css/neon-theme-min.css" id="style-resource-6">
	<link rel="stylesheet" href="css/neon-forms-min.css" id="style-resource-7">
	<link rel="stylesheet" href="css/custom-min.css" id="style-resource-8">
	
	
	<script type=text/javascript src="js/jquery-2.1.0.min.js"></script>
 
</head>
<body class="body" >
<?php 
    uploadPicture();
    ?>
</body>
</html>
<?php 
}
Esempio n. 7
0
$time = time();
		      $imagename = $_FILES['new_image']['name'];
              $source = $_FILES['new_image']['tmp_name'];
              $target = $location."".$imagename;
//$video_result = add_video($name, $description, '3');

	db_connect();
	$res = mysql_query("SELECT * FROM users 
							WHERE (email = '$ud_email' AND id != '$ud_id') 
							OR (uname = '$ud_username' AND id != '$ud_id')");
		if (mysql_num_rows($res) > 0)
			do_form_message("User already exists", $error);
		else{
		
			if (is_uploaded_file ($_FILES['new_image']['tmp_name'])){
					uploadPicture($source, $imagename, $newtitle, $location, $time);			
	
					db_connect();
					$updateRes = mysql_query("UPDATE users SET lname = '$ud_lname', fname = '$ud_fname', email = '$ud_email', uname = '$ud_username',
												access_level = '$ud_access_level', user_alias = '$ud_user_alias'
												WHERE id = '$ud_id'");
															
					if ($updateRes){
						$ext = getExtension($imagename);
						$saveImageAs = $localPath.''.$time.'.'.$ext;
	
						db_connect();
						$updateRes = mysql_query("UPDATE users SET profile_pic = '$saveImageAs' WHERE id = '$ud_id'");
						do_form_message("Photo Saved", "success");
						}
					else