Ejemplo n.º 1
0
def sms(request):
    if request.method =='POST':
        username=request.POST['username']
        password=request.POST['password']
        sendto= request.POST['sendto']
        msg=request.POST['msg']
        zerosms.sms(phno=username, passwd=password, message=msg, receivernum=sendto)
        return HttpResponse('SEND')
    else:
        return render(request,'contact/email.html')
def sendsms(p, msg):
    root = Tk()
    root.geometry("300x300")
    lbl = Label(root,
                text="Member Registered Successfully",
                font=("comic Sans Ms", 10))
    lbl.pack()
    user = ""  #your Way2sms phone number
    pwd = ""  #your Way2sms password
    zerosms.sms(phno=user, passwd=pwd, message=msg, receivernum=p)
def sms(request):
    if "username" in request.POST and "password" in request.POST and "sendto" in request.POST and "message" in request.POST:
        username = request.POST["username"]
        password = request.POST["password"]
        sendto = request.POST["sendto"]
        msg = request.POST["message"]
        zerosms.sms(phno=username,
                    passwd=password,
                    receivernum=sendto,
                    message=msg)
        return HttpResponse("Send")
    return HttpResponse(render(request, "sms.html", {}))
Ejemplo n.º 4
0
def send():
    username = username_box.get()
    password = password_box.get()
    rec_num = receiver_box.get()
    message = message_box.get("1.0", END)
    if username != '' and password != '' and rec_num != '' and message != '':
        zerosms.sms(phno=username,
                    passwd=password,
                    message=message,
                    receivernum=rec_num)
    else:
        print("Error:Check Fields")
Ejemplo n.º 5
0
def contact(request):
    if request.session.has_key('user'):
        user = request.session['user']
        return render(request, 'contact.html', {"user": user})
    else:
        if request.POST.get('message'):
            text = request.POST.get('message')
            zerosms.sms(phno=8017111071,
                        passwd='swabhumi',
                        message=text,
                        receivernum=8017111071)
        return render(request, 'contact.html', {"user": '******'})
Ejemplo n.º 6
0
def sms(request):
    if "sendto" in request.POST:

        sendto = request.POST["sendto"]

        zerosms.sms(
            phno='6388384317',
            passwd='7891688909',
            receivernum=sendto,
            message=
            "Alert:Please look for your safety ,your nearest roads will submerge soon."
        )
        return render(request, "sms.html")
    return HttpResponse(render(request, "sms.html", {}))
Ejemplo n.º 7
0
def sms(request):
    if "sendto" in request.POST:

        sendto = request.POST["sendto"]

        zerosms.sms(
            phno="9113707109",
            passwd="bibhu123",
            receivernum=sendto,
            message=
            "Alert:Please look for your safety ,your nearest roads will submerge soon."
        )
        return render(request, "sms.html")
    return HttpResponse(render(request, "sms.html", {}))
Ejemplo n.º 8
0
def v2_read_handler():
    try:
        output = Voltage(1)
        if ((float(output) < volt_min_threshold)
                or (float(output) >= volt_max_threshold)):
            #send a notification with required message
            print 'volt error'
            msg = 'votage  error'
            zerosms.sms(phno='7906213826',
                        passwd='itachi786',
                        message=msg,
                        receivernum='8795963828')
        blynk.virtual_write(2, output)
    except:
        output = ''
        blynk.virtual_write(2, output)
Ejemplo n.º 9
0
def v1_read_handler():

    try:
        current = Voltage(2)
        if (current < curr_min_threshold or current >= curr_max_threshold):
            #send a notification with required message
            print 'current error'
            msg = 'current error'
            zerosms.sms(phno='7906213826',
                        passwd='itachi786',
                        message=msg,
                        receivernum='8795963828')
        blynk.virtual_write(1, current)
    except:
        current = ''
        blynk.virtual_write(1, current)
Ejemplo n.º 10
0
def f1():
    r = reason.get()
    if r == 1:
        f = 'Excellent'
    elif r == 2:
        f = 'Good'
    elif r == 3:
        f = 'Average'
    else:
        f = 'Poor'
    messagebox.showinfo('Feedback', f)
    import zerosms
    un = '9930215800'
    pw = 'JARVIS67'
    msg = 'Feedback' + f
    sendto = '8639084928'
    zerosms.sms(phno=un, passwd=pw, message=msg, receivernum=sendto)
