Website blog

Introduction

This website is a colorful, attractive and user friendly website which not only facilitates the users who are using this website to make purchases and view innovative ideas of their favorite baked goods, but this website has also been made incredibly easy and dynamic for the admin of this online cupcake shop as well. Any time the need approaches to view the user details or orders that have been placed, the admin needn’t go into the database on PHPMyAdmin, but can view all details on a page on the website which has been restricted to other regular users. This is a website that makes buying and choosing as easy as possible for the users and makes selling easy for the sellers!

Concept

The concept behind this website is simple. Instead of wasting space by opening bakeries, the same things can be achieved by creating an online shop. Additionally, the nature of baked goods is such that they are easily spoilt and get stale. Most bakeries nowadays to showcase their incredible designs etc. have to make cakes in their physical shops and keep throwing them out and putting new ones in for a better customer base. Our online shop simply allows the users to browse through all the cakes that a bakery has made without the need for them to be physically present to the user.

Wireframes

1

Figure 1 Homepage

2.jpg

Figure 2 Cakes (Zoomed out view)

3.jpg

Figure 3 Customize

Design

The design is fairly simple. The website has 4 pages.

The first page is an introduction to shop. The navigation bar links to the rest of the pages. To facilitate the customer a sign in and sign up option has been made available on this page instead of on a new page.

The second page is ‘Cakes’. This page displays all the cakes that the shop offers. Each cake has a button next to it that can be clicked to order the cake.

The third page is called ‘Customize’. In case the customer doesn’t want to order from the list of cakes displayed on the ‘Cakes’ page, the customer can customize their own cake here and place the order.

The fourth page is a simple static page displaying information that can be used to contact the admin of this website.

Implementation details

The website has been implemented by first, making a template and then making php pages to put information inside that template in order to customize it.

The template four anchor tags within the navigation bar. These navigate to the different pages. The CSS has been attached to the template page. By including the template page in all of the other pages that we make, we can have a consistent website design throughout.

The pages have been implemented using entities, models and controllers. A separate php page has been allocated to making the entities of all the object being used in the website. There are 3 entities all in a separate folder. These are ‘OrderEntity’, ‘UserEntity’, and ‘CakeEntity’. Instead of making an admin entity separately an informed decision was made to allocate a unique ID and password to the admin within the user table. The admin pages will only be given access to the user with this combination. The entity pages define the object and allocate a set of attributes to them along with implementation of the constructor.

The CakeModel.php and OrderModel.php connect to the database using the file ‘Credentials.php’ which stores all the database connectivity information. The models retrieve all the data from the database that is needed by the controller. The functions within these models do the basic programming of retrieving and sorting the data which would make displaying it easier. The controller files then get these functions and prepare them to be called within the main pages that include the template.

The set of Controller pages contain all the functions that can be called with regard to these entities. Instead of making these functions within our pages, for instance the Customize page etc. these have been made separately providing an additional layer of security and keeping the code clean. These are OrderController and CakeController. These hold the following functions.

function CreateCakeDropdownList() – creates dropdown list on Cakes page, helps the user filter between cakes, cookies, cupcakes etc.

function CreateOptionValues(array $valueArray) – creates options for cake customization in customize.php

function GetImages() – gets image by concatenating the library at which the image is stored.

function InsertCake() – used by the admin or in customized when order needs to be placed or a new cake needs to be inserted by admin.

function UpdateCake($id) – used by admin to update cake.

function DeleteCake($id) – used by admin to delete cake.

function GetCakeById($id) – creates dropdown list to display in customize.php

function GetCakeByType($type) – getter for cake by filtering through ID

function GetCakeFlavours() – creates dropdown list to display in customize.php

function GetCakeToppings() – creates dropdown list to display in customize.php

function GetCakeFillings()  – creates dropdown list to display in customize.php

function GetCakeIcings()– creates dropdown list to display in customize.php

If the user wishes to sign up they click the sign up button in the sidebar. This button uses ajax and the form only appears once the user clicks the button. This is to avoid form clutter. Everything that the user stores goes into a database.

