Hak cipta dan penggunaan kembali:
Lisensi ini mengizinkan setiap orang untuk menggubah, memperbaiki, dan membuat ciptaan turunan bukan untuk kepentingan komersial, selama anda mencantumkan nama penulis dan melisensikan ciptaan turunan dengan syarat yang serupa dengan ciptaan asli.
Copyright and reuse:
This license lets you remix, tweak, and build upon work
non-commercially, as long as you credit the origin creator
and license it on your new creations under the identical
terms.
LAMPIRAN
Berikut adalah coding dari situs web yang menggunakan bahasa pemrograman PHP.
- login.php
- <?php
- session_start();
- include"include/connect.php";
- $info="";
- if(isset($_SESSION["infologin"])) - {
- $info=$_SESSION['infologin'];
- $_SESSION["infologin"]="";
- } - -
- - $sql=mysql_query("SELECT id_member, firstname, lastname, point FROM member WHERE account_type='c' ORDER BY point DESC LIMIT 3");
- - $LeaderboardList='<table width="200px" border="0" align="center" cellpadding="3">
- <tr> ';
- - while($row=mysql_fetch_array($sql)){
- - $id=$row['id_member'];
- $firstname=$row['firstname'];
- $lastname=$row['lastname'];
- $point=$row['point'];
- $firstname= substr($firstname,0,10);
- /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
- $check_pic="members/$id/image01.jpg";
- $default_pic="members/0/image01.jpg";
- if(file_exists($check_pic)){
- $user_pic="<img src=\"$check_pic\" width=\"64px\" border=\"0\" />";// forces picture to be 100px wide and no more
- }else{
- $user_pic="<img src=\"$default_pic\" width=\"64px\" border=\"0\" />";// forces default picture to be 100px wide and no more
- }
- - $LeaderboardList.='<td width="50%"><div style=" height:80px; overflow:hidden;"><a href="http://www.project0032.uphero.com/badge.php?kode_user='.$id.'">'.$user_pic.'</a></
td><td width="50%">Point : '.$point.'</td></div><tr>';
- - }// close while loop -
- ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- <scriptlanguage="javascript">
- function ajaxdate(tgl) - {
- $.ajax({
- type:"GET", - url:"ajaxdate.php", - data:"tgl="+tgl+"", - success:function(response) - {
- - } - });
- }
- function date() - {
- //===============TIME====================
- var d =new Date();
- var date= d.getDate();
- var mon = d.getMonth()+1;
- var year= d.getFullYear();
- if(date<10) - {
- var date="0"+date;
- }
- if(mon<10) - {
- var mon="0"+mon;
- }
- var tgl= year+"-"+mon+"-"+date;
- ajaxdate(tgl);
- - } - </script>
- </head>
- <bodyonLoad="date()">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass ="main">
- <tablewidth="100%">
- <tr>
- <tdwidth="50%">
- - <divclass="login">
- <span>Login</span>
- <tableborder="0"align="center">
- <formaction="dologin.php"method="get">
- - <tr>
- <td>
- Username - </td>
- </tr>
- <tr>
- <td>
- <inputclass="text"id="username"name="username"type="text"style="">
- </td>
- </tr>
- <tr>
- <td>
- Password - </td>
- </tr>
- <tr>
- <td>
- <inputclass="text"id="password"name="password"type="password"style="width:235 px;height:25px">
- </td>
- </tr>
- <tr>
- <tdstyle="color:#F00"align="center">
- <b><?echo$info;?></b>
- </td>
- </tr>
- <tr>
- <tdalign="right">
- <inputclass="button"type="submit"value="Log In"class="button">
- </td>
- </tr>
- </form>
- - </table>
- - </div>
- - - </td>
- <tdwidth="50%"rowspan="2">
- - <divclass="loginlist">
- <span>List Seminar</span>
- <?php
- $today=$_SESSION["date"];
- $rs=mysql_query(" select s.*,js.nama_jenis,js.point from seminar s - LEFT JOIN jenis_seminar js
- ON s.id_jenis_seminar = js.id_jenis_seminar - where s.tanggal>='$today'
- order by s.id_seminar desc");
- while($baca=mysql_fetch_array($rs)) - {
- $tanggal=$baca["tanggal"];
- $arrtanggal=explode("-",$tanggal);
- $tanggal=$arrtanggal[2]."-".$arrtanggal[1]."-".$arrtanggal[0];
- ?>
- <tableclass="detailseminarlgn"border="0">
- <tr>
- <tdalign="center"valign="middle"style="width:100px;">
- <imgstyle="width:90px;height:90px;"src="images/badge/<?phpecho$baca["picture"];?>
"/ >
- </td>
- <tdvalign="top">
- <tableborder="0"class="innerdetailseminar"style="">
- <tr>
- <tdstyle="width:100px;">Topic</td>
- <tdcolspan="3"style="width:600px;"><?phpecho$baca["nama_seminar"];?></td>
- </tr>
- <tr>
- <td>Jenis</td>
- <td><?phpecho$baca["nama_jenis"];?></td>
- <tdstyle="width:100px;">Point</td>
- <td><?phpecho$baca["point"];?></td>
- </tr>
- <tr>
- - <td>Tanggal</td>
- <tdstyle="width:150px;"><?phpecho$tanggal;?></td>
- <tdstyle="width:100px;">Jam</td>
- <td><?phpecho$baca["jam"];?></td>
- </tr>
- <tr>
- <tdvalign="top">Pembicara</td>
- <tdcolspan="3">
- <?php
- $kodeseminar=$baca["id_seminar"];
- $rs1=mysql_query("SELECT p.nama_pembicara FROM detail_pembicara dp - LEFT JOIN pembicara p
- ON dp.id_pembicara = p.id_pembicara - WHERE id_seminar ='$kodeseminar'");
- while($baca1=mysql_fetch_array($rs1)) - {
- ?>
- <li><?phpecho$baca1["nama_pembicara"];?></li>
- <?php
- } - ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <?php - } - ?>
- </div>
- - </td>
- </tr>
- <tr>
- <td>
- - <divclass="leaderboard">
- <span>Leaderboard</span>
- <table><tr><td><?phpprint"$LeaderboardList";?></td></tr></table>
- </div>
- - </td>
- </tr>
- </table>
- - </div>
- </div>
- </body>
- </html>
- index.php
- <?php
- session_start();
- include"include/protected.php";
- include"include/connect.php";
- -
- - $sql=mysql_query("SELECT id_member, firstname, lastname FROM member WHERE account_type='c' ORDER BY point DESC LIMIT 12");
- - $MemberDisplayList='<table border="0" align="center" cellpadding="3">
- <tr> ';
- - while($row=mysql_fetch_array($sql)){
- - $id=$row['id_member'];
- $firstname=$row['firstname'];
- $lastname=$row['lastname'];
- $firstname= substr($firstname,0,10);
- /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
- $check_pic="members/$id/image01.jpg";
- $default_pic="members/0/image01.jpg";
- if(file_exists($check_pic)){
- $user_pic="<img src=\"$check_pic\" width=\"64px\" border=\"0\" />";// forces picture to be 100px wide and no more
- }else{
- $user_pic="<img src=\"$default_pic\" width=\"64px\" border=\"0\" />";// forces default picture to be 100px wide and no more
- }
- - $MemberDisplayList.='<td><div style=" height:64px; overflow:hidden;"><a
href="http://www.project0032.uphero.com/badge.php?kode_user='.$id.'">'.$user_pic.'</a></
div></td>';
- - }// close while loop
- - $MemberDisplayList.=' </tr>
- </table> ';
- - - ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <scripttype="text/javascript">
- function date() - {
- //===============TIME====================
- var d =new Date();
- var date= d.getDate();
- var mon = d.getMonth()+1;
- var year= d.getFullYear();
- if(date<10) - {
- var date="0"+date;
- }
- if(mon<10) - {
- var mon="0"+mon;
- }
- var tgl= year+"-"+mon+"-"+date;
- - $.ajax({
- type:"GET", - url:"ajaxdate.php", - data:"tgl="+tgl+"", - success:function(response) - {
- } - });
- } - </script>
- - </head>
- <bodyonLoad="date()">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divstyle="width:100%; background-color:#EFEFEF; border:#999 thin solid;">
- <tablealign="center"><tr><td><?phpprint"$MemberDisplayList";?></td></tr></table>
- </div>
- <divclass="indexlist">
- <?php
- $today=$_SESSION["date"];
- $rs=mysql_query(" select s.*,js.nama_jenis,js.point from seminar s - LEFT JOIN jenis_seminar js
- ON s.id_jenis_seminar = js.id_jenis_seminar - where s.tanggal>='$today'
- order by s.id_seminar desc");
- while($baca=mysql_fetch_array($rs)) - {
- $tanggal=$baca["tanggal"];
- $arrtanggal=explode("-",$tanggal);
- $tanggal=$arrtanggal[2]."-".$arrtanggal[1]."-".$arrtanggal[0];
- ?>
- <tableclass="detailseminar"border="0">
- <tr>
- <tdalign="center"valign="middle"style="width:120px;">
- <imgstyle="width:100px;height:100px;"src="images/badge/<?phpecho$baca["picture"];?
>"/ >
- </td>
- <tdvalign="top">
- <tableborder="0"class="innerdetailseminar">
- <tr>
- <tdstyle="width:140px;">Topic</td>
- <tdcolspan="3"style="width:580px;"><?phpecho$baca["nama_seminar"];?></td>
- </tr>
- <tr>
- <td>Jenis</td>
- <td><?phpecho$baca["nama_jenis"];?></td>
- <tdstyle="width:140px;">Point</td>
- <td><?phpecho$baca["point"];?></td>
- </tr>
- <tr>
- - <td>Tanggal</td>
- <tdstyle="width:250px;"><?phpecho$tanggal;?></td>
- <tdstyle="width:140px;">Jam</td>
- <td><?phpecho$baca["jam"];?></td>
- </tr>
- <tr>
- <tdvalign="top">Pembicara</td>
- <tdcolspan="3">
- <?php
- $kodeseminar=$baca["id_seminar"];
- $rs1=mysql_query("SELECT p.nama_pembicara FROM detail_pembicara dp - LEFT JOIN pembicara p
- ON dp.id_pembicara = p.id_pembicara - WHERE id_seminar ='$kodeseminar'");
- while($baca1=mysql_fetch_array($rs1)) - {
- ?>
- <li><?phpecho$baca1["nama_pembicara"];?></li>
- <?php - } - ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <?php - } - ?>
- </div>
- </div>
- </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- dologin.php
- <?php
- session_start();
- include"include/connect.php";
- if(isset($_REQUEST['username'])) - {
- $user=$_REQUEST['username'];
- }
- if(isset($_REQUEST['password'])) - {
- $pas=$_REQUEST['password'];
- }
- $rs=mysql_query("select * from member where username='$user'");
- if($baca=mysql_fetch_array($rs)) - {
- if($baca["password"]==$pas) - {
- $_SESSION["kode_user"]=$baca["id_member"];
- $_SESSION["password"]=$baca["password"];
- $_SESSION["nama_user"]=$baca["firstname"];
- $_SESSION["account_type"]=$baca["account_type"];
- $_SESSION["pic"]=$baca["picture"];
- $today=$_SESSION["date"];
- $id_member=$baca["id_member"];
- echo$today;
- mysql_query("update member set - last_log_date = '$today'
- where id_member ='$id_member'");
- - header("location:index.php");
- } - else - {
- $_SESSION["infologin"]="Password salah";
- header("location:login.php");
- } - } - else - {
- $_SESSION["infologin"]="Username Tidak Terdaftar";
- header("location:login.php");
- }
-
?>- dologout.php
- <?
- session_start();
- $_SESSION["kode_user"]="";
- $_SESSION["password"]="";
- $_SESSION["nama_user"]="";
- $_SESSION["account_type"]="";
- header("location:./login.php");
-
?>- createseminar.php
- <?php
- session_start();
- include"include/protectedadmin.php";
- include"include/connect.php";
- ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <linkrel="stylesheet"type="text/css"href="js/fancybox/jquery.fancybox.css"media="scr een"/>
- <scripttype="text/javascript"src="js/fancybox/jquery.fancybox.js"></script>
- - <linkrel="stylesheet"type="text/css"href="js/jquery.ptTimeSelect.css"media="screen"/
>
- <scripttype="text/javascript"language="JavaScript"src="js/jquery.ptTimeSelect.js"></
script>
- <scriptlanguage="javascript">
- $(function(){
- $('#date').datepicker({ dateFormat:"dd-mm-yy"});
- $('#time').ptTimeSelect();
- });
- function addPembicara(byk) - {
- var no= byk+1;
- return"<tr>"+
- "<td class=\"bold\" style=\"width:226px;height:30px\">"+
- "Pembicara "+no+""+
- "</td>"+
- "<td >"+
- "<select class=\"text\" id=\"pembicara-"+no+"\" name=\"pembicara-"+no+"\">"+
- <?php
- $rs=mysql_query("select * from pembicara");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- "<option
value=\"<?phpecho$baca["id_pembicara"];?>\"><?phpecho$baca["nama_pembicara"];?></
option>"+
- <?php - } - ?>
- "</select>"+
- "</td>"+
- "</tr>";
- }
- function comboBanyak() - {
- var banyak = document.getElementById("banyakpembicara").value;
- var tamp="";
- for(var i=0;i<banyak;i++) - {
- tamp = tamp + addPembicara(i);
- }
- document.getElementById("detailpembicara").innerHTML=tamp;
- }
- function tgl() - {
- //===============TIME====================
- var d =new Date();
- var date= d.getDate();
- var mon = d.getMonth()+1;
- var year= d.getFullYear();
- if(date<10) - {
- var date="0"+date;
- }
- if(mon<10) - {
- var mon="0"+mon;
- }
- var tgl= date+"-"+mon+"-"+year;
- - return tgl;
- }
- function validasi() - {
- var namaseminar=document.getElementById('namaseminar').value;
- var jenisseminar=document.getElementById('jenisseminar').value;
- var date=document.getElementById('date').value;
- var time=document.getElementById('time').value;
- var myfile=document.getElementById('myfile').value;
- var banyakpembicara=document.getElementById('banyakpembicara').value;
- var tamp="";
- var cek="";
- var arrmyfile=myfile.split(".");
- var ext = arrmyfile[arrmyfile.length-1];
- var today = tgl();
- - var mySplitResult1 = date.split("-");
- var x1=new Date();
- x1.setFullYear(parseInt(mySplitResult1[2]),parseInt(mySplitResult1[1])- 1,parseInt(mySplitResult1[0]));
- var mySplitResult2 = today.split("-");
- var x2 =new Date();
- x2.setFullYear(parseInt(mySplitResult2[2]),parseInt(mySplitResult2[1])- 1,parseInt(mySplitResult2[0]));
- -
- for(var i=0;i<banyakpembicara;i++) - {
- for(var j=i+1;j<banyakpembicara;j++) - {
- var ii=i+1;
- var jj=j+1;
- var a = document.getElementById('pembicara-'+ii).value;
- var b = document.getElementById('pembicara-'+jj).value;
- if(a==b) - {
- i=banyakpembicara;
- j=banyakpembicara;
- cek="F";
- } - } - }
- - if(namaseminar=="") - {
- alert("Masukan Nama Seminar");
- }
- elseif(date=="") - {
- alert("Masukkan Tanggal");
- }
- elseif(x1<x2) - {
- alert("Tanggal seminart tidak boleh lebih kecil dari hari ini");
- }
- elseif(time=="") - {
- alert("Masukkan Waktu");
- }
- elseif(myfile=="") - {
- alert("Masukkan Logo");
- }
- elseif(ext!="jpg"&& ext!="png"&& ext!="gif")
- {
- alert("Tipe Document Salah (jpg,png,gif)");
- }
- elseif(cek=="F") - {
- alert("Pembicara Tidak Boleh Sama");
- } - else - {
- for(var i=0;i<banyakpembicara;i++) - {
- var no=i+1;
- if(i==0) - {
- var tamp=document.getElementById('pembicara-'+no).value;
- } - else - {
- var tamp=tamp+"|"+document.getElementById('pembicara-'+no).value;
- } - }
- document.getElementById('ext').value=ext;
- document.getElementById('allpembicara').value =tamp;
- document.form.submit();
- } - } - </script>
- - </head>
- <bodyonLoad="">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divclass="content nopaddingtop"align="center">
- <formaction="docreateseminar.php"method="post"enctype="multipart/form-
data"name="form"id="form">
- <tableborder="0"width="500px">
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Nama Seminar</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="text"id="namaseminar"name="namaseminar"type="text"style="width:2 35px;height:25px">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Jenis Seminar</td>
- <tdstyle="width:235px;height:25px">
- <selectclass="text"id="jenisseminar"name="jenisseminar">
- <?php
- $rs=mysql_query("select * from jenis_seminar ");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <optionvalue="<?phpecho$baca["id_jenis_seminar"];?>"><?phpecho$baca["nama_jenis"];
?></option>
- <?php - } - ?>
- </select>
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Tanggal</td>
- <tdstyle="width:235px;height:25px">
- <inputtype="text"class ="text"id="date"readonlyname="date">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Waktu</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="text"id="time"name="time"readonlyvalue="">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Logo</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="hidden"id="ext"name="ext"type="text"style="width:235px;height:25px"
>
- <inputclass="text"type="file"name="myfile"id="myfile"style="width:235px;height:25 px">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Banyak Pembicara</td>
- <tdstyle="width:235px;height:25px">
- <selectclass="text"id="banyakpembicara"name="banyakpembicara"onChange="comb
oBanyak()">
- <optionvalue="1">1</option>
- <optionvalue="2">2</option>
- <optionvalue="3">3</option>
- <optionvalue="4">4</option>
- <optionvalue="5">5</option>
- </select>
- </td>
- </tr>
- <tr>
- <tdcolspan="2">
- <inputclass="hidden"id="allpembicara"name="allpembicara"type="text"style="width :235px;height:25px">
- <tableid="detailpembicara"width="500px">
- <tr>
- <tdclass="bold"style="width:226px;height:30px">
- Pembicara 1 - </td>
- <td>
- <selectclass="text"id="pembicara-1"name="pembicara-1">
- <?php
- $rs=mysql_query("select * from pembicara ");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <optionvalue="<?phpecho$baca["id_pembicara"];?>"><?phpecho$baca["nama_pembicara"
];?></option>
- <?php - } - ?>
- </select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <tdalign="center"colspan="2"style="height:30px"><inputclass="button"type="button
"value="Save"class="button"onclick="validasi()"></td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- - </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- docreateseminar.php
- <?php
- session_start();
- include"include/connect.php";
- $namaseminar=$_REQUEST['namaseminar'];
- $jenisseminar=$_REQUEST['jenisseminar'];
- $date=$_REQUEST['date'];
- $arrtanggal=explode("-",$date);
- $date=$arrtanggal[2]."-".$arrtanggal[1]."-".$arrtanggal[0];
- $time=$_REQUEST['time'];
- $banyakpembicara=$_REQUEST['banyakpembicara'];
- $ext=$_REQUEST['ext'];
- $allpembicara=$_REQUEST['allpembicara'];
- $splitpembicara=explode("|",$allpembicara);
- $myfile=$_FILES["myfile"];
- $name=$myfile["name"];
- $tmp_name=$myfile["tmp_name"];
- $size=$myfile["size"];
- $error=$myfile["error"];
- - echo$size;
- if($size>26214400) - {
- header("location:message.php?message=File Paling besar 25 Mega&to=createseminar.php");
- }
- elseif($error==0) - {
- $nextkode="1";
- $rs=mysql_query("select *from seminar order by id_seminar desc");
- if($baca=mysql_fetch_array($rs)) - {
- $nextkode=$baca["id_seminar"]+1;
- }
- - $pic=$nextkode.".".$ext;
- move_uploaded_file($tmp_name,"images/badge/$pic");
- - mysql_query("insert into seminar values('$nextkode', - '$namaseminar', - '$jenisseminar', - '$date',
- '$time', - '$pic', - 'A')");
- for($i=0;$i<$banyakpembicara;$i++) - {
- mysql_query("insert into detail_pembicara values('$nextkode', - '$splitpembicara[$i]')");
- }
- include"include/disconnect.php";
- header("location:message.php?message=Seminar Berhasil Dibuat&to=createseminar.php");
- } - else - {
- header("location:message.php?message=Error&to=createseminar.php");
- } - ?>
- pembicara.php
- <?php
- session_start();
- include"include/protectedadmin.php";
- include"include/connect.php";
- ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <linkrel="stylesheet"type="text/css"href="js/fancybox/jquery.fancybox.css"media="scr een"/>
- <scripttype="text/javascript"src="js/fancybox/jquery.fancybox.js"></script>
- - <linkrel="stylesheet"type="text/css"href="js/jquery.ptTimeSelect.css"media="screen"/
>
- <scripttype="text/javascript"language="JavaScript"src="js/jquery.ptTimeSelect.js"></
script>
- <scriptlanguage="javascript">
- - function validasi() - {
- var namapembicara = document.getElementById('namapembicara').value;
- var emailpembicara = document.getElementById('emailpembicara').value;
- var organisasi = document.getElementById('organisasi').value;
- if(namapembicara=="") - {
- alert("isi nama pembicara");
- }
- elseif(!emailpembicara.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)) - {
- alert("Format Email Pembicara Salah");
- }
- elseif(organisasi=="") - {
- alert("isi nama organisasi");
- } - else - {
- document.form.submit();
- } - } - </script>
- - </head>
- <bodyonLoad="">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divclass="content nopaddingtop"align="center">
- <formaction="dopembicara.php"method="post"enctype="multipart/form-
data"name="form"id="form">
- <tableborder="0"width="500px">
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Nama Pembicara</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="text"id="namapembicara"name="namapembicara"type="text"style="wi dth:235px;height:25px">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Email Pembicara</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="text"id="emailpembicara"name="emailpembicara"type="text"style="wi dth:235px;height:25px">
- </td>
- </tr>
- <tr>
- <tdclass="bold"style="width:200px;height:30px">Organisasi</td>
- <tdstyle="width:235px;height:25px">
- <inputclass="text"id="organisasi"name="organisasi"type="text"style="width:235px;h eight:25px">
- </td>
- </tr>
- <tr>
- <tdalign="center"colspan="2"style="height:30px"><inputclass="button"type="button
"value="Save"class="button"onclick="validasi()"></td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- - </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- dopembicara.php
- <?php
- session_start();
- include"include/connect.php";
- $namapembicara=$_REQUEST['namapembicara'];
- $emailpembicara=$_REQUEST['emailpembicara'];
- $organisasi=$_REQUEST['organisasi'];
- -
- $nextkode="1";
- $rs=mysql_query("select * from pembicara order by id_pembicara desc");
- if($baca=mysql_fetch_array($rs)) - {
- $nextkode=$baca["id_pembicara"]+1;
- } - -
- mysql_query("insert into pembicara values('$nextkode', - '$namapembicara',
- '$emailpembicara', - '$organisasi')");
- - include"include/disconnect.php";
- header("location:message.php?message=Pembicara Berhasil Dibuat&to=pembicara.php");
-
-
?>- absent.php
- <?php
- session_start();
- include"include/protectedadmin.php";
- include"include/connect.php";
- ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <linkrel="stylesheet"type="text/css"href="js/fancybox/jquery.fancybox.css"media="scr een"/>
- <scripttype="text/javascript"src="js/fancybox/jquery.fancybox.js"></script>
- - <linkrel="stylesheet"type="text/css"href="js/jquery.ptTimeSelect.css"media="screen"/
>
- <scripttype="text/javascript"language="JavaScript"src="js/jquery.ptTimeSelect.js"></
script>
- <scriptlanguage="javascript">
- function ajaxdetail(table,idfield,wherefield,field){
- $.ajax({
- type:"GET", - url:"ajaxdetail.php", -
data:"table="+table+"&idfield="+idfield+"&wherefield="+wherefield+"&field="+field+"", - success:function(response)
- {
- //alert(response);
- addtable(response) - }
- });
- }
- function addtable(isi) - {
- - //alert(isi);
- var row=isi.split("||");
- document.getElementById("jumlahdetail").value=row.length-1;
- document.getElementById("tbldetail").innerHTML="";
- for(var i=0;i<row.length-1;i++) - {
- var no=i+1;
- var cell= row[i].split("|");
- - document.getElementById("tbldetail").innerHTML = document.getElementById("tbldetail").innerHTML+
- "<tr>"+
- "<td style=\"width: 50px;\" align=\"center\">"+no+"</td>"+
- "<td style=\"width: 250px;\">"+cell[2]+"</td>"+
- "<td style=\"width: 250px;\">"+cell[3]+"</td>"+
- "<td style=\"width: 220px;\">"+cell[4]+"</td>"+
- "<td style=\"width: 80px;\" align=\"center\">"+
- "<input checked type=\"checkbox\" name=\"status"+no+"\" id=\"status"+no+"\"
value=\""+cell[1]+"\"> "+
- "</td>"+
- "</tr>";
- } - }
- function changeabsent() - {
- var id_seminar= document.getElementById("id_seminar").value;
-
ajaxdetail('detail_permintaan_pembelian','no_spp',id_seminar,'id_seminar|id_member|firstna me|lastname|email');
- }
- function validasi() - {
- var banyak= document.getElementById("jumlahdetail").value;
- var tamp="";
- var tampstatus="";
- if(banyak=="0") - {
- alert("Jumlah Participant tidak ada");
- } - else - {
- for(var i=0;i<banyak;i++) - {
- var no = i+1;
- var status="";
- if(document.getElementById("status"+no).checked==true) - {
- status="y";
- }
- elseif(document.getElementById("status"+no).checked==false) - {
- status="a";
- }
- - if(tamp=="") - {
- tamp = document.getElementById("status"+no).value;
- tampstatus =status;
- } - else - {
- tamp = tamp+"|"+document.getElementById("status"+no).value;
- tampstatus = tampstatus+"|"+status;
- } - }
- document.getElementById("allid_member").value = tamp;
- document.getElementById("allstatus").value = tampstatus;
- document.form.submit();
- } - }
- function lap() - {
- var id_seminar= document.getElementById("id_seminar").value;
- var a ="cetakabsent.php?id_seminar="+id_seminar;
- window.open(a);
- } - </script>
- - </head>
- <bodyonLoad="changeabsent()">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divclass="content">
- <formaction="doabsent.php"method="get"name="form"id="form">
- <inputtype="hidden"class="text"id="jumlahdetail"name="jumlahdetail">
- <inputtype="hidden"class="text"id="allid_member"name="allid_member">
- <inputtype="hidden"class="text"id="allstatus"name="allstatus">
- <tablealign="center"width="100%">
- <tr>
- <tdalign="right">Daftar Seminar</td>
- <td>:</td>
- <td>
- <selectclass="text"id="id_seminar"name="id_seminar"onclick="changeabsent()">
- <?php
- $rs=mysql_query("select * from seminar where status='A'");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <optionvalue="<?phpecho$baca["id_seminar"];?>"><?phpecho$baca["nama_seminar"];?>
</option>
- <?php - } - ?>
- </select>
- </td>
- </tr>
- <tr>
- <tdcolspan="3"align="center">
- <tableclass="topdetail">
- <tr>
- <tdstyle="width: 50px;"align="center">No</td>
- <tdstyle="width: 250px;"align="center">Firstname</td>
- <tdstyle="width: 250px;"align="center">Lastname</td>
- <tdstyle="width: 220px;"align="center">Email</td>
- <tdstyle="width: 80px;"align="center">Status</td>
- </tr>
- </table>
- <tableclass="innerdetailseminar"id="tbldetail">
- - </table>
- </td>
- </tr>
- <tr>
- <tdcolspan="3"align="center">
- <inputtype="button"value="Cetak"class="button"style="width:100px;"onClick="lap()
">
- <inputtype="button"value="Simpan"class="button"style="width:100px;"onClick="val idasi()">
- </td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- doabsent.php
- <?php
- session_start();
- include"include/connect.php";
- $id_seminar=$_REQUEST["id_seminar"];
- $allid_member=$_REQUEST['allid_member'];
- $allstatus=$_REQUEST['allstatus'];
- - $arrid_member=explode("|",$allid_member);
- $arrstatus=explode("|",$allstatus);
- echo$id_seminar."<br>".
- $allid_member;
- - $rs=mysql_query(" select s.*,js.nama_jenis,js.point from seminar s - LEFT JOIN jenis_seminar js
- ON s.id_jenis_seminar = js.id_jenis_seminar - where s.id_seminar='$id_seminar'");
- if($baca=mysql_fetch_array($rs)) - {
- $point=$baca["point"];
- }
- - mysql_query("update seminar set - status ='N'
- where id_seminar ='$id_seminar'");
- - for($i=0;$i<count($arrid_member);$i++) - {
- mysql_query("update participant set - absent ='$arrstatus[$i]'
- where id_seminar ='$id_seminar' and id_member='$arrid_member[$i]'");
- if($arrstatus[$i]=="y") - {
- mysql_query("update member set - point = point + $point
- where id_member='$arrid_member[$i]'");
- } - }
- include"include/disconnect.php";
- header("location:message.php?message=Absent Berhasil&to=absent.php");
-
-
?>- daftarseminar.php
- <?php
- session_start();
- include"include/protecteduser.php";
- include"include/connect.php";
- ?>
- - <html>
- <head>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <scriptlanguage="javascript">
- function ajaxdate(tgl) - {
- $.ajax({
- type:"GET", - url:"ajaxdate.php", - data:"tgl="+tgl+"", - success:function(response) - {
- - } - });
- }
- function date() - {
- //===============TIME====================
- var d =new Date();
- var date= d.getDate();
- var mon = d.getMonth()+1;
- var year= d.getFullYear();
- if(date<10) - {
- var date="0"+date;
- }
- if(mon<10) - {
- var mon="0"+mon;
- }
- var tgl= year+"-"+mon+"-"+date;
- ajaxdate(tgl);
- - }
- function ajaxcek(seminar) - {
- $.ajax({
- type:"GET", - url:"ajaxcek.php",
- data:"seminar="+seminar+"", - success:function(response) - {
- document.getElementById("cek").value = response;
- } - });
- }
- function waitVersion() - {
- if(document.getElementById('cek').value=="") - {
- setTimeout("waitVersion()",100);
- } - else - {
- if(document.getElementById('cek').value=="Y") - {
- alert("Anda sudah terdaftar di seminar ini");
- } - else - {
- document.form.submit();
- } - } - }
- function validasi() - {
- var idseminar =document.getElementById("id_seminar").value;
- document.getElementById("cek").value="";
- ajaxcek(idseminar);
- waitVersion();
- } - </script>
- - </head>
- <bodyonLoad="date()">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- - <divclass="content">
- <formaction="dodaftarseminar.php"method="get"name="form"id="form">
- <inputtype="hidden"id="cek"name="cek"style="">
- <tablealign="center"width="100%">
- <tr>
- <tdalign="right">Daftar Seminar</td>
- <td>:</td>
- <td>
- <selectclass="text"id="id_seminar"name="id_seminar">
- <?php
- $today=$_SESSION["date"];
- $rs=mysql_query("select * from seminar where tanggal>'$today'");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <optionvalue="<?phpecho$baca["id_seminar"];?>"><?phpecho$baca["nama_seminar"];?>
</option>
- <?php - } - ?>
- </select>
- </td>
- </tr>
- <tr>
- <tdheight="40"colspan="3"align="center"valign="middle">
- <inputtype="button"value="Daftar"class="button"style="width:100px;"onClick="vali dasi()">
- </td>
- </tr>
- </table>
- </form>
- - </div>
- </div>
- </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- dodaftarseminar.php
- <?php
- session_start();
- include"include/connect.php";
- $id_seminar=$_REQUEST['id_seminar'];
- $id_member=$_SESSION["kode_user"];
- $cek="";
- -
- mysql_query("insert into participant values('$id_seminar', - '$id_member',
- 'p')");
- include"include/disconnect.php";
- header("location:message.php?message=Pendaftaran berhasil&to=daftarseminar.php");
- -
-
?>- profile.php
- <?php
- session_start();
- //include "include/protecteduser.php";
- include"include/connect.php";
- error_reporting(E_ALL^E_NOTICE);
- if($_GET['kode_user']){
- - $id=$_GET['kode_user'];
- - }elseif(isset($_SESSION['kode_user'])){
- - $id=$_SESSION['kode_user'];
- - }else{
- - include_once"index.php";
- exit();
- }
- - $id=mysql_real_escape_string($id);
- $sql=mysql_query("SELECT * FROM member WHERE id_member='$id'");
- - while($row=mysql_fetch_array($sql)){
- $firstname=$row["firstname"];
- $lastname=$row["lastname"];
- $email=$row["email"];
- $last_log_date=$row["last_log_date"];
- $last_log_date= strftime("%b %d, %Y", strtotime($last_log_date));
- /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
- $check_pic="members/$id/image01.jpg";
- $default_pic="members/0/image01.jpg";
- if(file_exists($check_pic)){
- $user_pic="<img src=\"$check_pic\" width=\"100px\" />";// forces picture to be 100px wide and no more
- }else{
- $user_pic="<img src=\"$default_pic\" width=\"100px\" />";// forces default picture to be 100px wide and no more
- }
- }// close while loop
- ?>
- - <html>
- <head>
- <metahttp-equiv="Content-Type"content="text/html; charset=iso-8859-1"/>
- <title></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <scripttype="text/javascript"src="js/jquery-1.7.2.min.js"></script>
- <scripttype="text/javascript"src="js/jquery-ui-1.8.20.custom.min.js"></script>
- <scriptsrc="js/div.js"type="text/javascript"></script>
- - <scriptlanguage="javascript">
- function date() - {
- //===============TIME====================
- var d =new Date();
- var date= d.getDate();
- var mon = d.getMonth()+1;
- var year= d.getFullYear();
- if(date<10) - {
- var date="0"+date;
- }
- if(mon<10) - {
- var mon="0"+mon;
- }
- var tgl= year+"-"+mon+"-"+date;
- - $.ajax({
- type:"GET", - url:"ajaxdate.php", - data:"tgl="+tgl+"", - success:function(response) - {
- } - });
- } - </script>
- - </head>
- <bodyonLoad="date()">
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divstyle="width:100%; height:160px; border:#999 thin solid; overflow:auto;">
- <tableborder="0">
- <tr>
- <tdalign="center"valign="middle"style="width:120px;">
- <?php
- print"$user_pic";if($id!=$_SESSION['kode_user']){
- ?>
- <br/>
- <?php - }else{
- ?>
- <br/><ahref="edit_profile.php"class="changedp">Change Display Picture</a>
- <?php - } - ?>
- </td>
- <tdvalign="top">
- <tableborder="0"class="profile">
- <tr>
- <tdclass="bold"style="width:200px;">First Name</td>
- <tdstyle="width:550px;"id="firstname"><?phpprint"$firstname";?></td>
- </tr>
- <tr>
- <tdclass="bold">Last Name</td>
- <tdid="lastname"><?phpprint"$lastname";?></td>
- </tr>
- <tr>
- <tdclass="bold">Email</td>
- <tdid="email"><?phpprint"$email";?></td>
- </tr>
- <tr>
- <tdclass="bold">Last Log Date</td>
- <tdid="last_log_date"><?phpprint"$last_log_date";?></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- <divclass="content nopaddingtop">
- <divclass="point">
- - <?php
- //$idmember = $_GET["kode_user"];
- if($id==$_SESSION['kode_user']){
- -
- - $idmember=$id;
- $rs=mysql_query("select * from member where id_member='$idmember'");
- if($baca=mysql_fetch_array($rs))
- { - ?>
- Total Point : <?phpecho$baca["point"];?>
- <?php - } - ?>
- </div>
- <divclass="badge">
- <?php
- - $rs=mysql_query(" SELECT p.*,s.picture, js.point FROM participant p - LEFT JOIN seminar s
- ON p.id_seminar= s.id_seminar - LEFT JOIN jenis_seminar js
- ON s.id_jenis_seminar = js.id_jenis_seminar
- WHERE p.id_member='$idmember' and p.absent='Y'");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <divclass="badgedetail">
- <table>
- <tr>
- <td>
- <imgclass="img100"src="images/badge/<?phpecho$baca["picture"];?>"/>
- </td>
- </tr>
- <tr>
- <tdalign="center">
- <?phpecho$baca["point"];?> point - </td>
- </tr>
- </table>
- </div>
- - - <?php - }
- }elseif($id==$_GET['kode_user']){
- -
- $idmember=$id;
- $rs=mysql_query("select * from member where id_member='$idmember'");
- if($baca=mysql_fetch_array($rs)) - {
- ?>
- Total Point : <?phpecho$baca["point"];?>
- <?php - } - ?>
- </div>
- <divclass="badge">
- <?php
- - $rs=mysql_query(" SELECT p.*,s.picture, js.point FROM participant p - LEFT JOIN seminar s
- ON p.id_seminar= s.id_seminar - LEFT JOIN jenis_seminar js
- ON s.id_jenis_seminar = js.id_jenis_seminar
- WHERE p.id_member='$idmember' and p.absent='Y'");
- while($baca=mysql_fetch_array($rs)) - {
- ?>
- <divclass="badgedetail">
- <table>
- <tr>
- <td>
- <imgclass="img100"src="images/badge/<?phpecho$baca["picture"];?>"/>
- </td>
- </tr>
- <tr>
- <tdalign="center">
- <?phpecho$baca["point"];?> point - </td>
- </tr>
- </table>
- </div>
- - <?php - } - } - ?>
- <divStyle="clear:both;">
- </div>
- </div>
- </div>
- </div>
- </div>
- <?phpinclude"footer_template.php"?>
- </body>
- </html>
- edit_profile.php
- <?php
- session_start();
- - // Connect to database
- include_once"include/connect.php";
- // Get the user session id variable into a local php variable for easier use in scripting - $id=$_SESSION['kode_user'];
- - // Now let's initialize vars to be printed to page in the HTML section so our script does not return errors
- // they must be initialized in some server environments, not shown in video - $error_msg="";
- $success_msg="";
- $firstname="";
- $lastname="";
- $user_pic="";
- - // Parsing section for the member picture... only runs if they attempt to upload or replace a picture
- error_reporting(E_ALL^E_NOTICE);
- if($_POST['parse_var']=="pic"){
- - if(!$_FILES['fileField']['tmp_name']){
- - $error_msg='<font color="#FF0000">ERROR: Please browse for an image before you press submit.</font>';
- - }else{
- - $maxfilesize=51200;// 51200 bytes equals 50kb - if($_FILES['fileField']['size']>$maxfilesize){
- - $error_msg='<font color="#FF0000">ERROR: Your image was too large, please try again.</font>';
- unlink($_FILES['fileField']['tmp_name']);
- - }elseif(!preg_match("/\.(gif|jpg|png)$/i",$_FILES['fileField']['name'])){
- - $error_msg='<font color="#FF0000">ERROR: Your image was not one of the accepted formats, please try again.</font>';
- unlink($_FILES['fileField']['tmp_name']);
- - }else{
- - $newname="image01.jpg";
- $place_file=
move_uploaded_file($_FILES['fileField']['tmp_name'],"members/$id/".$newname);
- $success_msg='<font color="#009900">Your image has been updated, it may take a few minutes for the changes to show... please be patient.</font>'; - }
- - }// close else that checks file exists
- - }// close the condition that checks the posted "parse_var" value for image upload or replace - -
- -
- // Final default sql query that will refresh the member data on page, and show most current
- $sql_default=mysql_query("SELECT * FROM member WHERE id_member='$id'");
- - while($row=mysql_fetch_array($sql_default)){
- - $firstname=$row["firstname"];
- $lastname=$row["lastname"];
- /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
- $check_pic="members/$id/image01.jpg";
- $default_pic="members/0/image01.jpg";
- if(file_exists($check_pic)){
- $user_pic="<img src=\"$check_pic\" width=\"100px\" />";// forces picture to be 100px wide and no more
- }else{
- $user_pic="<img src=\"$default_pic\" width=\"100px\" />";// forces default picture to be 100px wide and no more
- } - -
- }// close while loop - -
- ?>
- -
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <htmlxmlns="http://www.w3.org/1999/xhtml">
- <head>
- <metaname="Description"content="Profile edit area for
<?phpprint"$firstname$lastname";?>"/>
- <metaname="Keywords"content="<?phpprint"$firstname, $lastname";?>"/>
- <metahttp-equiv="Content-Type"content="text/html; charset=iso-8859-1"/>
- <title>Edit profile area for <?phpprint"$firstname$lastname";?></title>
- <linktype="text/css"href="css/ui-lightness/jquery-ui-
1.8.20.custom.css"rel="stylesheet"/>
- <linkrel="stylesheet"type="text/css"href="css/style.css"/>
- <linkrel="stylesheet"type="text/css"href="css/menu.css"/>
- <body>
- <divid="body">
- <divid="titlebar">
- <?phpinclude"include/tittle.php"?>
- </div>
- <divclass="menubar">
- <?phpinclude"include/menubar.php"?>
- </div>
- <divclass="main">
- <divstyle="width:100%; height:180px; border:#999 thin solid; overflow:auto;">
- <tablewidth="90%"border="0"align="center">
- <tr>
- <tdwidth="80%"><h3>Upload Your Display Picture here
<?phpprint"$firstname";?></h3></td>
- <tdwidth="20%"><!-- <a href="edit_settings.php">Edit Account Settings</a> --></td>
- </tr>
- </table>
- <?phpprint"$error_msg";?><?phpprint"$success_msg";?>
- <hralign="center"width="680"/>
- <tablewidth="90%"border="0"align="center">
- <formaction="edit_profile.php"enctype="multipart/form-
data"method="post"name="pic1_form"id="pic1_form">
- <tr>
- <tdwidth="16%"><?phpprint"$user_pic";?></td>
- <tdwidth="74%">
- <inputname="fileField"type="file"class="formFields"id="fileField"size="42"/>
- 50 kb max - </td>
- <tdwidth="10%">
- <inputname="parse_var"type="hidden"value="pic"/>
- <inputtype="submit"name="button"id="button"value="Submit"/>
- </td>
- </tr>
- </form>
- </table>
- </div>
- </div>
- - </div>
- - </body>
- </html>
- member_search.php
- <?php
- session_start();
- include"include/protected.php";
- include"include/connect.php";
- - // DEFAULT QUERY STRING
- $queryString="WHERE account_type ='c'";
- // DEFAULT MESSAGE ON TOP OF RESULT DISPLAY - $queryMsg="Showing Members by Name";
- - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////
- ///////////////////// SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS - error_reporting(E_ALL^E_NOTICE);
- if(($_POST['listByq']=="newest_members")){
- - $queryString="WHERE account_type ='c' ORDER by point DESC";
- $queryMsg="Showing Highest to Lowest Members' Points";
- - }elseif($_POST['listByq']=="by_firstname"){
- -
- $fname=$_POST['fname'];
- $fname=stripslashes($fname);
- $fname=strip_tags($fname);
- $fname=mysql_real_escape_string($fname);
- $queryString="WHERE firstname LIKE '%$fname%'";
- $queryMsg="Showing Members with the name you searched for";
- - }
- /////////////// END SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS - -
- ////////////// QUERY THE MEMBER DATA USING THE $queryString variable's value - $sql=mysql_query("SELECT id_member, firstname, lastname FROM member
$queryString");
- - //////////////////////////////////// Pagination Setup ////////////////////////////////////
- - // Build the Output Section Here - $outputList='';
- while($row=mysql_fetch_array($sql)){
- - $id=$row["id_member"];
- $firstname=$row["firstname"];
- $lastname=$row["lastname"];
- - /////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
- $check_pic="members/$id/image01.jpg";
- $default_pic="members/0/image01.jpg";
- if(file_exists($check_pic)){
- $user_pic="<img src=\"$check_pic\" width=\"120px\" border=\"0\" />";// forces picture to be 120px wide and no more
- }else{
- $user_pic="<img src=\"$default_pic\" width=\"120px\" border=\"0\" />";// forces default picture to be 120px wide and no more
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////
- - $outputList.='
- <table width="100%">
- <tr>
- <td width="23%" rowspan="3"><div style=" height:120px; overflow:hidden;"><a href="http://www.project0032.uphero.com/badge.php?kode_user='.$id.'"
target="_blank">'.$user_pic.'</a></div></td>
- <td width="14%" class="style7"><div align="right">Name:</div></td>
- <td width="63%"><a
href="http://www.project0032.uphero.com/badge.php?kode_user='.$id.'"
target="_blank">'.$firstname.' '.$lastname.'</a></td>
- </tr>
-