<?php include('accesscheck2.php'); 
require_once('Connections/courier.php');
require_once('functions/functions.php');

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_courier, $courier);
?>

<div class="page-bar">
                        <ul class="page-breadcrumb">
                            <li>
                                <i class="icon-home"></i>
                                <a href="index.html">Home</a>
                                <i class="fa fa-angle-right"></i>
                            </li>
                            <li>
                                <span>Dashboard</span>
                            </li>
                        </ul>
                        <div class="page-toolbar">
                            <div class="btn-group pull-right">
                                <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions
                                    <i class="fa fa-angle-down"></i>
                                </button>
                                <ul class="dropdown-menu pull-right" role="menu">
                                    <li onclick="getstep('admin_add_new_visit');">
                                        <a href="#">
                                            <i class="icon-refresh"></i> Refresh</a>
                                    </li>
<!--                                    <li class="divider"> </li>
                                    <li>
                                        <a href="#">
                                            <i class="icon-bag"></i> Separated link</a>
                                    </li>-->
                                </ul>
                            </div>
                        </div>
</div>

<div class="row">
    <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
            <div class="portlet light " id="patient_page_wrapper">
                                            <div class="portlet-title tabbable-line">
                                                <div class="caption caption-md">
                                                    <i class="icon-globe theme-font hide"></i>
                                                    <span class="caption-subject bold font-dark">CLIENT NEW VISIT </span>
                                                </div>
                                                <ul class="nav nav-tabs">
                                                    <li class="active">
                                                        <a href="#tab_1_1" data-toggle="tab" aria-expanded="true"> Search for Existing Client </a>
                                                    </li>
                                                    <li class="">
                                                        <a href="#tab_1_2" data-toggle="tab" aria-expanded="false">  Add New Client </a>
                                                    </li>
                                                    <li class="">
                                                        <a href="#tab_1_3" data-toggle="tab" aria-expanded="false">  Add Guest Client </a>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="portlet-body form">
                                                <div class="tab-content">
                                                    <div class="tab-pane active" id="tab_1_1">
                                                                                                          <div class="portlet-body form">
                <form class="form-horizontal" role="form" onsubmit="getProcess('search_new_patient_visit','#patient_search_result'); return false;">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-3 control-label">Search By</label>
                            <div class="col-md-9">
                                <select class="form-control" name="typesearch" id="typesearch">
                                    <option value="patientid" selected="selected">Patient ID/Old Card No.</option>
                                    <option value="member_no">Insurance/Staff No.</option>
                                    <option value="surname">Surname</option>
                                    <option value="othernames">Othernames</option>
                                    <option value="tel">Telephone Number</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label">Search Text</label>
                            <div class="col-md-9">
                                <input type="text" name="searchtext" id="searchtext" class="form-control" placeholder="Enter text">
                            </div>
                        </div>

                    </div>
                    <div class="form-actions right">
                        <button type="reset" class="btn default">Reset</button>
                        <button type="submit" class="btn green">Search</button>
                    </div>
                </form>
                <div id="patient_search_result"></div>
            </div>
                                                        </div>
                                                   
                                                    <div class="tab-pane" id="tab_1_2">
                                                       <div class="row">
                        <div class="col-md-12">
                            <!-- BEGIN PROFILE SIDEBAR -->
                            <div class="profile-sidebar">
                                <!-- PORTLET MAIN -->
                                <div class="portlet light profile-sidebar-portlet ">
                                    <!-- SIDEBAR USERPIC -->
                                    <div class="profile-userpic">
                                          <?php $picpath=$row_rsodest_patient['picpath']; 
										  
										  if(!$picpath){ 
											
											
											if($row_rsodest_patient['insurance_no1']){
											$inspicpath=getpicpath($row_rsodest_patient['insurance_company1']);
											
											if($inspicpath){
											
											$member_id=preg_replace("/[^0-9]/","",$row_rsodest_patient['insurance_no1']);
											
											$picpath=$inspicpath."/".ltrim($member_id,0).".jpg";
											}else{
											$picpath="images/profile.gif";		
											}
											}else{
											$picpath="images/profile.gif";	
											}
										  }
										  
										  ?>
                                        
                                        <img src="<?php echo $picpath;?>" class="img-responsive" alt=""> 
                                    </div>
                                    <div class="profile-usertitle">
                                        <div class="profile-usertitle-name"> PATIENT NAME </div>
                                        <div class="profile-usertitle-job"> PATIENT NO. </div>
                                    </div>
                                    <div class="profile-usermenu">
                                        <ul class="nav">
                                            <li class="patient-sub-menu active" id="patient_info" onclick="getProcess('view_patient_information', '#patient_page_wrapper', '<?php echo $id; ?>',this.id);">
                                                <a> <i class="icon-picture"></i> Upload Picture </a>
                                            </li>
                                            <li class="patient-sub-menu hide" id="patient_edit" onclick="getProcess('edit_patient_information', '#patient_page_wrapper', '<?php echo $id; ?>',this.id);">
                                                <a> <i class="icon-camera"></i> Take Picture Camera </a>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- END MENU -->
                                </div>
                            </div>
                            <div class="profile-content">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="portlet light " id="patient_page_wrapper" style="min-height:800px;">
                                            <div class="portlet-title">
                                                <div class="caption caption-md">
                                                    <i class="icon-globe theme-font hide"></i>
                                                    <span class="caption-subject font-blue-madison bold uppercase"> ADD NEW SPECIALIST CLIENT </span>
                                                </div>
                                            </div>
                                            <div class="portlet-body form">
                                                <div id="success_error_info_display"></div>
                                                <form role="form" action="#" id="edit_patient_info_form">
                                                    <div class="form-body">
                                                        <div class="row">
                                                             <div class="col-lg-12 col-xs-12 col-md-12">
                                                                 <div class="col-md-12">
                                                                    <div class="form-group">
                                                                        <label class="control-label">Type of Client</label>
                                                                        <select name="type_of_client" id="type_of_client" onchange="showtext(this.value);" class="form-control">
                                                                            <option value="">-------- SELECT --------</option>
                                                                            <option value="cash" <?php if ($row_rsodest_patient['type_of_client'] == 'cash') { ?>selected="selected"<?php } ?>>CASH</option>
                                                                            <option value="insurance" <?php if ($row_rsodest_patient['type_of_client'] == 'insurance') { ?>selected="selected"<?php } ?>>INSURANCE</option>
                                                                            <option value="company" <?php if ($row_rsodest_patient['type_of_client'] == 'company') { ?>selected="selected"<?php } ?>>COMPANY</option>
                                                                            <option value="staff" <?php if ($row_rsodest_patient['type_of_client'] == 'staff') { ?>selected="selected"<?php } ?>>STAFF</option>
                                                                        </select> 
                                                                    </div>
                                                                    <div id="cashbox" style="display:<?php if ($row_rsodest_patient['type_of_client'] == 'cash') {
                                                                                echo "block";
                                                                            } else {
                                                                                echo "none";
                                                                            } ?>">
                                                                        <div class="form-group">
                                                                            <label class="control-label">Employer</label>
                                                                            <input type="text" value="<?php echo $row_rsodest_patient['employer']; ?>" name="employer" id="employer" class="form-control"> 
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label">Occupation</label>
                                                                            <input type="text" name="occupation_cash" value="<?php echo $row_rsodest_patient['occupation']; ?>" id="occupation" class="form-control"> 
                                                                        </div>
                                                                    </div>
                                                                    <div id="insurance" style="display:<?php if ($row_rsodest_patient['type_of_client'] == 'insurance') {
                                                                                echo "block";
                                                                            } else {
                                                                                echo "none";
                                                                            } ?>">
                                                                             <div class="form-group">
                                                                            <label class="control-label">Occupation</label>
                                                                            <input type="text" name="occupation_insurance" value="<?php echo $row_rsodest_patient['occupation']; ?>" id="occupation" class="form-control"> 
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label">Insurance Company</label>
                                                                            <select name="insurance_com1" id="insurance_com1" class="form-control">
                                                                                <option value="">--Select Insurance Company --</option>
                                                                                <?php
                                                                                        $query_rsodestship_company_name = "SELECT * FROM insurance_company where status='Active' and type='insurance' order by company_name";
                                                                                        $rsodestship_company_name = mysql_query($query_rsodestship_company_name, $courier) or die(mysql_error());
                                                                                        $row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name);
                                                                                        $totalRows_rsodestship_company_name = mysql_num_rows($rsodestship_company_name);
                                                                                        do {
                                                                                            ?>
                                                                                    <option value="<?php echo $row_rsodestship_company_name['company_code']; ?>" <?php
                                                                                            if ($row_rsodest_patient['insurance_company1'] == $row_rsodestship_company_name['company_code']) {
                                                                                                echo "selected";
                                                                                            }
                                                                                            ?>><?php echo strtoupper($row_rsodestship_company_name['company_name']); ?></option>
    <?php
} while ($row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name));
$rows = mysql_num_rows($rsodestship_company_name);
if ($rows > 0) {
    mysql_data_seek($rsodestship_company_name, 0);
    $row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name);
}
?>
                                                                            </select> 
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label">Insurance No.</label>
                                                                            <input type="text" value="<?php echo $row_rsodest_patient['insurance_no1']; ?>" name="insurance_no1" id="insurance_no1" class="form-control"> 
                                                                        </div>
                                                                    </div>

                                                                    <div id="staff" style="display:<?php if ($row_rsodest_patient['type_of_client'] == 'staff') {
    echo "block";
} else {
    echo "none";
} ?>">
                                                                         <div class="form-group">
                                                                            <label class="control-label">Occupation</label>
                                                                            <input type="text" name="occupation_staff" value="<?php echo $row_rsodest_patient['occupation']; ?>" id="occupation" class="form-control"> 
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label">Staff No.</label>
                                                                            <input type="text" name="staff_no" value="<?php echo $row_rsodest_patient['medifem_staff_no']; ?>" id="staff_no" class="form-control"> 
                                                                        </div>
                                                                    </div>

                                                                    <div id="company" style="display:<?php if ($row_rsodest_patient['type_of_client'] == 'company') {
                                                                                    echo "block";
                                                                                } else {
                                                                                    echo "none";
                                                                                } ?>">
                                                                                 <div class="form-group">
                                                                            <label class="control-label">Occupation</label>
                                                                            <input type="text" name="occupation_company" value="<?php echo $row_rsodest_patient['occupation']; ?>" id="occupation" class="form-control"> 
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label">Company</label>
                                                                            <select name="company" id="company" class="form-control" >
                                                                                <option value="">--Select Company --</option>