If the user wishes to sign in, she/he can do it on any page as long as it’s before the order page. The user can view cakes etc. without logging in however the user needs to be logged in to actually place an order which will be stored in the database and would then be accessible to the admin.

The user when goes to the cakes page using the links in the navigation bar, will see a list of all cakes that have been uploaded by the admin. There will be a little dropdown list which can be used by the user to filter the baked goods being displayed, eg. The user can choose to view just cookies. This has been done by creating a dynamic list through picking up all the values in the database pertaining to type in the cake entity.

The user once logged in is stored into a session. The database has been made on PHPMyAdmin with the user, cake and order tables.

Trouble shooting notes

  • All Ajax code is sent to a single file xmlfile.php. Because the data is mostly being sent through the POST array, most conditions of isset can become true and data intended for other pages can also be displayed. This was countered by storing data in another variable first.
  • Mostly it is hard to imbed $_POST[] and $_GET[] into forms. It is important to remember to use the escape character with it.
  • In fetch_data.php because all forms are being directed to it through Ajax from all pages, writing ‘index.php’ only redirects the form to the index page even though it should go to the page from where the user began signing in.
  • The $sidebar variable was displayed in the template page and in some pages it wasn’t set. This led to an error. Simply solved by implementing if(isset()).

Actual UI walkthrough

The pages have been templated and all pages share a similar UI. The css file called stylesheet in the styles folder is used to set the css for the entire website. Little styling has been done inline and within the <head> tag of pages.

A banner of a cakes has been put up on the top of the website. The color of the font has carefully been selected in combination with the tiny cupcakes wallpaper and navigation bar background to make sure that all the text is visible. In the homepage the sign-up form is not visible as it would add a lot of clutter. The sign in form is replaced by a logout button once the user has successfully logged in.

The sidebar has been set with a light background complementing the colour of the page. The UI has been kept very simple.

In Cakes.php the cakes have been displayed in a linear order, vertically. All forms have been kept basic with sufficient spacing in the middle.

If a user selects a cake from the list to order, the image automatically goes onto the next page.

Code

Code is self explanatory

Code deployment guide

  • You need to have an online domain.
  • Unzip the folder ‘Cupcakes.rar’
  • Place the folder in your localhost or your domain.
  • Change the password and username in the file ‘credentials.php’
  • Run index.php

User guide

Admin:

  • Sign up as admin.
  • You will be redirected to the admin panel.
  • Here you will be given the options to View Orders and View Users.
  • You can also add, edit and delete cakes.
  • If an order is done, you can mark it complete by clicking on the status button in the View Orders tab.

User:

  • Sign up as user

signup

  • Select cake button from menu barbar.jpg
  • Select cake

selectcake.jpg

  • Customize it as per your requirementcustomize.png
  • Place order
  • Your website will display all the things that you add to the database using your website.
  • Add a cake
  • Sign in

Favouritism

This is basically an illness with no cure. And a gaping hole within our education system. Everyone has favourites. And people with strong personalities who aren’t really good at being politically correct are targets to favouritism.

images

We do a lot to curb it. We try to make systems transparent and we try to have most of our examination systems in written form so that there is some form of accountability. But then again favoritism can be pretty detrimental to a child’s growth especially at a younger age.

While adult students can highlight favoritism for what it is and probably know the cause, students at younger ages always end up questioning if there is something wrong with them. They are made to spend endless hours thinking about why and how a “Betty” or “Anna” is better than them.

The confidence of a kid, which is very essential to a child’s growth, waivers. So all we can really do to cure this, for the betterment of our future generations it to cleanse ourselves of favoritism. We will naturally like some people better than others. But we need to be as fair and objective as possible if a time calls for it. This will help us create a trend of justice.

How To Eat Less and Avoid Food Cravings

image

Can’t stop eating? Do you find yourself eating food that you probably don’t even like? Hate the bloated stomach feeling you get later on?

Well, here’s the simple solution.
Half an hour before having food, have a glass of water. This will help you with your appetite. Your stomach will feel slightly full, so you won’t brainlessly dive into the food. But don’t have water with, immediately before, or after the food. That can be really unhealthy. It expands the elastic lining of your stomach after you have had the food because most food swells in water.

