当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::runquery方法代码示例

本文整理汇总了PHP中Db::runquery方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::runquery方法的具体用法?PHP Db::runquery怎么用?PHP Db::runquery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db的用法示例。


在下文中一共展示了Db::runquery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     global $mySession;
     $db = new Db();
     $emailid_val = "";
     $qur = $db->runquery("SELECT * FROM  " . USERS . " WHERE user_id='" . $mySession->TeeLoggedID . "' ");
     //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' ");
     if ($qur != "" and count($qur) > 0) {
         $emailid_val = $qur[0]['emailid'];
     }
     # FORM ELEMENT:public name
     # TYPE : text
     $emailid = new Zend_Form_Element_Text('emailid');
     $emailid->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib('readonly', 'readonly')->setAttrib("style", "width:300px; height:30px;")->setValue($emailid_val);
     # FORM ELEMENT:address
     # TYPE : text
     $friendsemailid = new Zend_Form_Element_Text('friendsemailid');
     $friendsemailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'One id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("style", "width:300px; height:30px;")->setAttrib('class', 'changepasstextbox');
     //if(@$_REQUEST['friendsemailid']!="")
     //		{
     //		$friendsemailid-> addValidator('EmailAddress', true)
     //		->addDecorator('Errors', array('class'=>'errmsg'))
     //		->addErrorMessage('Please enter a valid email address');
     //		}
     //
     # FORM ELEMENT:city
     # TYPE : text
     $url = new Zend_Form_Element_Text('url');
     $url->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'URL is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:100px; height:30px;");
     $this->addElements(array($emailid, $friendsemailid, $url));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:31,代码来源:Referfriends.php

示例2: init

 public function init($name = "")
 {
     global $mySession;
     $db = new Db();
     //echo "url ....  : ".$name; die;
     $emailid_val = "";
     $emailfrnz_val = "";
     $quremailid = $db->runquery("SELECT emailid FROM  " . ORDER_RECORD . " WHERE teeurl='" . $name . "'");
     //prd($quremailid);
     if ($quremailid != "" and count($quremailid) > 0) {
         for ($i = 0; $i < count($quremailid); $i++) {
             if ($i == 0) {
                 $emailfrnz[$i] = $quremailid[$i]['emailid'];
             } else {
                 if (!in_array($quremailid[$i]['emailid'], $emailfrnz)) {
                     $emailfrnz[$i] = $quremailid[$i]['emailid'];
                 }
             }
         }
         //		prd($emailfrnz);
         $emailfrnz_val = implode(",", $emailfrnz);
     }
     $qur1 = $db->runquery("SELECT * FROM  " . LAUNCHCAMPAIGN . " WHERE url='" . $name . "' ");
     $qur = $db->runquery("SELECT * FROM  " . USERS . " WHERE user_id='" . $qur1[0]['user_id'] . "'");
     //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' ");
     if ($qur != "" and count($qur) > 0) {
         $emailid_val = $qur[0]['emailid'];
     }
     # FORM ELEMENT:public name
     # TYPE : text
     $emailid = new Zend_Form_Element_Text('emailid');
     $emailid->setRequired(true)->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:30px;")->setValue($emailid_val);
     if (@$_REQUEST['emailid'] != "") {
         $emailid->addValidator('EmailAddress', true)->addDecorator('Errors', array('class' => 'error'))->addErrorMessage('Please enter a valid email address');
     }
     # FORM ELEMENT:address
     # TYPE : text
     //$friendsemailid= new Zend_Form_Element_Text('friendsemailid');
     //		$friendsemailid->setRequired(true)
     //		->addValidator('NotEmpty',true,array('messages' =>'One id is required'))
     //		->addDecorator('Errors', array('class'=>'errmsg'))
     //		->setAttrib("style","width:300px; height:30px;")
     //		->setAttrib('class','changepasstextbox')
     //		->setValue($emailfrnz_val);
     $friendsemailid = new Zend_Form_Element_Hidden('friendsemailid');
     $friendsemailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'One id is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("style", "width:300px; height:30px;")->setAttrib('class', 'changepasstextbox')->setValue($emailfrnz_val);
     # FORM ELEMENT:city
     # TYPE : text
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subject is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:30px;");
     $content = new Zend_Form_Element_Textarea('content');
     $content->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Content is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:150px;");
     $this->addElements(array($emailid, $friendsemailid, $subject, $content));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:54,代码来源:Emailfriends.php

示例3: init

 public function init($campid)
 {
     global $mySession;
     $db = new Db();
     $title_val = "";
     $baseprice_val = "";
     $goal_val = "";
     $sold_val = "";
     $sellingprice_val = "";
     $description_val = "";
     $camplength_val = "";
     $url_val = "";
     $launchdate_val = "";
     if ($campid != "") {
         $qur = $db->runquery("SELECT * FROM  " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $campid . "'");
         if ($qur != "" and count($qur) > 0) {
             //prd($qur);
             $title_val = $qur[0]['title'];
             $baseprice_val = $qur[0]['base_price'];
             $goal_val = $qur[0]['goal'];
             $sold_val = $qur[0]['sold'];
             $sellingprice_val = $qur[0]['selling_price'];
             $description_val = $qur[0]['description'];
             $camplength_val = $qur[0]['campaign_length'];
             $url_val = $qur[0]['url'];
             $launchdate_val = $qur[0]['launch_date'];
         }
     }
     # FORM ELEMENT:no of tee
     # TYPE : text
     $baseprice = new Zend_Form_Element_Text('baseprice');
     $baseprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($baseprice_val);
     $sellingprice = new Zend_Form_Element_Text('sellingprice');
     $sellingprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sellingprice_val);
     # FORM ELEMENT:camptitle
     # TYPE : text
     $camptitle = new Zend_Form_Element_Text('camptitle');
     $camptitle->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:250px; height:30px;")->setvalue($title_val);
     # FORM ELEMENT:description
     # TYPE : text
     $description = new Zend_Form_Element_Textarea('description');
     $description->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:450px; height:120px;")->setvalue($description_val);
     $goal = new Zend_Form_Element_Text('goal');
     $goal->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($goal_val);
     $sold = new Zend_Form_Element_Text('sold');
     $sold->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sold_val);
     # FORM ELEMENT:url
     # TYPE : text
     $url = new Zend_Form_Element_Text('url');
     $url->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:60px; height:20px;")->setvalue($url_val);
     # FORM ELEMENT:url
     # TYPE : text
     $camplength = new Zend_Form_Element_Text('camplength');
     $camplength->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($camplength_val);
     # FORM ELEMENT:url
     # TYPE : text
     $launchdate = new Zend_Form_Element_Text('launchdate');
     $launchdate->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:70px; height:20px;")->setvalue($launchdate_val);
     $this->addElements(array($sellingprice, $baseprice, $camptitle, $camplength, $launchdate, $url, $description, $sold, $goal));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:60,代码来源:View.php