<?php
$query_rsodestship_company_name = "SELECT * FROM insurance_company where status='Active' and type='company' order by company_name";
$rsodestship_company_name = mysql_query($query_rsodestship_company_name, $courier) or die(mysql_error());
$row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name);
$totalRows_rsodestship_company_name = mysql_num_rows($rsodestship_company_name);
do {
    ?>
                                                                                    <option value="<?php echo $row_rsodestship_company_name['company_code']; ?>" <?php
    if ($row_rsodest_patient['company'] == $row_rsodestship_company_name['company_code']) {
        echo "selected";
    }
    ?>><?php echo strtoupper($row_rsodestship_company_name['company_name']); ?></option>
    <?php
} while ($row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name));
$rows = mysql_num_rows($rsodestship_company_name);
if ($rows > 0) {
    mysql_data_seek($rsodestship_company_name, 0);
    $row_rsodestship_company_name = mysql_fetch_assoc($rsodestship_company_name);
}
?>
                                                                            </select>
                                                                        </div> 
                                                                        <div class="form-group">
                                                                            <label class="control-label">Company Staff No.</label>
                                                                            <input type="text" name="staff_no" value="<?php echo $row_rsodest_patient['company_staff_no']; ?>" id="staff_no" class="form-control"> 
                                                                        </div>
                                                                    </div>
                                                            </div>
                                                            </div>
                                                        </div>
                                                        <hr>
                                                        <div class="col-md-12">
                                                            <div class="form-group">
                                                                    <label class="control-label">Title</label>
                                                                    <select name="title" id="title" class="form-control">
                                                                    <?php
                                                                    $titles = mysql_query("SELECT * FROM title");
                                                                    while($title = mysql_fetch_assoc($titles)){ ?>
                                                                            <option value="<?php echo $title['title']; ?>"><?php echo $title['title']; ?></option>
                                                                    <?php } ?>
                                                                    </select>
                                                                        </div>
                                                                    </div>
                                                        <div class="row">
                                                            <div class="col-lg-12 col-xs-12 col-md-12">
                                                                <div class="col-md-6">
                                                                    <div class="form-group">
                                                                        <label class="control-label">Surname</label>
                                                                        <input type="text" name="surname" id="surname" value="<?php echo $row_rsodest_patient['surname'] ?>" class="form-control"> 
                                                                        <input type="hidden" id="filepath0"  value="<?php echo $row_rsodest_patient['picpath'] ?>" name="filepath0">
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Date Of Birth</label>
                                                                        <input type="text" name="dateofbirth" value="<?php echo $row_rsodest_patient['dateofbirth'] ?>" type="text" id="dateofbirth" class="form-control"> </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Sex</label>
                                                                        <select name="sex" id="sex" class="form-control"  onchange="showpreg(this.value)">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <option value="Male" <?php if ($row_rsodest_patient['sex'] == 'Male') { ?> selected="selected" <?php } ?>>Male</option>
                                                                            <option value="Female" <?php if ($row_rsodest_patient['sex'] == 'Female') { ?> selected="selected" <?php } ?>>Female</option>
                                                                        </select>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Email</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['email']; ?>" type="text" name="email" id="email" class="form-control"> </div>
                                                                        <div class="form-group" style="display: none;">
                                                                        <label class="control-label">Country of Origin</label>
                                                                        <select name="country_of_origin"  id="country_of_origin" class="form-control">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <?php
                                                                            $query_rsodestship_country = "SELECT * FROM countrylist order by country";
                                                                            $rsodestship_country = mysql_query($query_rsodestship_country, $courier) or die(mysql_error());
                                                                            $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            $totalRows_rsodestship_country = mysql_num_rows($rsodestship_country);
                                                                            do {
                                                                                ?>
                                                                                <option value="<?php echo $row_rsodestship_country['country']; ?>" <?php if ($row_rsodest_patient['country_of_origin'] == $row_rsodestship_country['country']) { ?>selected="selected"<?php } ?>><?php echo $row_rsodestship_country['country'] ?></option>
                                                                                <?php
                                                                            } while ($row_rsodestship_country = mysql_fetch_assoc($rsodestship_country));
                                                                            $rows = mysql_num_rows($rsodestship_country);
                                                                            if ($rows > 0) {
                                                                                mysql_data_seek($rsodestship_country, 0);
                                                                                $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            }
                                                                            ?>
                                                                        </select>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Residential Address</label>
                                                                        <input type="text" class="form-control" name="radd" id="radd" value="<?php echo $row_rsodest_patient['home_address']; ?>"> 
                                                                    </div>
                                                                    <div class="form-group hide">
                                                                        <label class="control-label">Referer's Relationship</label>
                                                                        <select class="form-control" name="referer_relationship" id="referer_relationship">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <?php
                                                                            $query_rsodestship_country = "SELECT * FROM refer_relationship order by relationship";
                                                                            $rsodestship_country = mysql_query($query_rsodestship_country, $courier) or die(mysql_error());
                                                                            $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            $totalRows_rsodestship_country = mysql_num_rows($rsodestship_country);
                                                                            do {
                                                                                ?>
                                                                                <option value="<?php echo $row_rsodestship_country['relationship']; ?>" <?php if ($row_rsodest_patient['referer_relationship'] == $row_rsodestship_country['relationship']) { ?>selected="selected"<?php } ?>><?php echo $row_rsodestship_country['relationship'] ?></option>
                                                                                <?php
                                                                            } while ($row_rsodestship_country = mysql_fetch_assoc($rsodestship_country));
                                                                            $rows = mysql_num_rows($rsodestship_country);
                                                                            if ($rows > 0) {
                                                                                mysql_data_seek($rsodestship_country, 0);
                                                                                $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            }
                                                                            ?>
                                                                        </select> 
                                                                    </div>
                                                                </div>
                                                                <div class="col-md-6">
                                                                    <div class="form-group">
                                                                        <label class="control-label">Other Names</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['othernames']; ?>" name="othernames" id="othernames" class="form-control"> </div>
                                                                    <div class="form-group hide">
                                                                        <label class="control-label">Marital Status</label>
                                                                        <select name="marital_status" id="marital_status" class="form-control">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <option value="DIVORCED" <?php if ($row_rsodest_patient['marital_status'] == 'DIVORCED') { ?> selected="selected" <?php } ?> >DIVORCED</option>
                                                                            <option value="MARRIED" <?php if ($row_rsodest_patient['marital_status'] == 'MARRIED') { ?> selected="selected" <?php } ?>>MARRIED</option>
                                                                            <option value="SEPARATED" <?php if ($row_rsodest_patient['marital_status'] == 'SEPARATED') { ?> selected="selected" <?php } ?>>SEPARATED</option>
                                                                            <option value="SINGLE" <?php if ($row_rsodest_patient['marital_status'] == 'SINGLE') { ?> selected="selected" <?php } ?>>SINGLE</option>
                                                                            <option value="WIDOW" <?php if ($row_rsodest_patient['marital_status'] == 'WIDOW') { ?> selected="selected" <?php } ?>>WIDOW</option>
                                                                            <option value="WIDOWER" <?php if ($row_rsodest_patient['marital_status'] == 'WIDOWER') { ?> selected="selected" <?php } ?>>WIDOWER</option>
                                                                        </select>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Tel/Mobile</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['tel']; ?>" name="tel" id="tel" class="form-control"> </div>
                                                                    <div class="form-group hide">
                                                                        <label class="control-label">Home Language</label>
                                                                        <select name="home_language" id="home_language" class="form-control">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <?php
                                                                            $query_rsodestship_country = "SELECT * FROM home_language order by home_language";
                                                                            $rsodestship_country = mysql_query($query_rsodestship_country, $courier) or die(mysql_error());
                                                                            $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            $totalRows_rsodestship_country = mysql_num_rows($rsodestship_country);
                                                                            do {
                                                                                ?>
                                                                                <option value="<?php echo $row_rsodestship_country['home_language']; ?>"<?php if ($row_rsodest_patient['home_language'] == $row_rsodestship_country['home_language']) { ?> selected="selected" <?php } ?>><?php echo $row_rsodestship_country['home_language'] ?></option>
                                                                                <?php
                                                                            } while ($row_rsodestship_country = mysql_fetch_assoc($rsodestship_country));
                                                                            $rows = mysql_num_rows($rsodestship_country);
                                                                            if ($rows > 0) {
                                                                                mysql_data_seek($rsodestship_country, 0);
                                                                                $row_rsodestship_country = mysql_fetch_assoc($rsodestship_country);
                                                                            }
                                                                            ?>
                                                                        </select>
                                                                    </div>
                                                                    <div class="form-group hide">
                                                                        <label class="control-label">Postal Address</label>
                                                                        <input type="text" name="paddress" id="paddress" class="form-control" value="<?php echo $row_rsodest_patient['postal_address']; ?>"/>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Referred By</label>
                                                                        <input type="text" name="referred_by" id="referred_by" value="<?php echo $row_rsodest_patient['referred_by']; ?>" class="form-control"> 
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Tel of Referer</label>
                                                                        <input type="text" name="tel_of_referer" id="tel_of_referer" value="<?php echo $row_rsodest_patient['tel_of_referer']; ?>" class="form-control"> 
                                                                    </div>
                                                                </div>
                                                            </div>



                                                        </div>

                                                      
                                                    </div>
                                                    <div class="form-actions right">
                                                        <button type="reset" class="btn default"> Reset </button>
                                                        <a class="btn green" onclick="getstep('records_insert_patient');return false;"> Save </a>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
