Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. your mixing function and output. you need to do something along these lines:

    <?php
    function pokies_header_468_60_banner()
    {
    $output = '<div class="header_banner" >';
    $output .= adrotate_group(16);
    $output .= '</div>';
    return $output;
    }
    ?>
    

     

    then where you need to print it out:

    <?php
    print pokies_header_468_60_banner();
    ?>
    

  2. Hi Guys,

     

    I have been playing around with zend 2 and all going well, as I am sure you are aware the documentation is still in its early stages and is incomplete in some places.

    The problem I have got is I am trying to find the correct way to populate the options of a select element from a model using the zend table gateway method.

     

    I got this working fine using doctrine, but decided to try the gateway way aswell, and I have to admit it has me a little stumped. Do any of you have an example of this, or a good reference for it?

     

    thanks

  3. You will have to contact the developer of the plugin to get those answers. no one on this forum is going to be able to tell you what is happening without seeing the plugin code. If you want someone to fix it for you then you will be better posting in the freelance section

  4. or you could move the left div under the right div in the html, i have come a cropper on this more than once. If you want something to float right next to something floating left then it needs to be placed before the left float:

     

     

    
    <div class="rightstuff">  <option selected>Please Choose</option>
    <option value="Mr">Mr</option>
    <option value="Mrs">Mrs</option>
    <option value="Mr">Ms</option>
    <option value="Dr">Dr</option>
    </select>
    <br>
    
    
    
    
    <input type="text" name="Firstname"><br>
    <input type="text" name="Middlename"><br>
    <input type="text" name="Lastname"><br>                  
    <?php echo $form1; ?> <!--$form1 can be found in "includeDOB.php" --><br><br>
    
    
    
    
    
    <input type="text" name="PassportNo"><br>
    <?php echo $form2; ?><br> <!--$form2 can be found in "includeDOB.php" -->
    <?php echo $form3; ?><br> <!--$form3 can be found in "includeDOB.php" -->
    <input type="text" name="Nationality"><br>
    <input type="text" name="Issuecountry"><br><br>
    
    
    
    
    <!-- NEXT OF KIN INFO v -->
    
    <input type="text" name="Fullname"><br>
    <input type="text" name="Address"><br>
    <input type="text" name="Postcode"><br>
    <input type="text" name="Relationship"><br>
    <input type="text" name="Mobilenumber"><br>
    <input type="text" name="Daytimephone"><br>
    <input type="text" name="Eveningphone"><br>
    <input type="text" name="Email"><br><br>
    
    
    
    
    <!--TRAVEL INSURANCE DETAILS-->
    
    <input type="text" name="Company"><br>
    <input type="text" name="Policynumber"><br>
    <input type="text" name="Underwriter"><br>
    <input type="text" name="Emergencynumber"><br><br><br></div>
    
    <div class="leftstuff"><h1>Personal Information</h1><br>
    <!--PERSONAL INFORMATION -->
    
    
    Title:*<br>First Name:*<br>Middle Name:<br>Last Name:*<br>Last Name:*<br>Date of Birth:*<br><br><h1>Passport Details</h1><br>Passport Number:*<br>Date of Issue:*<br>Date of Expiry:*<br>Nationality:*<br>Issue Country:*<br><br><h1>Next of Kin Information</h1><br>Full Name:*<br>Address:*<br>Postcode:*<br>Relationship:*<br>Mobile Number:*<br>Daytime Phone:<br>Evening Phone:<br>Email Address:<br><br><h1>Travel Insurance Details</h1><br>Insurance Company:<br>Policy Number:<br>Medical Company Name:<br>Emergency Medical Contact Number:<br><br><br><span class="bottomtext">I have read and agree to the <a target="_blank" href="http://planetcruise.co.uk/about-planet-cruise/terms">terms and conditions</a></span> <input type="checkbox" name="checkbox">           <input type="submit" value="Submit"><select name="Title"></div>
    
    
    
    
    

  5. So, I have been playing round with using doctrine for a while now and have it in some basic projects, but i decided to go back and have an in depth look into what it can do.

     

     

     

     

    Ive now decided to switch to symfony 2 as my framework of choice and am looking into what doctrine 2 can do in more depth.

     

     

     

     

    One thing i have been trying to get my head around is the many to many relationship within doctrine. I am starting to build a recipe system and am working on the relation between recipe and ingredients which gave me 3 entities, recipe, recipeIngredient and ingredient. The reason i cannot use a direct many to many relation is because i want to store two additional columns in the join table ( unit and quantity ) for each ingredient.

     

     

     

     

    The problem i am having at the moment is that the entities persist ok, but the recipe_id in the join table is not inserted. The ingredient saves fine and the ingredient_id is stored as expected. I have tried everything i can think off and been through every thread and website looking for an answer . I am sure it is something completely obvious that i am missing. Please help, below is the code i have so far:

     

     

     

     

    <?php
    namespace Recipe\RecipeBundle\Entity;
    use Doctrine\ORM\Mapping as ORM;
    use Doctrine\Common\Collections\ArrayCollection;
    /**
    * @ORM\Entity
    * @ORM\Table(name="recipe")
    * @ORM\HasLifecycleCallbacks()
    */
    class Recipe{
    
    
    
    
    
    /**
    * @ORM\Id
    * @ORM\Column(type="integer")
    * @ORM\GeneratedValue(strategy="AUTO")
    */
    protected $id;
    
    
    
    
    
    /**
    * @ORM\OneToMany(targetEntity="RecipeIngredient", mappedBy="recipe", cascade= {"persist"})
    */
    protected $ingredients;
    /**
    * @ORM\Column(type="string")
    * @var string $title
    *
    */
    protected $title;
    /**
    * Constructor
    */
    public function __construct()
    {
    $this->ingredients = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    
    
    
    
    /**
    * Get id
    *
    * @return integer
    */
    public function getId()
    {
    return $this->id;
    }
    
    
    
    
    
    /**
    * Add ingredients
    *
    * @param \Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients
    * @return Recipe
    */
    public function addIngredient(\Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients)
    {
    $ingredients->setRecipe($this);
    $this->ingredients[] = $ingredients;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Remove ingredients
    *
    * @param \Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients
    */
    public function removeIngredient(\Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients)
    {
    $this->ingredients->removeElement($ingredients);
    }
    
    
    
    
    
    /**
    * Get ingredients
    *
    * @return \Doctrine\Common\Collections\Collection
    */
    public function getIngredients()
    {
    return $this->ingredients;
    }
    
    
    
    
    
    /**
    * Set title
    *
    * @param string $title
    * @return Recipe
    */
    public function setTitle($title)
    {
    $this->title = $title;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Get title
    *
    * @return string
    */
    public function getTitle()
    {
    return $this->title;
    }
    }
    and recipeIngredient
    
    
    
    
    
    /**
    * @ORM\Id
    * @ORM\Column(type="integer")
    * @ORM\GeneratedValue(strategy="AUTO")
    */
    protected $id;
    
    
    
    
    
    /**
    * @ORM\ManyToOne(targetEntity="Recipe", inversedBy="ingredients")
    * */
    protected $recipe;
    
    
    
    
    
    /**
    * @ORM\ManyToOne(targetEntity="Ingredient", inversedBy="ingredients" , cascade={"persist"})
    * */
    protected $ingredient;
    
    
    
    
    
    /**
    * @ORM\Column(type="string")
    * @var string $quantity
    *
    */
    protected $quantity;
    
    
    
    
    
    /**
    * @ORM\Column(type="string")
    * @var string $unit
    *
    */
    protected $unit;
    
    
    
    
    
    /**
    * Get id
    *
    * @return integer
    */
    public function getId()
    {
    return $this->id;
    }
    
    
    
    
    
    /**
    * Set quantity
    *
    * @param string $quantity
    * @return RecipeIngredient
    */
    public function setQuantity($quantity)
    {
    $this->quantity = $quantity;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Get quantity
    *
    * @return string
    */
    public function getQuantity()
    {
    return $this->quantity;
    }
    
    
    
    
    
    /**
    * Set unit
    *
    * @param string $unit
    * @return RecipeIngredient
    */
    public function setUnit($unit)
    {
    $this->unit = $unit;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Get unit
    *
    * @return string
    */
    public function getUnit()
    {
    return $this->unit;
    }
    
    
    
    
    
    /**
    * Set recipe
    *
    * @param \Recipe\RecipeBundle\Entity\Recipe $recipe
    * @return RecipeIngredient
    */
    public function setRecipe(\Recipe\RecipeBundle\Entity\Recipe $recipe = null)
    {
    $this->recipe = $recipe;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Get recipe
    *
    * @return \Recipe\RecipeBundle\Entity\Recipe
    */
    public function getRecipe()
    {
    return $this->recipe;
    }
    
    
    
    
    
    /**
    * Set ingredient
    *
    * @param \Recipe\RecipeBundle\Entity\Ingredient $ingredient
    * @return RecipeIngredient
    */
    public function setIngredient(\Recipe\RecipeBundle\Entity\Ingredient $ingredient = null)
    {
    $this->ingredient = $ingredient;
    
    
    
    
    
    return $this;
    }
    
    
    
    
    
    /**
    * Get ingredient
    *
    * @return \Recipe\RecipeBundle\Entity\Ingredient
    */
    public function getIngredient()
    {
    return $this->ingredient;
    }
    }
    

  6. if your uncommenting dll's then i can presume you are using a windows machine. Why not try a couple of alternative server stacks that have everything in place for you. Zend server community edition comes with phpmyadmin pre configured for you, and WAMP is alos a good server to use.

  7. you would just join the employee and licence tables aswell using the employee table as the reference, so something like this ( a bit rough but you should get the gist of it

    SELECT Emp_ID, Cal_Date, a.Area_Name, shift_ID, Stat_ID, [b]l.licence_type[/b] FROM schedule s
    INNER JOIN area a ON s.Area_ID = a.Area_ID
    [b]JOIN Employee e ON s.Emp_ID = e.Emp_ID
    JOIN licence l on l.Lic_ID = e.Lic_ID [/b]
    

    )

  8. best you read up on a few sql and join tutorials, the mysql website is a good repo to work through. 'schedule s' is declaring an alias for schedule, so instead of typing schedule.fieldname i can just refer to schedule through its alias s, you can call the alias anything you want as long as it has meaning. And yes, now your tables are joined you can pull any fields from either table. Hope this helps

×
×
  • 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.