示例4: myInit

 public function myInit()
 {
     global $mySession;
     $db = new Db();
     $public_name = "";
     $emailid_val = "";
     $bio_value = '';
     $old_profile_image_value = '';
     $qur = $db->runquery("SELECT * FROM  " . USERS . " WHERE user_id='" . $mySession->TeeLoggedID . "' ");
     if ($qur != "" and count($qur) > 0) {
         $public_name = $qur[0]['public_name'];
         $emailid_val = $qur[0]['emailid'];
         $bio_value = $qur[0]['bio'];
         $old_profile_image_value = $qur[0]['profile_image'];
     }
     $publicname = new Zend_Form_Element_Text('publicname');
     $publicname->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Public name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($public_name);
     $bio = new Zend_Form_Element_Textarea('bio');
     $bio->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Bio is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "changepasstextarea")->setAttrib("style", "height:150px;width:354px;")->setAttrib("maxlength", "300")->setAttrib("placeholder", "Max 300 Characters")->setValue($bio_value);
     $profile_image = new Zend_Form_Element_File('profile_image');
     $profile_image->setDestination(SITE_ROOT . 'images/profileimages/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setAttrib("style", "width:325px");
     $old_profile_image = new Zend_Form_Element_Hidden('old_profile_image');
     $old_profile_image->setValue($old_profile_image_value);
     $emailid = new Zend_Form_Element_Text('emailid');
     $emailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email Id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($emailid_val);
     $this->addElements(array($publicname, $emailid, $bio, $profile_image, $old_profile_image));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:27,代码来源:Profile.php

示例5: viewnewsletterAction

 public function viewnewsletterAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageHeading = "Manage Newsletter";
     $qry = $db->runquery("select * from " . NEWSLETTER . " ");
     $this->view->sql = $qry;
 }
开发者ID:artyomvolodyev,项目名称:php,代码行数:8,代码来源:SystemController.php

示例6: indexAction

 public function indexAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageHeading = "Manage Subscriptions Plans";
     $qry = $db->runquery("select * from " . SUBSCRIPTIONS . "");
     $this->view->sql = $qry;
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:SubscriptionController.php

