示例#1
0
 public function index()
 {
     $dataUser = $this->userHelper->getUserData();
     if ($dataUser) {
         foreach ($dataUser as $key => $value) {
             $dataUser[$key]['change_date'] = changeDate($value['register_date']);
         }
     }
     $this->view->assign('data', $dataUser);
     return $this->loadView('user/userlist');
 }
示例#2
0
 public function detailbooking()
 {
     global $CONFIG, $basedomain;
     $getProvinsi = $this->contentHelper->getProvinsi();
     $this->view->assign('prov', $getProvinsi);
     if (isset($_POST['submit'])) {
         $nama = $_POST['nama'];
         $alamat = $_POST['alamat'];
         $no_telp = $_POST['no_telp'];
         $email = $_POST['email'];
         $kota = $_POST['kota'];
         $provinsi = $_POST['provinsi'];
         $jumlah_kamar = $_POST['jumlah_kamar'];
         $extra_bed = $_POST['extra_bed'];
         $tamu_dewasa = $_POST['tamu_dewasa'];
         $tamu_anak = $_POST['tamu_anak'];
         $data = $this->contentHelper->inputbooking($_POST);
         // pr($data);
         if ($data['status'] == 1) {
             foreach ($data as $key => $value) {
                 if ($key == 'tanggal_masuk') {
                     $data['tanggalMasuk'] = changeDate($value);
                 }
                 if ($key == 'tanggal_keluar') {
                     $data['tanggalKeluar'] = changeDate($value);
                 }
             }
             $date1 = new DateTime($data['tanggal_masuk']);
             $date2 = new DateTime($data['tanggal_keluar']);
             $diff = $date2->diff($date1)->format("%a");
             $data['total'] = number_format($diff * 300000);
             $this->view->assign('data', $data);
             $msg = $this->loadView('emailTemplate');
             $send = sendGlobalMail($data['email'], false, $msg);
             // pr($data);
             // pr($msg);
             // exit;
             // echo "<script>alert('Data berhasil disimpan, silahkan periksa email anda');window.location.href='".$basedomain."booking'</script>";
         }
     }
     $tanggal_masuk = $_SESSION['data_booking']['tanggal_masuk'];
     $tanggal_keluar = $_SESSION['data_booking']['tanggal_keluar'];
     $tipe_kamar = $_SESSION['data_booking']['tipe_kamar'];
     $date1 = new DateTime($tanggal_masuk);
     $date2 = new DateTime($tanggal_keluar);
     $diff = $date2->diff($date1)->format("%a");
     $jumlahbook = 300000 * $diff;
     $this->view->assign('jumlahhari', $diff);
     $this->view->assign('jumlahbook', number_format($jumlahbook));
     $this->view->assign('data', $_SESSION['data_booking']);
     return $this->loadView('booking/detail_booking');
 }
示例#3
0
 public function index()
 {
     global $CONFIG;
     $data = $this->models->getnews();
     if ($data) {
         foreach ($data as $key => $value) {
             if ($value['tanggal_upload']) {
                 $data[$key]['tanggal'] = changeDate($value['tanggal_upload']);
             }
         }
         $this->view->assign('data', $data);
         // pr($data);
         return $this->loadView('berita/page_berita');
     }
 }
示例#4
0
 public function people()
 {
     $data = $this->mproject->getSData('hr_project', 'idProject=' . $_GET['id']);
     $req = $this->mproject->getDataCond('hr_project', "idProject IN ({$data['idRequired']})");
     $users = $this->mproject->getpeople($data['idRequired']);
     $team = $this->mproject->getTeam($_GET['id'], 1);
     $participants = $this->mproject->getDataCond('hr_users', "type IN (2,3)");
     $listParticipants = $this->mproject->getTeam($_GET['id'], 2);
     $data['date_start'] = changeDate($data['date_start']);
     $data['date_end'] = changeDate($data['date_end']);
     $this->view->assign('id', $_GET['id']);
     $this->view->assign('data', $data);
     $this->view->assign('users', $users);
     $this->view->assign('team', $team);
     $this->view->assign('participants', $participants);
     $this->view->assign('listParticipants', $listParticipants);
     $this->view->assign('required', $req);
     return $this->loadView('project/people');
 }