Secondly, know your food. Know the kind of food you like or dislike. Are you a big fan of Doritos who still has Lays for no particular reason? We need to change that. Don’t have that extra bag of Lays. Have Doritos and if you have already had a bag then feel good about it. Don’t have the Lays just because you were bored and then later have a bag of Doritos because you “never liked the Lays, anyway”.

When the food is in front of you, don’t just gobble it all down. Wait. Look at the food. Look at the colours. Take slow bites. Enjoy the flavour and taste in each bite. Chew slowly and then swallow. Be so involved in enjoying the food you are already having rather than having dibs on that last slice of pizza. You can live without that. Just enjoy your current slice.

So, love your food and treat it with respect. Although, love your stomach more. It’s not a dustbin, so don’t treat it like one.

What Really Matters

The point is, eventually, there are things a lot more important than fame and writing out stuff that can sell. And there is definitely stuff more important than being on top of a class, or getting first position in a race.

There are people who endlessly want to prove their worth to others. Their own word is not enough for them. They want to repeat in front of a large group how they scored an A. And this is not a one time ecstatic shout of joy. This is something they feel the need to do again and again. In front of different groups of people in all their social gatherings.

image

Before you show off, think for a moment why you felt the need to do that. Was your grade in Physics not good enough for you? Will the world somehow sanction your existence if they know of a grade you got a year ago?

Being with friends or people who make you happy, creates in you the instinct to tell them of a thing you achieved. And that is perfectly okay, and very joyful. But sharing a victory with friends is worlds apart from rubbing it into someone’s face again and again.

Because regardless of what you achieve, the ultimate test is always the same; can you pass at being human? Can you feel the kind of passion that drives you insane? Be in a kind of relationship that you want to hide in your pocket away from the ugly world? The midnight walks in a park that no one will know about? Something that is yours for you and not because you want to impress the world?

If you think you’re really worth it, then believe it. And don’t be so desperate for approval and appreciation from everyone else. The approval and love of the hand full of people who matter should be enough for you. Prioritize.

Success Ain’t Coming Fast Enough?

image

Do you imagine yourself doing stuff that has never been done before? And imagine yourself as a person you aren’t even close to in this moment? Then it is probably the day dreaming. And well, its time to admit that day dreaming is lethal to your success. We just sit on a comfortable couch and gain pounds as we think about tread-milling. And we always say, well, we will start from tomorrow. We also just sit on our asses and imagine the applause after being the best in class, again in this process, we forget to open our books. That too is put off to tomorrow. Day dreaming is one of the easiest and best feelings. We get to live in a parallel world with literally everything going the way we want to.

But I guess we should understand sooner, than later, that we only have the time to live, and win at one life. So better get out there. Better feel alive burning fat on the treadmill or killing yourself over a chemistry question. Because living should be about the pain and the trouble and not just the ultimate glory. You will honestly see yourself succeed if you stop focussing on the end goal and focus on the way you have to take to do that stuff. The means should be more important than the ends.

That will make you a more humble and successful person. I know day dreaming is one of the best feelings ever and can be done everyday for hours at a stretch. But lets just keep it at that. A forbidden fruit that you should only treat yourself to very seldom.

What we eventually remember.

Everything said and done there are a lot of people who have made our blood boil, some have done that by merely existing, others by consciously victimizing us.
We feel incredibly pissed off when in these moments we are asked to keep a cool head and don’t let things bother us. Because it seems impossible to look beyond someone else who has wronged us.
But coming across this picture, I was struck by how true it was. The faces of the people who have wronged me are a blur. But I clearly remember every color of the mornings I spent on the rooftop of my school with my friends. The three of us were mostly silent. Feeling the winter chill. Cuddled together. Each lost in our own thought. After every five minutes making a remark. We were out of things to say because we’d spend the whole day together living a mutual life with the same people in it and having mostly, the same opinions of those people. Having a whole day ahead of us we were mostly silent during those lazy winter mornings. One of us peeling away an orange, another with a cup of hot tea in her hand. Or munching on a 50 rupee chocolate muffin we’d grabbed on our way to the roof from the canteen.
Now we live our lives, geographically apart. Yes, we Skype, and dine out and meet up. But those moments that were so for granted back in the day, at times hit me with overwhelming waves of nostalgia.

