Jump to content

jubba890

Members
  • Posts

    28
  • Joined

  • Last visited

jubba890's Achievements

Member

Member (2/5)

0

Reputation

  1. Ones refer to the servers My bad, the second group is supposed to have the ID of 2 Both, a group with "type" of web cannot have a server whom's "type" is mysql If there are 2 groups: G1 and G2. and there was 1 server (S1), you would not see S2 on G2's list if it was already in G1 and vise-versa. If server is not in another group AND the server types match (for group and server) AND they are not already in the group.
  2. Hi! I have 2 tables servers: ID | IP | NAME | TYPE | STATUS serversgroups: ID | NAME | TYPE servergroupsdata: GROUPID | SERVERID On the page I have 2 listbox's and on the left is available ones, and on the right is the ones in the group, I need the ones on the 'available' ones to NOT show if they are in another group OR if they are in the current group you are editing AND they have to be the same type. Example: TestServer: - ID: 1 - TYPE: webserver OtherServer: - ID: 2 - TYPE: randomserver FinalServer: - ID: 3 - TYPE: webserver ################ TestGroup: - ID: 1 - TYPE: webserver TestGroup: - ID: 1 - TYPE: webserver ################ Row1: - GROUPID: 1 - SERVERID: 1 ROW2: - GROUPID: 2 - SERVERID: 3 Expected in 'available' for groupID 1: ##NOTHING## Expected in 'in the group' for groupID 1: - TestServer [With ID of 1] Is this a confusing way to do a simple task? Anything will help, I tried to fetch the array and then do while($var = mysqli_fetch_Array($query) but I ended up with 3 of those and a bunch of IF statements and I'm just really irritated right now. ANY help is MUCH appreciated
  3. It's a template system so I don't want it .php
  4. In index.php I have this code <?php $HTML = str_replace('{$template}', 'TEMPLATES/' . $template, file_get_contents('TEMPLATES/' . $template . '/index.tpl')); echo $HTML; ?> so everytime I call {$template} it replaces it with the directory, this works and all until I need PHP in my template. How can I get PHP code to execute so say if I have this in my template <?php echo "Test"; ?> It will show Test instead of the whole code, thanks!
  5. Hi guys! I am working to create a new front end for WHMCS using the backend. Here is what I have so far: http://inzernettechnologies.com/login.php http://inzernettechnologies.com/register.php http://inzernettechnologies.com/clientarea.php http://inzernettechnologies.com/resetPassword.php e-mail: cody-admin@inzernettechnologies.com password: cmr432we (To login to the login and to get to the client area, I know it isn't much but this is what I got done in a couple hours) I am wondering if someone would like to help with this project with me I was planning on selling this, so you could get some of the money from sales if you want. If you are interested, please let me know! Thanks!
  6. I am using WHMCS API and It gives me an array for the first name, last name, etc for the client information Here is the code I have so far checkLogin.php <?php session_start(); echo "ID: " . $_SESSION['clientID']; $postfields = array(); $postfields["action"] = "getclientsdetails"; $postfields["clientid"] = $_SESSION['clientID']; $postfields["stats"] = true; $postfields["responsetype"] = "xml"; echo "<br>"; include('XMLAPI.php'); ?> XMLAPI.php <?php /* *** WHMCS XML API Sample Code *** */ $url = "http://inzernettechnologies.com/billing/includes/api.php"; # URL to WHMCS API file $username = "user"; # Admin username goes here $password = "pass"; # Admin password goes here $postfields["username"] = $username; $postfields["password"] = md5($password); $query_string = ""; foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $xml = curl_exec($ch); if (curl_error($ch) || !$xml) $xml = '<whmcsapi><result>error</result>'. '<message>Connection Error</message><curlerror>'. curl_errno($ch).' - '.curl_error($ch).'</curlerror></whmcsapi>'; curl_close($ch); $arr = whmcsapi_xml_parser($xml); # Parse XML print_r($arr); # Output XML Response as Array /* Debug Output - Uncomment if needed to troubleshoot problems echo "<textarea rows=50 cols=100>Request: ".print_r($postfields,true); echo "\nResponse: ".htmlentities($xml)."\n\nArray: ".print_r($arr,true); echo "</textarea>"; */ function whmcsapi_xml_parser($rawxml) { $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $rawxml, $vals, $index); xml_parser_free($xml_parser); $params = array(); $level = array(); $alreadyused = array(); $x=0; foreach ($vals as $xml_elem) { if ($xml_elem['type'] == 'open') { if (in_array($xml_elem['tag'],$alreadyused)) { $x++; $xml_elem['tag'] = $xml_elem['tag'].$x; } $level[$xml_elem['level']] = $xml_elem['tag']; $alreadyused[] = $xml_elem['tag']; } if ($xml_elem['type'] == 'complete') { $start_level = 1; $php_stmt = '$params'; while($start_level < $xml_elem['level']) { $php_stmt .= '[$level['.$start_level.']]'; $start_level++; } $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];'; @eval($php_stmt); } } return($params); } ?> It outputs: ID: 1 Array ( [WHMCSAPI] => Array ( [ACTION] => getclientsdetails [RESULT] => success [CLIENT] => Array ( [USERID] => 1 [ID] => 1 [FIRSTNAME] => Cody [LASTNAME] => Robinson [FULLNAME] => Cody Robinson [COMPANYNAME] => InZernet Technologies [EMAIL] => cody-admin@inzernettechnologies.com [ADDRESS1] => Address [ADDRESS2] => [CITY] => 11 [FULLSTATE] => Michigan [STATE] => Michigan [POSTCODE] => 11111 [COUNTRYCODE] => US [COUNTRY] => US [STATECODE] => MI [COUNTRYNAME] => United States [PHONECC] => 1 [PHONENUMBER] => 1111111111 [PHONENUMBERFORMATTED] => 11111111 [BILLINGCID] => 0 [NOTES] => [PASSWORD] => PASSWORD [TWOFAENABLED] => [CURRENCY] => 1 [DEFAULTGATEWAY] => [CCTYPE] => [CCLASTFOUR] => [SECURITYQID] => 29 [SECURITYQANS] => Rogers [GROUPID] => 0 [STATUS] => Active [CREDIT] => 0.00 [TAXEXEMPT] => [LATEFEEOVERIDE] => [OVERIDEDUENOTICES] => [SEPARATEINVOICES] => [DISABLEAUTOCC] => [EMAILOPTOUT] => 0 [OVERRIDEAUTOCLOSE] => 0 [LANGUAGE] => [LASTLOGIN] => Date: 07/10/2014 17:43 IP Address: xx.xx.xx.xx.xx Host: xx.xx.xx.xx.xx.xx.xx [CUSTOMFIELDS1] => Other [CUSTOMFIELDS] => Array ( [ID] => 1 [VALUE] => Other ) [CURRENCY_CODE] => USD ) [STATS] => Array ( [NUMDUEINVOICES] => 0 [DUEINVOICESBALANCE] => $0.00 USD [INCOME] => $0.00 USD [INCREDIT] => [CREDITBALANCE] => $0.00 USD [NUMOVERDUEINVOICES] => 0 [OVERDUEINVOICESBALANCE] => $0.00 USD [NUMPAIDINVOICES] => 0 [PAIDINVOICESAMOUNT] => $0.00 USD [NUMUNPAIDINVOICES] => 0 [UNPAIDINVOICESAMOUNT] => $0.00 USD [NUMCANCELLEDINVOICES] => 0 [CANCELLEDINVOICESAMOUNT] => $0.00 USD [NUMREFUNDEDINVOICES] => 0 [REFUNDEDINVOICESAMOUNT] => $0.00 USD [NUMCOLLECTIONSINVOICES] => 0 [COLLECTIONSINVOICESAMOUNT] => $0.00 USD [PRODUCTSNUMACTIVEHOSTING] => 0 [PRODUCTSNUMHOSTING] => 0 [PRODUCTSNUMACTIVERESELLER] => 0 [PRODUCTSNUMRESELLER] => 0 [PRODUCTSNUMACTIVESERVERS] => 0 [PRODUCTSNUMSERVERS] => 0 [PRODUCTSNUMACTIVEOTHER] => 0 [PRODUCTSNUMOTHER] => 0 [PRODUCTSNUMACTIVE] => 0 [PRODUCTSNUMTOTAL] => 0 [NUMACTIVEDOMAINS] => 0 [NUMDOMAINS] => 0 [NUMACCEPTEDQUOTES] => 0 [NUMQUOTES] => 0 [NUMTICKETS] => 0 [NUMACTIVETICKETS] => 0 [NUMAFFILIATESIGNUPS] => 0 ) ) ) How would I get that information into a variable I tried $params[1]; and that didn't work I tried to remove the return($params); and use it in CheckLogin.php and did echo $params; but it didn't work Any help appreciated!!!!!
  7. I am looking for a PHP developer to develop an application in which is almost completed. I can pay, but I expect HIGH quality work like my other PHP Developer. Here is a link to the project that needs to be finished: http://inzernettechnologies.com/StreamIT Please contact me ASAP! Thanks Skype: inzernettechnologies.admin E-Mail: cody-admin@inzernettechnologies.com Contact form: http://inzernettechnologies.com/store/contact.php
  8. I fixed it by having the PHP execute before putting it in there, thank you SO much!
  9. You were right, I accidentally deleted the <?PHP and not that I inserted it correctly, it shows - only
  10. I originally used SocialCloud's code. which had the $song variable in it, I am not sure how to use the $song varible and where it fits into play here
  11. So far my code is: <?PHP //### Start the session session_start(); //### Make sure the user is logged in // if(!isset($_SESSION['streamit_user'])) { // header('Location: login.php'); // exit; // } if($_SERVER['HTTP_HOST'] == 'localhost') { $settings['base_path'] = 'XXX'; } else { $settings['base_path'] = 'XXX'; } ?> <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <title>Web Player</title> <base href="<?PHP echo $settings['base_path'];?>"><!--[if IE]></base><![endif]--> <link href="includes/css/main_style.css?<?PHP echo microtime(true);?>" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css"> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- Player Files --> <link href="includes/css/player.css?<?PHP echo microtime(true);?>" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="includes/js/jquery.jplayer.js"></script> <script type="text/javascript" src="includes/js/jplayer.playlist.js"></script> <!--[if IE 7]> <style> #jp_container_1{padding-bottom:-10px;margin-bottom:0;} </style> <![endif]--> <script type="text/javascript"> $(document).ready(function(){ new jPlayerPlaylist({ jPlayer: "#inzernet_player", cssSelectorAncestor: "#jp_container_1" }, [{ }], { swfPath: "includes", supplied: "mp3", wmode: "window", smoothPlayBar: true, keyEnabled: true, volume: 1 }); $("#inzernet_player").bind($.jPlayer.event.ended, function() { playNext('loop'); }); $("#inzernet_player").jPlayer({"solution": navigator.userAgent.indexOf("Trident/5")>-1 ? "flash" : "html,flash"}); if(navigator.appVersion.indexOf("MSIE 7.")!=-1){ $('.frame_loader').css('margin-left', '0'); } }); </script> </head> <body> <div id="main_wrap"> <div class="top_element"> <div class="top_links top_left"> <span><a href="#">Home</a></span> <span><a href="#">Latest News</a></span> <span><a href="#">My Account</a></span> <span><a href="#">Playlists</a></span> <span><a href="#">Upload</a></span> </div> <div class="top_links top_right"> <span><a href="login.php" target="main_frame" onClick="loadPage(this);">Log In</a></span> <span><a href="register.php" target="main_frame">Register</a></span> </div> <div style="clear:both;"></div> </div> <div class="content_limiter" id="player_el"> <div class="player_playlist"> <div class="playlist_content"> Playlist <br><br> <div id="playlist_items"></div> </div> </div> <div class="frame_loader"> <img src="images/loading.gif"> </div> <iframe src="frame_index.php" class="main_frame" name="main_frame" id="main_frame" frameBorder="0" allowTransparency="true" onLoad="hideLoader();"></iframe> <div style="clear:both;"></div> </div> <div class="top_element" style="height: 10px;"></div> <div class="content_limiter" id="player_element"> <!--- Player Start ---> <div id="inzernet_player" class="jp-jplayer"></div> <div id="jp_container_1" class="jp-audio"> <div class="jp-type-playlist"> <div class="jp-gui jp-interface"> <ul class="jp-controls"> <li><a href="javascript:;" class="jp-previous player_button" tabindex="1" style="margin-left:10px;" onClick="playPrevious(); return false;">previous</a></li> <li><a href="javascript:;" class="jp-play player_button" tabindex="1" onClick="playSong(); return false;">play</a></li> <li><a href="javascript:;" class="jp-pause player_button" tabindex="1" onClick="pauseSong(); return false;">pause</a></li> <li><a href="javascript:;" class="jp-next player_button" tabindex="1" onClick="playNext('button'); return false;">next</a></li> <!--<li><a href="javascript:;" class="jp-stop player_button" tabindex="1">stop</a></li>--> <li><a href="javascript:;" class="jp-mute " tabindex="1" title="mute">mute</a></li> <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li> <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li> </ul> <div class="player_right"> <div class="loop player_button" onClick="loop();"></div> </div> <div style="float: left;"> <div id="current_song" class="song_title"> No Song Selected </div> <div class="jp-current-time"></div> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div> </div> </div> <div class="jp-duration"></div> <div class="jp-volume-bar"> <div class="jp-volume-bar-value"></div> </div> <div style="clear:both;"></div> </div> <div style="clear:both;"></div> <div class="jp-playlist"> <ul> <li></li> </ul> </div> <div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div> </div> <div style="clear:both;"></div> </div> <!--- Player End ---> </div> </div> <div class="top_element" style="height: 10px;"></div> </div> <script type="text/javascript"> var isPaused = 0; var loopType = 'none'; var lastSong = -1; var playlist = new Array("<?php echo $songs; ?>"); $db = new mysqli(HOST.COM,USER,PASS,StreamIT); // use your credentials $sql = "SELECT Songs FROM Main"; $playlist = array(); $res = $db->query($sql); while ($row = $res->fetch_assoc()) { $playlist[] = $row['Songs']; } $songs = join('","', $playlist); ?> // var playlist = new Array(); // playlist[0] = 'Avicii - Levels'; // playlist[1] = 'Flo Rida - Good Feeling'; // playlist[2] = 'H3Ctic - Far away'; // playlist[3] = 'Hans Zimmer - Time'; // playlist[4] = 'Lana Del Rey - Summertime Sadness'; // playlist[5] = 'M4sonic - Weapon'; // playlist[6] = 'Extan - New World (feat. RomyHarmony)'; // playlist[7] = 'Nicki Minaj - Five-O'; // playlist[8] = 'Beautiful Sinner'; // playlist[9] = 'Cockiness'; // playlist[10] = 'Skrillex - Dirty Vibe'; $(document).ready(function(){ $('.player_button').on({ mouseenter: function() { $(this).addClass('player_button_hover');//.addClass($(this).attr('id')+'_hover'); }, mouseleave: function() { $(this).removeClass('player_button_hover');//.removeClass($(this).attr('id')+'_hover'); } }); $(document).bind('contextmenu', function(e){ //return false; }); $('.top_element span> a').each(function(index, link){ $(this).click(function(){ //alert('You clicked "'+$(this).text()+'".'); return false; }); }); createPlaylist(); }); function hideLoader() { $('.frame_loader').hide(); } function loadPage(t) { if($('#main_frame').attr('src') != t.href) { $('.frame_loader').show(); $('#main_frame').attr('src', t.href); } } function createPlaylist() { for(i=0; i<playlist.length; i++) { $('#playlist_items').append('<div class="playlist_item" id="playlist_item_'+i+'"> - <span onClick="playThis(\''+playlist[i]+'\');">'+playlist[i]+'</span></div>'); } } function reloadThis() { window.location.href = window.location.href.split('#')[0]; } function playSong() { isPaused = 0; $('#inzernet_player').jPlayer('play'); } function pauseSong() { isPaused = 1; $('#inzernet_player').jPlayer('pause'); } function loop() { if(loopType == 'all') { $('.loop').removeClass('loop_single').removeClass('loop_all'); loopType = 'none'; } else if(loopType == 'none') { $('.loop').addClass('loop_single').removeClass('loop_all'); loopType = 'single'; } else if(loopType == 'single') { $('.loop').removeClass('loop_single').addClass('loop_all'); loopType = 'all'; } } function playNext(type){ if(lastSong < 0){ //### No song has been played, we don't know what "next" is return; } //### Check to see if we are looping a single song if(loopType == 'single') { setTimeout(function(){ playThis(playlist[lastSong]); }, 100); return; } //### Stop the player, to stop the cross over of 2 songs $('#inzernet_player').jPlayer('stop'); //### Now we work out which song to play next if(lastSong >= playlist.length) { setTimeout(function(){ playThis(playlist[0]); }, 100); } else { if(lastSong+1 >= playlist.length) { //### Check if the next song is the start of the playlist if(type == 'loop') { //### Looper function is triggered if(loopType == 'all') { //### Check to see if looped is true lastSong = 0; } else { //### Looped isn't true, don't play first return; } } else { //### Button pressed so go back to the start lastSong = 0; } } else { //### Not the end of the playlist, play next lastSong+=1; } setTimeout(function(){ playThis(playlist[lastSong]); }, 100); } //### Show "loading" while we wait for the next song to be set $('#current_song').text('Loading...'); } function playPrevious(){ if(lastSong < 0) { //### No song has been played, we don't know what "previous" is return; } //### Stop the player, to stop the cross over of 2 songs $('#inzernet_player').jPlayer('stop'); //### Now we work out which song to play next if(lastSong == 0) { setTimeout(function(){ playThis(playlist[(playlist.length-1)]); }, 100); } else { lastSong = (lastSong-1 < 0) ? playlist.length-1 : lastSong-=1; setTimeout(function(){ playThis(playlist[lastSong]); }, 100); } //### Show "loading" while we wait for the next song to be set $('#current_song').text('Loading...'); } function playThis(songTitle){ var musicFile = '<?PHP echo $settings['base_path'];?>media/music/'+songTitle+'.mp3'; lastSong = include(playlist, songTitle); $('.playlist_item').removeClass('playing'); $('#playlist_item_'+lastSong).addClass('playing'); $('#current_song').text(songTitle); $('#inzernet_player').jPlayer("setMedia", { mp3:musicFile }); if(isPaused != 1) { $('#inzernet_player').jPlayer('play'); } } function include(arr, obj) { for(var i=0; i<arr.length; i++) { if (arr[i] == obj) return i; } } </script> </body> </html> It just shows up blank
  12. Hi, So I have an array var playlist = new Array(); And in it I have songs as so: playlist[0] = 'Avicii - Levels'; playlist[1] = 'Song'; playlist[2] = 'Song'; playlist[3] = 'Song'; playlist[4] = 'Song'; playlist[5] = 'Song'; playlist[6] = 'Song'; playlist[7] = 'Song'; playlist[8] = 'Song'; playlist[9] = 'Song'; playlist[10] = 'Song'; Now I'm not an expert at MySQL so I was wondering if there would be an easier way to do this with MySQL instead if adding playlist[number] = 'Song"; after every line. It would search the MySQL database for a column named songs and it would automatically put them into the array 'playlist'. Also code examples or a finished product would be VERY helpful! Thanks
  13. Okay so what is supposed to happen is that whatever the user selects in the listbox the song is supposed to then play, but I cannot even get that far because I get an error. <!DOCTYPE html> <html> <head><title>Test Music App/title></head> <body> <select name="Songs" multiple="multiple" onchange="playsong($song)"> <option>Nicki Minaj - Five-O.mp3</option> <option>text2</option> <option>text3</option> <option>text4</option> <option>text5</option> </select> <?php> function playsong($song); { <audio controls> <source src="http://www.inzernettechnologies.com/StreamIT/media/music/$song.mp3" type="audio/mpeg"> <embed height="150" width="400" src="http://www.inzernettechnologies.com/StreamIT/media/music/$song.mp3"> </audio> } ?> </body> </html>
  14. No it is not an image. It is a list of items. The item is song names like: Hello Brainless and so on. It is the user's favorite songs
  15. I need something to be uploaded and then echoed. Could it be in like a textbox or something? I have been trying for like 2 days now, but I can't figure it out. Also for MySQL what would be good for holding information like this: Item1 Item2 Item3 And so on. Thanks for any help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.