示例#5
0
 public function UpdateEvent($dataForm, $eventId)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . EVENTS . " where event_title='" . mysql_escape_string($dataForm['event_title']) . "' and event_id!='" . $eventId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $EventImagesPath = "";
         for ($counter = 1; $counter <= 10; $counter++) {
             $eventImage = $dataForm['event_image_Path' . $counter];
             if ($dataForm['event_image' . $counter] != "") {
                 if ($eventImage != "" && file_exists(SITE_ROOT . 'images/events/' . $eventImage)) {
                     unlink(SITE_ROOT . 'images/events/' . $eventImage);
                 }
                 $eventImage = time() . "_" . $dataForm['event_image' . $counter];
                 @rename(SITE_ROOT . 'images/events/' . $dataForm['event_image' . $counter], SITE_ROOT . 'images/events/' . $eventImage);
             }
             if ($eventImage != "") {
                 $EventImagesPath .= $eventImage . ",";
             }
         }
         if ($EventImagesPath != "") {
             $EventImagesPath = substr($EventImagesPath, 0, strlen($EventImagesPath) - 1);
         }
         $dataUpdate['event_title'] = $dataForm['event_title'];
         $dataUpdate['event_description'] = $dataForm['event_description'];
         $dataUpdate['event_date'] = changeDate($dataForm['event_date'], 0);
         $dataUpdate['event_time_from'] = $dataForm['hour_from'] . "::" . $dataForm['minute_from'] . "::" . $dataForm['ampm_from'];
         $dataUpdate['event_time_to'] = $dataForm['hour_to'] . "::" . $dataForm['minute_to'] . "::" . $dataForm['ampm_to'];
         $dataUpdate['event_image'] = $EventImagesPath;
         $dataUpdate['event_venue'] = $dataForm['event_venue'];
         $dataUpdate['event_location'] = $dataForm['address'];
         $dataUpdate['event_status'] = '1';
         $dataUpdate['event_lat'] = $dataForm['latitude'];
         $dataUpdate['event_long'] = $dataForm['longitude'];
         $updateCondition = "event_id='" . $eventId . "'";
         //user_id='".$mySession->LoggedUserId."' and
         $db->modify(EVENTS, $dataUpdate, $updateCondition);
         return 1;
     }
 }
示例#6
0
 public function index()
 {
     $dataUser = $this->userHelper->getUserData();
     if ($dataUser) {
         foreach ($dataUser as $key => $value) {
             $dataUser[$key]['change_date'] = changeDate($value['register_date']);
         }
     }
     // pr($dataUser);
     // if ($_POST['status']){
     // 	$iduser = implode(',', $_POST['ids']);
     // 	$updateUser = $this->userHelper->updateUser($iduser, $_POST['status']);
     // 	if ($updateUser){
     // 		$this->view->assign('status',true);
     // 	}else{
     // 		$this->view->assign('status',false);
     // 	}
     // }
     $this->view->assign('data', $dataUser);
     return $this->loadView('user/userlist');
 }
示例#7
0
 function result()
 {
     $id = $_COOKIE['idgen'];
     $newgen = $this->models->getData('generated_soal', 0, "id = {$id}");
     $materi = $this->models->getData('master_kategori', 0, "id_master = {$newgen['id_kategori']}");
     $user = $this->models->getData('master_peserta', 0, "id_peserta = {$newgen['id_peserta']}");
     $waktu_ujian = date('Y-m-d H:i:s', time());
     $now = strtoupper(changeDate($waktu_ujian));
     $this->view->assign('nowdate', $now);
     $this->view->assign('soal', $newgen);
     $this->view->assign('materi', $materi);
     $this->view->assign('user', $user);
     return $this->loadView('hasil');
 }
