Jump to content

Afreen

Members
  • Posts

    9
  • Joined

  • Last visited

Afreen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey the problem is solved. I just had to change one line in the javascript. Instead of <script type="text/javascript"> jQuery(function(){ //jQuery(document).ready(function(){ jQuery("#name").autocomplete({ source: "overall/search", // path to the overall/search method minLength: 1 }); }); </script> i need to change in the source line : source: "<? echo site_url('overall/search');?>",
  2. <script type="text/javascript"> jQuery(function(){ //jQuery(document).ready(function(){ jQuery("#name").autocomplete({ source: "overall/search", // path to the overall/search method minLength: 1 }); }); </script> <form action="<? echo site_url();?>/overall/search_all" name="overall_search" id="overall_search" onsubmit="return search_Val();" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <input name="name" id="name" type="text" class="searchBox1" border="1" value="" placeholder = "Enter event name or location"/> </td> <td width="80"> <input type="submit" value="Search" border="0" class="butt" style="margin-top:0px;" /> </td> </tr> </table> </form> The controller is called when the input type name is entered, class Overall extends CI_Controller { // $ Afreen A Kazi -28/05/2013 - The search() is called when the single search field is searched in the home page. It navigates // to the display_venue page in views folder. - START public function search() { $this->load->model('find_overall'); if (isset($_GET['term'])){ $q = strtolower($_GET['term']); $this->find_overall->search($q); } } // $ Afreen A Kazi - 28/05/2013 - search() - END } After this a model named as find_overall is called class Find_overall extends CI_Model { // $ Afreen A Kazi - 07/06/2013 - The search() gets all the list of event_type or event_location and displays on display // venuez page. - START public function search($q) { $query = $this->db->query("select distinct event_name from event_details where event_name like '$q%'"); $query1 = $this->db->query("select distinct event_location from event_details where event_location like '$q%'"); if($query->num_rows > 0){ foreach ($query->result_array() as $row){ $row_set[] = htmlentities(stripslashes($row['event_name'])); //build an array } echo json_encode($row_set); //format the array into json data } if($query1->num_rows > 0){ foreach ($query1->result_array() as $row1) { $row1_set[] = htmlentities(stripslashes($row1['event_location'])); } echo json_encode($row1_set); } } // $ Afreen A Kazi - 07/06/2013 - search() - END } This code works perfectly fine when the home page is called via a href link i.e. <a href="<? echo site_url();?>/home">Home</a> But, when the same thing is called via controller i.e. $this->load->view('home'); it doesn't. Please help.
  3. Hi all, I am facing problem in autocomplete feature in my project. I am working in codeigniter mvc framework. I have used autocomplete feature in my views folder. That is: I have written the autocomplete code in my home page. when the home page is called via controller then the autocomplete in jquery does not work. But, the same thing works when the home page is called without controller. For example: when i call via controller its like: public function index() { $this->load->view(‘home’); } it does not work. And then when I click on home page link: Home it works. What is the problem with the autocomplete feature while calling from controller. Please suggests.
  4. While writting in the admin part, I added ././images/venuez/$image_name while inserting into a folder. with the help of this the image is stored at the front end side.
  5. Solved it by myself, but forgot to reply here: In the contactform-code.php, in the javascript part it is wriiten: document.forms['contactus'].refresh_container=function() { var formpopup = document.getElementById('fg_formContainer'); var innerdiv = document.getElementById('fg_form_InnerContainer'); var b = innerdiv.offsetHeight+30+30; formpopup.style.height = b+"px"; } instead of the last line i added formpopup.style.height = "auto": And the problem is solved.
  6. I am doing a project which contains all the venue related information like birthday, wedding ceremony etc. The problem is: I have written all my front end programs in venuez/application/controller or view or model folder. And for admin i am writing programs in venuez/admin/application/controller or view or model folder. The thing is that, when the admin is adding venues to the site it is uploaded in the folder named as venuez/admin/images and frontend takes images from venuez/images folder. I think i should copy images from admin to frontend at the time of insertion and updation. Is this a proper solution, else please suggest me your opinion so that I can go forward and complete my project. Also if copying is the answer then i am confused with the path of the folders. Please suggests. Thanks in advance
  7. I am using Codeigniter framework. This is my pop-up form code (contactform-code.php): <div id='fg_formContainer' > <div id="fg_container_header"> <div id="fg_box_Title">Enquiry Form</div> <div id="fg_box_Close"><a href="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');">Close(X)</a></div> </div> <? //echo base_url();?><!--enquiry/form?--> <div id="fg_form_InnerContainer"> <!-- Main Div --> <div> <form id='contactus' action='' method='post' accept-charset='UTF-8'> <input type='hidden' name='submitted' id='submitted' value='1'/> <input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/> <input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' /> <div class='short_explanation'> Please fill in your information below and Stan Howard will contact you as soon as possible to book your event.<br/> Or call (877) 627-3320<br/><br/> <font color="red">*</font> required fields </div> <div id='fg_server_errors' class='error'></div> <!-- Left Div --> <div style="width:175px;float:left;"> <div class='container'> <label for='name' ><font color="red">*</font>Your Name : </label><br/> <input type='text' name='name' id='name' value='' maxlength="50" /><br/> <span id='contactus_name_errorloc' class='error'></span> </div> <div class='container'> <label for='email' ><font color="red">*</font>Email Address :</label><br/> <input type='text' name='email' id='email' value='' maxlength="50" /><br/> <span id='contactus_email_errorloc' class='error'></span> </div> <div class='container'> <label for='phone' ><font color="red">*</font>Phone :</label><br/> <input type='text' name='phone' id='phone' value='' maxlength="50" /><br/> <span id='contactus_phone_errorloc' class='error'></span> </div> <div class='container'> <label for='event_date' ><font color="red">*</font>Event Date :</label><br/> <input type='text' name='event_date' id='event_date' value='' maxlength="50" /><br/> <span id='contactus_event_date_errorloc' class='error'></span> </div> <div class='container'> <label for='event_time' ><font color="red">*</font>Event Time :</label><br/> <input type='text' name='event_time' id='event_time' value='' maxlength="50" /><br/> <span id='contactus_event_time_errorloc' class='error'></span> </div> <div class='container'> <input type="checkbox" name="flexible_date" id="flexible_date"/> <label for='flexible_date' >Dates are flexible </label><br/> <span id='contactus_flexible_date_errorloc' class='error'></span> </div> </div> <!-- Left Div Ends Here --> <!-- Right Div Starts Here --> <div style="width:285px;float:left;margin-left:40px;"> <div class='container'> <label for='event_type' ><font color="red">*</font>Event Type :</label><br/> <!-- <input type='text' name='event_type' id='event_type' value='' maxlength="50" /><br/>--> <select id="event_type" name="event_type"> <option value="">Please Select</option> <option value="Birthday">Birthday</option> <option value="Corporate Events">Corporate Events</option> <option value="Social Events">Social Events</option> <option value="Wedding Ceremony">Wedding Ceremony</option> </select><br/> <span id='contactus_event_type_errorloc' class='error'></span> </div> <div class='container'> <label for='no_of_guests' ><font color="red">*</font>Estimated number of guests :</label><br/> <input type='text' name='no_of_guests' id='no_of_guests' value='' maxlength="50" /><br/> <span id='contactus_no_of_guests_errorloc' class='error'></span> </div> <div class='container'> <label for='details' >Additional Details</label><br/> <span id='contactus_details_errorloc' class='error'></span> <textarea rows="10" cols="30" name='details' id='details'></textarea> </div> <div class='container'> <input type='submit' name='Submit' value='Submit' /> </div> </div> <!-- Right Div Ends Here --> </div> <!-- Main Div Ends Here --> </form> </div> </div> <!-- client-side Form Validations: Uses the excellent form validation script from JavaScript-coder.com--> <script type='text/javascript'> // <![CDATA[ var frmvalidator = new Validator("contactus"); frmvalidator.EnableOnPageErrorDisplay(); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email address"); frmvalidator.addValidation("email","email","Please provide a valid email address"); frmvalidator.addValidation("phone","req","Please provide your phone number"); frmvalidator.addValidation("event_date","req","Please provide your event date"); frmvalidator.addValidation("event_time","req","Please provide your event time"); frmvalidator.addValidation("event_type","req","Please provide your event type"); frmvalidator.addValidation("no_of_guests","req","Please provide total number of guests"); frmvalidator.addValidation("details","maxlen=2048","The additional detail is too long!(more than 2KB!)"); document.forms['contactus'].refresh_container=function() { var formpopup = document.getElementById('fg_formContainer'); var innerdiv = document.getElementById('fg_form_InnerContainer'); var b = innerdiv.offsetHeight+30+30; formpopup.style.height = b+"px"; } document.forms['contactus'].form_val_onsubmit = document.forms['contactus'].onsubmit; document.forms['contactus'].onsubmit=function() { if(!this.form_val_onsubmit()) { this.refresh_container(); return false; } return true; } function fg_submit_form() { //alert('submiting form'); var containerobj = document.getElementById('fg_form_InnerContainer'); var sourceobj = document.getElementById('fg_submit_success_message'); var error_div = document.getElementById('fg_server_errors'); var formobj = document.forms['contactus'] var submitter = new FG_FormSubmitter("popup-contactform.php",containerobj,sourceobj,error_div,formobj); var frm = document.forms['contactus']; submitter.submit_form(frm); } // ]]> </script> <div id='fg_backgroundpopup'></div> <div id='fg_submit_success_message'> <h2>Thanks!</h2> <p> Thanks for contacting us. We will get in touch with you soon! <p> <a href="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');">Close this window</a> <p> </p> </div> The pop-up form is called in the main file over here: <body onload="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');"> <? include('popup-contactform.php');?> <div align="right"> <a href='javascript:fg_popup_form("fg_formContainer","fg_form_InnerContainer","fg_backgroundpopup");'> <img src="<? echo base_url();?>images/make.png" border="0" /> </a> </div> include('contactform-code.php'); </body> The popup-contactform.php id here: <?php /* Contact Form from HTML Form Guide This program is free software published under the terms of the GNU Lesser General Public License. See this page for more info: http://www.html-form-guide.com/contact-form/simple-modal-popup-contact-form.html */ //$this->load->view('fgcontactform') include('fgcontactform.php'); $formproc = new FGContactForm(); //1.Add your email address here. //You can add more than one receipients. $formproc->AddRecipient('tests@html-form-guide.com'); //<<---Put your email address here //2. For better security. Get a random string from this link: http://tinyurl.com/randstr // and put it here $formproc->SetFormRandomKey('dz0sbNoc7mZPgXa'); if(isset($_POST['submitted'])) { if($formproc->ProcessForm()) { echo "success"; } else { echo $formproc->GetErrorMessage(); } } ?> The styles which I am using is: <style type="text/css"> #fg_formContainer { height:500px; width:550px; background:#FFFFFF; border:1px solid #000; padding:0; position:absolute; z-index:999; cursor:default; -moz-border-radius: 10px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; border-radius: 10px; display:none; } #contactus .spmhidip { display:none; width:10px; height:3px; } #fg_container_header { height:30px; background:#587a01; border-top-right-radius:10px; -moz-border-radius-topright:10px; -webkit-border-top-right-radius:10px; -khtml-border-top-right-radius: 10px; border-top-left-radius:10px; -moz-border-radius-topleft:10px; -webkit-border-top-left-radius:10px; -khtml-border-top-left-radius: 10px; } #fg_container_header a { color:#fff; font-family:Verdana,Arial; font-size:10pt; font-weight:bold; } #fg_box_Title { float:left; width:180px; margin:5px; margin-left:10px; color:#fff; font-family:"Delicious Smallcaps"; font-size:15pt; font-weight:bold; } #fg_box_Close { float:right; width:80px; margin:5px; font-family:"Delicious Smallcaps"; text-decoration:none; } #fg_form_InnerContainer { margin:15px; } #fg_form_InnerContainer h2 { font-family : Arial, sans-serif; font-size: 14pt; font-weight:bold; color:#333; } #fg_form_InnerContainer p { font-family : Arial, sans-serif; font-size: 12pt; color:#333; } #fg_backgroundpopup { position: fixed; top:0; left:0; bottom:0; right:0; background:#000000; opacity: .3; -moz-opacity: .3; filter: alpha(opacity=30); border:1px solid #cecece; z-index:1; display:none; } #fg_submit_success_message { display:none; padding:15px; } #contactus input[type=submit] { width:100px; height:30px; padding-left:0px; } #contactus textarea { height:120px; width:240px; } #contactus input[type=text]:focus,textarea:focus { color : #009; border : 1px solid #990000; background-color : #ffff99; font-weight:bold; } #contactus .container { margin-top:8px; margin-bottom: 10px; } #contactus .error { font-family: Verdana, Arial, sans-serif; font-size: 0.7em; color: #900; background-color : #ffff00; } </style>
  8. I have a pop-up form for 'Enquiry' page. I have completed the validation part of that form. When I submit the form, my form's size is reduced from 500px to 160px. I dont know why??? Previously, when I was doing the same pop-up form, all the fields were one after the other and at that time the form was fine even after submission. But, now I have made changes and divided the whole form in two divs - left and right, enclosed in another main div. And then the problem started. Can anyone help me out for?????
  9. I am a newbie to codeigniter. My website is a "Event Ordering" website. In this website users can come and order their venue for a particular city. Whenever we write code for a site, we include the admin folder in the application folder itself. i.e. application_folder/admin. I don't know how to give client the admin rights. We will give login for client. But, my question is: How can we give the url to the client. E.g. In core php, we ask the client to browse through www.application.com/admin and the page for the admin is opened. How to give the same thing in codeigniter??? (There is no user login in the website) I was thinking to create another folder inside htdocs as admin and then ask the client to login. I don't know whether i am correct or not?? Please suggest....
×
×
  • 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.