function fetchRaid() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $raidShort = $_GET['raid']; $raidPrep = $callDB->db->prepare("SELECT * FROM raid_archive WHERE short = :raid"); $raidPrep->execute(array('raid' => $raidShort)); //Result $raid = $raidPrep->fetch(PDO::FETCH_ASSOC); //Split raid Modes apart $raidModeseperator = '/,\\s*/'; $raidModes = preg_split($raidModeseperator, $raid['modes']); $this->raidModes = array(); foreach ($raidModes as $rSize) { $this->raidModes[] = $rSize; } //Split boss names apart $bossSeperator = '/,\\s*/'; $bossNames = preg_split($bossSeperator, $raid['bossNames']); $this->bosses = array(); foreach ($bossNames as $boss) { $this->bosses[] = $boss; } header('Content-Type: application/json'); echo json_encode(array("success" => 'true', "short" => $raid['short'], "fullname" => $raid['fullname'], "modes" => $this->raidModes, "xpac" => $raid['xpac'], "xpacNum" => $raid['xpacNum'], "tier" => $raid['tier'], "reqLevel" => $raid['reqLevel'], "bossCountN" => $raid['bossCountN'], "bossCountH" => $raid['bossCountH'], "bossNames" => $this->bosses), JSON_PRETTY_PRINT); }
private function check_queue() { Logger::log('Mailer', 0, 'Mailer queue >> Checking from ;mailqueue; table..'); $callDB = new PGSdb(); $callDB->connDB(); $fetchQueuedMail = $callDB->db->prepare("SELECT * FROM mailqueue WHERE status = 0 LIMIT 10"); $fetchQueuedMail->execute(); //Result $this->queue['items'] = $fetchQueuedMail->fetchAll(PDO::FETCH_ASSOC); $this->queue['queued'] = $fetchQueuedMail->rowCount(); Logger::log('Mailer', 0, 'Items in fetched queue (max:10): ' . $this->queue['queued']); if ($this->queue['queued'] >= 1) { foreach ($this->queue['items'] as $email) { // Run email validate $verifiedEmail = $this->validateEmail($email['addr']); if ($verifiedEmail) { Logger::log('Mailer', 0, 'Valid email ( ' . $verifiedEmail . ' ) >> True !'); // Prep data arr $emailArr = array('to' => $verifiedEmail, 'subject' => $email['subject'], 'body' => $email['body'], 'headers' => 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: noreply <*****@*****.**>' . "\r\n"); // Send email $this->sendMail($emailArr); Logger::log('Mailer', 0, 'Mail queue item (' . $email['id'] . ') >> sent >> To: ' . $email['addr'] . '; Subject: ' . $email['subject']); // Set email status $this->set_emailStatus($email['id'], 1); Logger::log('Mailer', 0, 'Setting status of item (' . $email['id'] . ') >> 1'); } else { // Invalid email == Status 2 $this->set_emailStatus($email['id'], 2); Logger::log('Mailer', 0, 'Mail queue item (' . $email['id'] . ') >> Invalid email address'); } } } else { Logger::log('Mailer', 0, 'Mailer queue >> No items in queue.. Sleeping'); } }
public static function get_day($day) { $callDB = new PGSdb(); $callDB->connDB(); $getAttendanceDay = $callDB->db->prepare("SELECT * FROM attendance WHERE dayHuman = :dayHuman"); $getAttendanceDay->execute(array('dayHuman' => $day)); return $getAttendanceDay->fetch(PDO::FETCH_ASSOC); }
protected static function update($updateData) { $callDB = new PGSdb(); $callDB->connDB(); //Prepare $fetchThreadPrep = $callDB->db->prepare("UPDATE forum_categories SET name = :name, rankRead = :read, rankPost = :write WHERE id = :id"); //Execute return $fetchThreadPrep->execute(array('name' => $updateData['name'], 'read' => $updateData['read'], 'write' => $updateData['write'], 'id' => $updateData['cat'])); }
public static function update_post($a) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $return = new news_db(); $updateNewsPost = $callDB->db->prepare("UPDATE news SET postTitle = :postTitle, article = :article, postImg = :postImg, tags = :tags WHERE id = :id"); return $updateNewsPost->execute(array('postTitle' => $a['title'], 'article' => $a['content'], 'postImg' => $a['img'], 'tags' => $a['tags'], 'id' => $a['postID'])); }
private function eventLog($eventID, $details, $eventAuthor) { $callDB = new PGSdb(); $callDB->connDB(); //Build event details to log $logEventTime = Time(); //Write to admin log. $eventLogSQL = $callDB->db->prepare("INSERT INTO admin_logs(eventid, user, details, time) VALUES(:eventID, :user, :detail, :time)"); //Execute $eventLogSQL->execute(array('eventID' => $eventID, 'user' => $eventAuthor, 'detail' => $details, 'time' => $logEventTime)); }
function get_raids() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); // Prep get $getRaidsFromDB = $callDB->db->prepare("SELECT short, fullname, modes, xpac, xpacNum, tier, reqLevel FROM raid_archive ORDER BY tier DESC"); // Execute $getRaidsFromDB->execute(); return $getRaidsFromDB->fetchAll(PDO::FETCH_ASSOC); }
protected static function delete($postID) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $deleteAllPrep = $callDB->db->prepare("DELETE FROM forum_posts WHERE id = :postID"); //Execute $deleteAllPrep->execute(array('postID' => $postID)); //Result return $deleteAllPrep->rowCount(); }
private function fetch_progress($raid) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); // Prep Lookup $lookupPrep = $callDB->db->prepare("SELECT * FROM progress WHERE raid = :raid"); // Execute $lookupPrep->execute(array('raid' => $raid)); $progressData = $lookupPrep->fetch(PDO::FETCH_ASSOC); return array('N' => $progressData['reg'], 'H' => $progressData['heroic'], 'M' => $progressData['mythic']); }
function ajaxEventInfo() { global $usrInfo; // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $idOfEvent = $_GET['305']; // $event = @mysqli_fetch_assoc($callDB->db->query("SELECT * FROM events WHERE id = '$idOfEvent'")); $eventPrep = $callDB->db->prepare("SELECT * FROM events WHERE id = :id"); //Execute $eventPrep->execute(array('id' => $idOfEvent)); //Result $event = $eventPrep->fetch(PDO::FETCH_ASSOC); //Success header('Content-Type: application/json'); echo json_encode(array("success" => 'true', "id" => $event['id'], "eventTitle" => $event['eventTitle'], "eventLoc" => $event['eventLocation'], "eventDesc" => $event['eventDesc'], "eventDateUnix" => $event['eventDate'], "eventDateDD" => date('d-m-Y', $event['eventDate']), "eventDateHH" => date('h', $event['eventDate']), "eventDateMM" => date('i', $event['eventDate']), "eventBy" => $event['eventBy'])); }
function updateRaidPro() { global $usrInfo; // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); if (user::rank() >= 4) { $raidProUpdate = $_POST['raidProUpdate']; $nraidProUpdate = $_POST['nraidProUpdate']; $hraidProUpdate = $_POST['hraidProUpdate']; $mraidProUpdate = $_POST['mraidProUpdate']; //Prepare $proUpdate = $callDB->db->prepare("UPDATE progress SET reg = :regPro, heroic = :heroicPro, mythic = :mythicPro WHERE raid = :raid"); //Execute $result = $proUpdate->execute(array('regPro' => $nraidProUpdate, 'heroicPro' => $hraidProUpdate, 'mythicPro' => $mraidProUpdate, 'raid' => $raidProUpdate)); if ($result) { json::resp(array('success' => true, 'msg' => $raidProUpdate . ' Progress updated!')); } else { json::resp(array('success' => false, 'error' => $raidProUpdate . ' Progress update failed..')); } } }
private function dbFileInfoRecord() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $this->settings(); //Data for DB $filename = $this->genFileName; $orig_filename = $this->fileName; $uploader = $this->user['Username']; $fileMime = $this->fileType; $fileExt = $this->fileExt; $newFileSize = $this->n_file_Size; $fileSize = $this->file_Size; $uploadTime = time(); $this->uploadTime = $uploadTime; $sha1 = $this->fileHash; $dirLoc = $this->dirLoc; $filenameFull = $filename . $fileExt; $newFileRecord = $callDB->db->prepare("INSERT INTO file_uploads(filename,filenameFull,originalFilename,uploader,fileMime,fileExt,fileSize,origFileSize,uploadTime,sha1,folder) VALUES(:filename, :fullFilename , :origFilename, :uploader, :fileMime, :fileExt, :newFileSize, :fileSize, :uploadTime, :sha1, :dirLoc)"); //Execute $newFileRecord->execute(array('filename' => $filename, 'fullFilename' => $filenameFull, 'origFilename' => $orig_filename, 'uploader' => $uploader, 'fileMime' => $fileMime, 'fileExt' => $fileExt, 'newFileSize' => $newFileSize, 'fileSize' => $fileSize, 'uploadTime' => $uploadTime, 'sha1' => $sha1, 'dirLoc' => $dirLoc)); $this->replyJSON('uploadSuccess', 'everything went fine'); }
protected static function update_last_reply($threadID, $username) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $threadUpdatePrep = $callDB->db->prepare("UPDATE forum_threads SET lastposter = :user WHERE id = :id"); return $threadUpdatePrep->execute(array('user' => $username, 'id' => $threadID)); }
public static function update_user_ban($data) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $userTOupdate = $data['userTOupdate']; $banStatus = $data['banStatus']; // $updateBy = $usrInfo['Username']; $updateUserRank = $callDB->db->prepare("UPDATE users SET BanStatus = :banStatus WHERE Username = :user"); return $updateUserRank->execute(array('banStatus' => $banStatus, 'user' => $userTOupdate)); // //Build event details to log // $logEventID = '602'; // $logDetails = 'The user '.$userTOupdate.'\'s BanStatus has been set to '. $banStatus .' by . '.$userTOupdate.'.'; // $logEventTime = Time(); // //Prepare // $eventLogSQL = $callDB->db->prepare("INSERT INTO admin_logs(eventid, user, details, time) VALUES(:eventID, :user, :detail, :time)"); // //Execute // $eventLogSQL->execute(array( // 'eventID' => $logEventID, // 'user' => $updateBy, // 'detail' => $logDetails, // 'time' => $logEventTime // )); }
function allEvents() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $userRank = user::rank(); echo ' <div id="content-header-wrapper"> <div id="content-header-content"><div id="content-header-content-expand">▼</div> <div class="navLocBar-noWrap">Events ></div> <div id="content-header-btns-right">'; if ($userRank >= 1) { newEvent(); echo '<button type="button" class="btn btn-green" onclick="wbox.show(\'newEvent\');"><span class="ion-plus"></span> New Event</button>'; } echo ' </div></div></div> <div id="content-content"> <div id="eventList">'; echo 'hello'; $currentDate = time(); $eventsPrep = $callDB->db->prepare("SELECT * FROM events WHERE eventDate > :evntDate ORDER BY eventDate ASC LIMIT 10"); $eventsPrep->execute(array('evntDate' => $currentDate)); while ($row = $eventsPrep->fetch(PDO::FETCH_ASSOC)) { $eventDateInUNIX = $row['eventDate']; $dateDifference = $eventDateInUNIX - $currentDate; $unixTOhuman = date('D, d M Y h:i a', $eventDateInUNIX); //Convert unixEventTime to human readable //Break time down in countdown $daysTill = floor($dateDifference / 3600 / 24); $hoursTill = floor($dateDifference / 3600 - $daysTill * 24); //strtotime to convert real to unix echo ' <div id="' . $row["id"] . '" class="eventList ' . $row["eventLocation"] . '" rel="' . $row["eventLocation"] . '"> <div class="eventBannerTitle">' . $row["eventTitle"] . '</div> <div class="timesCountdown"><span class="jsEventCountdown" data-timestamp="' . $eventDateInUNIX . '"></span></div> <div class="eventLoc">' . $row["eventLocation"] . '</div> <div class="eventFunctions">'; if ($userRank >= 4) { echo '<div class="editMedia btn-red" onclick="events.evnt.del(\'' . $row["id"] . '\');"><span class="ion-trash-b"></span></div>'; echo '<div class="editMedia btn-blue" onclick="wbox.show(\'editEvent\');events.info(\'' . $row['id'] . '\');events.setEditEventID(\'' . $row['id'] . '\');"><span class="ion-edit"></span></div>'; } ?> </div> </div> <?php } if ($userRank >= 4) { ?> <div id="editEvent" class="wbox" data-height="400px" data-width="100%" data-max-width="265px"> <div class="wbox-title">Edit Event</div> <div class="wbox-content"> <input type="text" id="editEventTitle" class="lot lot-N aniObj" placeholder="Event title" maxlength="25" disabled="disabled"> <label>Location:</label><br/> <select id="editEventLoc" id="newEventLoc" class="lot lot-N aniObj" disabled="disabled"> <option value="blank">-- Set location --</option> <?php foreach (event::raid_event_list() as $raid) { echo '<option value="' . $raid['short'] . '">' . $raid['fullname'] . '</option>'; } ?> </select> <label>Description:</label><br/> <textarea rows="4" cols="40" id="editEventDesc" class="lot lot-N aniObj" maxlength="150" disabled="disabled"></textarea> <select id="editEventSetDate" class="lot lot-N aniObj" disabled="disabled">'; <?php for ($i = 0; $i < 14; $i++) { $a = date('d-m-Y', strtotime("+" . $i . "days")); if ($i == 0) { echo '<option value="' . $a . '">' . $a . ' (Today)</option>'; } else { echo '<option value="' . $a . '">' . $a . '</option>'; } } ?> echo ' </select> <label>Time:</label><br/> <select id="editEventHour" class="lot lot-N aniObj" disabled="disabled"> <option value="00">00hr / 12am</option> <option value="01">01hr / 1am</option> <option value="02">02hr / 2am</option> <option value="03">03hr / 3am</option> <option value="04">04hr / 4am</option> <option value="05">05hr / 5am</option> <option value="06">06hr / 6am</option> <option value="07">07hr / 7am</option> <option value="08">08hr / 8am</option> <option value="09">09hr / 9am</option> <option value="10">10hr / 10am</option> <option value="11">11hr / 11am</option> <option value="12">12hr / 12pm</option> <option value="13">13hr / 1pm</option> <option value="14">14hr / 2pm</option> <option value="15">15hr / 3pm</option> <option value="16">16hr / 4pm</option> <option value="17">17hr / 5pm</option> <option value="18">18hr / 6pm</option> <option value="19">19hr / 7pm</option> <option value="20">20hr / 8pm</option> <option value="21">21hr / 9pm</option> <option value="22">22hr / 10pm</option> <option value="23">23hr / 11pm</option> </select> <select id="editEventMin" class="lot lot-N aniObj" disabled="disabled"> <option value="00">00 Mins past the hr</option> <option value="15">15 Mins past the hr</option> <option value="30">30 Mins past the hr</option> <option value="45">45 Mins past the hr</option> </select> </div> <div class="WBoxBtns"> <input type="button" id="editExistingEvent" class="WBox-btn btn-green" value="Update Event" onclick="events.evnt.update();"> </div> <div id="delEvent" class="wbox" data-height="190px" data-width="335px" data-max-width="100%"> </div> </div> </div> <?php } echo ' <script> window.setTimeout(function(){ events.evnt.timeleft(); }, 500); </script></div>'; }
function fetchMediaInfo() { global $usrInfo; // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $raid = $_GET['raid']; $mediaID = $_GET['mediaID']; $encounter = $_GET['encounter']; $type = $_GET['type']; if (!empty($raid)) { //$raidMedia = @mysqli_fetch_assoc($callDB->db->query("SELECT * FROM raid_archive WHERE short='$raid'")); $raidMediaPrep = $callDB->db->prepare("SELECT * FROM raid_archive WHERE short = :raid"); $raidMediaPrep->execute(array('raid' => $raid)); //Result $raidMedia = $raidMediaPrep->fetch(PDO::FETCH_ASSOC); //Turn JSON data to php friendly data @($jsonToData = json_decode($raidMedia['media'], true)); //Findout item in array @($mediaItem = $jsonToData[$encounter][$type][$mediaID]); header('Content-Type: application/json'); echo json_encode(array("id" => @$mediaID, "mediaRaid" => @$raid, "mediaRaidBoss" => @$encounter, "mediaType" => @$type, "mediaTitle" => @$mediaItem['title'], "mediaLink" => @$mediaItem['url'], "author" => @$mediaItem['author'], "date" => @$mediaItem['date'])); } }
private static function delete_item($folder_name, $file_name) { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $fileDetailsPrep = $callDB->db->prepare("DELETE FROM file_uploads WHERE folder = :folder AND filename = :filename"); return $fileDetailsPrep->execute(array('folder' => $folder_name, 'filename' => $file_name)); }
function raidOverview() { $userRank = user::rank(); // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $raidFetch = $_GET['raid']; $validRaids = array("Firelands" => "FL", "Dragon Soul" => "DS", "Mogu'shan Vaults" => "MSV", "Heart of Fear" => "HoF", "Terrace of Endless Spring" => "ToES", "Throne of Thunder" => "ToT", "Siege of Orgrimmar" => "SoO", "Highmaul" => "HM", "Blackrock Foundry" => "BRF"); if (array_search($raidFetch, $validRaids, true)) { $raidFullName = array_search($raidFetch, $validRaids, true); //For ease of use $progress = new progress(); $data = $progress->fetch_raid($raidFetch); //Fetch media for the specific raid //Prepare $raidMediaPrep = $callDB->db->prepare("SELECT * FROM guildmedia WHERE mediaRaid = :raidShort AND Status='1'"); $raidMediaPrep->execute(array('raidShort' => $raidFetch)); //Result $raidMedia = $raidMediaPrep->fetchAll(PDO::FETCH_ASSOC); //Prepare $raidSpecificsPrep = $callDB->db->prepare("SELECT * FROM raid_archive WHERE short = :raidShort"); $raidSpecificsPrep->execute(array('raidShort' => $raidFetch)); //Result $raidSpecifics = $raidSpecificsPrep->fetch(PDO::FETCH_ASSOC); $raidMediaArr = json_decode($raidSpecifics['media'], true); //Split boss names apart $bossSeperator = '/,\\s*/'; $bossNames = preg_split($bossSeperator, $raidSpecifics['bossNames']); echo ' <div id="content-header-wrapper"> <div id="content-header-content"><div id="content-header-content-expand">▼</div> <div class="navLocBar-noWrap"><a href="' . site_url . 'progress">Raid</a> > ' . $raidFullName . '</div> <div id="content-header-btns-right">'; if ($userRank >= 1) { echo '<button type="button" class="btn btn-green" onclick="wbox.show(\'addMediaDiv\');"><span class="ion-plus"></span> Add Media</button>'; } echo ' </div> </div> </div> <div id="content-content"> <div class="progressionBarFull ' . $raidFetch . '">'; if ($userRank >= "4") { echo ' <div id="raidProgressionSettingsBtn" class="aniObj" onclick="wbox.show(\'editProgression\');editProgression();"> <span class="ion-gear-b"></span> </div>'; } if (@$data->info['bossCount']['M'] != null) { echo '<div id="raidProgressionNumbers"><span id="regRaidProgression">' . $data->progress['N'] . '</span>/' . $data->info['bossCount']['N'] . 'R | <span id="hRaidProgression">' . $data->progress['H'] . '</span>/' . $data->info['bossCount']['H'] . 'H | <span id="mRaidProgression">' . $data->progress['M'] . '</span>/' . $data->info['bossCount']['M'] . 'M</div>'; } else { echo '<div id="raidProgressionNumbers"><span id="regRaidProgression">' . $data->progress['N'] . '</span>/' . $data->info['bossCount']['N'] . 'R | <span id="hRaidProgression">' . $data->progress['H'] . '</span>/' . $data->info['bossCount']['H'] . 'H</div>'; } foreach ($data->modes as $mode) { echo '<div class="progressBarFrame"><div id="' . $mode . 'Progressbar"><div class="raidDifcProgressBarText"></div></div></div>'; } echo ' <br/> </div> <script>'; foreach ($data->modes as $mode) { echo 'window.setTimeout(function(){progress.raidBar(\'' . $mode . 'Progressbar\',\'' . $data->progress[$mode] / $data->info['bossCount'][$mode] * 100 . '\');}, 500);'; } echo ' </script> <div class="progressTopicContents"> <div id="mediaGallery">'; $curBoss = 0; foreach ($bossNames as $boss) { $mediaIDItem = 0; echo '<div class="media-boss"> <div class="media-boss-name"><strong>' . $boss . '</strong></div>'; // echo var_dump($raidMediaArr[$curBoss]['screenshots'][0]); if (@$raidMediaArr[$curBoss] != null) { foreach ($raidMediaArr[$curBoss]['screenshots'] as $mediaItems) { echo '<div class="progressMediaFullItem b-lazy-loading"><img class="b-lazy" src="/img/1080placeholder.png" data-src="' . $mediaItems['url'] . '" />'; if ($userRank >= "4") { echo '<div class="editMediaWrapper"><div class="editMedia" onclick="wbox.show(\'editMedia\');progress.media.info(\'' . $raidFetch . '\', ' . $curBoss . ', \'screenshots\',' . $mediaIDItem . ');"><span class="ion-edit"></span></div></div>'; } echo '</div>'; $mediaIDItem = $mediaIDItem + 1; } } echo '</div>'; $curBoss = $curBoss + 1; } echo '</div>'; // Closing for #content-content // foreach (($raidMedia) as $row){ // if ($row['mediaType'] === 'screenshot'){ // echo ' // <div class="progressMedia"> // <div class="mediaPreview"> // <div class="progressMediaImg">'; // if ($userRank >= "4") // { // echo'<div class="editMediaWrapper"><div class="editMedia" onclick="wbox.show(\'editMedia\');fetchMediaInfo('.$row['id'].');"><span class="ui-icon ui-icon-pencil"></span></div></div>'; // } // echo ' // <img src="'.$row['mediaLink'].'" onclick="WBoxmedia(\'img\',\''.$row['mediaLink'].'\');"> // </div> // </div> // <div class="progressmediaLink"> // [Img] '.$row['mediaTitle'].'</a><br/> // </div> // </div>'; // } // elseif ($row['mediaType'] === 'video'){ // echo ' // <div class="progressMedia"> // <div class="mediaPreview"> // <div class="progressMediaImg">'; // if ($userRank >= "4"){ // echo'<div class="editMediaWrapper"><div class="editMedia" onclick="wbox.show(\'editMedia\');fetchMediaInfo('.$row['id'].');"><span class="ui-icon ui-icon-pencil"></span></div></div>'; // } // echo ' // <img src="http://img.youtube.com/vi/'.$row['mediaLink'].'/1.jpg" onclick="WBoxmedia(\'vid\',\''.$row['mediaLink'].'\');" /> // </div> // </div> // <div class="progressmediaLink"> // [Vid] '.$row['mediaTitle'].'</a><br/> // </div> // </div> // '; // } // else // {} // } if ($userRank >= "4") { ?> <script> function editProgression(){ <?php foreach ($data->modes as $mode) { ?> $(function(){ // Progress Sliders $('#slider<?php echo $mode; ?> ', '#WBox').slider({ value:<?php echo $data->progress[$mode]; ?> , min:0, max:<?php echo $data->info['bossCount'][$mode]; ?> , step:1, slide:function(event,ui){ $('#<?php echo $mode; ?> ProgressionEditor', '#WBox').val(ui.value); } }); $('#<?php echo $mode; ?> ProgressionEditor', '#WBox').val($('#slider<?php echo $mode; ?> ', '#WBox').slider('value')); }); <?php } ?> } </script> <div id="editMedia" class="wbox" data-height="215px" data-width="335px" data-max-width="100%"> <div class="wbox-title">Edit media</div> <div class="wbox-content"> <input type="text" id="mediaTitleEdit" class="lot" placeholder="Media Title" disabled="disabled"> <input type="text" id="mediaLinkEdit" class="lot" placeholder="Media Link" disabled="disabled"><br/><br/> <select id="mediaTypeEdit" class="TmpstLoT" placeholder="Media Type" disabled="disabled"> <option value="screenshot">Screenshot (Image)</option> <option value="video">Video (YouTube)</option> </select> <select id="raidBossSelUpdate" class="lot aniObject"> <option value="Blank">-- Select instance encounter --</option> </select><br/><br/> </div> <div class="WBoxBtns"> <input type="button" id="mediaUpdateBtn" class="WBox-btn btn-green aniObject" value="Save" onclick="progress.media.update('<?php echo $raidFetch; ?> ');" disabled="disabled" /> </div> </div> <div id="editProgression" class="wbox" data-height="300px" data-width="345px" data-max-width="100%"> <div class="wbox-title">Edit media</div> <div class="wbox-content"> <div id="<?php echo $raidFetch; ?> " class="progressionEditorTop <?php echo $raidFetch; ?> "> <div class="progressionEditorRaid"><?php echo $raidFullName; ?> </div> <div class="progressionEditorVals"><input id="NProgressionEditor" maxlength="2" readonly="readonly" style="width:20px; font-size:18px; color:white; background:transparent; border:0px; text-align:right;" value="<?php echo $data->progress['N']; ?> " />/<?php echo $data->info['bossCount']['N']; ?> R | <input id="HProgressionEditor" maxlength="2" readonly="readonly" style="width:20px; font-size:18px; color:white; background:transparent; border:0px; text-align:right;" value="<?php echo $data->progress['H']; ?> " />/<?php echo $data->info['bossCount']['H']; ?> H | <input id="MProgressionEditor" maxlength="2" readonly="readonly" style="width:20px; font-size:18px; color:white; background:transparent; border:0px; text-align:right;" value="<?php echo $data->progress['M']; ?> " />/<?php echo @$data->info['bossCount']['M']; ?> M</div> </div><br/> <?php foreach ($data->modes as $mode) { echo ' <div class="progressionMiniSliderDIV"> <span class="progressionEditorDiff">' . $mode . ' ' . $raidFetch . ' Progression:</span> <div id="slider' . $mode . '"></div> </div>'; } ?> </div> <div class="WBoxBtns"> <input type="button" onclick="progress.update('<?php echo $raidFetch; ?> ');" class="WBox-btn btn-green aniObj" value="Save" /> </div> </div> <?php } if ($userRank >= 1) { ?> <div id="addMediaDiv" class="wbox" data-height="195px" data-width="335px" data-max-width="100%"> <div class="wbox-title">Add guild media</div> <div class="wbox-content"> <select id="mediaType" class="lot aniObject"> <option value="Blank">-- Select media type --</option> <option value="screenshot">Screenshot (Image)</option> <option value="video">Video (YouTube)</option> </select> <select id="raidBossSel" class="lot aniObject"> <option value="Blank">-- Select instance encounter --</option> </select> <input type="text" id="mediaTitle" class="lot aniObject" name="mediaTitle" placeholder="Media Title"> <input type="text" id="mediaLink" class="lot aniObject" name="mediaLink" placeholder="Img ID or Video ID"> </div> <div class="WBoxBtns"> <input type="button" id="addMediaBtn" class="WBox-btn btn-green aniObject" onclick="progress.media.submit('<?php echo $raidFetch; ?> ');" value="Submit"> </div> </div> <script> window.setTimeout(function(){ progress.media.getRaidDetails('<?php echo $raidFetch; ?> '); }, 500); </script> <?php } echo '</div></div> <div class="progressClearSpace"></div> <script> var bLazy = new Blazy({ success: function(element){ setTimeout(function(){ var parent = element.parentNode; parent.className = parent.className.replace(/\\bloading\\b/,""); }, 200); } }); </script> '; } else { echo 'Invalid Raid'; } }
public static function setting() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $fetchQuery = $callDB->db->prepare("SELECT fullRoster, rosterRanks, topIMG, footerHTML FROM sitesettings WHERE guildName = :guild"); $fetchQuery->execute(array('guild' => 'Tempest')); return $fetchQuery->fetchAll(PDO::FETCH_ASSOC); }
private function all() { // Call DB Connector $callDB = new PGSdb(); $callDB->connDB(); $data = array(); //Prepare $getMainRaidRosterPrep = $callDB->db->prepare("SELECT * FROM wowchardata WHERE GuildStatus='Raider' OR GuildStatus='Sub' OR GuildStatus='Trial' ORDER BY GMRole ASC"); //Execute $getMainRaidRosterPrep->execute(); $getMainRaidRoster = $getMainRaidRosterPrep->fetchAll(PDO::FETCH_ASSOC); // echo var_dump($getMainRaidRoster); foreach ($getMainRaidRoster as $character) { $data['character'][] = $character; } build::page($data, 'roster/all'); }
public static function role_status($char, $serv) { $callDB = new PGSdb(); $callDB->connDB(); //Prepare $fetchToArrayPrep = $callDB->db->prepare("SELECT id, GuildStatus, GMrole, GOrole FROM wowchardata WHERE Name = :charName AND Serv = :charServ"); //Execute $fetchToArrayPrep->execute(array('charName' => $char, 'charServ' => $serv)); return $fetchToArrayPrep->fetch(PDO::FETCH_ASSOC); }
private function panel() { $callDB = new PGSdb(); $callDB->connDB(); // Set empty array variable $dbData = array(); // Lookup news data $newsArticles = $this->get_newsArticles(); // Get DB data for site $adminPanelDBfetch = $callDB->db->prepare("SELECT * FROM sitesettings WHERE guildName = :guild"); $adminPanelDBfetch->execute(array('guild' => guild_name)); $dbData['site'] = $adminPanelDBfetch->fetch(PDO::FETCH_ASSOC); // Get featured article title and build array for news posts to select as featured article foreach ($newsArticles as $newsPost) { $dbData['news'][] = $newsPost; // Get title for article thats featured if ($newsPost['id'] == $dbData['site']['featuredArticle']) { $dbData['site']['featuredArticleTitle'] = $newsPost['postTitle']; } } // Data Reloads // Last Update to human time $dbData['site']['fullRosterDate'] = date('h:ia, M d Y', $dbData['site']['fullRosterDate']); $dbData['site']['wcLogsZonesDate'] = date('h:ia, M d Y', $dbData['site']['wcLogsZonesDate']); // For each user in roster array $dbData['site']['rosterSize'] = 0; $decodedForCount = json_decode($dbData['site']['fullRoster'], true); try { foreach ($decodedForCount['members'] as $key => $character) { $dbData['site']['rosterSize']++; } } catch (Exception $e) { // } // Roster settings $dbData['site']['rosterRanksData'] = json_decode($dbData['site']['rosterRanks'], true); // foreach ($decodedForRanks as $key => $value) { // $dbData['site']['rosterRanksData'][$key] = $value; // } build::page($dbData, 'admin/admin'); }