示例7: indexAction

 public function indexAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageHeading = "Sub Administrator";
     $Obj = new Subadmin();
     $sql = $db->runquery("select * from " . SUBADMIN . " ");
     $this->view->sql = $sql;
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:9,代码来源:SubadminController.php

示例8: indexAction

 public function indexAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageHeading = "Manage Pages";
     $qry = "select * from " . PAGES . " WHERE page_id<>'17' && page_id<>'18' ";
     $sql = $db->runquery($qry);
     $this->view->sql = $sql;
 }
开发者ID:artyomvolodyev,项目名称:php,代码行数:9,代码来源:PagesController.php

示例9: indexAction

 public function indexAction()
 {
     global $mySession;
     $db = new Db();
     $this->_helper->layout->setLayout('myaccount');
     $page = $this->getRequest()->getParam('page');
     $this->view->page = $page;
     $qry = "select * from " . PAGES . " WHERE page='" . $page . "'";
     $sql = $db->runquery($qry);
     //prd($sql);
     $this->view->sql = $sql;
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:12,代码来源:AboutController.php

示例10: init

 public function init($sno)
 {
     global $mySession;
     $db = new Db();
     $tee_value = "";
     $disc_val = "";
     //echo "serial no. : ".$sno; die;
     $qur = $db->runquery("SELECT * FROM  " . TSHIRT_DISCOUNT . " where sno=" . $sno . "");
     //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' ");
     if ($qur != "" and count($qur) > 0) {
         $tee_value = $qur[0]['no_of_tee'];
         $disc_val = $qur[0]['discount_per'];
     }
     $nooftee = new Zend_Form_Element_Text('nooftee');
     $nooftee->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Number of Tee is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($tee_value);
     $per_discount = new Zend_Form_Element_Text('per_discount');
     $per_discount->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Discount % is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($disc_val);
     $this->addElements(array($nooftee, $per_discount));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:19,代码来源:Discount.php

示例11: myInit

 public function myInit($sno)
 {
     global $mySession;
     $db = new Db();
     $size_value = "";
     $inch_val = "";
     if ($sno && $sno > 0) {
         $qur = $db->runquery("SELECT * FROM  " . TSHIRT_SIZE . " where sizeid=" . $sno . "");
         if ($qur != "" and count($qur) > 0) {
             $size_value = $qur[0]['size'];
             $inch_val = $qur[0]['size_inch'];
         }
     }
     $sizes = new Zend_Form_Element_Text('sizes');
     $sizes->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Size is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($size_value);
     $ininches = new Zend_Form_Element_Text('ininches');
     $ininches->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Size in inches is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($inch_val);
     $this->addElements(array($sizes, $ininches));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:19,代码来源:Size.php

示例12: loginAction

 public function loginAction()
 {
     global $mySession;
     $db = new Db();
     $this->_helper->layout()->setLayout('simplecontent');
     $myformsignup = new Form_Signupdesigned();
     $this->view->myformsignup = $myformsignup;
     if ($this->getRequest()->isPost()) {
         //$abc=$this->getRequest()->getParam('abc');
         $request = $this->getRequest();
         $myform = new Form_Login();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $qury = $db->runquery("Select * from " . USERS . " where emailid='" . $dataForm['emailid'] . "' AND password='" . $dataForm['pass'] . "'");
             if ($qury != "" and count($qury) > 0) {
                 if ($qury[0]['user_status'] == 1) {
                     $mySession->TeeLoggedID = $qury[0]['user_id'];
                     //$this->_redirect('launchcampaign/index');
                     echo "<script>parent.top.location='" . APPLICATION_URL . "launchcampaign/index';</script>";
                     exit;
                 } else {
                     $mySession->errorMsg = "Your Account is inactivated by admin";
                     $this->_redirect('logindesigned/index');
                 }
             } else {
                 $mySession->errorMsg = "invalid Email Address & Password";
                 $this->_redirect('logindesigned/index');
             }
         } else {
             //$mySession->errorMsg="form not valid";
             $this->view->myform = $myform;
             $this->render('index');
         }
     } else {
         //$mySession->errorMsg="check out";
         $this->_redirect('logindesigned/index');
     }
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:38,代码来源:LogindesignedController.php

示例13: init

 public function init($sno)
 {
     global $mySession;
     $db = new Db();
     $basepric_value = "";
     $shhpng_val = "";
     //echo "serial no. : ".$sno; die;
     $qur = $db->runquery("SELECT * FROM  " . TSHIRT_PRICE . " where sno=" . $sno . "");
     if ($qur != "" and count($qur) > 0) {
         $basepric_value = $qur[0]['base_price'];
         $shhpng_val = $qur[0]['shipping_price'];
     }
     $base_price = new Zend_Form_Element_Text('base_price');
     $base_price->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Base price is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($basepric_value);
     /*$per_profit= new Zend_Form_Element_Text('per_profit');
     		$per_profit->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Profit % is required.'))
     		->addDecorator('Errors', array('class'=>'errormsg'))
     		->setAttrib("class","mws-textinput required");*/
     $shippingprice = new Zend_Form_Element_Text('shippingprice');
     $shippingprice->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Shipping Rate is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($shhpng_val);
     $this->addElements(array($base_price, $shippingprice));
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:23,代码来源:Price.php

示例14: init

 public function init($Id)
 {
     global $mySession;
     $db = new Db();
     if ($Id != "") {
         $adminData = $db->runQuery("select * from " . TSHIRT_PRODUCTS . " where t_cat_id='" . $Id . "'");
         $qur = $db->runquery("SELECT * FROM  " . TSHIRT_PRICE . " where campagin_id=" . $Id . "");
         $title_value = $adminData[0]['name'];
         $oldicon_value = $adminData[0]['image'];
         $backoldicon_value = $adminData[0]['backimage'];
         $oldfrontShadow_value = $adminData[0]['frontShadow'];
         $oldfrontHeigh_value = $adminData[0]['frontHeigh'];
         $oldbackShadow_value = $adminData[0]['backShadow'];
         $oldbacktHeigh_value = $adminData[0]['backHeigh'];
         $basepric_value = $qur[0]['base_price'];
         $colorcode_value = $adminData[0]['colorcode'];
         $shhpng_val = $qur[0]['shipping_price'];
     }
     $colorcode = new Zend_Form_Element_Text('colorcode');
     $colorcode->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please enter color code.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "Expandable mws-textinput required")->setAttrib("onkeypress", "return checknummspK(event)")->setValue($colorcode_value);
     $this->addElement($colorcode);
     $title = new Zend_Form_Element_Text('title');
     $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($title_value);
     $this->addElement($title);
     if ($Id == "") {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->setRequired(true)->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'));
     } else {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     }
     $this->addElement($image);
     $frontHeigh = new Zend_Form_Element_File('frontHeigh');
     $frontHeigh->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     $this->addElement($frontHeigh);
     $oldfrontHeigh = new Zend_Form_Element_Hidden('oldfrontHeigh');
     $oldfrontHeigh->setValue($oldfrontHeigh_value);
     $this->addElement($oldfrontHeigh);
     $frontShadow = new Zend_Form_Element_File('frontShadow');
     $frontShadow->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     $this->addElement($frontShadow);
     $oldfrontShadow = new Zend_Form_Element_Hidden('oldfrontShadow');
     $oldfrontShadow->setValue($oldfrontShadow_value);
     $this->addElement($oldfrontShadow);
     // back
     $backHeigh = new Zend_Form_Element_File('backHeigh');
     $backHeigh->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     $this->addElement($backHeigh);
     $oldbackHeigh = new Zend_Form_Element_Hidden('oldbackHeigh');
     $oldbackHeigh->setValue($oldbacktHeigh_value);
     $this->addElement($oldbackHeigh);
     $backShadow = new Zend_Form_Element_File('backShadow');
     $backShadow->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     $this->addElement($backShadow);
     $oldbackShadow = new Zend_Form_Element_Hidden('oldbackShadow');
     $oldbackShadow->setValue($oldbackShadow_value);
     $this->addElement($oldbackShadow);
     if ($Id != "") {
         $oldicon = new Zend_Form_Element_Hidden('oldicon');
         $oldicon->setValue($oldicon_value);
         $this->addElement($oldicon);
         $backoldicon = new Zend_Form_Element_Hidden('backoldicon');
         $backoldicon->setValue($backoldicon_value);
         $this->addElement($backoldicon);
     }
     $backimage = new Zend_Form_Element_File('backimage');
     $backimage->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     $this->addElement($backimage);
     $base_price = new Zend_Form_Element_Text('base_price');
     $base_price->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Base price is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($basepric_value);
     $this->addElement($base_price);
     $shippingprice = new Zend_Form_Element_Text('shippingprice');
     $shippingprice->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Shipping Rate is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($shhpng_val);
     $this->addElement($shippingprice);
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:75,代码来源:Tshirtcategory.php

示例15: initMyForm

 public function initMyForm($cid, $cidresume)
 {
     global $mySession;
     $db = new Db();
     $title_val = "";
     $description_val = "";
     $url_val = "";
     $camplength_val = "";
     $campaign_category_val = '';
     if ($mySession->TeeLoggedID != "") {
         if ($mySession->camptitl != "" && $mySession->showurl != "") {
             //echo "in form with session values"; die;
             $title_val = $mySession->camptitl;
             $description_val = $mySession->descrip;
             $url_val = $mySession->showurl;
             $camplength_val = $mySession->camplength;
             $campaign_category_val = $mySession->campaign_category;
         }
     }
     if ($cid != "") {
         $qur = $db->runquery("SELECT * FROM  " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $cid . "'");
         if ($qur != "" and count($qur) > 0) {
             //prd($qur);
             $title_val = $qur[0]['title'];
             $description_val = $qur[0]['description'];
             $url_val = $qur[0]['url'];
             $camplength_val = $qur[0]['campaign_length'];
             $campaign_category_val = $qur[0]['campaign_category'];
         }
     }
     # FORM ELEMENT:camptitle
     # TYPE : text
     $camptitle = new Zend_Form_Element_Text('camptitle');
     $camptitle->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:30px;")->setvalue($title_val);
     # FORM ELEMENT:description
     # TYPE : text
     $description = new Zend_Form_Element_Textarea('description');
     $description->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:120px;")->setvalue($description_val);
     $daysArr = array();
     $daysArr[1]['key'] = "3";
     $daysArr[1]['value'] = "3 Days";
     $daysArr[2]['key'] = "7";
     $daysArr[2]['value'] = "7 Days";
     $daysArr[3]['key'] = "10";
     $daysArr[3]['value'] = "10 Days";
     $daysArr[4]['key'] = "14";
     $daysArr[4]['value'] = "14 Days";
     $daysArr[5]['key'] = "21";
     $daysArr[5]['value'] = "21 Days";
     $no_ofdays = new Zend_Form_Element_Select('no_ofdays');
     $no_ofdays->addMultiOptions($daysArr)->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:150px; height:30px;")->setvalue($camplength_val);
     # FORM ELEMENT:url
     # TYPE : text
     if ($cid != "" || $cid != 0) {
         $url = new Zend_Form_Element_Text('url');
         $url->setRequired(true)->setAttrib('class', 'setgoaltxt')->setAttrib("readonly", "readonly")->setAttrib("style", "width:100px; height:30px;")->setvalue($url_val);
     } else {
         /*$url= new Zend_Form_Element_Text('url');
         		$url->setRequired(true)
         		->addDecorator('Errors', array('class'=>'errmsg'))
         		->setAttrib('class','setgoaltxt')
         		->setAttrib("onkeypress","return checkspecchar(event)")
         		->setAttrib('onkeyup','uniqueurl(this.value)')
         		->setAttrib("style","width:100px; height:30px;")
         		->setvalue($url_val);*/
         $url = new Zend_Form_Element_Text('url');
         $url->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib('onblur', 'uniqueurl(this.value)')->setAttrib("style", "width:100px; height:30px;")->setvalue($url_val);
     }
     # FORM ELEMENT:check
     # TYPE : text
     $add_checkbox = new Zend_Form_Element_Checkbox('add_checkbox');
     $add_checkbox->setAttrib('onclick', 'opendiv(this.id);');
     $newcheckbx = new Zend_Form_Element_Checkbox('newcheckbx');
     $newcheckbx->setAttrib('onclick', 'newdivaddr(this.id);');
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->addValidator('NotEmpty', true, array('messages' => 'First name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress');
     if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) {
         $firstname->setRequired(true);
     }
     $firstname->setAttrib("style", "width:180px; height:30px;");
     $this->addElement($firstname);
     # FORM ELEMENT:last name
     # TYPE : text
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->addValidator('NotEmpty', true, array('messages' => 'Last name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress');
     if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) {
         $lastname->setRequired(true);
     }
     $lastname->setAttrib("style", "width:180px; height:30px;");
     //if(@$_REQUEST['lastname']!="")
     //			{
     //			$lastname-> addValidator('Alpha', true)
     //			->addDecorator('Errors', array('class'=>'errmsg'))
     //			->addErrorMessage('Enter only characters');
     //			}
     $this->addElement($lastname);
     # FORM ELEMENT:address
     # TYPE : text
     $newaddress = new Zend_Form_Element_Text('newaddress');
     $newaddress->addValidator('NotEmpty', true, array('messages' => 'Address is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox');
//.........这里部分代码省略.........
开发者ID:Alexeykolobov,项目名称:php,代码行数:101,代码来源:Adddescription.php


注:本文中的Db::runquery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。