示例#8
0
 function tesMpdf()
 {
     global $CONFIG;
     $id = $_GET['id'];
     $ruang = str_replace("/", "_", $id_ruangan);
     $ujian = $this->models->getData('ujian', 0, "id_ujian = {$id}");
     $peserta = $this->models->getData('generated_soal', 1, "id_ujian = {$id}");
     $kategori = $this->models->getData('master_kategori', 0, "id_master = {$ujian['id_kategori']}");
     $time = 0;
     foreach ($peserta as $key => $value) {
         if ($time == 50) {
             $time = 0;
             sleep(2);
         }
         unset($soalSort);
         $getSoal = $this->models->getData('master_soal', 1, "id_soal IN ({$value['soal']})");
         $user = $this->models->getData('master_peserta', 0, "id_peserta = {$value['id_peserta']}");
         foreach ($getSoal as $k => $val) {
             $getSoal[$k]['soal'] = html_entity_decode(htmlspecialchars_decode($val['soal'], ENT_NOQUOTES));
             $getSoal[$k]['1'] = html_entity_decode(htmlspecialchars_decode($val['1'], ENT_NOQUOTES));
             $getSoal[$k]['2'] = html_entity_decode(htmlspecialchars_decode($val['2'], ENT_NOQUOTES));
             $getSoal[$k]['3'] = html_entity_decode(htmlspecialchars_decode($val['3'], ENT_NOQUOTES));
             $getSoal[$k]['4'] = html_entity_decode(htmlspecialchars_decode($val['4'], ENT_NOQUOTES));
         }
         $opts = unserialize($value['opt']);
         $exp = explode(",", $value['soal']);
         $opt = explode(",", $value['opt']);
         foreach ($exp as $k => $vals) {
             foreach ($getSoal as $j => $val) {
                 if ($vals == $val['id_soal']) {
                     $soalSort[$k] = $val;
                 }
             }
         }
         $letters = range('A', 'Z');
         foreach ($soalSort as $k => $val) {
             $opt = explode(",", $opts[$k]);
             foreach ($opt as $j => $vals) {
                 $soalSort[$k]['pilihan'][$j]['full'] = $letters[$j] . ". " . $val[$vals];
                 $soalSort[$k]['pilihan'][$j]['opt'] = $letters[$j];
             }
         }
         foreach ($soalSort as $k => $val) {
             $kisi = $this->models->getData('master_kategori', 0, "id_master = {$val['kisi']}");
             $soalSort[$k]['kisi'] = $kisi['nama_master'];
             $jwb = $this->models->getData('jawaban', 0, "id_kategori = {$val['id_kategori']} AND id_soal = {$val['id_soal']} AND id_peserta = {$value['id_peserta']}");
             $soalSort[$k]['jawaban'] = $jwb['jawaban'];
             $soalSort[$k]['opt'] = $jwb['opt'];
             $soalSort[$k]['fulljwb'] = $jwb['opt'] . ". " . $jwb['jawaban'];
         }
         $now = strtoupper(changeDate($value['waktu_mulai']));
         // db($soalSort);
         $this->view->assign('paket', $value['paket']);
         $this->view->assign('soal', $soalSort);
         $this->view->assign('kategori', $kategori);
         $this->view->assign('user', $user);
         $this->view->assign('tanggal', $now);
         $this->view->assign('skor', $value['nilai']);
         $this->reportHelper = $this->loadModel('reportHelper');
         $html = $this->loadView('kertaSoal');
         $generate = $this->reportHelper->loadMpdf($html, $user['nama'] . "-" . $kategori['nama_master'], LOGS);
         $time++;
     }
     // db($kategori['nama_master']);
     // $path = "{$CONFIG['default']['root_path']}logs/hasil/{$ruang}.pdf";
     // $filename = "{$CONFIG['default']['root_path']}logs/hasil/all/{$ruang}-NilaiAkademik-{$kategori['nama_master']}.pdf";
     // $status=exec("pdftk {$path} cat output '{$filename}' &");
     // return $this->loadView('kertaSoal');
     // $donwloadfile = "{$ruang}-NilaiAkademik-{$kategori['nama_master']}.pdf";
     // header("Cache-Control: public");
     // header("Content-Description: File Transfer");
     // header("Content-Disposition: attachment; filename={$donwloadfile}");
     // header("Content-type:application/pdf");
     // header("Content-Transfer-Encoding: binary");
     // read the file from disk
     // readfile($filename);
     echo "======= Done =========";
     // return 1;
 }
