dimanche 20 août 2017

How can I implement my C# panel & label idea with PHP / JavaScript / HTML

I created my own calendar with C#. But now I'm trying to implement it web based with PHP / JavaScript / HTML. I actually have no idea how to create panels like I did in my C# and fill them with labels...

Can anyone give me an advise what I should look for ? Or with which method I can realize my plans ?

Here is what my C# code looks like.

Code

//Aktuelle Panels erstellen
Panel test = new Panel();
count++;
//Panell anpassen
test.Name = "panel" + i;
test.Width = 245;
test.Height = 170;
test.BackColor = Color.White;
Label date = new Label();
//Datum einfügen
if(i >= 9)
{
    int description = i + 1;
    date.Text = description.ToString();
}
else
{
    int description = i + 1;
    date.Text = 0 + description.ToString();
}

//Create Label

string day = date.Text;
string year = cbJahr.Text;
string month = tbMonat.Text;
string stringDate = day + "." + month + "." + year;
DateTime dt = Convert.ToDateTime(stringDate);

//Sonntage farblich hinterlegen
if (dt.DayOfWeek == DayOfWeek.Sunday)
{
    test.BackColor = Color.LightGray;
}

//Label frühschicht
Label frühschicht = new Label();
string frühschichtText = datenbank.panelBefüllen(tag, monat, jahr, "Frühschicht", null, null, null, null);
frühschicht.Width = 236;
if (frühschichtText != null)
{
    frühschicht.Text = "Frühschicht: " + frühschichtText;
    frühschicht.ForeColor = Color.Black;
}
frühschicht.Location = new System.Drawing.Point(frühschichtlocationX, frühschichtlocationY);
date.Location = new System.Drawing.Point(datelocationX, datelocationY);
//foreach (Control c in this.Controls)

if (frühschicht.Text.Contains("Offe"))
{
    frühschicht.BackColor = Color.LightPink;
    fehlercount++;

    date.BackColor = Color.LightPink;
    date.Width = 19;
}
else
{
    frühschicht.BackColor = Color.LightGreen;
    date.BackColor = Color.LightGreen;
    date.Width = 19;
}

So, yeah. I just create a Panel, fill it with the date and colorize it. After that I check if something is in my database for this day, and fill it with a label.




Aucun commentaire:

Enregistrer un commentaire