Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

soopers's Achievements


Newbie (1/14)



  1. thanks larry for reply. do you have any third-party option in your mind ?
  2. I want to set the newsletter option in my site. i.e. the users subscribe to the newsletter with their name, email. and then on monthly basis a pdf format of document (that describe the organizations different achievements in that week) is sent to those emails, who have subscribed to our newsletter. the subscription form should be sent using ajax request. Please share your ideas and if anyone have done this kind of settings before then please share. thanks in advance.
  3. thanks larry for your reply. I have already the one pager theme. But how can I layout it. as we have to show all the models data on the same page. and also if any form insertion then it would be done on that page. also how can I set the navbar url path for different sections of the page i.e. how to write the code in createUrl() method for different ids of the section of the page.
  4. How can we create one pager or parallex websites in yii framework ?
  5. Hello guys. I am using a revolution slider in my project, in which the background images of the slider are set using javascript code. So how can I set the path for that images because currently it is not displaying once I have convert the theme into yii. here is javascript code that I have paste in main layout file. jQuery(document).ready(function () { window.slider_bg = {"ind": 0, // index to start sliding at "source": ["<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide1.jpg", //replace these slides with your own ones "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide2.jpg", "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide3.jpg", "<?php echo Yii::app()->theme->baseUrl; ?>/pic/slider/bg_slide4.jpg"], "bg_container": jQuery("#bg_container"), "bg_substrate": jQuery("#bg_substrate")}; window.slider_bg.bg_container.css("background-image", "url(" + window.slider_bg.source[window.slider_bg.ind] + ")"); }); the above code work fine on local server, but doesn't work on online server. How can I solve this ? Thanks in advance.
  6. I have 3 types of contact us pages. i.e Contact with Admin, contact with Director, Contact with Producer. and and every page have a contact form through which we can contact with the concern person i.e. Director, Admin, Producer. and I want that when the contact us form is filled then this data should be sent the concern person's email address. So how can I do this ? thanks in advance.
  7. I have set some custom validation for login the user, i.e. once a user create an account then that account will be confirmed by the administrator of the site, for that purpose I am using is_confirmed (ENUM) type field. and I have set its validation on login action and a user can't login if its not yet confirmed, but I have set a simple text message like "You are not yet confirmed" and this message is displayed at the top of the page. Now I want to show that message in form, just like when we enter an invalid password then it shows the message that your password is inavlid etc. So how can I show my message in the login form below the text field boxes. Thanks in advance.
  8. I am using this extension and it works good. but when I change the date then as it is updated in the database, but on the gridview field it is not displaying. I am using beforeSave() and afterFind() methods of yii in my model. as bellow protected function beforeSave() { if (parent::beforeSave()) { if ($this->isNewRecord) { $this->dob= date('Y-m-d', strtotime($this->dob)); return true; } else { $this->dob= date('Y-m-d', strtotime($this->dob)); return true; } } else return false; } protected function afterFind() { if (strtotime($this->dob) != 0) $this->dob= XHtml::formatDate($this->dob); else $this->dob= ''; return TRUE; } So how can I solve my problem. Also the datepicker range is from 2004-2024 is the issue that how to increase this range.
  9. Thanks Larry for your reply. Actually I have to fields and two models data, and I am switching the fields and in both the fields both models data can be saved. So when in cgridview, I want to display that two fields data, then I want to display the name fields data instead of id. Now in both of fields, both models data is saved, so how can I classify that data regarding to their model ?
  10. Hello guys, how are you ? I have three tables "A", "B" and "C", all the tables have 'name' fields, now I am saving the "B" and "C"'s table data in table "A" such that I am changing the field display property using javascript and can save both the tables i.e. "B" and "C" data in either field. Now In "A"'s admin gridview I want to display both fields data that I have stored in "A" table and it displays the ids of all those records. Now I want to display the 'name' of the records of "B" and "C"'s tables instead of their ids. So how can I do this ? One option is to use Joins and Unions. But I don't have that concept. Please anyone who knows the solution help me ? Thanks in advance.
  11. hello dears. I am currently working on a project in which I want to use the Search() as just like we use with Gridview (admin view that gii generates by default.). But I want to display my search result on some other page. here is my code. Search code on index page. <?php $this->renderPartial('_search', array( 'model' => $model, )); ?> <?php Yii::app()->clientScript->registerScript('my-list-search', " $('.search-button').click(function(){ $('.search-form').toggle(); return false; }); $('.search-form form').submit(function(){ $.fn.yiiListView.update('itemslistview', { data: $(this).serialize() }); return false; }); "); ?> and I want to display its result on the some other page e.g. search_result.php <?php $this->widget('zii.widgets.CListView', array( 'id' => 'itemslistview', 'dataProvider' => $model->search(), 'summaryText' => '', 'itemView' => '_products', 'enablePagination' => false, )); ?> and here is search() public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria = new CDbCriteria; $criteria->compare('id', $this->id); $criteria->compare('language', $this->language, true); $criteria->compare('seller_id', $this->seller_id); $criteria->compare('category_id', $this->category_id); $criteria->compare('title', $this->title, true); $criteria->compare('detail', $this->detail, true); $criteria->compare('tags', $this->tags, true); $criteria->compare('url', $this->url, true); $criteria->compare('vehicle_type', $this->vehicle_type); $criteria->compare('brand_id', $this->brand_id); $criteria->compare('model_id', $this->model_id); $criteria->compare('year', $this->year); $criteria->compare('code', $this->code, true); $criteria->compare('image', $this->image, true); $criteria->compare('price', $this->price, true); $criteria->compare('is_new', $this->is_new, true); $criteria->compare('in_stock', $this->in_stock, true); $criteria->compare('is_featured', $this->is_featured, true); $criteria->compare('is_blocked', $this->is_blocked, true); $criteria->compare('status', $this->status); $criteria->compare('viewed', $this->viewed); $criteria->compare('last_modified', $this->last_modified, true); $criteria->compare('create_date', $this->create_date, true); return new CActiveDataProvider($this, array( 'criteria' => $criteria, )); } but it is not working. How can I solve my problem ? Thanks in advance.
  12. Thanks sir for your response. Sir I am new to yii and also have no idea of ajax. So if you write the code which you have told, then it will be effecient for me. Thanks
  13. Hello everyone. I am displaying the products records in index page in which I want to display a delete button with each Item, so that when click on that delete button then it should delete that Item record. I have set something but doesn't work, <?php echo CHtml::button('Delete', array( 'submit' => array('item/delete', array('id' => $data->id)), 'confirm' => 'Are you sure?' ) ); ?> and here is the delete action public function actionDelete($id) { if(Yii::app()->request->isPostRequest) { // we only allow deletion via POST request $this->loadModel($id)->delete(); // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser if(!isset($_GET['ajax'])) $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } else throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); } Where I am doing mistake ?? Thanks in advance.
  • Create New...