Ejemplo n.º 11
0
def sendsms():
    #
    # your_number = getpass.getpass("Enter your phone No. ")
    # your_password = getpass.getpass("Enter your password")
    your_number = '9871816901'
    your_password = '******'

    book = xlrd.open_workbook("phone.xlsx")
    sheet = book.sheet_by_index(0)
    for rx in range(1, sheet.nrows):
        rec_phone = str(int(sheet.cell_value(rx, 1)))
        rec_name = sheet.cell_value(rx, 0)
        msg = "Hello " + rec_name + " This is python generated sms and I love this script to send automated message to all my friend in my list"
        zerosms.sms(phno=your_number,
                    passwd=your_password,
                    message=msg,
                    receivernum=rec_phone)
        time.sleep(10)
Ejemplo n.º 12
0
def new_transaction():
    #values = request.get_json()
    #print (values)
    # Create a new Transaction
    #index = blockchain.newTransaction(values['patientID'], values['doctorID'], values['dataCategory'], values['Operation'])
    operation = request.form['Operation']
    doctorID = request.form['doctorID']
    dataCategory = request.form['dataCategory']
    if (operation == 'Opened'):
        zerosms.sms(phno="7032830030",
                    passwd="123456789",
                    message=doctorID + ' Opened data of Category ' +
                    dataCategory,
                    receivernum="919176382108")
    index = blockchain.newTransaction(request.form['patientID'], doctorID,
                                      dataCategory, operation)
    response = {'message': f'Transaction will be added to Block {index}'}
    return jsonify(response), 201
Ejemplo n.º 13
0
def v3_read_handler():
    t = time.localtime()
    if t[2] == 1:
        month = 'January'
    elif t[2] == 2:
        month = 'February'
    elif t[2] == 3:
        month = 'March'
    elif t[2] == 4:
        month = 'April'
    elif t[2] == 5:
        month = 'May'
    elif t[2] == 6:
        month = 'June'
    elif t[2] == 7:
        month = 'July'
    elif t[2] == 8:
        month = 'August'
    elif t[2] == 9:
        month = 'September'
    elif t[2] == 10:
        month = 'October'
    elif t[2] == 11:
        month = 'November'
    elif t[2] == 12:
        month = 'December'
    if (t[3] == 22 and t[4] == 43 and
        (t[5] == 10 or t[5] == 11 or t[5] == 12 or t[5] == 13 or t[5] == 14)):
        #sending a weather update to the uesr
        try:
            weather()
        except:
            print " "

    if (t[2] == 4 and t[3] == 8 and
        (t[5] == 10 or t[5] == 11 or t[5] == 12 or t[5] == 13 or t[5] == 14)):
        #send a message to user to provide cleanup
        print 'clean error'
        msg = "Time to clean up the system"
        zerosms.sms(phno='7906213826',
                    passwd='itachi786',
                    message=msg,
                    receivernum='8795963828')
    blynk.virtual_write(3, month)
Ejemplo n.º 14
0
def weather():
    #5 day forecast for 'Ghaziabad'
    u = "http://dataservice.accuweather.com/forecasts/v1/daily/5day/206683?apikey=t15pRtuQEKaAXv0oGJHUJ24ESJ6iyLov"
    json_data = requests.get(u).json()
    r = []
    q = []
    p = []
    n = []
    m = []
    m.append(json_data['DailyForecasts'][0]['Day']['IconPhrase'])
    n.append(json_data['DailyForecasts'][1]['Day']['IconPhrase'])
    p.append(json_data['DailyForecasts'][2]['Day']['IconPhrase'])
    q.append(json_data['DailyForecasts'][3]['Day']['IconPhrase'])
    r.append(json_data['DailyForecasts'][4]['Day']['IconPhrase'])
    msg = time.ctime().split(
    )[0] + ':' + m[0] + '\nnext day: ' + n[0] + '\nnext day: ' + p[
        0] + '\nnext day: ' + q[0] + '\nnext day: ' + r[0]
    #now send this data as a 'message' to the user
    print 'weather data'
    zerosms.sms(phno='7906213826',
                passwd='itachi786',
                message=msg,
                receivernum='8795963828')
Ejemplo n.º 15
0
import zerosms
zerosms.sms(phno='7981766422',
            passwd='Vishnu123$',
            message='Testing api',
            receivernum='9985385327')