示例#9
0
文件: index.php 项目: Juje/guestBook
while ($row = mysqli_fetch_assoc($sql)) {
    ?>
                <h3><?php 
    echo $lang["by"];
    ?>
 <?php 
    echo nameAndMail($row["post_username"], $row["post_website"]);
    if (!empty($row["post_email"])) {
        ?>
 :: <?php 
        echo changeMail($row["post_email"]);
    }
    ?>
</h3>
                <p class="date"><?php 
    echo changeDate($row["post_datetime"]);
    ?>
</p>
                <div class="postbg"><p class="post"><?php 
    echo textFormat($row["post_msg"]);
    ?>
</p></div>
                <br/><!-- <p class="extraInfo">Een beetje extra info</p>-->
			<?php 
}
?>
			<hr />
			<h3><?php 
echo $lang["newmsg"];
?>
</h3>
示例#10
0
" width="75"></span></p>
					<p class="UserStatus"><span>Super Member</span></p>
					<p class="UserActive"><span>****</span></p>
					<p class="userGroup"><span>ჯგუფი: </span><span class="group<?php 
    echo $post['groups'];
    ?>
"><?php 
    echo $post['groupName'];
    ?>
</span></p>
					<p class="userPostCount"><span>პოსტები: <?php 
    echo $countPost;
    ?>
</span></p>
					<p class="userReg"><span>რეგისტრ.: <?php 
    echo changeDate($post['reg_date']);
    ?>
</span></p>
					<p class="userCity"><span>მდებარ.: <?php 
    echo $post['city'];
    ?>
</span></p>
					<p class="userId"><span>წევრი № <?php 
    echo $post['userid'];
    ?>
</span></p>
				</div>
			</div>
			<div class="PostContent col-lg-10 col-md-10 col-sm-10 nopadding">
				<div class="postTitle">
					<p class="postDate"><span>პოსტი <?php 