<!--                                                      <p style="font-size:18px">
                                                          
        <button type="submit" class="btn btn-lg green" onclick="getProcess('add_administrative_charges', '#patient_page_wrapper', '7217@@@WL03750VL16','patient_administraitve_charges');return false;"> <i class="fa fa-plus-circle"></i> Add Charges Now </button>
        </p>-->
        
                                                    </div>
                                                    
                                                    <div class="tab-pane" id="tab_1_3">
                                                          <div class="row">
                        <div class="col-md-12">
                            <!-- BEGIN PROFILE SIDEBAR -->
                            <div class="profile-sidebar">
                                <!-- PORTLET MAIN -->
                                <div class="portlet light profile-sidebar-portlet ">
                                    <!-- SIDEBAR USERPIC -->
                                    <div class="profile-userpic">
                                          <?php $picpath=$row_rsodest_patient['picpath']; 
										  
										  if(!$picpath){ 
											
											
											if($row_rsodest_patient['insurance_no1']){
											$inspicpath=getpicpath($row_rsodest_patient['insurance_company1']);
											
											if($inspicpath){
											
											$member_id=preg_replace("/[^0-9]/","",$row_rsodest_patient['insurance_no1']);
											
											$picpath=$inspicpath."/".ltrim($member_id,0).".jpg";
											}else{
											$picpath="images/profile.gif";		
											}
											}else{
											$picpath="images/profile.gif";	
											}
										  }
										  
										  ?>
                                        
                                        <img src="<?php echo $picpath;?>" class="img-responsive" alt=""> 
                                    </div>
                                    <div class="profile-usertitle">
                                        <div class="profile-usertitle-name"> PATIENT NAME </div>
                                        <div class="profile-usertitle-job"> PATIENT NO. </div>
                                    </div>
                                    <div class="profile-usermenu">
                                        <ul class="nav">
                                            <li class="patient-sub-menu active" id="patient_info" onclick="getProcess('view_patient_information', '#patient_page_wrapper', '<?php echo $id; ?>',this.id);">
                                                <a> <i class="icon-picture"></i> Upload Picture File </a>
                                            </li>
                                            <li class="patient-sub-menu " id="patient_edit" onclick="getProcess('edit_patient_information', '#patient_page_wrapper', '<?php echo $id; ?>',this.id);">
                                                <a> <i class="icon-camera"></i> Take Picture Camera </a>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- END MENU -->
                                </div>
                            </div>
                            <div class="profile-content">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="portlet light " id="patient_page_wrapper" style="min-height:800px;">
                                            <div class="portlet-body form">
                                                <div id="success_error_info_display"></div>
                                                <form role="form" action="#" id="edit_patient_info_form">
                                                    <div class="form-body">
                                                        <div class="row">
                                                            <div class="col-lg-12 col-xs-12 col-md-12">
                                                                <div class="col-md-6">
                                                                    <div class="form-group">
                                                                        <label class="control-label">Surname</label>
                                                                        <input type="text" name="surname1" id="surname1" value="<?php echo $row_rsodest_patient['surname'] ?>" class="form-control"> </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Date Of Birth</label>
                                                                        <input type="text" name="dateofbirth1" value="<?php echo $row_rsodest_patient['dateofbirth'] ?>" type="text" id="dateofbirth1" class="form-control"> </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Sex</label>
                                                                        <select name="sex1" id="sex1" class="form-control"  onchange="showpreg(this.value)">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <option value="Male" <?php if ($row_rsodest_patient['sex'] == 'Male') { ?> selected="selected" <?php } ?>>Male</option>
                                                                            <option value="Female" <?php if ($row_rsodest_patient['sex'] == 'Female') { ?> selected="selected" <?php } ?>>Female</option>
                                                                        </select>
                                                                    </div>
                                                                    
                                                                   
                                                                </div>
                                                                <div class="col-md-6">
                                                                    <div class="form-group">
                                                                        <label class="control-label">Other Names</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['othernames']; ?>" name="othernames1" id="othernames1" class="form-control"> 
                                                                    </div>
                                                                        <div class="form-group" style="display: none;">
                                                                        <label class="control-label">Marital Status</label>
                                                                        <select name="marital_status" id="marital_status" class="form-control">
                                                                            <option value="">-------- SELECT -------</option>
                                                                            <option value="DIVORCED" <?php if ($row_rsodest_patient['marital_status'] == 'DIVORCED') { ?> selected="selected" <?php } ?> >DIVORCED</option>
                                                                            <option value="MARRIED" <?php if ($row_rsodest_patient['marital_status'] == 'MARRIED') { ?> selected="selected" <?php } ?>>MARRIED</option>
                                                                            <option value="SEPARATED" <?php if ($row_rsodest_patient['marital_status'] == 'SEPARATED') { ?> selected="selected" <?php } ?>>SEPARATED</option>
                                                                            <option value="SINGLE" <?php if ($row_rsodest_patient['marital_status'] == 'SINGLE') { ?> selected="selected" <?php } ?>>SINGLE</option>
                                                                            <option value="WIDOW" <?php if ($row_rsodest_patient['marital_status'] == 'WIDOW') { ?> selected="selected" <?php } ?>>WIDOW</option>
                                                                            <option value="WIDOWER" <?php if ($row_rsodest_patient['marital_status'] == 'WIDOWER') { ?> selected="selected" <?php } ?>>WIDOWER</option>
                                                                        </select>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Tel/Mobile</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['tel']; ?>" name="tel1" id="tel1" class="form-control"> 
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label">Email</label>
                                                                        <input type="text" value="<?php echo $row_rsodest_patient['email']; ?>" type="text" name="email1" id="email1" class="form-control"> 
                                                                    </div>
                                                                </div>
                                                            </div>



                                                        </div>

                                                    </div>
                                                    <div class="form-actions right">
                                                        <button type="reset" class="btn default"> Reset </button>
                                                        <a class="btn green" onclick="getstep('records_guest_insert_patient');return false;"> Save </a>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                                                        
                                                    </div>
                                                    
                                                </div>
                                            </div>
                                        </div>
           
    </div>
</div>


