Page 53 - PYTHON-12
P. 53

mobileno=x[4]

                       check_in=x[5]
                       check_in=x[6]

                       adv_pay=x[7]
                       room_type=x[8]

                       print(cno,cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type)

               def generate():
                   Tax=0


               mydb=mysql.connector.connect(host="localhost",user="root",passwd="DBA",databa
               se="project")
                   mycur=mydb.cursor( )

                   cno=int(input("Enter The Customer number: "))
                   str="Select cno,cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type  ,dayofyear(check_out) - dayofyear(check_in)  from hotel where
               cno={}"

                   query=str.format(cno)

                   print("==========================================")
                   mycur.execute(query)

                   myrec=mycur.fetchall()
                   for x in myrec:

                       cno=x[0]
                       cname=x[1]

                       address=x[2]
                       roomno=x[3]

                       mobileno=x[4]
                       check_in=x[5]

                       check_out=x[6]
                       adv_pay=x[7]

                       room_type=x[8]
                       days=x[9]

                       print('=================================================')

                       print("                     THE TAJ HOTEL                ")
                       print("                                                  ")
                       print("                     Colaba,Mumbai                ")
   48   49   50   51   52   53   54   55   56   57   58