image

Eid Ul Azha

People are naturally biased towards their religious traditions. These somehow seem to make more sense than all other traditions combined. Eid is a day of festivity within Pakistan.
image

The Eid Ul Azha or ‘bakra eid’ as many like to call it requires Muslims to buy an animal from a variety ranging from goats to camels. These animals are then sacrificed.
Now under the increasing culture of animal rights and awareness this may seem brutal, but let’s understand the core concept behind this. Firstly the point of this ritual is to understand death and life after death. Islam comes with the promise of resurrection on the day of Judgment. In ancient times, prophet Ibrahim (AS) was asked to sacrifice the thing that he held dearest. After a lot of contemplation, he chose his son. But an instant before the sacrifice, his son was replaced by a sheep. Now you can laugh and pass this as unreal and superficial, but let’s not forget how this whole universe, the way we were created, our brains, what’s beyond the milky way and all forces and charges are supernatural.

So the point of this tradition is a belief in the mercy of God and that we belong to Him before anyone else and to Him we have to return. And so we should keep alive, in ourselves, the spirit of sacrifice. But it’s not just about that. Its about faith in after life. Faith in the fact that departure within this world is a necessity and a norm. Death happens. But people can unite in heaven. This world and the next are linked.
Now I understand that this may seem brutal. But is death really brutal? Only the dead can know but they can’t really tell us. Death is thought of as brutal because of the suffering of the living.

Do not pity the dead, pity the living.

And people want life to end and commit suicide all the time. So let’s understand the life of an animal. Who has no outlet of speech. Who does endless work without any return. Who has no hope of evolution. When sacrificing, you are not taking away a life, you’re relieving a creature in misery off that life.
Islam is very specific about the rules of sacrifice. There is to be no pre sacrifice torture. The weapons aren’t to be sharpened in front of the animal. The animal is to be treated royally before sacrifice and should be well fed. If the animal isn’t sacrificed in one go, then the kurbani (sacrifice) isn’t halal.
So before you call this tradition brutal, just because it includes blood, think again. Islam condemns all other sorts of animal torture such as cock fighting and brutally slaying or cutting animal body parts while they are alive for pleasure.
The Muslims are commanded to distribute a specified portion of this meat to the needy, of which there is no lack in most Muslim nations. Men, women and children dress up in colorful cultural shalwar kameez, put on henna and meet up with relatives while enjoying all sorts of desi desserts. When life becomes a screaming bore, the festivity within these events keeps you going, with something to look forward to.

image

Eid Mubarak!

The paradox of immortal words.

image

Writers, poets and artists are perpetually glorified and their lifestyles admired. But do we ever stop to think about the pain that is driving the passion within a novel, the desperation within a song, or the anger within the perfect curves, sketched violently by an artist?

Virginia Woolf, well known writer and  a modernist of the twentieth century, with works so timeless that they’re alive to date, committed suicide. She walked into the water after stuffing stones inside her coat’s pockets, so that there was no chance of survival. This was her parting letter to her husband. When this letter was shared in my literature class, I was truly moved.

Dearest,

I feel certain that I am going mad again. I feel we can’t go through another of those terrible times. And I shan’t recover this time. I begin to hear voices, and I can’t concentrate. So I am doing what seems the best thing to do. You have given me the greatest possible happiness. You have been in every way all that anyone could be. I don’t think two people could have been happier till this terrible disease came. I can’t fight any longer. I know that I am spoiling your life, that without me you could work. And you will I know. You see I can’t even write this properly. I can’t read. What I want to say is I owe all the happiness of my life to you. You have been entirely patient with me and incredibly good. I want to say that — everybody knows it. If anybody could have saved me it would have been you. Everything has gone from me but the certainty of your goodness. I can’t go on spoiling your life any longer.

I don’t think two people could have been happier than we have been.

V.