EVOLUTION-MANAGER
Edit File: host-profile.php
<?php require_once("models/config.php"); if (!securePage($_SERVER['PHP_SELF'])){die();} require_once('header.php'); require_once('home-nav.php'); //Check host details asper url //if($loggedInUser->checkPermission(array(2))) header("Location: ".$baseurl); if(!usernameExists($_GET["host"])) header("Location: ".$baseurl); //if(!$loggedInUser->checkPermission(array(4))) header("Location: ".$baseurl); $usrID=usernameToID($_GET["host"]); $perms=fetchUserPermissions($usrID); /*if(!in_array(4,array_column($perms, 'permission_id'))) header("Location: ".$baseurl); else*/ $hostdetails = fetchHostDetails($_GET["host"]); //if(!$hostdetails || $hostdetails["usertype"]!=1 && $hostdetails["usertype"]!=2){ header("Location: ".$baseurl); die(); } //user exists and is a HOST $activDiff=time()-$hostdetails['lastActiv']; if($activDiff<1800 && $activDiff>0) $isOnlineActive=1; else $isOnlineActive=0; ?> <div class="container-fluid" id="hostBanner"> <div class="row-fluid"> <div class="span12 well well-small"> <div class="span12"><img src="<?php echo $baseurl.'img/users/'.$hostdetails["img"] ?>" alt="<?php echo $hostdetails["display_name"]; ?>" title="<?php echo $hostdetails["display_name"]; ?>"/></div> <div id="hostInfo"> <h1><?php echo $hostdetails["display_name"]; ?></h1> <p><?php if(isset($hostdetails["userDesc"])) echo $hostdetails["userDesc"]; else echo "I am here only to listen to you my sweet friend. Call me and let me know what your heart thinks."; ?></p> <p>Talk to me about: <?php if(isset($hostdetails["userTags"])) echo $hostdetails["userTags"]; else echo "Friendly chat, Your problems"; ?></p> <p>I speak: <?php if(isset($hostdetails["userLangs"])) echo $hostdetails["userLangs"]; else echo "English, Hindi"; ?></p> <p>I am available: <?php if(isset($hostdetails["userTiming"])) echo $hostdetails["userTiming"]; else echo "9:00 AM to 5:00 PM"; ?></p> <p class="hostCamOptions"><img src="<?php echo $baseurl ?>img/phoneAvailable.png" alt="available for phone" title="<?php echo $hostdetails["display_name"]; ?> does phone"/> <?php if($hostdetails["usertype"]==2) {?> <img src="<?php echo $baseurl ?>img/camAvailable.png" alt="available for cam" title="<?php echo $hostdetails["display_name"]; ?> does cam"/> <?php } ?></p> <?php if(!isset($hostdetails["userRate"])) $hostdetails["userRate"]=1; ?> <?php if(isUserLoggedIn()) { ?> <?php if($hostdetails['online'] && $isOnlineActive) echo '<button type="button" class="btn btn-large btn-121" id="callButton">Call @ '.$hostdetails["userRate"].' credit</button>'; echo ' <button type="button" class="btn btn-large btn-warning" id="scheduleButton">Schedule a Call</button> You have <strong>'.$loggedInUser->credit.'</strong> credits. <a href="'.$baseurl.'get-credits/'.$loggedInUser->username.'" title="Get more credits">Get more credits</a>'; } else { if($hostdetails['online']) {?> <a class="btn btn-large btn-danger" type="button" href="<?php echo $baseurl ?>login.php">Login and Call</a> <?php } else {?> <a class="btn btn-large btn-warning" type="button" href="<?php echo $baseurl ?>login.php">Login and Schedule</a> <?php }} ?> </div> </div> </div> </div> <?php if(isUserLoggedIn()) { ?> <div class="container-fluid" id="hostCallScheduleDetails"> <div id="video-container"> <div class="pure-g"> <!-- Video area --> <div class="pure-u-2-3" id="video-container"> <video id="their-video" autoplay></video> <video id="my-video" muted="true" autoplay></video> </div> <!-- Steps --> <div class="pure-u-1-3"> <!-- Get local audio/video stream --> <div id="step1"> <p>Please click `allow` on the top of the screen so we can access your webcam and microphone for calls.</p> <div id="step1-error"> <p>Failed to access the webcam and microphone. Make sure click "Allow"/"Share Selected Devices" when asked for permission by the browser.</p> <a href="#" class="pure-button pure-button-error" id="step1-retry">Try again</a> </div> </div> <!-- Make calls to others --> <div id="step2"> <p>Your id: <span id="my-id">...</span></p> <!--<p>Share this id with others so they can call you.</p> <h3>Make a call</h3> <div class="pure-form"> <input type="text" placeholder="Call user id..." id="callto-id"> <a href="#" class="pure-button pure-button-success" id="make-call">Call</a> </div>--> </div> <!-- Call in progress --> <div id="step3"> <p>Currently in call with <span id="their-id">...</span></p> <p><a href="#" class="btn btn-danger" id="end-call">End call</a> <a href="#" class="btn btn-danger" id="mute">Mute Audio</a> <a href="#" class="btn btn-danger" id="hide">Video Off</a></p> </div> </div> </div> <!--<div class="pure-g"> <div class="pure-u-2-3" id="video-container"> <video id="their-video" autoplay></video> <video id="my-video" muted="true" autoplay></video> </div> <div class="pure-u-1-3"> <div id="step1"> <div id="step1-error"> <p>Failed to access the webcam and microphone. Make sure you click <strong>"Allow"</strong> at the top of the browser. <a href="#" class="pure-button pure-button-error" id="step1-retry">Try again</a></p> <p>If you have clicked Deny before, then <a href="https://support.google.com/chrome/answer/2693767?hl=en" alt="Allow microphone or webcam access again" target="_blank">check here how you can Allow access again</a>.</p> </div> </div> <div id="step2"> <div class="pure-form"> <input type="text" placeholder="Call user id..." id="callto-id"> <a href="#" class="pure-button pure-button-success" id="make-call">Call</a> </div> </div> <div id="step3"> <p>Currently in call with <span id="their-id">...</span></p> <p><a href="#" class="pure-button pure-button-error" id="end-call">End call</a></p> </div> </div> <button type="button" id="endCall">End Call</button> </div>--> </div> <div id="scheduleCallNow"> <h3>Schedule a call with <?php echo $hostdetails["display_name"]; ?></h3> <form name="scheduleCall" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" class="form-horizontal well"> <div class="control-group"> <label class="control-label" for="username">Select date</label> <div class="controls"> <input id="textinput" name="textinput" type="text" placeholder="mm/dd/yyyy" class="input"/> </div> </div> <div class="control-group"> <label class="control-label" for="username">Select time</label> <div class="controls"> <select id="hour" name="hour" class="input-small"> <option>00</option> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> </select> : <select id="minute" name="minute" class="input-small"> <option>00</option> <option>05</option> <option>10</option> <option>15</option> <option>20</option> <option>25</option> <option>30</option> <option>35</option> <option>40</option> <option>45</option> <option>50</option> <option>55</option> </select> <select id="ampm" name="ampm" class="input-small"> <option>AM</option> <option>PM</option> </select> </div> </div> <div class="control-group"> <label class="control-label" for="duration">Minimum duration</label> <div class="controls"> <div class="input-append"> <input id="duration" name="duration" class="input-small" type="text"> <span class="add-on"> minutes </span> </div> </div> </div> <div class="control-group"> <label class="control-label" for="username">Credits on hold</label> <div class="controls"> <span id="creditsRequired">0</span> - you have <?php echo $loggedInUser->credit; ?> credits. <a href="<?php echo $baseurl; ?>get-credits/<?php echo $loggedInUser->username ?>" title="Get more credits">Get more credits</a> </div> </div> <div class="control-group"> <label class="control-label" for="username">Message for host</label> <div class="controls"> <textarea id="message" name="message"></textarea> </div> </div> <div class="control-group"> <div class="controls"> <input type="submit" id="scheduleNowButton" name="scheduleNowButton" class="btn btn-success" title="Schedule" value="Schedule"/> </div> </div> </form> </div> <?php } ?> </div> <?php require_once("footer.php"); ?>