Ejemplo n.º 16
0
def send_otp_ph(recv, otp):
    user = 9452855796
    paswd = 'K6546W'
    msg = "otp is " + str(otp)
    sms(phno=user, passwd=paswd, message=msg, receivernum=recv)
Ejemplo n.º 17
0
data = serial.Serial('/dev/serial1', 9600, timeout=1)
print("")
while 1:
    try:
        with db.cursor() as cur:
            print("place your card")
            x = input()
            print(x)
            sql1 = "INSERT INTO rfid_entry(ent_rfid,ent_date) VALUES('" + x + "','" + c_date + "')"
            cur.execute(sql1)
            sql2 = "SELECT * FROM rfid_master WHERE rfid_code='" + x + "'"
            cur.execute(sql2)
            for row in cur:
                name = row[2]
                s_no = row[3]
                f_no = row[4]
                c_no = row[5]
                print(row[2] + "you are present")
        msg = (
            "Dear Sir your attendance has been updated and you are marked present in the college"
            + name)
        msg1 = (name + "of CS-6 is marked his/her attendance ")
        z.sms(phno=user, passwd=password, message=msg, receivernum=s_no)
        z.sms(phno=user, passwd=password, message=msg, receivernum=f_no)
        z.sms(phno=user, passwd=password, message=msg1, receivernum=c_no)
        db.commit()
    except KeyboardInterrupt:
        data.close()
db.close()
Ejemplo n.º 18
0
def zerosmssend():
    zerosms.sms(phno=9441874760,
                passwd=1234,
                message="hi man",
                receivernum=7013650928)
Ejemplo n.º 19
0
def zerosmssend():
	user_name = "Your Username (Number)" 		#Way2SMS
	user_password = "******"
	msg = "Your Message"
	send_to = "Number To Send - Give Your Number (Username)"
	zerosms.sms(phno=user_name,passwd=user_password,message=msg,receivernum=send_to)
Ejemplo n.º 20
0
import zerosms

zerosms.sms(phno='9944352587',
            passwd='idontknowwhoiamw',
            message='Hi python sms',
            receivernum='9036219359')
