Strider Posted June 6, 2013 Report Share Posted June 6, 2013 As some of you have seen in my post in the va section, I have a codeshare module. It at the time did not have an admin side thus I had to add all the codeshares in manually. I have now since created a module, using Simpilots events as a base but edited to add in new codeshare routes. The adding of the codeshares works a dream, it adds the new route into the codeshare table and all. But the main view where you should see the ones currently in the db do not show. And I cant for the life of me work out why. I have switched the way the if else statement looks at it and it just gives me an error, saying an invalid argument supplied for foreach. <?php $this->show('codeshare/codeshare_header.tpl'); echo 'Click On Codeshare For Details/Editing<hr />'; echo '<h4>Codeshares</h4><hr />'; if(!$codeshare) { echo '<table width="100%">'; echo '<tr><td width="30%"><u>Schedule ID</u></td><td width="60%"><u>Airline</u></td></tr>'; foreach($codeshare as $codeshares) { echo '<tr><td><a href="'.SITE_URL.'/admin/index.php/CodeShare_admin/get_codeshare?id='.$codeshares->id.'">'.$codeshares->schedid.'</a></td>'; echo '<td>'.$codeshares->airline.'</td></tr>'; } echo '</table>'; } else { echo 'No Codeshares found'; } ?> There is the code from the index page of the module. 2 Quote Link to comment Share on other sites More sharing options...
sherming Posted June 7, 2013 Report Share Posted June 7, 2013 Thanks for sharing the module Quote Link to comment Share on other sites More sharing options...
Strider Posted June 7, 2013 Author Report Share Posted June 7, 2013 This is not the entire module, this is part of the admin side of it that is not working properly. Quote Link to comment Share on other sites More sharing options...
Strider Posted June 7, 2013 Author Report Share Posted June 7, 2013 Ok I figured out the problem, and it all works except the edit function. It is not passing the data into the DB. I need help with this. Quote Link to comment Share on other sites More sharing options...
Strider Posted June 7, 2013 Author Report Share Posted June 7, 2013 It is now working the way it should be. Quote Link to comment Share on other sites More sharing options...
Tom Posted June 7, 2013 Report Share Posted June 7, 2013 You should put code on GitHub, that way others can fork and contribute to it easily Quote Link to comment Share on other sites More sharing options...
Strider Posted June 7, 2013 Author Report Share Posted June 7, 2013 It is finished now and it is up https://github.com/Strider2/codeshare 2 Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted June 11, 2013 Report Share Posted June 11, 2013 have a problem importing the sql #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''image' varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHA' at line 5 CREATE TABLE IF NOT EXISTS `phpvms_codeshares` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `schedid` int( 11 ) NOT NULL , `airline` varchar( 50 ) NOT NULL , 'image'varchar( 255 ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =28; I solved it by manually creating the table dont know why it did not work to import the via mysql import option Quote Link to comment Share on other sites More sharing options...
Strider Posted June 11, 2013 Author Report Share Posted June 11, 2013 I have fixed that problem, and another problem that would have been encountered with the image. If you go to the github for it you can download the updates to it Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted June 11, 2013 Report Share Posted June 11, 2013 found another thing the external link to a airline pic is optional but condition is "not null" which requires to fill that field out Quote Link to comment Share on other sites More sharing options...
Strider Posted June 11, 2013 Author Report Share Posted June 11, 2013 It is fixed Quote Link to comment Share on other sites More sharing options...
Kyle Watkins Posted June 19, 2013 Report Share Posted June 19, 2013 Can't seem to get it working. Re-installed the entire thing and done exactly what the instructions said and adding them and they don't show up. Quote Link to comment Share on other sites More sharing options...
Strider Posted June 20, 2013 Author Report Share Posted June 20, 2013 hmmm, not sure, this happened with jet2 virtual, they installed it, I even installed it, but it did not work for them. And I do not know why. It is the same code that works for others who say it works for them. Do any errors show up for you? Quote Link to comment Share on other sites More sharing options...
Kyle Watkins Posted June 20, 2013 Report Share Posted June 20, 2013 No errors at all. I put in all the info with an image and it just does not show up. Quote Link to comment Share on other sites More sharing options...
Strider Posted June 20, 2013 Author Report Share Posted June 20, 2013 hmm, is it being entered into the db at all? Quote Link to comment Share on other sites More sharing options...
Kyle Watkins Posted June 21, 2013 Report Share Posted June 21, 2013 There is no data going into the db. Quote Link to comment Share on other sites More sharing options...
Strider Posted June 21, 2013 Author Report Share Posted June 21, 2013 hmmm, I am not sure why some people have trouble with the modules I have. Only thing I can think of is that maybe the download got corrupted when you downloaded it, and thus it is not working the way it should. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.