public static function infoForm($mp) { ?> <input type="hidden" value="<?php echo $mp->prod_id; ?> " name="prod_id" id="prod_id"> <div id="formgroup_VariantID" class="form-group"> <label for="prod_id" class=" col-sm-2 control-label">SKU</label> <div class="col-sm-10"> <input type="text" name="VariantID" value="<?php echo $mp->VariantID; ?> " id="VariantID" class="form-control" > <span class="help-block" id="warning_VariantID"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_BaseArticleNameINA" class="form-group"> <label for="BaseArticleNameINA" class=" col-sm-2 control-label">Name INA</label> <div class="col-sm-10"> <input type="text" name="BaseArticleNameINA" value="<?php echo $mp->BaseArticleNameINA; ?> " id="BaseArticleNameINA" class="form-control"> <span class="help-block" id="warning_BaseArticleNameINA"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_BaseArticleNameENG" class="form-group"> <label for="BaseArticleNameENG" class=" col-sm-2 control-label">Name ENG</label> <div class="col-sm-10"> <input type="text" name="BaseArticleNameENG" value="<?php echo $mp->BaseArticleNameENG; ?> " id="BaseArticleNameENG" class="form-control"> <span class="help-block" id="warning_BaseArticleNameENG"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_ArticleType" class="form-group"> <label for="ArticleType" class=" col-sm-2 control-label">Type</label> <div class="col-sm-10"> <select name="ArticleType" id="ArticleType" class="form-control"> <option value="Base">Base</option> <option value="Variant" <?php if ($mp->ArticleType == "Variant") { echo "selected"; } ?> >Variant</option> </select> <span class="help-block" id="warning_ArticleType"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_BaseArticleImageFile" class="form-group"> <label for="BaseArticleImageFile" class=" col-sm-2 control-label">Image</label> <div class="col-sm-10"> <?php $ip = new \Leap\View\InputGallery("BaseArticleImageFile", "BaseArticleImageFile", $mp->BaseArticleImageFile); $ip->p(); ?> <span class="help-block" id="warning_BaseArticleImageFile"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_VariantImageFile" class="form-group"> <label for="VariantImageFile" class=" col-sm-2 control-label">Picture</label> <div class="col-sm-10"> <input type="text" name="VariantImageFile" value="" id="VariantImageFile" class="form-control"> <span class="help-block" id="warning_VariantImageFile"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_VariantEAN" class="form-group"> <label for="VariantEAN" class=" col-sm-2 control-label">INA Code</label> <div class="col-sm-10"> <input type="text" name="VariantEAN" value="134001792" id="VariantEAN" class="form-control"> <span class="help-block" id="warning_VariantEAN"></span> </div> <div class="clearfix"></div> </div> <div id="formgroup_VariantEAN" class="form-group"> <label for="VariantEAN" class=" col-sm-2 control-label">EAN</label> <div class="col-sm-10"> <input type="text" name="VariantEAN" value="134001792;92936;96029862" id="VariantEAN" class="form-control"> <span class="help-block" id="warning_VariantEAN"></span> </div> <div class="clearfix"></div> </div> <?php }
public static function freeForm() { $rand = time() . rand(0, 100); $_SESSION['rand'] = $rand; $id = addslashes($_GET['id']); $app = new AppAccount(); $app->getByID($id); AppAccount::checkOwnership($app); if ($app->app_active == 2) { die("App already active"); } if ($app->app_active == 1 && $app->app_type == 0) { die("App already active"); } ?> <style> .foto100{ width: 100px; height: 100px; overflow: hidden; cursor: pointer; } .foto100 img{ /*width: 100%;*/ } @media (max-width: 768px) { .monly { display: initial; } .donly { display: none; } .fotowadah{ text-align: center; } .foto100{ margin: 0 auto; } input[type="file"]{ text-align: center; margin: 0 auto; } } @media (min-width: 768px) { .monly { display: none; } .donly { display: initial; } } </style> <div class="container attop" > <div class="col-md-8 col-md-offset-2"> <div class="appear_logo_pages"> <a href="<?php echo _SPPATH; ?> "> <img src="<?php echo _SPPATH; ?> images/appear-free.png" > </a> </div> <div id="waitingApproval" <?php if (!($app->app_active == 1 && $app->app_type == 1)) { ?> style="display: none;"<?php } ?> > <h3 style="text-align: center;">Your request is being processed. Please wait for our updates.</h3> <div class="back_to_button" style="text-align: center;" > <a href="<?php echo _SPPATH; ?> mydashboard">back to dashboard</a> </div> </div> <?php if (!($app->app_active == 1 && $app->app_type == 1)) { ?> <div id="uploadFree"> <div style="text-align: center; padding: 15px;"> <p>Please upload your organization credentials, and fill your contact person credentials to be able to apply as free apps registrants.</p> </div> <div class="berpadding" style="text-align: center; margin-bottom: 100px;"> <form id="formreg_free" class="form-horizontal" role="form" > <input type="hidden" name="token" value="<?php echo $rand; ?> "> <input type="hidden" name="app_id" value="<?php echo $id; ?> "> <div class="form-group"> <label class="control-label col-sm-3" for="org_doc">Organization Documents : </label> <div class="col-sm-9 fotowadah"> <?php $file = new \Leap\View\InputGallery("org_doc", "org_doc", ""); $file->p(); ?> <div id="org_doc_err" class="err"></div> </div> </div> <div class="form-group"> <label class="control-label col-sm-3" for="org_name">Organization Name : </label> <div class="col-sm-9" > <input name="org_name" type="text" class="form-control" id="org_name" placeholder="Organization Name"> <div id="org_name_err" class="err"></div> </div> </div> <div class="form-group"> <label class="control-label col-sm-3" for="org_type">Organization Type : </label> <div class="col-sm-9"> <select id="org_type" name="org_type" class="form-control"> <option value="Educational">Educational</option> <option value="Spiritual">Spiritual/Religion</option> <option value="Social">Social</option> <option value="Other">Other Non-profit</option> </select> <div id="org_type_err" class="err"></div> </div> </div> <div class="form-group"> <label class="control-label col-sm-3" for="org_addresss">Address : </label> <div class="col-sm-9"> <textarea name="org_addresss" id="org_addresss" class="form-control" rows="5"></textarea> <div id="org_addresss_err" class="err"></div> </div> </div> <hr> <div class="form-group"> <label class="control-label col-sm-3" for="contact_name">Contact Person : </label> <div class="col-sm-9"> <input name="contact_name" type="text" class="form-control" id="contact_name" placeholder="Contact Person"> <div id="contact_name_err" class="err"></div> </div> </div> <div class="form-group"> <label class="control-label col-sm-3" for="contact_phone">Mobile Phone : </label> <div class="col-sm-9"> <input name="contact_phone" type="tel" class="form-control" id="contact_phone" placeholder="Enter mobile phone"> <div id="contact_phone_err" class="err"></div> </div> </div> <div class="form-group"> <label class="control-label col-sm-3" for="contact_email">Email : </label> <div class="col-sm-9"> <input name="contact_email" type="email" class="form-control" id="contact_email" placeholder="Enter email"> <div id="contact_email_err" class="err"></div> </div> </div> <hr> <div class="form-group"> <label class="control-label col-sm-3" for="tos">Terms and Conditions: </label> <div class="col-sm-9" style="text-align: left; "> <input type="checkbox" name="tos" id="tos" value="1" > I accept the terms and conditions. <div class="read"> <a target="_blank" href="<?php echo _SPPATH; ?> tos/free_app">read terms and conditions</a></div> <div id="tos_err" class="err"></div> </div> </div> <hr> <div id="resultajax" style="display: none; text-align: center;" class="alert alert-danger"></div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button style="width: 100%;" type="submit" class="btn btn-primary btn-appeargreen">Apply as FREE Apps</button> <div class="back_to_button" > <a href="<?php echo _SPPATH; ?> PaymentWeb/pay?app_id=<?php echo $_GET['id']; ?> ">back to payment</a> | <a href="<?php echo _SPPATH; ?> mydashboard">back to dashboard</a> </div> </div> </div> </form> </div> </div> <?php } ?> </div> </div> <script> $( "#formreg_free" ).submit(function( event ) { if(allowed) { if (validateFormOnSubmit(this)) { // alert("benar semua1"); var $form = $(this); var url = "<?php echo _SPPATH; ?> processFree"; $(".err").hide(); // Send the data using post var posting = $.post(url, $form.serialize(), function (data) { console.log(data); if (data.bool) { $('#waitingApproval').show(); $('#uploadFree').hide(); //kalau success masuk ke check your email.... // document.location = "<?php //=_SPPATH; ?> //check_your_email?type=<?php //=$type; ?> //"; // alert(data.bool); } else { $("#resultajax").show(); $("#resultajax").html(data.err); } },'json'); } else { } }else{ alert("Please complete registration"); } event.preventDefault(); }); var allowed = 1; </script> <script> function validateFormOnSubmit(theForm) { var reason = ""; reason += validateEmpty(theForm.tos); reason += validateEmpty(theForm.org_name); reason += validateEmpty(theForm.org_type); reason += validateEmpty(theForm.org_doc); reason += validateEmpty(theForm.org_addresss); reason += validateEmpty(theForm.contact_name); reason += validateEmpty(theForm.contact_phone); reason += validateEmpty(theForm.contact_email); if(!document.getElementById("tos").checked){ var texterr = "Please Accept Agreement"; reason += texterr; $('#tos_err').css( "color", "red").show().html(texterr); // $('#tos_err').html(texterr); }else{ $('#tos_err').hide(); } if (reason != "") { // alert("Some fields need correction:\n" + reason); return false; } return true; } function validateEmpty(fld) { var error = ""; if (fld.value.length == 0) { error = "The required field has not been filled in.\n" fld.style.background = '#CCCCCC'; $( fld ).next().css( "color", "red").show().html(error); } else { fld.style.background = 'White'; $( fld ).next().hide(); } return error; } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } </script> <?php }