function display_form()
{
    global $errors;
    global $err_count;
    global $successMSG;
    global $msg;
    $secKEY = random_string_generator(10);
    $fakeKey1 = random_string_generator(128);
    $fakeKey2 = random_string_generator(16);
    $val_fullname = isset($_REQUEST['name']) ? $_REQUEST['name'] : "";
    $val_email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";
    $val_url = isset($_REQUEST['url']) ? $_REQUEST['url'] : "";
    $val_message = isset($_REQUEST['message']) ? $_REQUEST['message'] : "";
    if ($successMSG != 0) {
        $val_message = "";
    }
    ?>

<article class="puncoz-post puncoz-article">
	<div class="puncoz-postmetadataheader">
		<h2 class="puncoz-postheader">
			<span class="puncoz-postheadericon">Contact Us</span>
		</h2>
	</div>
	
	<div class="puncoz-postcontent puncoz-postcontent-0 clearfix">
		<div class="puncoz-content-layout">
			<div class="puncoz-content-layout-row">
				<div class="puncoz-layout-cell layout-item-0" style="width: 100%" >
					<p>
						<form action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
?refid=6&tokenKey=<?php 
    echo $fakeKey1;
    ?>
&secKEYOrg=<?php 
    echo $secKEY;
    ?>
&MsgID=<?php 
    echo $fakeKey2;
    ?>
" method="post" name="form-contact" id="form-contact" formnovalidate="formnovalidate">
							<fieldset class="input" style="border: 0 none;">
								
								<?php 
    if ($successMSG != 0) {
        ?>
  								<table width="245" border="1" bgcolor="#CCFFFF">
      								<tr>
        								<td width="235">
											<div align="center">
												<span style="color:#006633; font-size:16px; font-weight:bold;"><?php 
        echo $msg;
        ?>
</span>
											</div>
										</td>
      								</tr>
    							</table>
 								 <?php 
    }
    ?>
								
								<p style="margin-top: 5px">
									<p style="color:#669933; font-weight:bolder; font-size:17px">Full Name:<strong style="color:#FF0000; font-weight:bolder">*</strong></p>
									<input id="ContactName" type="text" name="name" class="inputbox" alt="name" size="18" value="<?php 
    echo $val_fullname;
    ?>
" required="required"/>
								</p>
								<p style="margin-top: 5px">
									<p style="color:#669933; font-weight:bolder; font-size:17px">e-mail:<strong style="color:#FF0000; font-weight:bolder">*</strong></p>
									<input id="ContactEmail" type="text" name="email" class="inputbox" alt="email" size="18" value="<?php 
    echo $val_email;
    ?>
" required="required"/>
								</p>
								<p style="margin-top: 5px">
									<p style="color:#669933; font-weight:bolder; font-size:17px">Website (Optional):</p>
									<input id="ContactURL" type="text" name="url" class="inputbox" alt="url" size="18" value="<?php 
    echo $val_url;
    ?>
"/>
								</p>
								<p>
									<p style="color:#669933; font-weight:bolder; font-size:17px">Messages:<strong style="color:#FF0000; font-weight:bolder">*</strong></p>
									<textarea name="message" rows="9" required="required"><?php 
    echo $val_message;
    ?>
</textarea>
								</p>
								<p style="margin-top: 5px">
									<p style="color:#669933; font-weight:bolder; font-size:17px">Security Key (Case Sensitive):<strong style="color:#FF0000; font-weight:bolder">*</strong> <?php 
    echo $errors['sec_key'];
    ?>
</p>
									<img src="images/sec_key_image.php?text=<?php 
    echo $secKEY;
    ?>
" width="172" height="62">
									 <input name="sec_key" type="text" id="sec_key"  value="Enter the sec. key" onfocus="this.value = &#39;&#39;;" onblur="if(this.value==&#39;&#39;) this.value=&#39;Enter the sec. key&#39;;" autocomplete="off"/>
								</p>
								<br />
								<p style="margin-top: 5px">
									<input type="hidden" name="submitted" />
									<input type="submit" value="Send" name="Send" class="puncoz-button" />
								</p>
							</fieldset>
						</form>
					</p>
				</div>
			</div>
		</div>
	</div>
</article>

<?php 
}
示例#2
0
 /**
  * Création d'un nouveau book
  * 
  */
 function create($source)
 {
     $this->load->helper('random_string_generator_helper');
     $book_private_key = random_string_generator(15, true, false, true, false);
     $book = array('user_id' => $source['user_id'], 'name' => $source['book_name'], 'description' => $source['description'], 'order' => $this->get_next_book_order($source['user_id']), 'private_key' => $book_private_key, 'id_occasion' => $source['occasion'], 'cover_pic' => 0, 'short_url' => '');
     $this->db->insert('user_book', $book);
     $book_id = $this->db->insert_id();
     $book_url = base_url() . 'index.php/book/show/' . $book_id;
     $this->load->library('bitly');
     $short_url = $this->bitly->shorten($book_url);
     $data = array('short_url' => $short_url);
     $this->db->where('id', $book_id)->update('user_book', $data);
     return $book_id;
 }