Book Cover
Book Title
Author Name
Category --
Price Free
Access Unlock
About this book
SECURE READER


Loading Document...

Login Required

You need to be logged in to access this content.

Create new account

Soil Science ebook <\/p>\n","long_desc":"

this is long discription<\/p>\n","cover":"https:\/\/examups.com\/wp-content\/uploads\/2025\/01\/FSSAI-CFSO-Notes-.jpg","file":"","category":"AP AGRICET","price":2,"original_price":100,"discount_price":2,"is_paid":1,"link":"https:\/\/examups.com\/soil-science-ebook-2\/","price_read":0,"validity_read":0,"download_limit":5,"images":"[\"https:\\\/\\\/examups.com\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Blue-and-White-Modern-We-Are-Hiring-Flyer.jpg\",\"https:\\\/\\\/examups.com\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/Gemini_Generated_Image_wbv6f2wbv6f2wbv6-scaled.png\"]","demo_pdf_url":"https:\/\/examups.com\/wp-content\/uploads\/2026\/01\/Soil_Testing_Profit_Formula-1.pdf","rental_plans":[{"label":"Basic","days":"30","price":"1"},{"label":"Standard","days":"180","price":"2"},{"label":"Premium","days":"360","price":"3"}],"can_read":false,"can_download":false,"primary_action":"buy","sec_action":"buy_pdf","btn_text":"Buy Now","btn_price":"\u20b92","type":"ebook"},{"id":1,"title":"Bundle","author":"Bundle","desc":"

gedgfvw<\/p>\n","long_desc":"","cover":"https:\/\/examups.com\/wp-content\/uploads\/2024\/08\/Principles-of-Agronomy.png","file":"","category":"Bundles","price":2,"original_price":499,"discount_price":2,"is_paid":1,"link":"https:\/\/examups.com\/?p=23449","price_read":0,"validity_read":0,"download_limit":0,"images":"","demo_pdf_url":"","rental_plans":[],"can_read":false,"can_download":false,"primary_action":"buy","sec_action":"none","btn_text":"Buy Bundle","btn_price":"\u20b92","type":"bundle"}]; const ebUser = { id: null }; const ebRzpKey = "rzp_live_msZP27iCfeNQqT"; const ebDeepLink = 7; let ebState = { activeBook: null, filter: 'all', typeFilter: 'all' // NEW: Type filter (all, ebook, bundle) }; // --- 1. RENDER LIST --- function ebRender() { const list = document.getElementById('ebList'); const search = document.getElementById('ebSearch').value.toLowerCase(); list.innerHTML = ''; const filtered = ebData.filter(b => { const matchSearch = b.title.toLowerCase().includes(search) || b.author.toLowerCase().includes(search); const matchCat = (ebState.filter === 'all') || (b.category === ebState.filter); const matchType = (ebState.typeFilter === 'all') || (b.type === ebState.typeFilter); return matchSearch && matchCat && matchType; }); if(filtered.length === 0) { list.innerHTML = '

No books found.
'; return; } filtered.forEach(b => { const card = document.createElement('div'); card.className = 'eb-book-card'; card.className = 'eb-book-card'; // Navigation Logic card.onclick = (e) => { // Prevent default if it was an anchor click inside (though we don't have anchors usually) if(e.target.tagName !== 'A' && e.target.tagName !== 'BUTTON') { // Logic: If there is a dedicated page link, go there. Otherwise open overlay. if(b.link && b.link !== '' && b.link !== '#') { window.location.href = b.link; } else { ebOpenDetail(b.id); } } }; const coverImg = b.cover ? `` : '
No Cover
'; // NEW: Bundle Badge Logic let badge = ''; if(b.type === 'bundle') { badge = 'BUNDLE'; } else if(b.is_paid) { badge = 'Premium'; } else { badge = 'Free'; } // Price Display Logic let priceDisplay = 'Free'; if(b.is_paid) { // If we want to show original price crossed out, we can add that logic here too priceDisplay = '₹' + b.price; } card.innerHTML = `
${coverImg} ${badge}
${b.title}
By ${b.author}
`; list.appendChild(card); }); } function ebFilter(cat, btn) { ebState.filter = cat; // Only affect category chips, not type chips const categoryChips = Array.from(document.querySelectorAll('.eb-chip')).slice(4); // Skip first 4 (type chips + divider) categoryChips.forEach(c => c.classList.remove('active')); btn.classList.add('active'); ebRender(); } // NEW: Type Filter Function function ebFilterType(type, btn) { ebState.typeFilter = type; // Only affect type chips (first 3) const typeChips = Array.from(document.querySelectorAll('.eb-chip')).slice(0, 3); typeChips.forEach(c => c.classList.remove('active')); btn.classList.add('active'); ebRender(); } // --- 2. DETAILS LOGIC (ENHANCED) --- function ebOpenDetail(id) { const book = ebData.find(b => b.id === id); if(!book) return; ebState.activeBook = book; // 1. Cover & Blur const posterEl = document.getElementById('detPoster'); const blurEl = document.getElementById('detBlur'); if(book.cover) { posterEl.src = book.cover; blurEl.style.backgroundImage = `url(${book.cover})`; posterEl.style.display = 'block'; } else { posterEl.style.display = 'none'; blurEl.style.background = '#1f2937'; } // 2. Text & Meta document.getElementById('detTitle').innerText = book.title; document.getElementById('detAuthor').innerText = "By " + book.author; document.getElementById('detDesc').innerHTML = book.desc; document.getElementById('detCat').innerText = book.category; // Price let priceHtml = 'Free'; if(book.is_paid) { if(book.original_price) { priceHtml = `₹${book.original_price} ₹${book.price}`; } else { priceHtml = '₹' + book.price; } } document.getElementById('detPriceDisplay').innerHTML = priceHtml; // Access Badge const accessEl = document.getElementById('detAccess'); if(book.can_read) { accessEl.innerText = "Available"; accessEl.style.color = "#10b981"; } else { accessEl.innerText = "Locked"; accessEl.style.color = "#f59e0b"; } // --- RENTAL PLANS UI --- const plansContainer = document.getElementById('detRentalPlans'); if(book.rental_plans && book.rental_plans.length > 0 && !book.can_read) { let html = '
'; html += '
Select Validity
'; book.rental_plans.forEach((p, idx) => { html += ` `; }); html += '
'; plansContainer.innerHTML = html; plansContainer.style.display = 'block'; // Select first by default ebState.selectedPlan = 0; ebUpdateBtnPrice(book.id, 0); // Helper to update btn } else { plansContainer.innerHTML = ''; plansContainer.style.display = 'none'; ebState.selectedPlan = -1; // No plan (Direct Buy/Read) } // --- BUTTONS LOGIC --- const btnLabel = document.getElementById('btnLabel'); const btnPrice = document.getElementById('btnPriceTag'); const btnSec = document.getElementById('detSecBtn'); const secLabel = document.getElementById('secBtnLabel'); // PRIMARY ACTION btnLabel.innerText = book.btn_text; btnPrice.innerText = book.btn_price; // SECONDARY ACTION (Download or Buy PDF) btnSec.classList.remove('locked-dl'); if(book.sec_action === 'download') { btnSec.style.display = 'flex'; secLabel.innerHTML = ' Download PDF'; } else if(book.sec_action === 'buy_pdf') { btnSec.style.display = 'flex'; btnSec.classList.add('locked-dl'); secLabel.innerHTML = ` Buy PDF (₹${book.price})`; } else { btnSec.style.display = 'none'; } document.getElementById('view-detail').classList.add('active'); } function ebCloseDetail() { document.getElementById('view-detail').classList.remove('active'); ebState.activeBook = null; } // --- 3. ACTIONS HANDLER --- // PRIMARY (Main Button) function ebHandlePrimary() { const book = ebState.activeBook; if(!book) return; if(ebUser.id === null) { document.getElementById('ebModal').style.display = 'flex'; return; } if(book.primary_action === 'read') { ebOpenReader(book); } else { ebStartPayment(book); } } // SECONDARY (Small Button) function ebHandleSecondary() { const book = ebState.activeBook; if(!book) return; if(ebUser.id === null) { document.getElementById('ebModal').style.display = 'flex'; return; } if(book.sec_action === 'download') { if(book.file) { // FORCE DOWNLOAD USING ANCHOR TRICK const tempLink = document.createElement('a'); tempLink.href = book.file; tempLink.setAttribute('download', book.title || 'ebook'); document.body.appendChild(tempLink); tempLink.click(); document.body.removeChild(tempLink); } else { alert('No PDF file available.'); } } else if(book.sec_action === 'buy_pdf') { ebStartPayment(book); } } // --- 4. READER & PDF (SMART DOWNLOAD BUTTON) --- function ebOpenReader(book) { if(!book.file) { alert('Book file missing.'); return; } document.getElementById('view-reader').classList.add('active'); // --- SMART DOWNLOAD BUTTON IN READER --- const dlBtn = document.getElementById('readerDlBtn'); const newBtn = dlBtn.cloneNode(true); // Clear listeners dlBtn.parentNode.replaceChild(newBtn, dlBtn); if(book.can_download) { newBtn.style.display = 'flex'; newBtn.href = book.file; newBtn.target = '_blank'; newBtn.innerHTML = ' Download'; newBtn.title = "Download PDF"; } else if (book.sec_action === 'buy_pdf') { // SHOW LOCKED DOWNLOAD BUTTON WITH TEXT newBtn.style.display = 'flex'; newBtn.href = '#'; newBtn.removeAttribute('target'); // UPDATED: Shows icon + "Download (Price)" newBtn.innerHTML = ` Download (₹${book.price})`; newBtn.title = `Pay ₹${book.price} to Download`; // Trigger Payment on Click newBtn.addEventListener('click', (e) => { e.preventDefault(); if(confirm(`To download this PDF, you need to purchase the Premium version for ₹${book.price}. Proceed to payment?`)) { ebStartPayment(book); } }); } else { newBtn.style.display = 'none'; } ebRenderPDF(book.file); } async function ebRenderPDF(url) { const container = document.getElementById('eb-canvas-container'); const loader = document.getElementById('eb-loading-msg'); container.innerHTML = ''; container.appendChild(loader); loader.style.display = 'block'; try { const loadingTask = pdfjsLib.getDocument(url); const pdf = await loadingTask.promise; loader.style.display = 'none'; for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) { const page = await pdf.getPage(pageNum); const scale = 1.5; const viewport = page.getViewport({ scale: scale }); const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); canvas.height = viewport.height; canvas.width = viewport.width; canvas.style.width = '95%'; canvas.style.height = 'auto'; canvas.style.maxWidth = viewport.width + 'px'; container.appendChild(canvas); const renderContext = { canvasContext: context, viewport: viewport }; await page.render(renderContext).promise; } } catch (error) { console.error(error); loader.innerHTML = 'Error loading document.'; } } function ebToggleFullScreen() { const elem = document.getElementById('view-reader'); if (!document.fullscreenElement) { if (elem.requestFullscreen) elem.requestFullscreen(); else if (elem.webkitRequestFullscreen) elem.webkitRequestFullscreen(); else if (elem.msRequestFullscreen) elem.msRequestFullscreen(); } else { if (document.exitFullscreen) document.exitFullscreen(); else if (document.webkitExitFullscreen) document.webkitExitFullscreen(); else if (document.msExitFullscreen) document.msExitFullscreen(); } } function ebCloseReader() { if (document.fullscreenElement) { if (document.exitFullscreen) document.exitFullscreen(); } document.getElementById('view-reader').classList.remove('active'); document.getElementById('eb-canvas-container').innerHTML = '


Loading Document...
'; } // --- 5. PAYMENT & AUTH --- // --- 5. PAYMENT & AUTH --- function ebStartPayment(book, access_mode) { // Redirect to Checkout Page // Use dynamically located checkout URL from backend let checkoutUrl = agri_ajax.checkout_url || '/checkout/'; // Default to 'download' if not specified access_mode = access_mode || 'download'; // Ensure we handle URL params correctly const separator = checkoutUrl.includes('?') ? '&' : '?'; const redirectBack = encodeURIComponent(window.location.href); // Append Plan Index if Selected let planParam = ''; if(typeof ebState.selectedPlan !== 'undefined' && ebState.selectedPlan > -1) { planParam = `&plan=${ebState.selectedPlan}`; } window.location.href = `${checkoutUrl}${separator}type=ebook&prod_id=${book.id}&access_mode=${access_mode}${planParam}&redirect_to=${redirectBack}`; } function ebLogin() { const u = document.getElementById('eb_user').value; const p = document.getElementById('eb_pass').value; if(!u || !p) return; jQuery.post(agri_ajax.url, { action: 'agri_ajax_login', user: u, pass: p }, (res) => { if(res.success) location.reload(); else alert(res.data); }); } function ebSignup() { const e = document.getElementById('eb_reg_email').value; const u = document.getElementById('eb_reg_user').value; jQuery.post(agri_ajax.url, { action: 'agri_ajax_signup', email: e, user: u }, (res) => { if(res.success) { alert('Account created! Please check your email.'); ebToggleAuth('login'); } else alert(res.data); }); } function ebToggleAuth(mode) { if(mode === 'signup') { document.getElementById('eb-login-form').style.display = 'none'; document.getElementById('eb-signup-form').style.display = 'block'; } else { document.getElementById('eb-login-form').style.display = 'block'; document.getElementById('eb-signup-form').style.display = 'none'; } } document.addEventListener('DOMContentLoaded', function() { const hasList = document.getElementById('ebList'); if(hasList) { ebRender(); if(ebDeepLink > 0) { setTimeout(() => { const b = ebData.find(x => x.id === ebDeepLink); if(b) { if(b.can_read) ebOpenReader(b); else ebOpenDetail(ebDeepLink); } }, 500); } } else { // Single View Mode const b = ebData.find(x => x.id === ebDeepLink); if(b) { ebState.activeBook = b; // Tilt Effect const card = document.getElementById('templateBookCover'); if(card) { document.addEventListener('mousemove', (e) => { let xAxis = (window.innerWidth / 2 - e.pageX) / 25; let yAxis = (window.innerHeight / 2 - e.pageY) / 25; card.style.transform = `rotateY(${xAxis}deg) rotateX(${yAxis}deg)`; }); } } } }); // --- REVIEW SUBMISSION FUNCTIONS --- function ebSetRating(val) { document.getElementById('eb-rating-val').value = val; const stars = document.querySelectorAll('#eb-star-selector span'); stars.forEach((star, idx) => { if(idx < val) { star.style.color = '#f59e0b'; } else { star.style.color = '#cbd5e1'; } }); } // Initialize review form if it exists document.addEventListener('DOMContentLoaded', function() { if(document.getElementById('eb-star-selector')) { ebSetRating(5); } }); function ebSubmitReview(ebookId) { const rating = document.getElementById('eb-rating-val').value; const reviewText = document.getElementById('eb-review-text').value.trim(); const msgBox = document.getElementById('eb-review-msg'); if(!reviewText) { msgBox.style.display = 'block'; msgBox.style.background = '#fee2e2'; msgBox.style.color = '#991b1b'; msgBox.style.border = '1px solid #fecaca'; msgBox.innerHTML = ' Please write a review before submitting.'; return; } msgBox.style.display = 'block'; msgBox.style.background = '#e0f2fe'; msgBox.style.color = '#0369a1'; msgBox.style.border = '1px solid #bae6fd'; msgBox.innerHTML = ' Submitting your review...'; jQuery.post('https://examups.com/wp-admin/admin-ajax.php', { action: 'agri_submit_ebook_review', ebook_id: ebookId, rating: rating, review_text: reviewText }, function(res) { if(res.success) { msgBox.style.background = '#dcfce7'; msgBox.style.color = '#166534'; msgBox.style.border = '1px solid #bbf7d0'; msgBox.innerHTML = ' ' + res.data.message; // Clear form document.getElementById('eb-review-text').value = ''; // Optionally reload after 2 seconds to show the review setTimeout(() => { location.reload(); }, 2000); } else { msgBox.style.background = '#fee2e2'; msgBox.style.color = '#991b1b'; msgBox.style.border = '1px solid #fecaca'; msgBox.innerHTML = ' ' + res.data.message; } }) .catch(err => { console.error('Review submit error:', err); msgBox.style.display = 'block'; msgBox.style.background = '#fee2e2'; msgBox.style.color = '#991b1b'; msgBox.style.border = '1px solid #fecaca'; msgBox.innerHTML = ' An error occurred. Please try again.'; }); } // --- HELPERS FOR RENTAL --- function ebSelectPlan(bookId, planIdx, price) { ebState.selectedPlan = planIdx; const radios = document.getElementsByName('rental_plan'); if(radios) { radios.forEach(r => { if(r.value == planIdx) r.checked = true; }); } // Update Button Logic const book = ebData.find(b => b.id === bookId); if(book) { const btn = document.getElementById('btnPriceTag'); const label = document.getElementById('btnLabel'); if(btn) btn.innerText = '₹' + price; if(label) label.innerText = 'Rent E-Book'; } } function ebUpdateBtnPrice(bookId, planIdx) { const book = ebData.find(b => b.id === bookId); if(book && book.rental_plans[planIdx]) { const p = book.rental_plans[planIdx]; const btn = document.getElementById('btnPriceTag'); const label = document.getElementById('btnLabel'); if(btn) btn.innerText = '₹' + p.price; if(label) label.innerText = 'Rent E-Book'; } } // NEW: Demo PDF Functions function ebOpenDemoPDF(url) { const modal = document.getElementById('eb-demo-modal'); const iframe = document.getElementById('eb-demo-iframe'); modal.style.display = 'flex'; iframe.src = url; document.body.style.overflow = 'hidden'; // Prevent background scrolling } function ebCloseDemoModal() { const modal = document.getElementById('eb-demo-modal'); const iframe = document.getElementById('eb-demo-iframe'); modal.style.display = 'none'; iframe.src = ''; document.body.style.overflow = ''; // Restore scrolling } // NEW: Image Modal Function function ebOpenImageModal(imageUrl) { const modal = document.getElementById('eb-image-modal'); const img = document.getElementById('eb-modal-image'); modal.style.display = 'flex'; img.src = imageUrl; document.body.style.overflow = 'hidden'; } // Close image modal when clicking outside document.addEventListener('DOMContentLoaded', function() { const imageModal = document.getElementById('eb-image-modal'); if(imageModal) { imageModal.addEventListener('click', function(e) { if(e.target === imageModal) { imageModal.style.display = 'none'; document.body.style.overflow = ''; } }); } });

Warning: Undefined variable $wp in /home/u733758978/domains/examups.com/public_html/wp-content/plugins/Examups App/frontend-mobile-nav.php on line 27

Warning: Attempt to read property "request" on null in /home/u733758978/domains/examups.com/public_html/wp-content/plugins/Examups App/frontend-mobile-nav.php on line 27

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/u733758978/domains/examups.com/public_html/wp-includes/functions.php on line 1154

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/u733758978/domains/examups.com/public_html/wp-includes/functions.php on line 1161

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/u733758978/domains/examups.com/public_html/wp-includes/functions.php on line 1164

Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/u733758978/domains/examups.com/public_html/wp-includes/functions.php on line 1171

Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/u733758978/domains/examups.com/public_html/wp-includes/functions.php on line 1174
dashicons-wallet My Wallet dashicons-groups Affiliate