示例#11
0
 public function init($eventId)
 {
     global $mySession;
     $db = new Db();
     $event_title_value = "";
     $event_date_value = "";
     $event_time_from_value = "";
     $event_time_to_value = "";
     $event_venue_value = "";
     $event_location_value = "";
     $event_lat_value = "";
     $event_long_value = "";
     $event_image_old_value = "";
     $event_description_value = "";
     if ($eventId != "") {
         $eventData = $db->runQuery("select * from " . EVENTS . " where event_id='" . $eventId . "'");
         $event_image_old_value = $eventData[0]['event_image'];
         $event_title_value = $eventData[0]['event_title'];
         $event_date_value = changeDate($eventData[0]['event_date'], 1);
         $event_time_from_value = $eventData[0]['event_time_from'];
         $event_time_to_value = $eventData[0]['event_time_to'];
         $event_description_value = $eventData[0]['event_description'];
         $event_venue_value = $eventData[0]['event_venue'];
         $event_location_value = $eventData[0]['event_location'];
         $event_lat_value = $eventData[0]['event_lat'];
         $event_long_value = $eventData[0]['event_long'];
     }
     $hour_from_value = "";
     $minute_from_value = "";
     $ampm_from_value = "";
     if ($event_time_from_value != "") {
         $explode = explode("::", $event_time_from_value);
         $hour_from_value = $explode[0];
         $minute_from_value = $explode[1];
         $ampm_from_value = $explode[2];
     }
     $hour_to_value = "";
     $minute_to_value = "";
     $ampm_to_value = "";
     if ($event_time_to_value != "") {
         $explode = explode("::", $event_time_to_value);
         $hour_to_value = $explode[0];
         $minute_to_value = $explode[1];
         $ampm_to_value = $explode[2];
     }
     $event_title = new Zend_Form_Element_Text('event_title');
     $event_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Event title is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setValue($event_title_value);
     $this->addElement($event_title);
     $event_date = new Zend_Form_Element_Text('event_date');
     $event_date->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Event date is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setAttrib("readonly", "readonly")->setAttrib("onclick", "displayCalendar(this,'mm-dd-yyyy',this)")->setValue($event_date_value);
     $this->addElement($event_date);
     $MinutesArr = array();
     $MinutesArr[0]['key'] = "";
     $MinutesArr[0]['value'] = "Minutes";
     $Counter = 1;
     for ($j = 0; $j <= 59; $j++) {
         $Value = $j;
         if (strlen($j) == '1') {
             $Value = "0" . $j;
         }
         $MinutesArr[$Counter]['key'] = $Value;
         $MinutesArr[$Counter]['value'] = $Value;
         $Counter++;
     }
     $HoursArr = array();
     $HoursArr[0]['key'] = "";
     $HoursArr[0]['value'] = "Hours";
     for ($j = 1; $j <= 12; $j++) {
         $Value = $j;
         if (strlen($j) == '1') {
             $Value = "0" . $j;
         }
         $HoursArr[$j]['key'] = $Value;
         $HoursArr[$j]['value'] = $Value;
     }
     $AmPmArr = array();
     $AmPmArr[0]['key'] = "AM";
     $AmPmArr[0]['value'] = "AM";
     $AmPmArr[1]['key'] = "PM";
     $AmPmArr[1]['value'] = "PM";
     $hour_from = new Zend_Form_Element_Select('hour_from');
     $hour_from->addMultiOptions($HoursArr)->setAttrib("class", "textInput")->setAttrib("style", "width:80px;")->setValue($hour_from_value);
     $this->addElement($hour_from);
     $minute_from = new Zend_Form_Element_Select('minute_from');
     $minute_from->addMultiOptions($MinutesArr)->setAttrib("class", "textInput")->setAttrib("style", "width:80px;")->setValue($minute_from_value);
     $this->addElement($minute_from);
     $ampm_from = new Zend_Form_Element_Select('ampm_from');
     $ampm_from->addMultiOptions($AmPmArr)->setAttrib("class", "textInput")->setAttrib("style", "width:50px;")->setValue($ampm_from_value);
     $this->addElement($ampm_from);
     $hour_to = new Zend_Form_Element_Select('hour_to');
     $hour_to->addMultiOptions($HoursArr)->setAttrib("class", "textInput")->setAttrib("style", "width:80px;")->setValue($hour_to_value);
     $this->addElement($hour_to);
     $minute_to = new Zend_Form_Element_Select('minute_to');
     $minute_to->addMultiOptions($MinutesArr)->setAttrib("class", "textInput")->setAttrib("style", "width:80px;")->setValue($minute_to_value);
     $this->addElement($minute_to);
     $ampm_to = new Zend_Form_Element_Select('ampm_to');
     $ampm_to->addMultiOptions($AmPmArr)->setAttrib("class", "textInput")->setAttrib("style", "width:50px;")->setValue($ampm_to_value);
     $this->addElement($ampm_to);
     /*$event_time= new Zend_Form_Element_Text('event_time');
     		$event_time->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Event time is required.'))
     		->addDecorator('Errors', array('class'=>'errmsg'))
     		->setAttrib("class","textInput")
     		->setValue($event_time_value);
     		$this->addElement($event_time);*/
     if ($event_image_old_value != "") {
         $explode = explode(",", $event_image_old_value);
     }
     for ($counter = 1; $counter <= 10; $counter++) {
         $eventImageName = 'event_image' . $counter;
         $eventImageName = new Zend_Form_Element_File($eventImageName);
         $eventImageName->setDestination(SITE_ROOT . 'images/events/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->addDecorator('Errors', array('class' => 'errmsg'));
         $this->addElement($eventImageName);
         $eventImagePath = 'event_image_Path' . $counter;
         $eventImagePath = new Zend_Form_Element_Hidden($eventImagePath);
         $eventImagePath->setValue(@$explode[$counter - 1]);
         $this->addElement($eventImagePath);
     }
     $event_venue = new Zend_Form_Element_Textarea('event_venue');
     $event_venue->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Event venue is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setValue($event_venue_value);
     $this->addElement($event_venue);
     $event_description = new Zend_Form_Element_Textarea('event_description');
     $event_description->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Event description is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setValue($event_description_value);
     $this->addElement($event_description);
     $address = new Zend_Form_Element_Text('address');
     $address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Location on map is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setValue($event_location_value);
     $this->addElement($address);
     $latitude = new Zend_Form_Element_Hidden('latitude');
     $latitude->setValue($event_lat_value);
     $this->addElement($latitude);
     $longitude = new Zend_Form_Element_Hidden('longitude');
     $longitude->setValue($event_long_value);
     $this->addElement($longitude);
 }
示例#12
0
?>
                @foreach($data['schedule'] as $key => $value)
                    <tr>
                        <?php 
$start = strtotime($value->schedule_date_start);
$end = strtotime($value->schedule_date_end);
?>
                        <td>{{ $key + 1 }}</td>
                        <td>{{ $value->schedule_title }}</td>
                        <td>{{ $value->schedule_type_name }}</td>
                        <td><?php 
echo changeDate(date("l", $start)) . ", " . date("d F Y H:i", $start);
?>
</td>
                        <td><?php 
echo changeDate(date("l", $end)) . ", " . date("d F Y H:i", $end);
?>
</td>
                        <td>{{ $value->schedule_media_id }}</td>
                        <td>{{ $value->users_name_creator }}</td>

                        <!-- untuk menambahkan tombol tampil, edit, dan hapus -->
                        <td>
                            <a class="btn btn-small btn-success" href="{{ URL('admin/schedule/' . $value->schedule_id) }}">View</a>

                            <a class="btn btn-small btn-warning" href="{{ URL('admin/schedule/' . $value->schedule_id . '/edit') }}">Edit</a>

                            {!! Form::open(['method' => 'DELETE', 'url' => 'admin/schedule/' . $value->schedule_id, 'class' => 'pull-right', 'onsubmit' => 'return confirm("Are you sure you want to delete this item?");']) !!}
                                {!! Form::submit('Delete', ['class' => 'btn btn-small btn-danger']) !!}
                            {!! Form::close() !!}
示例#13
0
}
?>
		</ul>
		<p class="sectionTitle"><strong>ბოლო სტუმრები</strong></p>
		<ul>
			<?php 
