Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. webiscore
    3. Posts
    W
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by webiscore

    • Upload Hyrbid Onsen App to iTunes Connect (iOS)

      I have developed a hybrid app Onsen-UI based through Phonegap, I created the app info in iTunes Connect but can’t upload the build as it’s not Application Loader or Xcode based. Anyone been through this can guide me with a solution to upload the app. Thanks!

      posted in Onsen UI
      W
      webiscore
    • RE: Android Exit on Backbutton and Slide Menu on Menu Button

      @Fran-Diox said:

      ons-navigator

      Yes I’m using ons-navigator. Can’t we override the poppage and do action without an alert to the customer?

      I’ll check the menu event behavior and try it.

      posted in Developer Corner
      W
      webiscore
    • Android Exit on Backbutton and Slide Menu on Menu Button

      Hi,

      How manage both Android’s Back and Menu Button. So my question is split into 2.

      First how to slide the app menu when the use clicks on device’s menu button (especially Samsung)?

      The second issue is about the Mobile Device Back button (hardware) when clicking on it, it exists the application while it should return to homepage and if on homepage the client should click twice to exist.

      posted in Developer Corner
      W
      webiscore
    • TypeError: jQueryxxxxxx is not a function

      When first opening the mobile app homepage it returns an error

      "TypeError: Jqueryxxxxxx is not a function" although it shows the API callback results "jQuery111309512500500950475_1459208158307({"code":1,"msg":"Ok","details":{"data"..." according to Firebug.
      

      I have to open different app pages then return to homepage to see Featured Merchants parsed.

      JS Code

      case "page-home":
          callAjax('getFeaturedMerchant','');
          break;
      case "getFeaturedMerchant":
          displayFeaturedRestaurant( data.details.data ,'list-featured');
          break;
      case "getFeaturedMerchant":
          createElement('list-featured','');
          break;
      

      API PHP Code

      public function actiongetFeaturedMerchant()
      {
          $DbExt=new DbExt;  
          $DbExt->qry("SET SQL_BIG_SELECTS=1");       
      
          $start=0;
          $limit=200;
      
          $and='';
          if (isset($this->data['restaurant_name'])){
              $and=" AND restaurant_name LIKE '".$this->data['restaurant_name']."%'";
          }
      
          $stmt="SELECT a.*,
          (
          select option_value
          from 
          {{option}}
          WHERE
          merchant_id=a.merchant_id
          and
          option_name='merchant_photo'
          ) as merchant_logo
      
          FROM
          {{view_merchant}} a
          WHERE is_featured='2'
          AND is_ready ='2'
          AND status in ('active')
          $and
          ORDER BY sort_featured ASC
          LIMIT $start,$limit     
          ";              
      
          if (isset($_GET['debug'])){
              dump($stmt);
          }
      
          if ($res=$DbExt->rst($stmt)){
              $data='';
      
              foreach ($res as $val) {                
                  $data[]=array(
                    'merchant_id'=>$val['merchant_id'],
                    'restaurant_name'=>$val['restaurant_name'],
                    'logo'=>AddonMobileApp::getMerchantLogo($val['merchant_id']),               
                  );
              }
              $this->details=array(
                'data'=>$data
              );
              $this->code=1;$this->msg="Ok";
              $this->output();
          } else $this->msg=$this->t("No Featured Restaurant found");
          $this->output();
      }
      

      Please also check my SOF

      http://stackoverflow.com/questions/36274120/typeerror-jqueryxxxxxx-is-not-a-function

      posted in Developer Corner
      W
      webiscore
    • RE: Contact Us Form

      This is my SOF post

      http://stackoverflow.com/questions/35561226/onsen-ui-contact-us-form-submission

      posted in Onsen UI
      W
      webiscore
    • RE: Contact Us Form

      Hi,

      Thanks for the reply. It’s passing none, none of the parameters are being submitted.

      posted in Onsen UI
      W
      webiscore
    • Contact Us Form

      I’m creating In-App contact form using OnSen

      In index.html I added

      <script type="text/ons-template" id="contact.html"> 
      <ons-navigator title="Navigator" var="sNavigator"> 
      <ons-page id="page-contact">
         <ons-toolbar>     
          
          <div class="left">
           <ons-toolbar-button onclick="setHome();">
              <ons-icon icon="fa-chevron-left"></ons-icon>
           </ons-toolbar-button>        
          </div> 
               
          <div class="center white">
          <span id="search-text" class="trn" data-trn-key="contact">Contact Us</span>
          </div>                  
         </ons-toolbar>
      
          <div class="home-header">
            <img src="css/images/banner.png" alt="" title="">
            <p class="center trn" data-trn-key="contact">We respond to messages in the order received</p>
          </div>   
         
         <form id="frm-contact" class="frm-contact" method="post">
      
         <div class="wrapper">
            <div class="field-wrapper">
            <input type="text" name="first_name"  class="first_name text-input text-input--underbar has_validation" 
            placeholder="First Name" value="" data-validation="required" data-validation-error-msg="this field is mandatory!" >
            </div>
            
            <div class="field-wrapper">
            <input type="text" name="last_name"  class="last_name text-input text-input--underbar has_validation" 
            placeholder="Last Name" value="" data-validation="required" data-validation-error-msg="this field is mandatory!" >
            </div>
            
            <div class="field-wrapper">
            <input type="number" name="contact_phone"  class="contact_phone text-input text-input--underbar has_validation" 
            placeholder="Mobile Phone" value="" data-validation="required" data-validation-error-msg="this field is mandatory!" >
            </div>
            
            <div class="field-wrapper">
            <input type="email" name="email_address"  class="email_address text-input text-input--underbar has_validation" 
            placeholder="Email address" value="" data-validation="email" data-validation-error-msg="this field is mandatory!" >
            </div>
            
            <div class="field-wrapper">
            <input type="text" name="subject"  class="subject text-input text-input--underbar has_validation" 
            placeholder="Subject" value="" data-validation="required" data-validation-error-msg="this field is mandatory!" >
            </div>
            
            <div class="field-wrapper">
            <textarea style="width:100%;height:80px" name="message"  class="message text-input text-input--underbar has_validation" 
            placeholder="Your Message" value="" data-validation="required" data-validation-error-msg="this field is mandatory!" ></textarea>
            </div>
            
            <p class="small-font-dim trn" data-trn-key="create_account_terms">
            Please note all fields are mandatory, you should fill in all before submission.</p>      
         </div>
         
         <button class="button green-btn button--large trn" onclick="contact();" data-trn-key="contact" >
      	Submit Now!
      	<div class="search-btn"><ons-icon icon="fa-chevron-right"></ons-icon></div>
         </button>
         </form>
                    
      </ons-page>
      </ons-navigator> 
      </script>
      

      Then I’m validating the form in the .js file and calling the API function

      	    case "page-contact":		 
      	     translatePage();
      	     translateValidationForm();
      	     $(".full_name").attr("placeholder",  getTrans("Full Name",'full_name') );
      	     $(".last_name").attr("placeholder",  getTrans('Last Name','last_name') );
      	     $(".contact_phone").attr("placeholder",  getTrans('Mobile Phone','contact_phone') );
      	     $(".email_address").attr("placeholder",  getTrans('Email address','email_address') );
      	     $(".subject").attr("placeholder",  getTrans('Subject','subject') );
      	     $(".message").attr("placeholder",  getTrans('Your Message','message') );	     
      	     
      	     break;
      
      function contact()
      {
      	$.validate({ 	
      	    form : '#frm-contact',    
      	    borderColorOnError:"#FF0000",
      	    onError : function() {      
      	    },	    
      	    onSuccess : function() {     	      
      	      var params = $( "#frm-contact").serialize();	      
      	      params+="&device_id="+ getStorage("device_id");
      	      callAjax("contact",params);       
      	      return false;
      	    }  
      	});
      }
      

      At the webserver end the PHP code includes

          public function actionContact($to='',$from='',$subject='',$body='')
          {    			 
          	$from1=Yii::app()->functions->getOptionAdmin('global_admin_sender_email');
          	if (!empty($from1)){
          		$from=$from1;
          	}    	
          	   	    	
          	$email_provider=Yii::app()->functions->getOptionAdmin('email_provider');
          	
          	if ( $email_provider=="smtp"){
          		$smtp_host=Yii::app()->functions->getOptionAdmin('smtp_host');
          		$smtp_port=Yii::app()->functions->getOptionAdmin('smtp_port');
          		$smtp_username=Yii::app()->functions->getOptionAdmin('smtp_username');
          		$smtp_password=Yii::app()->functions->getOptionAdmin('smtp_password');
          		    		    		
          		$mail=Yii::app()->Smtpmail;
          		
          		Yii::app()->Smtpmail->Host=$smtp_host;
          		Yii::app()->Smtpmail->Username=$smtp_username;
          		Yii::app()->Smtpmail->Password=$smtp_password;
          		Yii::app()->Smtpmail->Port=$smtp_port;
          		
      		    $mail->SetFrom($from, '');
      		    $mail->Subject = $subject;
      		    $mail->MsgHTML($body);
      		    $mail->AddAddress($to, "");
      		    if(!$mail->Send()) {
      		        //echo "Mailer Error: " . $mail->ErrorInfo;
      		        return false;
      		    }else {
      		        //echo "Message sent!";
      		        return true;
      		    }    		    		
          	} elseif ( $email_provider=="mandrill"){
          		$api_key=Yii::app()->functions->getOptionAdmin('mandrill_api_key');    		
          		try {
          			 require_once 'mandrillapp/Mandrill.php';
          			 $mandrill = new Mandrill($api_key);
          			 $message = array(
      			        'html' => $body,
      			        'text' => '',
      			        'subject' => $subject,
      			        'from_email' => $from,
      			        //'from_name' => 'Example Name',
      			        'to' => array(
      			            array(
      			                'email' => $to,
      			                //'name' => 'Recipient Name',
      			                'type' => 'to'
      			            )
      			        )
                      );                
                      $async = false;
      			    $ip_pool = '';
      			    $send_at = '';
      			    $result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
      			    //dump($result);
      			    if (is_array($result) && count($result)>=1){
      			    	if ($result[0]['status']=="sent"){
      			    		return true;
      			    	}				    	
      			    } 
          		} catch(Mandrill_Error $e) {
          			//echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
      
          		}	
          		return false;
          	}
          	
      		$body = $_POST['first_name']. ' ' .$_POST['last_name']. ' ' .$_POST['contact_phone']. ' ' .$_POST['message'];
      		
      		$to       = 'info@domain.com';
      		$from  	  = $_POST['email_address'];
      		
      		$headers  = "From: $from\r\n";		
      		$headers .= "Content-type: text/html; charset=UTF-8\r\n";
      		$subject = $_POST['subject'];
      $message =<<<EOF
      $body
      EOF;
      				
      		if (!empty($to)) {
      			if (@mail($to, $subject, $message, $headers)){
      				return true;
      			}
      		}
          	return false;
          }  
      

      The form is sending the email however with empty null data. Please advise, thank you

      posted in Onsen UI
      W
      webiscore
    • Carousel managed from web server backend

      Hello, I want to add a mobile app homepage carousel for showing sponsors added by administrator at the backend of php.

      Please provide me with example thank you!

      posted in Onsen UI
      W
      webiscore