Skip to content

Instantly share code, notes, and snippets.

@hanxue
Created April 25, 2016 10:04
Show Gist options
  • Save hanxue/3870e603feb88e1ec6ca5c62f2badbaf to your computer and use it in GitHub Desktop.
Save hanxue/3870e603feb88e1ec6ca5c62f2badbaf to your computer and use it in GitHub Desktop.
PHP syntax error VMS
<?php
# +-------------------------------------------------------------------------------------------------------+
# | |
# | Copyright (c) 2012 |
# | |
# | For the full copyright and license information, please view the LICENSE |
# | file that was distributed with this source code. |
# +----------------------------------------------------------------------------------------------------------+
require_once( "../../WEB_INF/controller.php" );
$rs = VmsController( "oper_user_list" );
$index='operator';
?>
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/bootstrap-theme.min.css">
<!-- <script src="../../js/bootstrap.min.js"></script> -->
<script src="../../js/jquery.js"></script>
<script language="javascript" >
$(document).ready(function(e) {
myCalendar = new dhtmlXCalendarObject(["birthday"]);
//myCalendar.setDateFormat("%Y%m%d");
// myCalendar.attachEvent("onClick", ChangeFilter);//when click event handler
myCalendar.hideTime();
});
function form_confirm(val,add_name)
{
var form=eval(val);
form.mode.value=add_name;
if(add_name=='delete') {
if(confirm("Do you want to delete this user?")) {
form.submit();
}
}else {
form.submit();
}
}
function send_confirm(){
if($('#userform input[name$="user_id"]').val()=="")
{
alert("Username is null"); return false;
}
if($('#userform input[name$="user_name"]').val()=="")
{
alert("Fullname is null"); return false;
}
if($('#userform input[name$="user_pwd"]').val()=="")
{
alert("Password is null"); return false;
}
if($('#userform input[name$="user_pwd_confirm"]').val()!=$('#userform input[name$="user_pwd"]').val())
{
alert("Password is incorrect"); return false;
}
// if($('#userform input[name$="office_phone"]').val()=="")
// {
// alert("Office phone is null"); return false;
// }
$('#userform input[name$="mode"]').attr('value','update');
$('#userform').submit();
}
</script>
<?php include("../../menu_sys.php"); ?>
<div class="container">
<?php
include("../../navbar_admin.php");
?>
<form id="userform" name="userform" class="form-group" method="post" enctype="multipart/form-data" action="<?php echo($_SERVER['PHP_SELF']); ?>" >
<h1 class="page-header">Operator Management <small> (Edit) </small></h1>
<div class="row">
<div class="pull-right">
<input type="submit" name="Submit" class="btn btn-primary" value="Save" onclick="send_confirm()" />
<input type="reset" name="Cancel" class="btn" value="Cancel" onclick="location.href='list.php?company_id=<?php echo($rs->profile['company_id']); ?>';" />
</div>
</div>
<br />
<input type="hidden" name="proper" value="signup" />
<input type="hidden" name="id" value="<?php echo($rs->id); ?>" />
<input type="hidden" name="mode" value="" />
<div class="row">
<div class="col-md-7">
<table class="table table-striped">
<tr>
<td><label for="user_id">Operator Name</label></td>
<td>
<input name="user_id" id="user_id" type="text" class="form-control" value="<?php echo($rs->profile['user_id']); ?>" required="true" />
</td>
</tr>
<tr>
<td><label for="user_name">Full Name</label> <span style="color:red">*</span> </td>
<td>
<input name="user_name" id="user_name" type="text" class="form-control" value="<?php echo($rs->profile['user_name']); ?>" required="true" /> </td>
</tr>
<tr>
<td><label for="user_pwd">Password <span style="color:red">*</span> </td>
<td>
<input name="user_pwd" id="user_pwd" type="password" class="form-control" value="<?php echo($rs->profile['user_pwd']); ?>" required="true" />
</td>
</tr>
<tr>
<td><label for="user_pwd_confirm">Confirm Password <span style="color:red">*</span> </label></td>
<td>
<input name="user_pwd_confirm" id="user_pwd_confirm" type="password" class="form-control" value="<?php echo($rs->profile['user_pwd']); ?>" required="true" />
</td>
</tr>
<tr>
<td><label for="gender">Gender</label></td>
<td>
<select name="gender" id="gender" class="form-control">
<?php if($rs->profile['gender'] == "Female") { ?>
<option value="Female" selected="selected">Female</option>
<option value="Male" >Male</option>
<?php } else { ?>
<option value="Female">Female</option>
<option value="Male" selected="selected" >Male</option>
<?php } ?>
</select>
</td>
</tr>
<!--<tr>
<td height="25" align="right" class="signin">Birthday</td>
<td style="font-size:12px;">
<input type="text" name="birthday" id="birthday" value="<? //=$rs->profile['birthday']?>" />
</td>
</tr>
<tr>
<td height="25" align="right" class="signin">Home address</td>
<td> <input name="home_address" type="text" id="home_address" value="<? //=$rs->profile['home_address']?>" size="40" /> </td>
</tr>-->
<tr>
<td><label for="email">Email</label></td>
<td>
<input name="email" id="email" type="text" class="form-control" value="<?php echo($rs->profile['email']); ?>" />
</td>
</tr>
<tr>
<td><label for="office_phone">Office Phone</label></td>
<td> <input name="office_phone" id="office_phone" type="text" class="form-control" value="<?php echo($rs->profile['office_phone']); ?>" /> </td>
</tr>
<tr>
<td><label for="mobile_phone">Mobile Phone</label></td>
<td>
<input name="mobile_phone" name="mobile_phone" type="text" class="form-control" value="<?php echo($rs->profile['mobile_phone']); ?>" />
</td>
</tr>
<!--<tr>
<td height="25" align="right" class="signin">Home Phone</td>
<td> <input name="home_phone" type="text" id="home_phone" value="<? //=$rs->profile['home_phone']?>" size="40" /> </td>
</tr>
<tr>
<td height="25" align="right" class="signin">Card Number</td>
<td> <input name="card_number" type="text" id="card_number" value="<? //=$rs->profile['card_number']?>" size="40" /> </td>
</tr>-->
<tr>
<td><label for="details">Detail</label></td>
<td>
<textarea name="details" id="details" class="form-control" rows="4" ><?php echo($rs->profile['detail']); ?></textarea>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="col-md-5">
<input name="MAX_FILE_SIZE" value="102400" type="hidden">
<table class="table table-striped">
<tr>
<td style="font-size:12px; padding-right:20px;"> JoinDate </td> <td style="font-size:12px;"><?php echo(date('l jS \of F Y h:i:s A',$rs->profile['join_date'])); ?> </td>
</tr>
<tr>
<td style="font-size:12px; padding-right:20px"> Last Visit Date </td>
<td style="font-size:12px;">
<?php if($rs->profile['last_visit_date'] != "") {
print date('l jS \of F Y h:i:s A', $rs->profile['last_visit_date']);
?>
</td>
</tr>
<input type="hidden" name="group_id" value="3" />
<!-- <tr>
<td style="font-size:12px; padding-right:20px;"> Group Name </td>
<td style="font-size:12px;">
<select name="group_id" style="width:180px;" >
<option value="3">Operator</option>
</select>
</td>
</tr>-->
<tr>
<td colspan="2">
<input name="photo" id="photo" class="form-control" accept="image/jpeg" type="file" />
</td>
</tr>
<tr>
<td colspan="2">
<?php
if($rs->profile['photo']) {
?>
<div>
<img src="<?php echo($BASE_URL."/admin/user/image.php?id=".$rs->profile['id']); ?>" width="150" height="100" />
</div>
<?php } else { ?>
<div>
<img width="150" height="100" src="<?php echo($BASE_URL."/images/profile/default.png"); ?>" />
</div>
<?php } ?>
</td> </tr>
<tr>
<td colspan="2">
<script language="javascript" >
<?php if($rs->rs_msg!="") { ?>
alert("Successfully Changed");
<?php } ?>
</script>
</td>
</tr>
</table>
</div>
<div><?php echo($rs->msg); ?></div>
</div>
</form>
</div>
<?php
// $rs->PrintFooter();
?>
<?php
# +---------------------------------------------------------------------------+
# | |
# | Copyright (c) 2012 .
# | |
# | For the full copyright and license information, please view the LICENSE |
# | file that was distributed with this source code. |
# +---------------------------------------------------------------------------+
require_once( "../../WEB_INF/controller.php" );
$rs = VmsController( "system_visit_type" );
?>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="15%"><?php Print_page_menu_sys(); ?></td>
<td width="85%" valign="top">
<div style="padding-top:20px; padding-left:30px;">
<script type="text/javascript">
$(document).ready(function() {
$('.li_button').bind("mouseover", function(){
var color = $(this).css("background-color");
$(this).css("background", "#FEFEFF");
$(this).bind("mouseout", function(){
$(this).css("background", color);
})
})
})
///////////////////rows(org_row)////////////
$(document).ready(function() {
$('.cont').bind("mouseover", function(){
var color = $(this).css("background-color");
$(this).css("background", "#F2F2F2");
$(this).bind("mouseout", function(){
$(this).css("background", color);
})
})
})
</script>
<div >
<li class="li_button" style="width:35px;" onclick="location.href='view.php?proper=view';">Add</li>
</div>
<div style="margin-top:10px; font-size:12px;">
<form action="<?php echo($_SERVER['PHP_SELF']); ?>" name="form" id="form" method="post">
Company Name &nbsp;&nbsp;&nbsp; <?php $org = $rs->Select_list("company"); ?>
<select name="company_id" style="width:180px;" onchange="form.submit();" >
<?php print_options $org, $rs->company_id); ?>
</select>
</form>
</div>
<div style="margin-top:10px;" >
<table cellpadding="0" cellspacing="2" class="list_table" >
<tr >
<td width="50" class="head" >No</td>
<td width="300" class="head" >Company Name </td>
<td width="300" class="head" >VisitType Name </td>
</tr>
<?php $rs->Org_list($rs->company_id); ?>
</table>
</div>
</div>
</td>
</tr>
</table>
<?php //$rs->PrintFooter(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment