Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <script src="/scripts/jquery.timepicker.min.js"></script>
- <link rel="stylesheet" href="/scripts/jquery.timepicker.css">
- <script>
- $(function() {
- $( "#startDate" ).datepicker({
- dateFormat: 'yy-mm-dd',
- altField: '#endDate',
- altFormat: 'yy-mm-dd'
- });
- $( "#endDate" ).datepicker({
- dateFormat: 'yy-mm-dd'
- });
- });
- $(document).ready(function(){
- $('#startTime').timepicker({
- 'step': 15,
- 'timeFormat': 'h:i A',
- 'scrollDefault': '4:00 PM'
- });
- $('#endTime').timepicker({
- 'step': 15,
- 'timeFormat': 'h:i A',
- 'scrollDefault': '4:00 PM'
- });
- });
- </script>
- <?php
- include '/var/www/vhosts/tamuphysics.com/dbauth/auth.php';
- include '/var/www/vhosts/tamuphysics.com/dbauth/cst-library.php';
- $con=mysqli_connect("localhost","directoryreader",$directoryreader,"directory");
- // Check connection
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- function runSQL($con, $sql){
- if (!mysqli_query($con, $sql)) {
- die('Error: ' . mysqli_error($con));
- }
- else{
- return "Query successfully submitted!";
- }
- }
- // GET USER ID FROM PERSON VIEWING
- $current_user = wp_get_current_user();
- $userid = $current_user->user_login;
- //$userid = "hezhe2110509010";
- //GET ldapID
- $lookupresult1 = mysqli_query($con,"SELECT ldapID FROM deptFaculty WHERE isActive=1 AND `UID`='$userid'");
- while($row = mysqli_fetch_array($lookupresult1))
- {
- $ldapID = $row['ldapID'];
- }
- $lookupresult2 = mysqli_query($con,"SELECT ldapID FROM deptResearcher WHERE isActive=1 AND `UID`='$userid'");
- while($row = mysqli_fetch_array($lookupresult2))
- {
- $ldapID = $row['ldapID'];
- }
- $lookupresult3 = mysqli_query($con,"SELECT ldapID FROM deptGraduate WHERE isActive=1 AND `UID`='$userid'");
- while($row = mysqli_fetch_array($lookupresult3))
- {
- $ldapID = $row['ldapID'];
- }
- //echo $ldapID;
- if(!empty($ldapID) OR in_array($userid, $groupmiadmins))
- {
- $con=mysqli_connect("localhost","calendarreader",$calendarreader,"calendars");
- //SECTION FOR BUTTON
- if(isset($_POST['submit']))
- {
- //echo '<script type="text/javascript">alert("inside submit"); </script>';
- if(empty($_POST['title']) or empty($_POST['location']) or empty($_POST['startDate']))
- {
- echo "<div class='row' ><div class='alert-box alert centered' >One or more of the fields were left blank. Please try again.</div></div>";
- }
- else
- {
- //get proper count variable for each userid to we can call the correct dropdown and get the value
- if($userid=="tim" OR $userid=="kbon080" OR $userid=="timmah" OR $userid=="allen" OR $userid="jonathan.perry.9" OR $userid="hwalker" OR $userid="aetaylor")
- {
- $count=0;
- }
- elseif(in_array($userid, $groupmiadmins))
- {
- $count=1;
- }
- elseif(in_array($userid,$groupphysadmins) OR $userid=="msylvester")
- {
- $count=2;
- }
- elseif($userid=="etanya")
- {
- $count=3;
- }
- elseif($userid=="tony_shutov" OR $userid=="sashaa")
- {
- $count=4;
- }
- elseif($userid=="rapp" OR $userid=="rjfries")
- {
- $count=5;
- }
- elseif($userid=="abanov")
- {
- $count=6;
- $abstract = $_POST['abstract'];
- $hostedBy = $_POST['hostedBy'];
- }
- elseif($userid=="test")
- {
- $count=7;
- }
- elseif($userid=="welch")
- {
- $count=8;
- }
- //get values from form
- $event = $_POST[$count];
- $eventTitle = sanitizeUserInput($_POST['title']);
- $startDate = $_POST['startDate'];
- $endDate = $_POST['endDate'];
- $description = $_POST['description'];
- $startTime = $_POST['startTime'];
- $endTime = $_POST['endTime'];
- $description = sanitizeUserInput($_POST['description']);
- $location = sanitizeUserInput($_POST['location']);
- if($event == "Theory Seminars") {
- $event = "HET Seminars";
- }
- echo $event;
- //CHECK IF DUPLICATE ENTRY
- $checkDuplicate = mysqli_query($con,"SELECT * FROM `$event` WHERE `eventTitle`='$eventTitle' AND `startDate`='$startDate' AND `startTime`='$startTimeFormat'");
- $checkDuplicateCount = mysqli_num_rows($checkDuplicate);
- if($checkDuplicateCount != 0)
- {
- //POPUP BOX showing duplicate entry
- echo "<div class='row'>"; //start of div row
- echo "<div class='alert-box alert' >"; //start of popup box upon duplicate entry
- echo "There already exists an entry with that information. Thank you!";
- echo "</div>"; //close popup box
- echo "</div>"; //close div row
- }
- else
- {
- //find the next incriment of index and assign variable
- $findNextIndex = mysqli_query($con,"SELECT calendarIndex FROM `$event` ORDER BY calendarIndex DESC LIMIT 1");
- while($row = mysqli_fetch_array($findNextIndex))
- {
- $nextIndex = $row['calendarIndex'] + 1;
- }
- //POPUP BOX ASKING TO CONFIRM SUBMISSION
- echo "<div class='row'>"; //start of div row
- echo "<div class='alert-box success' >"; //start of popup box upon successfull sql input
- echo "Please confirm your submission: <ul class='nobull'>"; //popout box content
- echo "<li>Title: $eventTitle </li>";//popout box content
- echo "<li>Description: $description </li>";//popout box content
- echo "<li>Calendar: $event </li>";
- echo "<li>Start date / End date: " . $startDate . " / " . $endDate . "</li>";//popout box content
- echo "<li>Start time / End time: " . $startTime . " / " . $endTime . "</li>";//popout box content
- echo "<li>Location: $location </li>";//popout box content
- if($abstract AND $hostedBy)
- {
- echo "<li>Abstract: $abstract </li>";//popout box content
- echo "<li>Host: $hostedBy </li>";//popout box content
- }
- echo "</ul>";
- //section for submit button
- echo "<form method='POST' action='' class='' name='confirmation'>"; //create new form for submit button
- echo "<div class='row'>";
- echo "<div class='medium-2 medium-offset-3 columns'>"; //position the button
- echo "<input type='submit' class='button' value='Cancel' name='cancel' >"; //cancel button
- echo "</div>";
- echo "<div class='medium-2 columns end'>"; //position the button
- echo "<input type='submit' class='button' value='Modify' name='modify' >"; //modify button
- echo "</div>";
- echo "<div class='medium-2 columns end'>"; //position the button
- echo "<input type='submit' class='button' value='Confirm' name='confirm' >"; //confirm button
- //section of hidden variables that we will use to assign variables inside of the second if(issset($_POST))
- echo "<input type='hidden' name='organization' value='$event'>";
- echo "<input type='hidden' name='eventTitle' value='$eventTitle'>";
- echo "<input type='hidden' name='startDate' value='$startDate'>";
- echo "<input type='hidden' name='endDate' value='$endDate'>";
- echo "<input type='hidden' name='startTime' value='$startTime'>";
- echo "<input type='hidden' name='endTime' value='$endTime'>";
- echo "<input type='hidden' name='description' value='$description'>";
- echo "<input type='hidden' name='location' value='$location'>";
- echo "<input type='hidden' name='index' value='$nextIndex'>";
- echo "<input type='hidden' name='host' value='$host'>";
- echo "<input type='hidden' name='hostedBy' value='$hostedBy'>";
- echo "<input type='hidden' name='abstract' value='$abstract'>";
- echo "</div>"; //close position
- echo "</div>"; //close row
- echo "</form>"; //close form
- echo "</div>"; //close popup box
- echo "</div>"; //close div row
- $onlyoneform =1; //variable to make sure that only one version of the form shows up
- }
- }
- }
- if(isset($_POST['confirm'])) //after they hit confirm or cancel from popup box
- {
- //assign varaibles from the hidden section above
- $event = $_POST['organization'];
- $eventTitle = $_POST['eventTitle'];
- $startDate = $_POST['startDate'];
- $endDate = $_POST['endDate'];
- $description = $_POST['description'];
- $location = $_POST['location'];
- $nextIndex = $_POST['index'];
- $host = $_POST['host'];
- $hostedBy = $_POST['hostedBy'];
- $abstract = $_POST['abstract'];
- $startTimeFormat = date_format(date_create($_POST['startTime']), 'G:i:s'); //reformat start time to 24 hr
- $endTimeFormat = date_format(date_create($_POST['endTime']), 'G:i:s'); //reformat end time to 24 hr
- if($event=="Colloquium")
- {
- $inputEvent = "INSERT INTO `$event` (`calendarIndex`,`eventTitle`,`startDate`,`endDate`,`startTime`,`endTime`,`description`,`location`,`poster`,`hostedBy`) VALUES ('$nextIndex','$eventTitle','$startDate','$endDate','$startTimeFormat','$endTimeFormat','$description','$location','','$host')";
- $con=mysqli_connect("localhost","calendarwriter",$calendarwriter,"calendars");
- runSQL($con,$inputEvent);
- }
- elseif($event=="Condensed Matter")
- {
- $inputEvent = "INSERT INTO `$event` (`calendarIndex`,`eventTitle`,`startDate`,`endDate`,`startTime`,`endTime`,`description`,`location`,`abstract`,`hostedBy`) VALUES ('$nextIndex','$eventTitle','$startDate','$endDate','$startTimeFormat','$endTimeFormat','$description','$location','$abstract','$hostedBy')";
- $con=mysqli_connect("localhost","calendarwriter",$calendarwriter,"calendars");
- runSQL($con,$inputEvent);
- }
- else
- {
- $inputEvent = "INSERT INTO `$event` (`calendarIndex`,`eventTitle`,`startDate`,`endDate`,`startTime`,`endTime`,`description`,`location`) VALUES ('$nextIndex','$eventTitle','$startDate','$endDate','$startTimeFormat','$endTimeFormat','$description','$location')";
- $con=mysqli_connect("localhost","calendarwriter",$calendarwriter,"calendars");
- runSQL($con,$inputEvent);
- }
- //popup boxing telling user the submission was successfully submitted
- echo "<div class='row'>"; //start of div row
- echo "<div class='alert-box success' >"; //start of popup box upon successfull sql input
- echo "Thank you for your submission!";
- echo "</div>"; //close alert box
- echo "</div>"; //close div row
- }
- elseif(isset($_POST['modify'])) //if modify is selected, want to reproduce the form but with the values that were put in the first time.
- {
- //assign variable from hidden field inside of "confirmation box"
- $event = $_POST['organization'];
- $eventTitle = $_POST['eventTitle'];
- $startDate = $_POST['startDate'];
- $endDate = $_POST['endDate'];
- $description = $_POST['description'];
- $location = $_POST['location'];
- $startTime = $_POST['startTime'];
- $endTime = $_POST['endTime'];
- $host = $_POST['host'];
- $hostedBy = $_POST['hostedBy'];
- $abstract = $_POST['abstract'];
- echo "<form method='POST' action='' class='' name='form'>";
- echo "<div class='row'>";
- //SECTION FOR Title
- echo "<div class='medium-12 columns'>";
- echo "<label>Title of Event: \n";
- echo "<input type='text' name='title' value='$eventTitle' />";
- echo "</label></div>";
- echo "</div>";
- echo "<div class='row'>";
- //SECTION FOR DESCRIPTION
- echo "<div class='medium-12 columns'>";
- echo "<label>Description: \n";
- echo "<input type='text' name='description' value='$description' />";
- echo "</label></div>";
- echo "</div>";
- if($userid=="abanov")
- {
- echo "<div class='row'>";
- //SECTION FOR ABSTRACT
- echo "<div class='medium-12 columns'>";
- echo "<label>Abstract: \n";
- echo "<input type='text' name='abstract' value='$abstract' />";
- echo "</label></div>";
- echo "</div>";
- }
- echo "<div class='row'>";
- //SECTION FOR START DATE
- echo "<div class='medium-3 columns'>";
- echo "<label>Start Date: \n";
- echo "<input type='text' id='startDate' name='startDate' value='$startDate' size='30'>";
- echo "</label></div>";
- //SECTION FOR END DATE
- echo "<div class='medium-3 columns'>";
- echo "<label>End Date: \n";
- echo "<input type='text' id='endDate' name='endDate' value='$endDate' size='30'>";
- echo "</label></div>";
- //SECTION FOR START TIME
- echo "<div class='medium-2 columns end'>";
- echo "<label>Start Time: \n";
- echo "<input type='text' id='startTime' name='startTime' value='$startTime' size='30'>";
- echo "</label></div>";
- //SECTION FOR END TIME
- echo "<div class='medium-2 columns end'>";
- echo "<label>End Time: \n";
- echo "<input type='text' id='endTime' name='endTime' value='$endTime' size='30'>";
- echo "</label></div>";
- if($userid=="abanov")
- {
- //SECTION FOR hosted By
- echo "<div class='medium-2 columns end'>";
- echo "<label>Host: \n";
- echo "<input type='text' name='hostedBy' value='$hostedBy'>";
- echo "</label></div>";
- }
- echo "</div>";
- echo "<div class='row'>";
- //SECTION FOR LOCATION
- echo "<div class='medium-5 columns end'>";
- echo "<label>Location: \n";
- echo "<input type='text' name='location' value='$location' />";
- echo "</label></div>";
- if($userid=="tim" OR $userid=="kbon080" OR $userid=="timmah" OR $userid=="allen" OR $userid="jonathan.perry.9" OR $userid="hwalker" OR $userid="aetaylor")
- {
- $count=0;
- $Group = array("Atomic Molecular and Optical" => "Atomic Molecular and Optical", "astronomy seminar" => "astronomy seminar", "Colloquium" => "Colloquium",
- "condensed matter seminar" => "condensed matter seminar", "Cyclotron Institute colloquium" => "Cyclotron Institute colloquium", "DEEP showcase" => "DEEP showcase",
- "grad student seminar" => "grad student seminar", "HEPEC seminar" => "HEPEC seminar", "high energy theory seminar" => "high energy theory seminar",
- "Just Add Science" => "Just Add Science", "mathematical physics seminar" => "mathematical physics seminar", "mock lecture" => "mock lecture", "nuclear theory seminar" => "nuclear theory seminar",
- "OSA" => "OSA", "Physics and Engineering Festival" => "Physics and Engineering Festival", "Physics Show" => "Physics Show", "Star Party"=>"Star Party");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif(in_array($userid, $groupmiadmins))
- {
- $count=1;
- $Group = array("Astronomy Seminar" => "Astronomy Seminars", "HEPEC Seminar" => "HEPEC Seminars",
- "HET Seminar"=>"HET Seminars", "Institute Meeting" => "Institute Meetings", "MI Scientific Event" => "MI Scientific Events",
- "REU" => "REU", "Star Parties"=>"Star Parties" );
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif(in_array($userid,$groupphysadmins) OR $userid=="msylvester")
- {
- $count=2;
- $Group = array("Mathematical Physics" => "Mathematical Physics","Harmonic Analysis"=>"Harmonic Analysis","Differential Equations Seminar"=>"Differential Equations Seminar");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="etanya")
- {
- $count=3;
- $Group = array("Just Add Science" => "Just Add Science","Grad Student Seminar"=>"Grad Student Seminars","Physics Show"=>"Physics Show");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="tony_shutov" OR $userid=="sashaa")
- {
- $count=4;
- $Group = array("OSA" => "OSA");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="rapp" OR $userid=="rjfries")
- {
- $count=5;
- $Group = array("Nuclear Theory" => "Nuclear Theory","Colloquium"=>"Colloquium");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="abanov")
- {
- $count=6;
- $Group = array("Condensed Matter" => "Condensed Matter", "Cyclotron Colloquium"=>"Cyclotron Colloquium");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="hwalker")
- {
- $count=7;
- $Group = array("Mathematical Physics" => "Mathematical Physics", "Harmonic Analysis"=>"Harmonic Analysis","Differential Equations Seminars"=>"Differential Equations Seminars");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="welch")
- {
- $count=8;
- $Group = array("Atomic Molecular and Optical" => "Atomic Molecular and Optical", "Quantum Optics Seminars"=>"Quantum Optics Seminars");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- if($value==$event)
- {
- $dropdown .= '<option value="'.$value.'" selected >'.$key.'</option>';
- }
- else
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- //SECTION FOR SUBMIT
- echo "<div class='medium-2 columns end' >";
- echo "<input type='submit' class='button' value='Submit Event' style='top: 10px;' name='submit' >";
- echo "</div>";
- echo "</div>";
- echo "</form>";
- $onlyoneform =1; //variable to make sure that only one version of the form shows up
- }
- //check to make sure it only displays one version of the form
- if($onlyoneform!=1)
- {
- $con=mysqli_connect("localhost","calendarreader",$calendarreader,"calendars");
- echo "<form method='POST' action='' class='' name='form'>";
- echo "<div class='row'>";
- //SECTION FOR TITLE
- echo "<div class='medium-12 columns'>";
- echo "<label>Title of Event: \n";
- echo "<input type='text' name='title' value='' />";
- echo "</label></div>";
- echo "</div>";
- echo "<div class='row'>";
- //SECTION FOR DESCRIPTION
- if($userid!="etanya")
- {
- echo "<div class='medium-12 columns'>";
- echo "<label>Description: \n";
- echo "<input type='text' name='description' placeholder='Short Description of the Event' />";
- echo "</label></div>";
- }
- echo "</div>";
- if($userid=="abanov")
- {
- echo "<div class='row'>";
- //SECTION FOR ABSTRACT
- echo "<div class='medium-12 columns'>";
- echo "<label>Abstract: \n";
- echo "<input type='text' name='abstract' value='' />";
- echo "</label></div>";
- echo "</div>";
- }
- echo "<div class='row'>";
- //SECTION FOR START DATE
- echo "<div class='medium-3 columns'>";
- echo "<label>Start Date: \n";
- echo "<input type='text' id='startDate' name='startDate' size='30'>";
- echo "</label></div>";
- //SECTION FOR END DATE
- echo "<div class='medium-3 columns'>";
- echo "<label>End Date: \n";
- echo "<input type='text' id='endDate' name='endDate' size='30'>";
- echo "</label></div>";
- //SECTION FOR START TIME
- echo "<div class='medium-2 columns end'>";
- echo "<label>Start Time: \n";
- echo "<input type='text' id='startTime' name='startTime' size='30'>";
- echo "</label></div>";
- //SECTION FOR START TIME
- echo "<div class='medium-2 columns end'>";
- echo "<label>End Time: \n";
- echo "<input type='text' id='endTime' name='endTime' size='30'>";
- echo "</label></div>";
- if($userid=="abanov")
- {
- //SECTION FOR hosted By
- echo "<div class='medium-2 columns end'>";
- echo "<label>Host: \n";
- echo "<input type='text' name='hostedBy' value=''>";
- echo "</label></div>";
- }
- echo "</div>";
- echo "<div class='row'>";
- //SECTION FOR LOCATION
- echo "<div class='medium-5 columns end'>";
- echo "<label>Location: \n";
- if($userid=="abanov")
- {
- echo "<input type='text' name='location' value='MIST M102' />";
- } else {
- echo "<input type='text' name='location' placeholder='i.e. Hawking Auditorium, MPHY 103' />";
- }
- echo "</label></div>";
- //SECTION FOR GROUP
- $con=mysqli_connect("localhost","directoryreader",$directoryreader,"directory"); //set connection to directory
- $queryMistGroup = mysqli_query($con,"SELECT mistGroup FROM deptMistGroup WHERE ldapID='$ldapID' LIMIT 1"); //query to get which group the mitchell faculty member is in
- $fetchMistGroup = mysqli_fetch_array($queryMistGroup);//fetch array
- $mistGroup = $fetchMistGroup['mistGroup']; //use this variable to assign additional options for appropriate members
- if($userid=="tim" OR $userid=="kbon080" OR $userid=="timmah" OR $userid=="allen" OR $userid="jonathan.perry.9" OR $userid="hwalker" OR $userid="aetaylor")
- {
- $count=0;
- $Group = array("Atomic Molecular and Optical" => "Atomic Molecular and Optical", "astronomy seminar" => "astronomy seminar", "Colloquium" => "Colloquium",
- "condensed matter seminar" => "condensed matter seminar", "Cyclotron Institute colloquium" => "Cyclotron Institute colloquium", "DEEP showcase" => "DEEP showcase",
- "grad student seminar" => "grad student seminar", "HEPEC seminar" => "HEPEC seminar", "high energy theory seminar" => "high energy theory seminar",
- "Just Add Science" => "Just Add Science", "mathematical physics seminar" => "mathematical physics seminar", "mock lecture" => "mock lecture", "nuclear theory seminar" => "nuclear theory seminar",
- "OSA" => "OSA", "Physics and Engineering Festival" => "Physics and Engineering Festival", "Physics Show" => "Physics Show", "Star Party"=>"Star Party");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif(in_array($userid, $groupmiadmins))
- {
- $count=1;
- $Group = array("Astronomy Seminar" => "Astronomy Seminars", "HEPEC Seminar" => "HEPEC Seminars",
- "HET Seminar"=>"HET Seminars", "Institute Meeting" => "Institute Meetings", "MI Scientific Event" => "MI Scientific Events",
- "REU" => "REU", "Star Parties"=>"Star Parties" );
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- echo $count;
- unset($Group);
- }
- elseif(in_array($userid,$groupphysadmins) OR $userid=="msylvester")
- {
- $count=2;
- $Group = array("Mathematical Physics" => "Mathematical Physics","Harmonic Analysis"=>"Harmonic Analysis","Differential Equations Seminar"=>"Differential Equations Seminar");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="etanya")
- {
- $count=3;
- $Group = array("Just Add Science" => "Just Add Science","Grad Student Seminar"=>"Grad Student Seminars","Physics Show"=>"Physics Show");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="tony_shutov" OR $userid=="sashaa")
- {
- $count=4;
- $Group = array("OSA" => "OSA");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="rapp" OR $userid=="rjfries")
- {
- $count=5;
- $Group = array("Nuclear Theory" => "Nuclear Theory","Colloquium"=>"Colloquium");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="abanov")
- {
- $count=6;
- $Group = array("Condensed Matter" => "Condensed Matter");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="hwalker")
- {
- $count=7;
- $Group = array("Mathematical Physics" => "Mathematical Physics", "Harmonic Analysis"=>"Harmonic Analysis","Differential Equations Seminars"=>"Differential Equations Seminars");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- elseif($userid=="welch")
- {
- $count=8;
- $Group = array("Atomic Molecular and Optical" => "Atomic Molecular and Optical", "Quantum Optics Seminars"=>"Quantum Optics Seminars");
- echo "<div class='medium-4 columns end'>";
- echo "<label>Calendar: <select id='organization' name='$count'>\n";
- foreach($Group as $key=>$value)
- {
- $dropdown .= '<option value="'.$value.'" >'.$key.'</option>';
- }
- echo $dropdown;
- echo "</select></label></div>";
- unset($Group);
- }
- //SECTION FOR SUBMIT
- echo "<div class='medium-2 columns end' >";
- echo "<input type='submit' class='button' value='Submit Event' style='top: 10px; margin-top: 25px;' name='submit' >";
- echo "</div>";
- echo "</form>";
- }
- }
- else
- {
- echo "You are not eligible to sumit an event. If this is an error, email Kyle Bonar at kbon080@tamu.edu .";
- }
- ?>
- <script>
- var startDate = document.getElementById("startDate");
- var endDate = document.getElementById("endDate");
- var startTime = document.getElementById("startTime");
- var endTime = document.getElementById("endTime");
- if (startDate)
- {
- startDate.addEventListener("input", function(){
- if(startDate.value.length>=10)
- {
- startDate.value = startDate.value.substring(0,10);
- }
- });
- }
- if (endDate)
- {
- endDate.addEventListener("input", function(){
- if(endDate.value.length>=10)
- {
- endDate.value = endDate.value.substring(0,10);
- }
- });
- }
- if (startTime)
- {
- startTime.addEventListener("input", function(){
- if(startTime.value.length>=8)
- {
- startTime.value = startTime.value.substring(0,8);
- }
- });
- }
- if (endTime)
- {
- endTime.addEventListener("input", function(){
- if(endTime.value.length>=8)
- {
- endTime.value = endTime.value.substring(0,8);
- }
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement