لتصميم كروت المايكترويك
<title>جساس سوفت - ميكروتك برو</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/qrcode@1.5.1/build/qrcode.min.js"></script> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif; } body { background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%); min-height: 100vh; direction: rtl; } .marquee { background: #1e293b; padding: 6px 10px; color: #fbbf24; font-weight: bold; border-bottom: 1px solid #fbbf24; position: sticky; top: 0; z-index: 100; white-space: nowrap; overflow-x: auto; font-size: 12px; } .marquee span { display: inline-block; animation: marquee 40s linear infinite; padding-left: 100%; } @keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } } .drawer { position: fixed; top: 0; right: -250px; width: 230px; height: 100%; background: rgba(15, 23, 42, 0.98); backdrop-filter: blur(16px); z-index: 1000; transition: 0.3s; padding: 12px 0; border-radius: 20px 0 0 20px; border-left: 1px solid rgba(255,255,255,0.1); overflow-y: auto; } .drawer.open { right: 0; } .drawer-header { text-align: center; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px; } .logo-icon { font-size: 38px; background: linear-gradient(135deg, #fbbf24, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; } .drawer-header h3 { color: white; font-size: 13px; margin-top: 4px; } .drawer-header p { color: #94a3b8; font-size: 9px; } .drawer-item { padding: 6px 14px; margin: 3px 8px; color: #e2e8f0; border-radius: 30px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12px; transition: 0.2s; } .drawer-item:hover { background: linear-gradient(95deg, #3b82f6, #a855f7); color: white; transform: translateX(-3px); } .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 999; display: none; } .main-content { padding: 15px; max-width: 600px; margin: 0 auto; } .card { background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(12px); border-radius: 24px; padding: 16px; margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.1); color: #f1f5f9; } .btn { background: linear-gradient(95deg, #3b82f6, #a855f7); border: none; padding: 8px 14px; border-radius: 40px; color: white; font-size: 12px; font-weight: 600; cursor: pointer; margin: 4px; display: inline-flex; align-items: center; gap: 6px; } .btn-green { background: linear-gradient(95deg, #10b981, #059669); } .btn-blue { background: linear-gradient(95deg, #3b82f6, #2563eb); } .btn-outline { background: transparent; border: 1px solid #a855f7; } input, select { width: 100%; padding: 8px 12px; margin: 5px 0; border-radius: 40px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.4); color: white; font-size: 13px; } label { font-size: 11px; margin-top: 6px; display: block; color: #cbd5e1; } .flex-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; } .remaining-badge { background: #10b981; padding: 3px 8px; border-radius: 30px; font-size: 10px; } .top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .menu-btn { background: rgba(255,255,255,0.1); border: none; color: white; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; } h2 { font-size: 18px; margin-bottom: 10px; } h3 { font-size: 15px; margin-bottom: 8px; } .inline-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .inline-group .btn-icon { background: rgba(255,255,255,0.2); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; } .hotspot-card { background: white; color: #0f172a; border-radius: 28px; padding: 16px; text-align: center; } .hotspot-card input { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; } .footer { text-align: center; font-size: 9px; margin-top: 15px; padding: 8px; border-top: 1px solid rgba(255,255,255,0.1); color: #94a3b8; } .footer a { color: #fbbf24; text-decoration: none; margin: 0 3px; } .social-icons a { margin: 0 5px; display: inline-block; } @media (max-width: 550px) { .btn { width: 100%; justify-content: center; } } </style>✨ بسم الله الرحمن الرحيم ✨ || 🚀 عروض حصرية: اشتراك Starlink بأسعار مخفضة | سرعات فائقة | دعم فني 24/7 || 🔥 تجديد الاشتراكات الآن واحصل على خصم 20% || للتواصل: واتساب 249923211001 || ✨ ما عليك إلا التواصل معنا ✨
🏠 الرئيسية
📱 دخول المستخدم (Hotspot)
⚙️ إعدادات الميكروتك
🌐 إعدادات التطبيق (اسم الشبكة)
🃏 إنشاء كروت
📊 اشتراكي
🔐 لوحة المسؤول
💳 تجديد الاشتراك
📞 الدعم الفني
تم اكتشاف استخدام التطبيق على أكثر من جهاز. سيتم فتح الحظر بعد 3 ساعات.
الوقت المتبقي: ${Math.floor(b.remaining/60)} دقيقة ${b.remaining%60} ثانية
`;
let int=setInterval(()=>{ let nb=isBlocked(); if(!nb.blocked){ clearInterval(int); location.reload(); } else { document.getElementById('countdown').innerText=`${Math.floor(nb.remaining/60)} دقيقة ${nb.remaining%60} ثانية`; document.getElementById('progress').style.width=`${((10800-nb.remaining)/10800)*100}%`; } },1000); return false; } return true; }
// ---------- البيانات ----------
let currentUser = null, mikrotikConfig = null, subscription = null, printedCards = 0, trialUsed = false, mikrotikConnected = false, networkName = "شبكة جساس سوفت";
let printSettings = { netSize:16, userSize:14, infoSize:12, footer:"جساس سوفت للخدمات" };
let pageTexts = { welcomeMsg: "مرحباً بك في تطبيق جساس سوفت لإدارة كروت الميكروتك", loginWelcome: "أهلاً بك، أدخل بيانات الكرت للاتصال بالإنترنت" };
const SECRET="JassasSoftSecret2025", WHATSAPP="https://wa.me/249923211001", FACEBOOK="https://www.facebook.com/share/1Nc5Z8PG2X/", EMAIL="mailto:jassas1001@gmail.com";
function loadData(){
currentUser=JSON.parse(localStorage.getItem('currentUser'));
mikrotikConfig=JSON.parse(localStorage.getItem('mikrotikConfig'));
subscription=JSON.parse(localStorage.getItem('subscription'));
printedCards=parseInt(localStorage.getItem('printedCards'))||0;
trialUsed=localStorage.getItem('trialUsed')==='true';
mikrotikConnected=localStorage.getItem('mikrotikConnected')==='true';
networkName=localStorage.getItem('networkName')||"شبكة جساس سوفت";
let ps=localStorage.getItem('printSettings'); if(ps) printSettings=JSON.parse(ps);
let pt=localStorage.getItem('pageTexts'); if(pt) pageTexts=JSON.parse(pt);
}
function saveData(){
if(currentUser) localStorage.setItem('currentUser',JSON.stringify(currentUser));
if(mikrotikConfig) localStorage.setItem('mikrotikConfig',JSON.stringify(mikrotikConfig));
if(subscription) localStorage.setItem('subscription',JSON.stringify(subscription));
localStorage.setItem('printedCards',printedCards);
localStorage.setItem('trialUsed',trialUsed);
localStorage.setItem('mikrotikConnected',mikrotikConnected);
localStorage.setItem('networkName',networkName);
localStorage.setItem('printSettings',JSON.stringify(printSettings));
localStorage.setItem('pageTexts',JSON.stringify(pageTexts));
}
function getRemaining(){
if(subscription && new Date(subscription.endDate)>new Date()){ let rem=subscription.maxCards-printedCards; return rem>0?rem:0; }
else if(!trialUsed && printedCards<5) return 5-printedCards;
return 0;
}
function consumeCards(c){ printedCards+=c; if(!trialUsed && printedCards>=5) trialUsed=true; saveData(); }
function testMikrotik(){ return mikrotikConnected; }
function generateUsernames(prefix,digits,count,start=1){ let arr=[]; let p=prefix.trim(); let d=parseInt(digits); if(isNaN(d)||d<6) d=6; for(let i=0;i0) doc.addPage();
let container=document.createElement('div');
container.style.direction='rtl'; container.style.display='grid'; container.style.gridTemplateColumns='repeat(4,1fr)'; container.style.gap='8px'; container.style.padding='12px'; container.style.backgroundColor='white'; container.style.width='1100px';
let start=p*perPage, end=Math.min(start+perPage,usernames.length);
for(let i=start;i${netName}
اسم المستخدم: ${usernames[i]}
المدة: ${durationText}
السعة: ${limitText}
`;
let qrDiv=document.createElement('div'); qrDiv.style.width='50px'; qrDiv.style.textAlign='center';
let canvas=document.createElement('canvas'); await QRCode.toCanvas(canvas,`شبكة: ${netName}\nمستخدم: ${usernames[i]}\nكلمة السر: ${passwords[i]}\nالمدة: ${durationText}\nالسعة: ${limitText}`,{width:90,margin:1});
let img=document.createElement('img'); img.src=canvas.toDataURL(); img.style.width='45px'; img.style.height='45px'; qrDiv.appendChild(img);
let footerDiv=document.createElement('div'); footerDiv.style.fontSize='8px'; footerDiv.style.color='#666'; footerDiv.style.marginTop='6px'; footerDiv.style.textAlign='center'; footerDiv.innerText=printSettings.footer;
card.appendChild(info); card.appendChild(qrDiv); card.appendChild(footerDiv);
container.appendChild(card);
}
document.body.appendChild(container);
let cvs=await html2canvas(container,{scale:2,backgroundColor:'#fff'});
let imgData=cvs.toDataURL('image/png');
let w=doc.internal.pageSize.getWidth(), h=(cvs.height*w)/cvs.width;
doc.addImage(imgData,'PNG',0,0,w,h);
document.body.removeChild(container);
}
doc.save(isTest?'test_cards.pdf':`cards_${Date.now()}.pdf`);
return true;
}
async function createAndPrint(isTest=false){
let count=parseInt(document.getElementById('cardCount').value);
if(!isTest && !(getRemaining()>=count)){ Swal.fire('خطأ','لا يوجد رصيد كافٍ','error'); return; }
let prefix=document.getElementById('cardPrefix').value.trim();
let digits=parseInt(document.getElementById('cardDigits').value);
let start=parseInt(document.getElementById('cardStartFrom').value)||1;
let durType=document.getElementById('durationType').value;
let hours=parseInt(document.getElementById('customHours').value);
let limitVal=parseFloat(document.getElementById('limitValue').value);
let limitUnit=document.getElementById('limitUnit').value;
let durText=getDuration(durType,hours);
let limitText=getLimit(limitVal,limitUnit);
let net=document.getElementById('cardNetworkName').value.trim()||networkName;
let users=generateUsernames(prefix,digits,count,start);
let passes=[]; for(let i=0;imax) v=max; } inp.value=v; }
function toggleHours(){ let sel=document.getElementById('durationType'); let div=document.getElementById('hoursDiv'); if(sel.value==='hours') div.style.display='block'; else div.style.display='none'; }
// واجهات المستخدم
function showMain(){
loadData(); let remaining=getRemaining();
let trialMsg=(subscription && new Date(subscription.endDate)>new Date())?`📦 الرصيد: ${remaining} كرت`:(!trialUsed && printedCards<5)?`✅ تجريبي: ${remaining} كرت مجاني`:`${pageTexts.welcomeMsg}
🃏 إنشاء كروت⚙️ إعدادات الميكروتك
📱 واتساب📘 فيسبوك✉️ البريد
☰
${content}`;
}
function registerOrLogin(){ let email=document.getElementById('loginEmailPhone').value.trim(); let name=document.getElementById('loginName').value.trim(); if(!email){ Swal.fire('خطأ','الرجاء إدخال بريد أو رقم هاتف','error'); return; } currentUser={emailOrPhone:email, name:name||email}; saveData(); Swal.fire('تم','تم تسجيل الدخول','success'); showMain(); }
function showUserLogin(){
let html=`${trialMsg}
✨ بسم الله نبدأ ✨
🌐 ${networkName}
${pageTexts.loginWelcome}
🚀 اتصال💾 حفظ الكرت🔙 رجوع للرئيسية
عدد الكروت (الحد الأقصى: ${isAdminMode?'غير محدود':remaining})
بادئة (مثال 29)عدد الأرقام (أقل شيء 6)البدء من الرقم
اسم الشبكة لهذه الطبعةالمدةساعات (مخصص)يومأسبوعشهر
`;
document.getElementById('mainContent').innerHTML=html; if(!isAdminMode) document.getElementById('cardCount').max=remaining; toggleHours(); document.getElementById('durationType').addEventListener('change',toggleHours);
}
function showLicenseScreen(){ let html=`-10-1+1+10
بادئة (مثال 29)عدد الأرقام (أقل شيء 6)البدء من الرقم
اسم الشبكة لهذه الطبعةالمدةساعات (مخصص)يومأسبوعشهر
عدد الساعات (1-720)
سعة البياناتجيجابايتميغابايتغير محدود
🖨️ طباعة (خصم رصيد)${isAdminMode?`🧪 طباعة تجريبية (بدون خصم)`:''}إلغاء
1500 كرت - شهراشتر الآن
3500 كرت - شهراناشتر الآن
7000 كرت - 3 أشهراشتر الآن
مفتاح التفعيل:
تفعيلواتسابفيسبوكالبريد
رجوع`; if(subscription && new Date(subscription.endDate)>new Date()) html+=`
`; document.getElementById('mainContent').innerHTML=html; }
// لوحة المسؤول مع تحكم كامل بالصفحات
function showAdminLogin(){ document.getElementById('mainContent').innerHTML=``; }
async function checkAdminLogin(){ if(document.getElementById('adminPass').value==='Jassas2025'){ isAdminMode=true; showAdminPanel(); } else Swal.fire('خطأ','كلمة مرور خاطئة','error'); }
function showAdminPanel(){
let html=`الباقة: ${subscription.package}
الحد: ${subscription.maxCards} كرت
المطبوع: ${printedCards}
المتبقي: ${rem}
تنتهي: ${new Date(subscription.endDate).toLocaleDateString('ar')}
`; else if(!trialUsed && printedCards<5) html+=`✅ تجريبي: ${rem} كرت مجاني
`; else html+=`🔧 إعدادات الطباعة
حجم اسم الشبكة حجم اسم المستخدم حجم المدة/السعة نص تذييل الكرت 💾 حفظ إعدادات الطباعة 🔄 إعادة تعيين الطباعةرسالة الترحيب الرئيسية<textarea id="adminWelcomeMsg" rows="2" style="border-radius:16px;">${pageTexts.welcomeMsg}</textarea>
<label>رسالة ترحيب صفحة الدخول (Hotspot)</label><textarea id="adminLoginWelcome" rows="2" style="border-radius:16px;">${pageTexts.loginWelcome}</textarea>
<button class="btn btn-green" onclick="savePageTexts()">💾 حفظ نصوص الصفحات</button>
<hr>
<button class="btn" onclick="showTestPrint()">🧪 تجربة طباعة كرت واحد</button>
<button class="btn btn-outline" onclick="showMain()">رجوع</button>
</div>`;
document.getElementById('mainContent').innerHTML=html;
}
function saveAdminSettings(){
printSettings.netSize=parseInt(document.getElementById('adminNetSize').value);
printSettings.userSize=parseInt(document.getElementById('adminUserSize').value);
printSettings.infoSize=parseInt(document.getElementById('adminInfoSize').value);
printSettings.footer=document.getElementById('adminFooter').value;
saveData(); Swal.fire('تم','تم حفظ إعدادات الطباعة','success'); showAdminPanel();
}
function resetAdminSettings(){
printSettings={netSize:16,userSize:14,infoSize:12,footer:"جساس سوفت للخدمات"};
saveData(); Swal.fire('تم','إعادة تعيين الطباعة','success'); showAdminPanel();
}
function savePageTexts(){
pageTexts.welcomeMsg=document.getElementById('adminWelcomeMsg').value;
pageTexts.loginWelcome=document.getElementById('adminLoginWelcome').value;
saveData(); Swal.fire('تم','تم حفظ نصوص الصفحات','success'); showAdminPanel();
}
async function showTestPrint(){ await printCards(['test000001'],['test123'],'يوم واحد','غير محدود',networkName,true); }
function openDrawer(){ document.getElementById('drawer').classList.add('open'); document.getElementById('overlay').style.display='block'; }
function closeDrawer(){ document.getElementById('drawer').classList.remove('open'); document.getElementById('overlay').style.display='none'; }
window.showMain=showMain; window.showUserLogin=showUserLogin; window.showMikrotikSettings=showMikrotikSettings; window.showAppSettings=showAppSettings; window.showCreateCard=showCreateCard; window.showLicenseScreen=showLicenseScreen; window.showSubscriptionDetails=showSubscriptionDetails; window.showAdminLogin=showAdminLogin; window.registerOrLogin=registerOrLogin; window.saveMikrotikSettings=saveMikrotikSettings; window.createAndPrint=createAndPrint; window.changeCardCount=changeCardCount; window.toggleHours=toggleHours; window.loginToNetwork=loginToNetwork; window.saveCardManually=saveCardManually; window.saveNetworkName=saveNetworkName; window.requestPurchase=requestPurchase; window.activateLicense=activateLicense; window.checkAdminLogin=checkAdminLogin; window.saveAdminSettings=saveAdminSettings; window.resetAdminSettings=resetAdminSettings; window.savePageTexts=savePageTexts; window.showTestPrint=showTestPrint; window.openDrawer=openDrawer; window.closeDrawer=closeDrawer; window.WHATSAPP=WHATSAPP; window.FACEBOOK=FACEBOOK; window.EMAIL=EMAIL;
if(!applyBlockIfNeeded()){} else { loadData(); if(!checkSingleDevice()) applyBlockIfNeeded(); else showMain(); }