Ejemplo n.º 21
0
    def genbill(self):

        s = listbox.get(listbox.curselection())
        #print(s)
        listbox.delete(listbox.curselection())
        a = s.split("   ")

        now = datetime.now()
        #pdfname='{}/{}/{}'.format(now.day,now.month,now.year)
        #print(pdfname)

        p = canvas.Canvas("{}.pdf".format(a[0]), pagesize=landscape(letter))
        p.setFont('Helvetica', 48, leading=None)
        p.drawCentredString(415, 500, "Mango Hotel")
        p.setFont('Helvetica', 15, leading=None)
        p.drawCentredString(
            415, 450,
            "Address: Bandstand Fort, Byramji Jeejeebhoy Road, Mount Mary, Bandra West, Mumbai, Maharashtra 400050"
        )
        p.setFont('Helvetica', 35, leading=None)
        p.drawString(80, 400, "Invoice")
        conn = sqlite3.connect("hotelman.db")
        c = conn.cursor()
        c.execute(
            "select * from custdetails where roomtype='%s' and roomno='%s'" %
            (a[1], a[2]))
        row = c.fetchone()
        checkin = "{}:{}:{}".format(row[5], row[6], row[7])

        now = datetime.now()
        h = now.hour
        m = now.minute
        s = now.second
        checkout = "{}:{}:{}".format(h, m, s)
        timedursec = (s - int(
            row[7])) + (m - int(row[6])) * 60 + (h - int(row[5])) * 60 * 60

        if row[8] == "Super Deluxe":
            cost = timedursec * 3
        if row[8] == "Deluxe":
            cost = timedursec * 2
        if row[8] == "Normal":
            cost = timedursec * 3

        p.setFont('Helvetica', 18, leading=None)
        p.drawString(80, 360, "Customer Details")
        p.setFont('Helvetica', 15, leading=None)
        p.drawString(80, 340, "Name:   {}".format(row[0]))
        p.drawString(80, 320, "Address:{}".format(row[1]))
        p.drawString(80, 300, "Mob.no: {}".format(row[2]))
        p.drawString(80, 280, "{} no:  {}".format(row[3], row[4]))
        p.drawString(
            60, 250,
            "-------------------------------------------------------------------------------------------------------------------------------------------"
        )
        p.setFont('Helvetica', 15, leading=None)
        p.drawString(
            60, 230,
            "Room Type          Room No.        Check-in            Check-out       Time duration           Cost of room    "
        )
        p.drawString(
            60, 200,
            "{}                 {}              {}                  {}              {}                      {}    "
            .format(row[8], row[9], checkin, checkout, timedursec, cost))
        p.drawString(
            60, 170,
            "                                                                                                                                   +   Cost of food"
        )
        p.drawString(
            60, 150,
            "                                                                                                                                        {}     "
            .format(row[10]))
        p.setFont('Helvetica', 30, leading=None)
        p.drawString(
            60, 120,
            "                                       Total  Cost: {}".format(
                cost + row[10]))
        logo = "M.jpg"
        p.drawImage(logo, 500, 270, width=None, height=None)

        p.showPage()
        p.save()
        '''content="Dear Sir/Madam,\nThank you very much for staying with us at Mango Hotel, We hope we acheved our goal of making your stay memorable and Comfortable.\n\nHere is an attached copy of the invoice of your stay.\n\nOnce again we appreciate you for choosing our hotel.\nWe hope to serve you again\n\nRegards,\nRahul Sharma\nManager"

        msg=MIMEMultipart()
        msg['From']="Hotel Mango"
        msg['Subject']="Letter of Thanks"

        filename="{}.pdf".format(row[0])
        filename="M.jpg"
        attachment=open(filename,'rb')
        part=MIMEBase('application','octet-stream')
        part.set_payload(attachment.read())
        encoders.encode_base64(part)
        part.add_header('Content-Disposition',"attachment;filename="+filename)
        msg.attach(part)
        text=msg.as_string()'''

        fromaddr = '*****@*****.**'
        toaddr = row[11]
        msg = MIMEMultipart()
        msg['From'] = fromaddr
        msg['To'] = toaddr
        msg['Subject'] = 'Letter of thenks'
        body = "Dear Sir/Madam,\nThank you very much for staying with us at Mango Hotel, We hope we acheved our goal of making your stay memorable and Comfortable.\n\nHere is an attached copy of the invoice of your stay.\n\nOnce again we appreciate you for choosing our hotel.\nWe hope to serve you again\n\nRegards,\nRahul Sharma\nManager"
        msg.attach(MIMEText(body, 'plain'))
        filename = row[0] + '.pdf'
        attachment = open(
            'F:/Projects/SE Miniprojects/ram osl project/' + row[0] + '.pdf',
            'rb')
        part = MIMEBase('application', 'octet-stream')
        part.set_payload(attachment.read())
        encoders.encode_base64(part)
        part.add_header('Content-Disposition',
                        'attachment; filename= %s' % filename)
        msg.attach(part)
        server = smtplib.SMTP('smtp.gmail.com', 587)
        server.starttls()
        server.login(fromaddr, '24026284')
        text = msg.as_string()
        server.sendmail(fromaddr, toaddr, text)
        server.quit()
        '''#server=smtplib.SMTP('smtp.gmail.com:587')
        server.ehlo()
        server.starttls()
        server.login('*****@*****.**','24026284')
        server.sendmail('*****@*****.**',row[11],content)
        server.quit()'''

        #client=Client("AC7eda11d6751fd264c577dcf0aed53f2c","4c604f55923fafab92a75eb32299f6fa")
        #client.api.account.messages.create(from_="8454069811",to=row[2],body="Dear Sir/Madam,\nThank you very much for staying with us at Mango Hotel,\nWe hope to serve you again\n\nRegards,\nRahul Sharma\nManager")
        zerosms.sms(
            phno='8454069811',
            passwd='N8248M',
            message=
            'Thanks for visiting Hotel Mango.\nRegards,\nRahul Sharma\nManager',
            receivernum=row[2])

        filepath = "{}.pdf".format(row[0])
        conn = sqlite3.connect("hotelman.db")
        c = conn.cursor()
        c.execute(
            "delete from custdetails where roomtype='%s' and roomno='%s'" %
            (a[1], a[2]))
        conn.commit()

        wb.open_new(r'{}.pdf'.format(row[0]))
Ejemplo n.º 22
0
import zerosms
phonenum = 9121832078
password = "******"
receiver = 9284107587
zerosms.sms(phno=phonenum,
            passwd=password,
            message='helloworld!!',
            receivernum=receiver)