Jump to content

Kapitan

Members
  • Posts

    103
  • Joined

  • Last visited

Posts posted by Kapitan

  1. On 09/04/2011 at 1:52 PM, Tomgis34 said:

    Hi,

    I have a problem with contact form. In fact, when I send a test mail via this form, it didn't receive/send.

    Code of Contact_form.tpl

     

    
    <h3>Contactez-nous</h3>
    <form method="post" action="<?php echo url('/contact'); ?>">
     <table width='100%' border='0'>
       <tr>
         <td><strong>Nom:</strong></td>
         <td>
    	<?php
    	if(Auth::LoggedIn())
    	{
    		echo Auth::$userinfo->firstname .' '.Auth::$userinfo->lastname;
    		echo '<input type="hidden" name="name" 
    				value="'.Auth::$userinfo->firstname 
    						.' '.Auth::$userinfo->lastname.'" />';
    	}
    	else
    	{
    	?>
    		<input type="text" name="name" value="" />
    		<?php
    	}
    	?>
         </td>
       </tr>
       <tr>
    	<td width="1%" nowrap><strong>Adresse e-mail:</strong></td>
    	<td>
    	<?php
    	if(Auth::LoggedIn())
    	{
    		echo Auth::$userinfo->email;
    		echo '<input type="hidden" name="name" 
    				value="'.Auth::$userinfo->email.'" />';
    	}
    	else
    	{
    	?>
    		<input type="text" name="email" value="" />
    		<?php
    	}
    	?>
    	</td>
    </tr>
    
       <tr>
    	<td><strong>Destinataire: </strong></td>
    	<td><select name="recipient">
           	<option value="info@worldskyairline.com">Le staff</option>
    	<option value="executif@worldskyairline.com">La direction général</option>
    	<option value="rh@worldskyairline.com">La direction des ressources humaines</option>
    	<option value="thomas.nouyer@worldskyairline.com">La direction technique et des opérations</option>
           <select></td>
    
    </tr>
    
    <tr>
    	<td><strong>Objet: </strong></td>
    	<td><input type="text" name="subject" value="<?php echo $_POST['subject'];?>" /></td>
    
    </tr>
       <tr>
         <td><strong>Message:</strong></td>
         <td>
    	<textarea name="message" cols='45' rows='5'><?php echo $_POST['message'];?></textarea>
         </td>
       </tr>
    
    	<td>
    		<input type="hidden" name="loggedin" value="<?php echo (Auth::LoggedIn())?'true':'false'?>" />
    	</td>
    	<td>
             <input type="submit" name="submit" value='Send Message'>
    	</td>
       </tr>
     </table>
    </form>
    
     

     

    Code of Contact.php :

     

    
    <?php
    /**
    * phpVMS - Virtual Airline Administration Software
    * Copyright (c) 2008 Nabeel Shahzad
    * For more information, visit www.phpvms.net
    *	Forums: http://www.phpvms.net/forum
    *	Documentation: http://www.phpvms.net/docs
    *
    * phpVMS is licenced under the following license:
    *   Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
    *   View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
    *
    * @author Nabeel Shahzad
    * @copyright Copyright (c) 2008, Nabeel Shahzad
    * @link http://www.phpvms.net
    * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
    */
    
    class Contact extends CodonModule 
    {
    
    public function index()
    {
    	if($this->post->submit)
    	{
    		$captcha = SessionManager::Get('captcha_sum');
    
    		if($this->post->loggedin == 'false')
    		{		
    
    
    			# Make sure they entered an email address
    			if(trim($this->post->name) == '' 
    				|| trim($this->post->email) == '')
    			{
    				$this->set('message', 'You must enter a name and email!');
    				$this->render('core_error.tpl');
    				return;
    			}
    		}
    
    		if($this->post->subject == '' || trim($this->post->message) == '')
    		{
    			$this->set('message', 'You must enter a subject and message!');
    			$this->render('core_error.tpl');
    			return;
    		}
    
    		$subject = 'New message from '.$this->post->name.' - "'.$this->post->subject.'"';
    		$message = DB::escape($this->post->message) . PHP_EOL . PHP_EOL;
    
    		foreach($_POST as $field=>$value)
    		{
    			$message.="-$field = $value".PHP_EOL;
    		}
    
    		Util::SendEmail($this->post->recipient, $subject, $message);
    
    		$this->render('contact_sent.tpl');
    		return;
    	}		
    
    	# Just a simple addition
    	$rand1 = rand(1, 10);
    	$rand2 = rand(1, 10);
    
    	$this->set('rand1', $rand1);
    	$this->set('rand2', $rand2);		
    
    	$tot = $rand1 + $rand2;
    	//echo "total: $tot <br />";
    	SessionManager::Set('captcha_sum', $tot);
    
    	//echo 'output of $_SESSION: <br />';
    	//print_r($_SESSION);
    
    	$this->render('contact_form.tpl');
    }
    
    }
    
     

     

    Can you help me please ?

     

    On mine working only to email i added in admin panel , i add in form another two and dont send to them , 

  2. Try this

    <select name="aircraft">
    <?php
    foreach($aircraft as $ac) {
    if($ac->id == $route->aircraft) {
    $sel1 = "selected";
    } else {
    $sel1 = "";
    }
    
    if($ac->enabled == '0') {
    continue;
    }
    
    echo '<option value="'.$ac->id.'" '.$sel1.'>'.$ac->name.' - '.$ac->registration.'</option>';
    }
    ?>
    </select>
    

    Work's great , thank you so much

  3. Hi

    In my va i have a form to bid a flight where pilot choose a AC , FL insert a route etc ..

    My code to choose a AC is -

    <select name="aircraft"><?php foreach($aircraft as $ac) { if($ac->id == $route->aircraft) { $sel1 = "selected"; } else { $sel1 = ""; } ?><option value="<?php echo $ac->id ?>" <?php echo $sel1 ?>><?php echo $ac->name.' - '.$ac->registration; ?></option><?php } ?></select>

    What i want is change code so disabled aircrafts will not show.

    Thank You in advance

  4. The reason you get that error is that you actually haven't defined your module for the system. What you need to do is to create a folder in "core/modules" named "shoutbox" inside the folder you'll need a file named "shoutbox.php" inside that you'll need to add the following code:

    
    class shoutbox extends CodonModule
    {
    public function index()
    {
    
    $this->show('/shoutbox.php');
    
    }
    }
    
    

    Then you'll need to create another file named "shoutbox.php" and place it in your "lib/skins/yourskinfolder" inside that file you'll need to add whatever codes you want. This is how you make a module that actually works.

    Cheers

    Hi Parko i all ready have all that.

  5. Looks like my question marks on news are only showing if i use space , when i look for the code source and have -   space on news page after publish instead space i have question marks.

  6. Works now fantastic , another problem ...before when i log in and insert my details and click log in its open a profile page , or when i book a flight its take me to xxxxx//index.php/schedules/bids , now its open a empty page and i got xxxxxx//index.php/bidoptions/confirmbid

    Where is a problem ?

  7. Im try to transfer va to new db and new hosting ..all the files are there just got that error - Notice: The template file "/home/travelje/public_html//lib/skins/cc_vaskin_01S/header.tpl" doesn't exist in /home/travelje/public_html/core/classes/TemplateSet.class.php on line 248

  8. Hello , just one question all works perfect for me on two va's , im wonder if is possible to change the name when saving flight plan for ex. my fligt plan for PMDG is now - EPGDEPWA_PMR_1427875235.rte , i woudl like to have like PFPX do for example - EPGDEPWA01.rte. Where i can change that.

×
×
  • Create New...