foreach ($lastlogins as $lastlogin) {
    ?>
			<li><a href="<?php 
    echo base_url() . 'user/' . $lastlogin['userid'];
    ?>
"><?php 
    echo $lastlogin['userName'];
    ?>
</a><span class="statisticDesc" title="თარიღი"><?php 
    echo changeDate($lastlogin['lastlogin']);
    ?>
</span></li>
			<?php 
}
?>
		</ul>		
	</div>
	<div class="row4">
		<p class="sectionTitle"><strong>ბოლო პოსტები</strong></p>
		<p class="titleStat"><span class='lastPostTitle'>სათაური</span><span class="lastPostAutor">ავტორი</span></p>
		<ul>
		<?php 
foreach ($lastPosts as $lastTopic) {
    ?>
			<li><a class="textEclipse" href="<?php 
示例#14
0
 public function init($userId)
 {
     global $mySession;
     $db = new Db();
     if ($userId != "") {
         $adminData = $db->runQuery("select * from " . USERS . " where user_id='" . $userId . "'");
         $first_name_value = $adminData[0]['first_name'];
         $last_name_value = $adminData[0]['last_name'];
         $email_address_value = $adminData[0]['email_address'];
         $old_profile_image_value = $adminData[0]['image'];
         $gender_value = $adminData[0]['gender'];
         //$dob_value=$adminData[0]['dob'];
         $dob_value = changeDate($adminData[0]['dob'], 1);
         $location_value = $adminData[0]['location'];
         $country_value = $adminData[0]['country'];
         $blog_url_value = $adminData[0]['blog_url'];
         $website_url_value = $adminData[0]['website_url'];
         $about_me_value = $adminData[0]['about_me'];
         $occupation_value = $adminData[0]['occupation'];
         //$password_value=md5($adminData[0]['password']);
     }
     $first_name = new Zend_Form_Element_Text('first_name');
     $first_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'First Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($first_name_value);
     $this->addElement($first_name);
     $last_name = new Zend_Form_Element_Text('last_name');
     $last_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Last Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setAttrib("onkeypress", "return checknummsp1(event);")->setValue($last_name_value);
     $this->addElement($last_name);
     $email_address = new Zend_Form_Element_Text('email_address');
     $email_address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($email_address_value);
     $this->addElement($email_address);
     if (@$_REQUEST['email_address'] != "") {
         $email_address->addValidator('EmailAddress', true)->addErrorMessage('Please enter a valid email address');
     }
     $old_profile_image = new Zend_Form_Element_Hidden('old_profile_image');
     $old_profile_image->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($old_profile_image_value);
     $this->addElement($old_profile_image);
     $user_pic = new Zend_Form_Element_File('user_pic');
     $user_pic->setDestination(SITE_ROOT . 'images/profileimgs/');
     if ($userId == "") {
         $user_pic->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please select a photo.'));
     }
     $user_pic->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'))->setValue($image_value);
     $this->addElement($user_pic);
     $GenderArr = array();
     $GenderArr[0]['key'] = "1";
     $GenderArr[0]['value'] = "Male";
     $GenderArr[1]['key'] = "2";
     $GenderArr[1]['value'] = "Female";
     $gender = new Zend_Form_Element_Radio('gender');
     $gender->addMultiOptions($GenderArr)->setValue($gender_value);
     $this->addElement($gender);
     $countryArr = array();
     $sql = "select * from " . COUNTRIES;
     $countryData = $db->runQuery($sql);
     $countryArr[0]['key'] = 0;
     $countryArr[0]['value'] = "---Select Country---";
     $i = 1;
     foreach ($countryData as $key => $data) {
         $countryArr[$i]['key'] = $data['country_id'];
         $countryArr[$i]['value'] = $data['country_name'];
         $i++;
     }
     $country = new Zend_Form_Element_Select('country');
     $country->setRequired(true)->addMultiOptions($countryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setValue($country_value);
     $this->addElement($country);
     $password = new Zend_Form_Element_Text('password');
     $password->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($password);
     $cpassword = new Zend_Form_Element_Password('cpassword');
     $cpassword->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($cpassword);
     $npassword = new Zend_Form_Element_Password('npassword');
     $npassword->setAttrib("class", "textInput")->setValue($password_value);
     $this->addElement($npassword);
     if (isset($_REQUEST['changePass']) && $userId != "") {
         $npassword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Password is required.'))->addDecorator('Errors', array('class' => 'error'));
         $cpassword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Confirm password is required.'))->addDecorator('Errors', array('class' => 'error'));
     }
     $GenderArr = array();
     $GenderArr[0]['key'] = "1";
     $GenderArr[0]['value'] = "Male";
     $GenderArr[1]['key'] = "2";
     $GenderArr[1]['value'] = "Female";
     $gender = new Zend_Form_Element_Radio('gender');
     $gender->addMultiOptions($GenderArr)->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Field is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($gender_value);
     $this->addElement($gender);
     $location = new Zend_Form_Element_Text('location');
     $location->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Location is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($location_value);
     $this->addElement($location);
     $occupation = new Zend_Form_Element_Text('occupation');
     $occupation->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Occupation is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($occupation_value);
     $this->addElement($occupation);
     $about_me = new Zend_Form_Element_Textarea('about_me');
     //$about_me->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Please enter this field.'))
     $about_me->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:150px; height:60px;")->setValue($about_me_value);
     $this->addElement($about_me);
     $blog_url = new Zend_Form_Element_Text('blog_url');
     //$blog_url->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Blog URL is required.'))
     $blog_url->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->addValidator('Hostname', true)->setAttrib("Placeholder", "http://")->setValue("{$website_url_value}");
     $this->addElement($blog_url);
     $website_url = new Zend_Form_Element_Text('website_url');
     //$website_url->setRequired(true)
     //->addValidator('NotEmpty',true,array('messages' =>'Website URL is required.'))
     $website_url->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->addValidator('Hostname', true)->setAttrib("Placeholder", "http://")->setValue("{$website_url_value}");
     $this->addElement($website_url);
 }